SOFA API  6a688117
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, typename std::enable_if< std::is_same< U, NoArgument >::value, int >::type = 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

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

template<typename TKey, class TObject, typename TArgument = NoArgument, typename TPtr = TObject*>
iterator sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::begin ( )
inline
template<typename TKey, class TObject, typename TArgument = NoArgument, typename TPtr = TObject*>
const_iterator sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::begin ( ) const
inline
template<typename TKey , class TObject , typename TArgument , typename TPtr >
TPtr sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::createAnyObject ( Argument  arg)
template<typename TKey, class TObject, typename TArgument = NoArgument, typename TPtr = TObject*>
static ObjectPtr sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::CreateAnyObject ( Argument  arg)
inlinestatic
template<typename TKey, class TObject, typename TArgument = NoArgument, typename TPtr = TObject*>
template<class U = Argument, typename std::enable_if< std::is_same< U, NoArgument >::value, int >::type = 0>
ObjectPtr sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::createObject ( Key  key,
Argument  arg = NoArgument() 
)
inline
template<typename TKey , class TObject , typename TArgument , typename TPtr >
TPtr sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::createObject ( Key  key,
Argument  arg 
)
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
template<typename TKey , class TObject , typename TArgument , typename TPtr >
bool sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::duplicateEntry ( Key  existing,
Key  duplicate 
)
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
template<typename TKey, class TObject, typename TArgument = NoArgument, typename TPtr = TObject*>
iterator sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::end ( )
inline
template<typename TKey, class TObject, typename TArgument = NoArgument, typename TPtr = TObject*>
const_iterator sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::end ( ) const
inline
template<typename TKey , class TObject , typename TArgument , typename TPtr >
Factory< TKey, TObject, TArgument, TPtr > * sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::getInstance ( )
static
template<typename TKey , class TObject , typename TArgument , typename TPtr >
bool sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::hasKey ( Key  key)
template<typename TKey, class TObject, typename TArgument = NoArgument, typename TPtr = TObject*>
static bool sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::HasKey ( Key  key)
inlinestatic
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
template<typename TKey , class TObject , typename TArgument , typename TPtr >
bool sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::resetEntry ( Key  existingKey)
template<typename TKey, class TObject, typename TArgument = NoArgument, typename TPtr = TObject*>
static bool sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::ResetEntry ( Key  existing)
inlinestatic
template<typename TKey , class TObject , typename TArgument , typename TPtr >
template<typename OutIterator >
void sofa::helper::Factory< TKey, TObject, TArgument, TPtr >::uniqueKeys ( OutIterator  out)