PeriDyno 1.2.1
Loading...
Searching...
No Matches
WtDataModelRegistry Class Reference

#include <WtDataModelRegistry.h>

Classes

struct  HasStaticMethodName
 
struct  HasStaticMethodName< T, typename std::enable_if< std::is_same< decltype(T::Name()), std::string >::value >::type >
 
struct  UnwrapUniquePtr
 
struct  UnwrapUniquePtr< std::unique_ptr< T > >
 

Public Types

using RegistryItemPtr = std::unique_ptr<WtNodeDataModel>
 
using RegistryItemCreator = std::function<RegistryItemPtr()>
 
using RegisteredModelCreatorsMap = std::unordered_map<std::string, RegistryItemCreator>
 
using RegisteredModelsCategoryMap = std::unordered_map<std::string, std::string>
 
using CategoriesSet = std::set<std::string>
 
using RegisteredTypeConvertersMap = std::map<TypeConverterId, TypeConverter>
 

Public Member Functions

 WtDataModelRegistry ()=default
 
 ~WtDataModelRegistry ()=default
 
 WtDataModelRegistry (WtDataModelRegistry const &)=delete
 
 WtDataModelRegistry (WtDataModelRegistry &&)=default
 
WtDataModelRegistryoperator= (WtDataModelRegistry const &)=delete
 
WtDataModelRegistryoperator= (WtDataModelRegistry &&)=default
 
template<typename ModelType>
void registerModel (RegistryItemCreator creator, std::string const &category="Nodes")
 
template<typename ModelType>
void registerModel (std::string const &category="Nodes")
 
template<typename ModelType>
void registerModel (std::string const &category, RegistryItemCreator creator)
 
template<typename ModelCreator>
void registerModel (ModelCreator &&creator, std::string const &category="Nodes")
 
template<typename ModelCreator>
void registerModel (std::string const &category, ModelCreator &&creator)
 
void registerTypeConverter (TypeConverterId const &id, TypeConverter typeConverter)
 
std::unique_ptr< WtNodeDataModelcreate (std::string const &modelName)
 
RegisteredModelCreatorsMap const & registeredModelCreators () const
 
RegisteredModelsCategoryMap const & registeredModelsCategoryAssociation () const
 
CategoriesSet const & categories () const
 
TypeConverter getTypeConverter (NodeDataType const &d1, NodeDataType const &d2) const
 

Private Types

template<typename CreatorResult>
using compute_model_type_t = typename UnwrapUniquePtr<CreatorResult>::type
 

Static Private Member Functions

template<typename ModelType>
static std::string computeName (std::true_type, RegistryItemCreator const &)
 
template<typename ModelType>
static std::string computeName (std::false_type, RegistryItemCreator const &creator)
 

Private Attributes

RegisteredModelsCategoryMap _registeredModelsCategory
 
CategoriesSet _categories
 
RegisteredModelCreatorsMap _registeredItemCreators
 
RegisteredTypeConvertersMap _registeredTypeConverters
 

Detailed Description

Definition at line 22 of file WtDataModelRegistry.h.

Member Typedef Documentation

◆ CategoriesSet

using WtDataModelRegistry::CategoriesSet = std::set<std::string>

Definition at line 29 of file WtDataModelRegistry.h.

◆ compute_model_type_t

template<typename CreatorResult>
using WtDataModelRegistry::compute_model_type_t = typename UnwrapUniquePtr<CreatorResult>::type
private

Definition at line 145 of file WtDataModelRegistry.h.

◆ RegisteredModelCreatorsMap

using WtDataModelRegistry::RegisteredModelCreatorsMap = std::unordered_map<std::string, RegistryItemCreator>

Definition at line 27 of file WtDataModelRegistry.h.

◆ RegisteredModelsCategoryMap

using WtDataModelRegistry::RegisteredModelsCategoryMap = std::unordered_map<std::string, std::string>

Definition at line 28 of file WtDataModelRegistry.h.

◆ RegisteredTypeConvertersMap

◆ RegistryItemCreator

Definition at line 26 of file WtDataModelRegistry.h.

◆ RegistryItemPtr

Definition at line 25 of file WtDataModelRegistry.h.

Constructor & Destructor Documentation

◆ WtDataModelRegistry() [1/3]

WtDataModelRegistry::WtDataModelRegistry ( )
default
Here is the caller graph for this function:

◆ ~WtDataModelRegistry()

WtDataModelRegistry::~WtDataModelRegistry ( )
default

◆ WtDataModelRegistry() [2/3]

