SOFA API  ca665544
Open source framework for multi-physics simuation
sofa::helper::Factory< TKey, TObject, TArgument, TPtr > Class Template Reference

#include <Factory.h>

Inheritance diagram for sofa::helper::Factory< TKey, TObject, TArgument, TPtr >:

Protected Attributes

std::multimap< Key, Creator * > registry
 

Public Member Functions

bool registerCreator (Key key, Creator *creator, bool multi=false)
 
template<class U = Argument, std::enable_if_t< std::is_same_v< U, NoArgument >, int > = 0>
ObjectPtr createObject (Key key, Argument arg=NoArgument())
 
ObjectPtr createObject (Key key, Argument arg)
 
ObjectPtr createAnyObject (Argument arg)
 
template<typename OutIterator >
void uniqueKeys (OutIterator out)
 
bool hasKey (Key key)
 
bool duplicateEntry (Key existing, Key duplicate)
 
bool resetEntry (Key existingKey)
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 

Static Public Member Functions

static Factory< Key, Object, Argument, ObjectPtr > * getInstance ()
 
static ObjectPtr CreateObject (Key key, Argument arg)
 
static ObjectPtr CreateAnyObject (Argument arg)
 
static bool HasKey (Key key)
 
static bool DuplicateEntry (Key existing, Key duplicate)
 
static bool ResetEntry (Key existing)
 

Attribute details

◆ registry

template<typename TKey , class TObject , typename TArgument = NoArgument, typename TPtr = TObject*>
std::multimap<Key, Creator*> sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::registry
protected

Function details

◆ begin() [1/2]

template<typename TKey , class TObject , typename TArgument = NoArgument, typename TPtr = TObject*>
iterator sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::begin ( )
inline

◆ begin() [2/2]

template<typename TKey , class TObject , typename TArgument = NoArgument, typename TPtr = TObject*>
const_iterator sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::begin ( ) const
inline

◆ createAnyObject()

template<typename TKey , class TObject , typename TArgument , typename TPtr >
TPtr sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::createAnyObject ( Argument  arg)

◆ CreateAnyObject()

template<typename TKey , class TObject , typename TArgument = NoArgument, typename TPtr = TObject*>
static ObjectPtr sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::CreateAnyObject ( Argument  arg)
inlinestatic

◆ createObject() [1/2]

template<typename TKey , class TObject , typename TArgument , typename TPtr >
TPtr sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::createObject ( Key  key,
Argument  arg 
)

◆ CreateObject()

template<typename TKey , class TObject , typename TArgument = NoArgument, typename TPtr = TObject*>
static ObjectPtr sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::CreateObject ( Key  key,
Argument  arg 
)
inlinestatic

◆ createObject() [2/2]

template<typename TKey , class TObject , typename TArgument = NoArgument, typename TPtr = TObject*>
template<class U = Argument, std::enable_if_t< std::is_same_v< U, NoArgument >, int > = 0>
ObjectPtr sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::createObject ( Key  key,
Argument  arg = NoArgument() 
)
inline

◆ duplicateEntry()

template<typename TKey , class TObject , typename TArgument , typename TPtr >
bool sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::duplicateEntry ( Key  existing,
Key  duplicate 
)

◆ DuplicateEntry()

template<typename TKey , class TObject , typename TArgument = NoArgument, typename TPtr = TObject*>
static bool sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::DuplicateEntry ( Key  existing,
Key  duplicate 
)
inlinestatic

◆ end() [1/2]

template<typename TKey , class TObject , typename TArgument = NoArgument, typename TPtr = TObject*>
iterator sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::end ( )
inline

◆ end() [2/2]

template<typename TKey , class TObject , typename TArgument = NoArgument, typename TPtr = TObject*>
const_iterator sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::end ( ) const
inline

◆ getInstance()

template<typename TKey , class TObject , typename TArgument , typename TPtr >
Factory< TKey, TObject, TArgument, TPtr > * sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::getInstance
static

◆ hasKey()

template<typename TKey , class TObject , typename TArgument , typename TPtr >
bool sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::hasKey ( Key  key)

◆ HasKey()

template<typename TKey , class TObject , typename TArgument = NoArgument, typename TPtr = TObject*>
static bool sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::HasKey ( Key  key)
inlinestatic

◆ registerCreator()

template<typename TKey , class TObject , typename TArgument = NoArgument, typename TPtr = TObject*>
bool sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::registerCreator ( Key  key,
Creator creator,
bool  multi = false 
)
inline

◆ ResetEntry()

template<typename TKey , class TObject , typename TArgument = NoArgument, typename TPtr = TObject*>
static bool sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::ResetEntry ( Key  existing)
inlinestatic

◆ resetEntry()

template<typename TKey , class TObject , typename TArgument , typename TPtr >
bool sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::resetEntry ( Key  existingKey)

◆ uniqueKeys()

template<typename TKey , class TObject , typename TArgument , typename TPtr >
template<typename OutIterator >
void sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::uniqueKeys ( OutIterator  out)