#include <ObjectFactory.h>
Helper class used to register a class in the ObjectFactory. More...
Helper class used to register a class in the ObjectFactory.
This class accumulate information about a given class, as well as creators for each supported template instanciation, to register a new entry in the ObjectFactory.
It should be used as a temporary object, finalized when used to initialize an int static variable. For example :
Protected Attributes | |
ObjectFactory::ClassEntry | entry |
Class entry being constructed. More... | |
Public Member Functions | |
RegisterObject (const std::string &description) | |
Start the registration by giving the description of this class. More... | |
RegisterObject & | addAlias (std::string val) |
Add an alias name for this class. More... | |
RegisterObject & | addDescription (std::string val) |
Add more descriptive text about this class. More... | |
RegisterObject & | addAuthor (std::string val) |
Specify a list of authors (separated with spaces) More... | |
RegisterObject & | addLicense (std::string val) |
Specify a license (LGPL, GPL, ...) More... | |
RegisterObject & | addCreator (std::string classname, std::string templatename, ObjectFactory::Creator::SPtr creator) |
template<class RealObject > | |
RegisterObject & | add (bool defaultTemplate=false) |
operator int () | |
This is the final operation that will actually commit the additions to the ObjectFactory. More... | |
|
protected |
Class entry being constructed.
sofa::core::RegisterObject::RegisterObject | ( | const std::string & | description | ) |
Start the registration by giving the description of this class.
|
inline |
Add a template instanciation of this class.
defaultTemplate | set to true if this should be the default instance when no template name is given. |
RegisterObject & sofa::core::RegisterObject::addAlias | ( | std::string | val | ) |
Add an alias name for this class.
RegisterObject & sofa::core::RegisterObject::addAuthor | ( | std::string | val | ) |
Specify a list of authors (separated with spaces)
RegisterObject & sofa::core::RegisterObject::addCreator | ( | std::string | classname, |
std::string | templatename, | ||
ObjectFactory::Creator::SPtr | creator | ||
) |
Add a creator able to instance this class with the given templatename.
See the add<RealObject>() method for an easy way to add a Creator.
RegisterObject & sofa::core::RegisterObject::addDescription | ( | std::string | val | ) |
Add more descriptive text about this class.
RegisterObject & sofa::core::RegisterObject::addLicense | ( | std::string | val | ) |
Specify a license (LGPL, GPL, ...)
sofa::core::RegisterObject::operator int | ( | ) |
This is the final operation that will actually commit the additions to the ObjectFactory.