AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
FactoryHolder< T, O, Key > Class Template Referenceabstract

#include "FactoryHolder.h"

Inheritance diagram for FactoryHolder< T, O, Key >:
IdleMovementFactory MovementGeneratorFactory< Movement > SelectableAI SelectableGameObjectAI CreatureAIFactory< REAL_AI > GameObjectAIFactory< REAL_GO_AI >

Public Types

typedef ObjectRegistry< FactoryHolder< T, O, Key >, Key > FactoryHolderRegistry
 

Public Member Functions

 FactoryHolder (Key const &k)
 
virtual ~FactoryHolder ()
 
void RegisterSelf ()
 
virtual T * Create (O *object=nullptr) const =0
 Abstract Factory create method.
 

Private Attributes

Key const _key
 

Detailed Description

template<class T, class O, class Key = std::string>
class FactoryHolder< T, O, Key >

FactoryHolder holds a factory object of a specific type

Member Typedef Documentation

◆ FactoryHolderRegistry

template<class T , class O , class Key = std::string>
typedef ObjectRegistry<FactoryHolder<T, O, Key>, Key> FactoryHolder< T, O, Key >::FactoryHolderRegistry

Constructor & Destructor Documentation

◆ FactoryHolder()

template<class T , class O , class Key = std::string>
FactoryHolder< T, O, Key >::FactoryHolder ( Key const &  k)
inlineexplicit
33: _key(k) { }
Key const _key
Definition: FactoryHolder.h:41

◆ ~FactoryHolder()

template<class T , class O , class Key = std::string>
virtual FactoryHolder< T, O, Key >::~FactoryHolder ( )
inlinevirtual
34{ }

Member Function Documentation

◆ Create()

template<class T , class O , class Key = std::string>
virtual T * FactoryHolder< T, O, Key >::Create ( O *  object = nullptr) const
pure virtual

Abstract Factory create method.

◆ RegisterSelf()

template<class T , class O , class Key = std::string>
void FactoryHolder< T, O, Key >::RegisterSelf ( )
inline
36{ FactoryHolderRegistry::instance()->InsertItem(this, _key); }
static ObjectRegistry< T, Key > * instance()
Definition: ObjectRegistry.h:45

References FactoryHolder< T, O, Key >::_key, and ObjectRegistry< T, Key >::instance().

Member Data Documentation

◆ _key

template<class T , class O , class Key = std::string>
Key const FactoryHolder< T, O, Key >::_key
private