9 # include <ozulis/core/singleton.hh>
18 * @brief this template delivers ids for a Base and remember child/parent
21 template <typename Base
>
22 class IdBase
: public Singleton
<IdBase
<Base
> >
27 /** @brief get the next available id */
29 /** @brief make the assocation between two types */
30 static void setParent(id_t parent
, id_t child
);
31 /** @brief get the parent of a type */
32 static id_t
parent(id_t child
);
33 /** @brief check that child is the child of parent */
34 static bool check(id_t parent
, id_t child
);
37 typedef std::map
<id_t
, std::set
<id_t
> > childs_t
;
38 typedef std::map
<id_t
, id_t
> parents_t
;
46 * @brief associate an id to a Base and a Type
48 template <typename Base
, typename Type
>
56 * @brief make the association between a Parent and a Type
58 template <typename Base
, typename Parent
, typename Type
>
67 extern template class std::map
<ozulis::core::id_t
,
68 std::set
<ozulis::core::id_t
> >;
69 extern template class std::map
<ozulis::core::id_t
, ozulis::core::id_t
>;