VISH  0.2
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | Related Functions
Wizt::TypedSlot Class Reference

An input slot for VObjects, bound to a specific type. More...

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

List of all members.

Classes

Public Types

Public Member Functions

Static Public Member Functions

Static Public Attributes

Friends

Related Functions

(Note that these are not member functions.)


Detailed Description

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.

Examples:

MonochromeBackground.cpp.


Constructor & Destructor Documentation

Wizt::TypedSlot::TypedSlot ( VObject that,
const string name,
const T &  initialValue,
int  expertLevel = 0 
) [inline]

Constructing a typed slot.

Parameters:
thatThe VObject to which this slot is bound.
ELthe Expert level of this slot, which might be used for a GUI.
initialValueThe 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.

Parameters:
thatThe VObject to which this slot is bound.
ELthe Expert level of this slot, which might be used for a GUI.
initialValueThe 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.

Note:
Requires template VValueParameter<T>::VValueParameter(string, const RefPtr<VCreationPreferences>&) to be specialized!!
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.

Note:
Requires template VValueParameter<T>::VValueParameter() to be specialized!!
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.

Parameters:
thatThe object to which this parameter will be attached.
nameThe name under which this parameter will be accessed from within this object. It will be modified via VObject::CreateParameterName().
initialValueThe 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.

Parameters:
thatThe object to which this parameter will be attached.
nameThe name under which this parameter will be accessed from within this object. It will be modified via VObject::CreateParameterName().
initialValueThe 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.


Member Function Documentation

template<class Type >
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.

Returns:
false If there type is incompatible, or there is no such property at all.

Friends And Related Function Documentation

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.

Returns:
true if the value has been changed.

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