Add Internal::IndexedMap 84/270484/36
authorEunki, Hong <eunkiki.hong@samsung.com>
Thu, 3 Feb 2022 07:20:06 +0000 (16:20 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Wed, 23 Feb 2022 11:15:56 +0000 (20:15 +0900)
commit33a8477946185463936981476e9772d40c37fd72
tree78b4e5762020b0f1635cdc35f76b7c2738160224
parentf19e582fe69147df2e753162086b2d18611b12ae
Add Internal::IndexedMap

Make IndexedMap that key can be std::uint32_t and Internal::ConstString
IndexedMap can only do Register + Get.
We can check unique registration by this API.

IndexedMap use iterator as std::vector<std::pair<KeyType, ElementType>>::iterator.

Get API return iterator that key contained.
If found failed, return End() iterator.

Internally, we make it sorted key-index-element container.
It can search key by binary search. and less element copy action.
(ConstString can be convert const char* == size_t which can comparable)

Time complexity is O(|Element count|) for Register and
O(log|Element count|) for Get

Change some std::vector container as IndexedConstStringMap and IndexedIntegerMap
at type-info and type-register.

type-info is very important area of DALi engine.
So I append some define blocks when we meet some strange problems in future.
It will be remove when this patch is safe enough.

Change-Id: I7ad2e1a4776a4acedb4632053419b4fdcfa043bb
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
automated-tests/src/dali-internal/CMakeLists.txt
automated-tests/src/dali-internal/utc-Dali-Internal-IndexedConstStringMap.cpp [new file with mode: 0644]
automated-tests/src/dali-internal/utc-Dali-Internal-IndexedIntegerMap.cpp [new file with mode: 0644]
dali/internal/common/indexed-const-string-map.h [new file with mode: 0644]
dali/internal/common/indexed-integer-map.h [new file with mode: 0644]
dali/internal/common/indexed-map-base.h [new file with mode: 0644]
dali/internal/event/common/type-info-impl.cpp
dali/internal/event/common/type-info-impl.h
dali/internal/event/common/type-registry-impl.cpp
dali/internal/event/common/type-registry-impl.h