VISH
0.2
|
A registry for the runtime-creation of typed slots, allowing creation of type-specific VObject input parameters without knowing their types explicitly. More...
#include </home/werner/origo/vish/ocean/plankton/VSlot.hpp>
A registry for the runtime-creation of typed slots, allowing creation of type-specific VObject input parameters without knowing their types explicitly.
Usage:
if (RefPtr<TypedSlotCreatorBase> TC = TypedSlotCreatorBase::getTypedSlotCreator("int") ) { RefPtr<VSlot> mylot = TC->newSlot( ... ); }
Wizt::TypedSlotCreator::~TypedSlotCreator | ( | ) |
Destructor, cleans up registry.
It will be called when a type is defined in a plugin and the plugin is unloaded.
virtual RefPtr<VSlot> Wizt::TypedSlotCreator::newSlot | ( | VObject * | that, |
const string & | name, | ||
const string & | InitialValue, | ||
bool & | Initialized, | ||
const RefPtr< VCreationPreferences > & | VP, | ||
int | ExpertLevel | ||
) | const [pure virtual] |
The virtual slot creation function.
InitialValue | An initial value encoded as string, utilizing the VValueTrait<> template to convert into the actual type. |
Initialized | Flag telling wether the slot could be initialized successfully from the given initial value. If that one is invalid, for instance it could not be parsed correctly for the final type, then the Slot will be initialized with the default constructor of the given type. |
Implemented in Wizt::TypedSlot::SlotCreator.
void Wizt::TypedSlotCreator::registerTypedSlotCreator | ( | const type_info & | theType, |
const WeakPtr< TypedSlotCreator, TypedSlotCreator > & | who | ||
) | [static] |
Add an instance of a type-specific SlotCreator to the registry.
theType | The typeid of the value that are operated on |
who | A static SlotCreator as provided by TypedSlotCreator<>::getCreator(); |