Restore rows() and cols() in aligned_array.h

These getters were removed in https://codereview.webrtc.org/1172163004
but are used in external code, so it makes sense to keep
them around to make the class more useful.

R=henrikg@webrtc.org, pkasting@chromium.org

Review URL: https://codereview.webrtc.org/1178043005.

Cr-Commit-Position: refs/heads/master@{#9478}
This commit is contained in:
Henrik Kjellander 2015-06-20 20:10:57 +02:00
parent 6ee4816d6f
commit e8d191f00f
2 changed files with 14 additions and 2 deletions

View File

@ -68,6 +68,14 @@ template<typename T> class AlignedArray {
return Row(row)[col];
}
int rows() const {
return rows_;
}
int cols() const {
return cols_;
}
private:
int rows_;
int cols_;
@ -78,4 +86,3 @@ template<typename T> class AlignedArray {
} // namespace webrtc
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ALIGNED_ARRAY_

View File

@ -51,5 +51,10 @@ TEST(AlignedArrayTest, CheckOverlap) {
}
}
} // namespace webrtc
TEST(AlignedArrayTest, CheckRowsCols) {
AlignedArray<bool> arr(10, 7, 128);
ASSERT_EQ(arr.rows(), 10);
ASSERT_EQ(arr.cols(), 7);
}
} // namespace webrtc