Home
last modified time | relevance | path

Searched refs:IntArrayView (Results 1 – 2 of 2) sorted by relevance

/packages/inputmethods/LatinIME/native/jni/src/utils/
Dint_array_view.h51 class IntArrayView {
53 IntArrayView() : mPtr(nullptr), mSize(0) {} in IntArrayView() function
55 IntArrayView(const int *const ptr, const size_t size) in IntArrayView() function
58 explicit IntArrayView(const std::vector<int> &vector) in IntArrayView() function
62 AK_FORCE_INLINE static IntArrayView fromArray(const std::array<int, N> &array) { in fromArray()
63 return IntArrayView(array.data(), array.size()); in fromArray()
67 AK_FORCE_INLINE static IntArrayView singleElementView(const int *const ptr) { in singleElementView()
68 return IntArrayView(ptr, 1); in singleElementView()
101 AK_FORCE_INLINE const IntArrayView limit(const size_t maxSize) const { in limit()
102 return IntArrayView(mPtr, std::min(maxSize, mSize)); in limit()
[all …]
/packages/inputmethods/LatinIME/native/jni/tests/utils/
Dint_array_view_test.cpp29 IntArrayView intArrayView(intVector); in TEST()
38 IntArrayView intArrayView(intVector); in TEST()
50 const auto intArrayView = IntArrayView::fromArray(intArray); in TEST()
56 const auto intArrayView = IntArrayView::singleElementView(&object); in TEST()
62 EXPECT_FALSE(IntArrayView().contains(0)); in TEST()
63 EXPECT_FALSE(IntArrayView().contains(1)); in TEST()
66 IntArrayView intArrayView(intVector); in TEST()
76 IntArrayView intArrayView(intVector); in TEST()
82 IntArrayView subView = intArrayView.limit(4); in TEST()
91 IntArrayView intArrayView(intVector); in TEST()
[all …]