33 lines
806 B
C++
33 lines
806 B
C++
#ifndef id9B2FF4B4CA4244EAB93C619479A8E816
|
|
#define id9B2FF4B4CA4244EAB93C619479A8E816
|
|
|
|
#include <FBVector.h>
|
|
|
|
namespace dk {
|
|
template <typename T, typename C>
|
|
class ItemsWithID {
|
|
typedef C container_type;
|
|
public:
|
|
typedef T value_type;
|
|
typedef typename container_type::size_type size_type;
|
|
typedef typename container_type::size_type id_type;
|
|
typedef value_type& reference_type;
|
|
|
|
ItemsWithID ( void ) = default;
|
|
~ItemsWithID ( void ) noexcept = default;
|
|
|
|
id_type add ( const value_type& parNewVal );
|
|
void erase ( id_type parID );
|
|
reference_type operator[] ( id_type parID );
|
|
const reference_type operator[] ( id_type parID ) const;
|
|
|
|
|
|
private:
|
|
container_type items_;
|
|
|
|
// see:
|
|
// https://github.com/facebook/folly/blob/master/folly/docs/FBVector.md
|
|
};
|
|
} //namespace dk
|
|
|
|
#endif
|