#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 instantiation, 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 | |
ObjectRegistrationData (const std::string &description) | |
Start the registration by giving the description of this class. More... | |
ObjectRegistrationData & | addAlias (std::string val) |
Add an alias name for this class. More... | |
ObjectRegistrationData & | addDescription (std::string val) |
Add more descriptive text about this class. More... | |
ObjectRegistrationData & | addAuthor (std::string val) |
Specify a list of authors (separated with spaces) More... | |
ObjectRegistrationData & | addLicense (std::string val) |
Specify a license (LGPL, GPL, ...) More... | |
ObjectRegistrationData & | addDocumentationURL (std::string url) |
Specify a documentation URL. More... | |
ObjectRegistrationData & | addCreator (std::string classname, std::string templatename, ObjectFactory::Creator::SPtr creator) |
template<class RealObject > | |
ObjectRegistrationData & | add (bool defaultTemplate=false) |
bool | commitTo (sofa::core::ObjectFactory *objectFactory) const |
This is the final operation that will actually commit the additions to the ObjectFactory. More... | |
|
protected |
Class entry being constructed.
|
explicit |
Start the registration by giving the description of this class.
|
inline |
Add a template instantiation of this class.
defaultTemplate | set to true if this should be the default instance when no template name is given. |
ObjectRegistrationData & sofa::core::ObjectRegistrationData::addAlias | ( | std::string | val | ) |
Add an alias name for this class.
ObjectRegistrationData & sofa::core::ObjectRegistrationData::addAuthor | ( | std::string | val | ) |
Specify a list of authors (separated with spaces)
ObjectRegistrationData & sofa::core::ObjectRegistrationData::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.
ObjectRegistrationData & sofa::core::ObjectRegistrationData::addDescription | ( | std::string | val | ) |
Add more descriptive text about this class.
ObjectRegistrationData & sofa::core::ObjectRegistrationData::addDocumentationURL | ( | std::string | url | ) |
Specify a documentation URL.
ObjectRegistrationData & sofa::core::ObjectRegistrationData::addLicense | ( | std::string | val | ) |
Specify a license (LGPL, GPL, ...)
bool sofa::core::ObjectRegistrationData::commitTo | ( | sofa::core::ObjectFactory * | objectFactory | ) | const |
This is the final operation that will actually commit the additions to the ObjectFactory.