TrinityCore
Loading...
Searching...
No Matches
ScriptRegistryCompositum Class Reference
+ Inheritance diagram for ScriptRegistryCompositum:

Classes

class  DeleteableObject
 
class  DeleteableObjectBase
 Type erasure wrapper for objects. More...
 

Public Member Functions

void SetScriptNameInContext (std::string const &scriptname, std::string const &context)
 
std::string const & GetScriptContextOfScriptName (std::string const &scriptname) const
 
void ReleaseContext (std::string const &context) final override
 
void SwapContext (bool initialize) final override
 Injects and updates the changed script objects.
 
void RemoveUsedScriptsFromContainer (std::unordered_set< std::string > &scripts) final override
 
void Unload () final override
 Unloads the script registry.
 
template<typename T >
void QueueForDelayedDelete (T &&any)
 
- Public Member Functions inherited from ScriptRegistryInterface
 ScriptRegistryInterface ()
 
virtual ~ScriptRegistryInterface ()
 
 ScriptRegistryInterface (ScriptRegistryInterface const &)=delete
 
 ScriptRegistryInterface (ScriptRegistryInterface &&)=delete
 
ScriptRegistryInterfaceoperator= (ScriptRegistryInterface const &)=delete
 
ScriptRegistryInterfaceoperator= (ScriptRegistryInterface &&)=delete
 

Static Public Member Functions

static ScriptRegistryCompositumInstance ()
 

Private Member Functions

 ScriptRegistryCompositum ()
 
void Register (ScriptRegistryInterface *registry)
 
void DoDelayedDelete ()
 

Private Attributes

std::unordered_set< ScriptRegistryInterface * > _registries
 
std::vector< std::unique_ptr< DeleteableObjectBase > > _delayed_delete_queue
 
std::unordered_map< std::string, std::string > _scriptnames_to_context
 

Friends

template<class >
class ScriptRegistry
 

Detailed Description

Definition at line 143 of file ScriptMgr.cpp.

Constructor & Destructor Documentation

◆ ScriptRegistryCompositum()

ScriptRegistryCompositum::ScriptRegistryCompositum ( )
inlineprivate

Definition at line 146 of file ScriptMgr.cpp.

Member Function Documentation

◆ DoDelayedDelete()

void ScriptRegistryCompositum::DoDelayedDelete ( )
inlineprivate

Definition at line 248 of file ScriptMgr.cpp.

+ Here is the caller graph for this function:

◆ GetScriptContextOfScriptName()

std::string const & ScriptRegistryCompositum::GetScriptContextOfScriptName ( std::string const &  scriptname) const
inline

Definition at line 182 of file ScriptMgr.cpp.

◆ Instance()

static ScriptRegistryCompositum * ScriptRegistryCompositum::Instance ( )
inlinestatic

Definition at line 236 of file ScriptMgr.cpp.

◆ QueueForDelayedDelete()

template<typename T >
void ScriptRegistryCompositum::QueueForDelayedDelete ( T &&  any)
inline

Definition at line 227 of file ScriptMgr.cpp.

◆ Register()

void ScriptRegistryCompositum::Register ( ScriptRegistryInterface registry)
inlineprivate

Definition at line 243 of file ScriptMgr.cpp.

◆ ReleaseContext()

void ScriptRegistryCompositum::ReleaseContext ( std::string const &  context)
inlinefinaloverridevirtual

Removes all scripts associated with the given script context. Requires ScriptRegistryBase::SwapContext to be called after all transfers have finished.

Implements ScriptRegistryInterface.

Definition at line 190 of file ScriptMgr.cpp.

◆ RemoveUsedScriptsFromContainer()

void ScriptRegistryCompositum::RemoveUsedScriptsFromContainer ( std::unordered_set< std::string > &  scripts)
inlinefinaloverridevirtual

Removes the scripts used by this registry from the given container. Used to find unused script names.

Implements ScriptRegistryInterface.

Definition at line 214 of file ScriptMgr.cpp.

◆ SetScriptNameInContext()

void ScriptRegistryCompositum::SetScriptNameInContext ( std::string const &  scriptname,
std::string const &  context 
)
inline

Definition at line 175 of file ScriptMgr.cpp.

◆ SwapContext()

void ScriptRegistryCompositum::SwapContext ( bool  initialize)
inlinefinaloverridevirtual

Injects and updates the changed script objects.

Implements ScriptRegistryInterface.

Definition at line 206 of file ScriptMgr.cpp.

+ Here is the call graph for this function:

◆ Unload()

void ScriptRegistryCompositum::Unload ( )
inlinefinaloverridevirtual

Unloads the script registry.

Implements ScriptRegistryInterface.

Definition at line 220 of file ScriptMgr.cpp.

Friends And Related Symbol Documentation

◆ ScriptRegistry

template<class >
friend class ScriptRegistry
friend

Definition at line 149 of file ScriptMgr.cpp.

Member Data Documentation

◆ _delayed_delete_queue

std::vector<std::unique_ptr<DeleteableObjectBase> > ScriptRegistryCompositum::_delayed_delete_queue
private

Definition at line 255 of file ScriptMgr.cpp.

◆ _registries

std::unordered_set<ScriptRegistryInterface*> ScriptRegistryCompositum::_registries
private

Definition at line 253 of file ScriptMgr.cpp.

◆ _scriptnames_to_context

std::unordered_map< std::string , std::string > ScriptRegistryCompositum::_scriptnames_to_context
private

Definition at line 260 of file ScriptMgr.cpp.


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