feat(core): add generic container classes
Description
Currently, we use several data object containers for holding data (Composite, SeriesDB, Vector, ...). Lots of code could be factorized and even removed since we re-implement STL accessors, iterators for each of them. Furthermore, some container classes need to be added for #862 (closed), which justifies even more a generic container class.
Proposal
A new IContainer
class, inherited by all container, that will do the job.
Since it is a part of #862 (closed), some additional, but unused for now, classes are also there, just ignore them for now.
Functional specifications
- Same API as STL equivalent: iterators, initializer list
-
Composite
,Vector
, ... just have to inherits from templatedIContainer<XXX>
with XXX being a STL container. -
IContainer<XXX>
will implement generic shallow and deep copy, as well as equality operators - Code for
Composite
,Vector
, ... will be minimal
Technical specifications
- Use private inheritance and template matching to expose the API of a STL container (std::vector, std::map)
- Most of the code should be factorized in IContainer class.
-
compare.hpp
will gather all template matching code, allowing to write specific code for specific container like:... if constexpr(core::tools::is_map_like(T)::value) { .... }
Test plan
- unit test (olds, and the ones added)
- launch sightviewer