fw4spl
fwAtomsPatch::StructuralCreatorDB Class Reference

Structural creator database. All structural creators are stored in this database. More...

#include <StructuralCreatorDB.hpp>

Public Types

typedef std::shared_ptr< StructuralCreatorDBsptr
 
typedef std::pair< std::string, std::string > VersionIDType
 Typedef used to store the pair classname/version of a data structure.
 
typedef std::map< VersionIDType, std::shared_ptr< ::fwAtomsPatch::IStructuralCreator > > CreatorsType
 Typedef used to store all the structural creators.
 

Public Member Functions

FWATOMSPATCH_API void registerCreator (std::shared_ptr< ::fwAtomsPatch::IStructuralCreator > creator)
 Registers a new creator. More...
 
FWATOMSPATCH_API std::shared_ptr< ::fwAtomsPatch::IStructuralCreatorgetCreator (const std::string &classname, const std::string &version)
 Retrieves creator to create data revision. More...
 
FWATOMSPATCH_API std::shared_ptr< ::fwAtoms::Objectcreate (const std::string &classname, const std::string &version)
 Creates a new object instance with given classname and version. More...
 
FWATOMSPATCH_API size_t size () const
 Returns the number of creators.
 
 StructuralCreatorDB ()
 Constructor.
 
 ~StructuralCreatorDB ()
 Destructor.
 

Static Public Member Functions

static StructuralCreatorDB::sptr getDefault ()
 Returns the default instance of StructuralCreatorDB.
 

Detailed Description

Structural creator database. All structural creators are stored in this database.

Definition at line 33 of file StructuralCreatorDB.hpp.

Member Function Documentation

fwAtoms::Object::sptr fwAtomsPatch::StructuralCreatorDB::create ( const std::string &  classname,
const std::string &  version 
)

Creates a new object instance with given classname and version.

Note
This method is thread safe.

Definition at line 45 of file StructuralCreatorDB.cpp.

References getCreator(), and OSLM_ASSERT.

+ Here is the call graph for this function:

fwAtomsPatch::IStructuralCreator::sptr fwAtomsPatch::StructuralCreatorDB::getCreator ( const std::string &  classname,
const std::string &  version 
)

Retrieves creator to create data revision.

Parameters
classnamethe structure classname.
versionthe structure version.
Returns
creator used to generate the data structure.
Note
This method is thread safe.

Definition at line 26 of file StructuralCreatorDB.cpp.

Referenced by create().

+ Here is the caller graph for this function:

void fwAtomsPatch::StructuralCreatorDB::registerCreator ( std::shared_ptr< ::fwAtomsPatch::IStructuralCreator creator)

Registers a new creator.

Parameters
creatorthe new creator.
Note
This method is thread safe.

Definition at line 17 of file StructuralCreatorDB.cpp.


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