From e8d191f00fff1ed3574d6a9d7e6d62b1acb5d5d3 Mon Sep 17 00:00:00 2001 From: Henrik Kjellander Date: Sat, 20 Jun 2015 20:10:57 +0200 Subject: [PATCH] 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} --- webrtc/system_wrappers/interface/aligned_array.h | 9 ++++++++- webrtc/system_wrappers/source/aligned_array_unittest.cc | 7 ++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/webrtc/system_wrappers/interface/aligned_array.h b/webrtc/system_wrappers/interface/aligned_array.h index 0acf53f481..8278af2ae3 100644 --- a/webrtc/system_wrappers/interface/aligned_array.h +++ b/webrtc/system_wrappers/interface/aligned_array.h @@ -68,6 +68,14 @@ template 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 class AlignedArray { } // namespace webrtc #endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ALIGNED_ARRAY_ - diff --git a/webrtc/system_wrappers/source/aligned_array_unittest.cc b/webrtc/system_wrappers/source/aligned_array_unittest.cc index e5e556dff5..f25c7178d2 100644 --- a/webrtc/system_wrappers/source/aligned_array_unittest.cc +++ b/webrtc/system_wrappers/source/aligned_array_unittest.cc @@ -51,5 +51,10 @@ TEST(AlignedArrayTest, CheckOverlap) { } } -} // namespace webrtc +TEST(AlignedArrayTest, CheckRowsCols) { + AlignedArray arr(10, 7, 128); + ASSERT_EQ(arr.rows(), 10); + ASSERT_EQ(arr.cols(), 7); +} +} // namespace webrtc