VISH
0.2
|
An input slot for VObjects, bound to a specific type. More...
#include </home/werner/origo/vish/ocean/plankton/VSlot.hpp>
(Note that these are not member functions.)
An input slot for VObjects, bound to a specific type.
An input slot is a reference to a VParameter, that is contained within an VObject. The typical usage is
class MyObject : public VObject { TypedSlot<int> MyInteger; MyObject() : MyInteger(this, "myvalue", 42) {} };
Basically a TypedSlot is a convenience class wrapper for using VObject::Slot, which is for untyped slots.
Wizt::TypedSlot::TypedSlot | ( | VObject * | that, |
const string & | name, | ||
const T & | initialValue, | ||
int | expertLevel = 0 |
||
) | [inline] |
Constructing a typed slot.
that | The VObject to which this slot is bound. |
EL | the Expert level of this slot, which might be used for a GUI. |
initialValue | The intial value of this slot's parameter. |
Wizt::TypedSlot::TypedSlot | ( | const WeakVObjectPtr & | that, |
const string & | name, | ||
const T & | initialValue, | ||
int | expertLevel = 0 |
||
) | [inline] |
Constructing a typed slot.
that | The VObject to which this slot is bound. |
EL | the Expert level of this slot, which might be used for a GUI. |
initialValue | The intial value of this slot's parameter. |
Wizt::TypedSlot::TypedSlot | ( | VObject * | that, |
const string & | name, | ||
const RefPtr< VCreationPreferences > & | VP, | ||
int | prior | ||
) | [inline] |
Construct a typed slot with Creation Preferences, but no initialization of the value.
Uses non-standard constructor for VValueParameter<T>, thus this constructor is only available for types where a specialization of VValueParameter<T>(string, RefPtr<VCreationPrefences>) exists.
Wizt::TypedSlot::TypedSlot | ( | VObject * | that, |
const string & | name, | ||
const VSlot::Empty & | , | ||
int | prior = 0 |
||
) | [inline] |
Special constructor that does not initialize the value of this input slot.
Rarely to be used, only for specific cases where initialization of a slot's type is non-trivial.
Uses non-standard constructor for VValueParameter<T>, thus this constructor is only available for types where a specialization of VValueParameter<T>() exists.
Wizt::TypedSlot::TypedSlot | ( | VObject * | that, |
const string & | name, | ||
const T & | initialValue, | ||
const RefPtr< VCreationPreferences > & | VP, | ||
int | ExpertLevel = 0 , |
||
bool | overwriteExistingSlot = true |
||
) | [inline] |
Creation of a typed slot, constructor with creation preferences.
that | The object to which this parameter will be attached. |
name | The name under which this parameter will be accessed from within this object. It will be modified via VObject::CreateParameterName(). |
initialValue | The initial value of this slot's parameter. |
Wizt::TypedSlot::TypedSlot | ( | const WeakVObjectPtr & | that, |
const string & | name, | ||
const T & | initialValue, | ||
const RefPtr< VCreationPreferences > & | VP, | ||
int | ExpertLevel = 0 , |
||
bool | overwriteExistingSlot = true |
||
) | [inline] |
Creation of a typed slot, constructor with creation preferences.
that | The object to which this parameter will be attached. |
name | The name under which this parameter will be accessed from within this object. It will be modified via VObject::CreateParameterName(). |
initialValue | The initial value of this slot's parameter. |
Wizt::TypedSlot::~TypedSlot | ( | ) | [inline] |
Destructor.
It contains meaningless code to access the static SlotCreator instance such that SlotCreators are instantiated and added to the SlotCreator registry. This meaningless code is a simple pointer assignment and will slow down the destructor by about one or two CPU cycles.
bool Wizt::TypedSlot::getProperty | ( | const string & | s, |
Type & | value | ||
) | const [inline] |
Retrieve the value of a certain property of the parameter associated with this slot, if it is compatible to the specified type.
const ValueSetPair& operator+= | ( | const ValueSetPair & | VSP, |
const TypedSlot & | VS | ||
) | [friend] |
RefPtr<ValueSet> Changeables = new ValueSet();
Changeables & R += nLines, X, Y, Z, Length, DistributionWidth;
const ValueSetPair& operator, | ( | const ValueSetPair & | VSP, |
const TypedSlot & | VS | ||
) | [friend] |
RefPtr<ValueSet> Changeables = new ValueSet();
Changeables & R += nLines, X, Y, Z, Length, DistributionWidth;
bool operator<<= | ( | const SlotContext & | SC, |
const T & | Variable | ||
) | [friend] |
Assign a parameter's value within slot context IF it has changed.
This requires the existence of a comparision operator for type T. It will read the previous value of the slot into a temporary variable for comparison.