WtDataModelRegistry::WtDataModelRegistry ( WtDataModelRegistry const & )
delete
Here is the call graph for this function:

◆ WtDataModelRegistry() [3/3]

WtDataModelRegistry::WtDataModelRegistry ( WtDataModelRegistry && )
default
Here is the call graph for this function:

Member Function Documentation

◆ categories()

WtDataModelRegistry::CategoriesSet const & WtDataModelRegistry::categories ( ) const

Definition at line 24 of file WtDataModelRegistry.cpp.

◆ computeName() [1/2]

template<typename ModelType>
static std::string WtDataModelRegistry::computeName ( std::false_type ,
RegistryItemCreator const & creator )
inlinestaticprivate

Definition at line 121 of file WtDataModelRegistry.h.

◆ computeName() [2/2]

template<typename ModelType>
static std::string WtDataModelRegistry::computeName ( std::true_type ,
RegistryItemCreator const &  )
inlinestaticprivate

Definition at line 115 of file WtDataModelRegistry.h.

Here is the caller graph for this function:

◆ create()

std::unique_ptr< WtNodeDataModel > WtDataModelRegistry::create ( std::string const & modelName)

Definition at line 3 of file WtDataModelRegistry.cpp.

◆ getTypeConverter()

TypeConverter WtDataModelRegistry::getTypeConverter ( NodeDataType const & d1,
NodeDataType const & d2 ) const

Definition at line 29 of file WtDataModelRegistry.cpp.

◆ operator=() [1/2]

WtDataModelRegistry & WtDataModelRegistry::operator= ( WtDataModelRegistry && )
default
Here is the call graph for this function:

◆ operator=() [2/2]

WtDataModelRegistry & WtDataModelRegistry::operator= ( WtDataModelRegistry const & )
delete
Here is the call graph for this function:

◆ registeredModelCreators()

WtDataModelRegistry::RegisteredModelCreatorsMap const & WtDataModelRegistry::registeredModelCreators ( ) const

Definition at line 14 of file WtDataModelRegistry.cpp.

◆ registeredModelsCategoryAssociation()

WtDataModelRegistry::RegisteredModelsCategoryMap const & WtDataModelRegistry::registeredModelsCategoryAssociation ( ) const

Definition at line 19 of file WtDataModelRegistry.cpp.

◆ registerModel() [1/5]

template<typename ModelCreator>
void WtDataModelRegistry::registerModel ( ModelCreator && creator,
std::string const & category = "Nodes" )
inline

Definition at line 69 of file WtDataModelRegistry.h.

Here is the call graph for this function:

◆ registerModel() [2/5]

template<typename ModelType>
void WtDataModelRegistry::registerModel ( RegistryItemCreator creator,
std::string const & category = "Nodes" )
inline

Definition at line 43 of file WtDataModelRegistry.h.

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

◆ registerModel() [3/5]

template<typename ModelCreator>
void WtDataModelRegistry::registerModel ( std::string const & category,
ModelCreator && creator )
inline

Definition at line 76 of file WtDataModelRegistry.h.

Here is the call graph for this function:

◆ registerModel() [4/5]

template<typename ModelType>
void WtDataModelRegistry::registerModel ( std::string const & category,
RegistryItemCreator creator )
inline

Definition at line 62 of file WtDataModelRegistry.h.

Here is the call graph for this function:

◆ registerModel() [5/5]

template<typename ModelType>
void WtDataModelRegistry::registerModel ( std::string const & category = "Nodes")
inline

Definition at line 55 of file WtDataModelRegistry.h.

Here is the call graph for this function:

◆ registerTypeConverter()

void WtDataModelRegistry::registerTypeConverter ( TypeConverterId const & id,
TypeConverter typeConverter )
inline

Definition at line 81 of file WtDataModelRegistry.h.

Member Data Documentation

◆ _categories

CategoriesSet WtDataModelRegistry::_categories
private

Definition at line 100 of file WtDataModelRegistry.h.

◆ _registeredItemCreators

RegisteredModelCreatorsMap WtDataModelRegistry::_registeredItemCreators
private

Definition at line 102 of file WtDataModelRegistry.h.

◆ _registeredModelsCategory

RegisteredModelsCategoryMap WtDataModelRegistry::_registeredModelsCategory
private

Definition at line 98 of file WtDataModelRegistry.h.

◆ _registeredTypeConverters

RegisteredTypeConvertersMap WtDataModelRegistry::_registeredTypeConverters
private

Definition at line 104 of file WtDataModelRegistry.h.


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