score::EntityMap< T, Ordered > Class Template Reference

The EntityMap class. More...

Detailed Description

template<typename T, bool Ordered = false>
class score::EntityMap< T, Ordered >

The EntityMap class.

This class is a wrapper over IdContainer. Differences :

  • Deletes objects when they are removed ("ownership")
  • Sends signals after adding and before deleting.

The parent of the childs are the parents of the map. Hence the objects shall not be deleted upon deletion of the map itself, to prevent a double-free.

Public Types

using value_type = T
 

Public Member Functions

OSSIA_INLINE auto begin () const INLINE_EXPORT
 
OSSIA_INLINE auto cbegin () const INLINE_EXPORT
 
OSSIA_INLINE auto end () const INLINE_EXPORT
 
OSSIA_INLINE auto cend () const INLINE_EXPORT
 
OSSIA_INLINE auto size () const INLINE_EXPORT
 
OSSIA_INLINE bool empty () const INLINE_EXPORT
 
OSSIA_INLINE auto & unsafe_map () INLINE_EXPORT
 
OSSIA_INLINE const auto & map () const INLINE_EXPORT
 
OSSIA_INLINE const auto & get () const INLINE_EXPORT
 
T & at (const Id< T > &id) INLINE_EXPORT
 
T & at (const Id< T > &id) const INLINE_EXPORT
 
auto find (const Id< T > &id) const INLINE_EXPORT
 
void add (T *t) INLINE_EXPORT
 
void erase (T &elt) INLINE_EXPORT
 
void remove (T &elt) INLINE_EXPORT
 
void remove (T *elt) INLINE_EXPORT
 
void remove (const Id< T > &id) INLINE_EXPORT
 
void clear () INLINE_EXPORT
 
void replace (IdContainer< T, T, Ordered > &&new_map)
 

Public Attributes

Nano::Signal< void(T &)> mutable_added
 
Nano::Signal< void(const T &)> added
 
Nano::Signal< void(const T &)> removing
 
Nano::Signal< void(const T &)> removed
 
Nano::Signal< void()> orderChanged
 
Nano::Signal< void()> replaced
 

The documentation for this class was generated from the following file: