TrinityCore
ObjectRegistry< T, Key > Class Template Referencefinal

#include <ObjectRegistry.h>

Public Types

typedef std::map< Key, std::unique_ptr< T > > RegistryMapType
 

Public Member Functions

T const * GetRegistryItem (Key const &key) const
 Returns a registry item. More...
 
bool InsertItem (T *obj, Key const &key, bool force=false)
 Inserts a registry item. More...
 
bool HasItem (Key const &key) const
 Returns true if registry contains an item. More...
 
RegistryMapType const & GetRegisteredItems () const
 Return the map of registered items. More...
 

Static Public Member Functions

static ObjectRegistry< T, Key > * instance ()
 

Private Member Functions

 ObjectRegistry ()
 
 ~ObjectRegistry ()
 
 ObjectRegistry (ObjectRegistry const &)=delete
 
ObjectRegistryoperator= (ObjectRegistry const &)=delete
 

Private Attributes

RegistryMapType _registeredObjects
 

Detailed Description

template<class T, class Key = std::string>
class ObjectRegistry< T, Key >

ObjectRegistry holds all registry item of the same type

Definition at line 28 of file ObjectRegistry.h.

Member Typedef Documentation

◆ RegistryMapType

template<class T , class Key = std::string>
typedef std::map<Key, std::unique_ptr<T> > ObjectRegistry< T, Key >::RegistryMapType

Definition at line 31 of file ObjectRegistry.h.

Constructor & Destructor Documentation

◆ ObjectRegistry() [1/2]

template<class T , class Key = std::string>
ObjectRegistry< T, Key >::ObjectRegistry ( )
inlineprivate

Definition at line 79 of file ObjectRegistry.h.

◆ ~ObjectRegistry()

template<class T , class Key = std::string>
ObjectRegistry< T, Key >::~ObjectRegistry ( )
inlineprivate

Definition at line 80 of file ObjectRegistry.h.

◆ ObjectRegistry() [2/2]

template<class T , class Key = std::string>
ObjectRegistry< T, Key >::ObjectRegistry ( ObjectRegistry< T, Key > const &  )
privatedelete

Member Function Documentation

◆ GetRegisteredItems()

template<class T , class Key = std::string>
RegistryMapType const & ObjectRegistry< T, Key >::GetRegisteredItems ( ) const
inline

Return the map of registered items.

Definition at line 70 of file ObjectRegistry.h.

◆ GetRegistryItem()

template<class T , class Key = std::string>
T const * ObjectRegistry< T, Key >::GetRegistryItem ( Key const &  key) const
inline

Returns a registry item.

Definition at line 40 of file ObjectRegistry.h.

+ Here is the caller graph for this function:

◆ HasItem()

template<class T , class Key = std::string>
bool ObjectRegistry< T, Key >::HasItem ( Key const &  key) const
inline

Returns true if registry contains an item.

Definition at line 64 of file ObjectRegistry.h.

◆ InsertItem()

template<class T , class Key = std::string>
bool ObjectRegistry< T, Key >::InsertItem ( T *  obj,
Key const &  key,
bool  force = false 
)
inline

Inserts a registry item.

Definition at line 49 of file ObjectRegistry.h.

◆ instance()

template<class T , class Key = std::string>
static ObjectRegistry< T, Key > * ObjectRegistry< T, Key >::instance ( )
inlinestatic

Definition at line 33 of file ObjectRegistry.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

template<class T , class Key = std::string>
ObjectRegistry & ObjectRegistry< T, Key >::operator= ( ObjectRegistry< T, Key > const &  )
privatedelete

Member Data Documentation

◆ _registeredObjects

template<class T , class Key = std::string>
RegistryMapType ObjectRegistry< T, Key >::_registeredObjects
private

Definition at line 76 of file ObjectRegistry.h.


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