VISH  0.2
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions
Wizt::VCreatorBase Class Reference

Base class for objects that serve to create VObject's. More...

#include </home/werner/origo/vish/ocean/plankton/VCreatorBase.hpp>

List of all members.

Classes

Public Member Functions

Static Public Member Functions

Protected Member Functions


Detailed Description

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.

Note:
Currently, VCreator object's are in the same pool as VInputCreatorBase, but not all VInputCreatorBase objects are VCreator's as well, since not every VInput is an VObject.

In contrast to VInputCreators, VCreators possess a virtual create method that only requires a name.


Constructor & Destructor Documentation

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.


Member Function Documentation

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<>.

Parameters:
nameAn optional name, if none is given then the new object will be named like the creator itself, possibly with an enumeration number appended.
CreationContextAn 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.
Returns:
A pointer to the newly created object.

Implemented in Wizt::VCreator.

RefPtr<VObject> Wizt::VCreatorBase::create ( const string name = "") const [inline]

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.

Parameters:
nameAn optional name, if none is given then the new object will be named like the creator itself, possibly with an enumeration number appended.

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