VISH
0.2
|
Base class for objects that serve to create VObject's. More...
#include </home/werner/origo/vish/ocean/plankton/VCreatorBase.hpp>
Base class for objects that serve to create VObject's.
In general, such creator objects will be statically defined in a plugin library.
All such creator objects are registered in the object pool for the domain `VCreatorBase'. Iteration over the VCreatorBase pool provides all possible creator objects.
If they are created dynamically instead (there is hardly any reason for this, but who know's), then the isStatic constructor argument shall be set to false.
In contrast to VInputCreators, VCreators possess a virtual create method that only requires a name.
Wizt::VCreatorBase::VCreatorBase | ( | const string & | CreatorKeyName, |
int | priority = DEFAULT_PRIORITY , |
||
const RefPtr< VCreationPreferences > & | prop = NullPtr() , |
||
bool | isStatic = true |
||
) | [protected] |
Constructor a VCreator from a key name.
This is not recommended (see base class VCreatorProperties), as it requires parsing the given string based on interpretation of special characters.
virtual RefPtr<VObject> Wizt::VCreatorBase::create | ( | const string & | name, |
const Intercube & | CreationContext | ||
) | const [pure virtual] |
The virtual object creation function, it is implemented by VCreator<>.
name | An optional name, if none is given then the new object will be named like the creator itself, possibly with an enumeration number appended. |
CreationContext | An Intercube that allows specifying additional parameters for the circumstances of creation. It is passed to the VActionNotifier::VObjectCreation() call. If omitted, then the Creator object itself will be used as CreationContext. This is not recommended, however. A CreationContext should rather provide explicit information about the circumstances of the creation. |
Implemented in Wizt::VCreator.
Convenience function to create objects using default parameters.
The actual function called is the virtual create(name,CreationContext) function. The CreationContext will be the Creator object itself, by default.
name | An optional name, if none is given then the new object will be named like the creator itself, possibly with an enumeration number appended. |