Wizt::VSlot Struct Reference
#include </home/packages/vish/vish/ocean/plankton/VSlot.hpp>
Inheritance diagram for Wizt::VSlot:
List of all members.
Detailed Description
Intermediate class for storing (named) references to parameters.
This reference class is used whereever we want to refer to a certain parameter, but the parameter itself may change since it might be connected to one or another object. This reference slot implements an edge in the data flow graph. Independently, each parameter may be related to one or many inputs, which are related through the control flow graph.
Note that global operators are provided that enable user-friendly convenient retrieval of slot values. Code looks like this:
Slot mySlot;
Context myContext;
int Value;
if ( mySlot << myContext >> Value )
{
printf("Yes, got a value, and its value is %d!\n", Value);
}
else
{
printf("Sorry, could not retrieve the desired input value...\n");
}
Public Types
-
typedef const std::pair< const
RefPtr< ValueSet >, const
RefPtr< ValuePool > > ValueSetPair
Public Member Functions
-
Ageable & age (const RefPtr< ValuePool > &VP) const
- template<class T> bool forceSetProperty (const string &name, const T &value) const
- Set a certain property of this parameter, and issue a notification event for the parameter's input object.
-
template<class T> bool getProperty (const string &s, T &value) const
- Retrieve a certain propert of a parameter.
-
RefPtr< VValueBase > getProperty (const string &s) const
- Retrieve a certain property with yet unknown type.
-
const type_info & getType () const
- template<class Type> bool getValue (Type &Variable, const RefPtr< ValuePool > &VP) const
- Get a value for a certain parameter.
-
RefPtr< VValueBase > getValueBase (const RefPtr< ValuePool > &VP) const
- void Globalize (const RefPtr< ValuePool > &GhostValues)
- If a context-local parameter should rather be set to a global value, call this function.
- void Localize ()
- New object parameters start as global parameters.
-
RefPtr< VValueBase > operator * () const
- Return the GLOBAL value associated with this slot.
-
RefPtr< VValueBase > operator() (const RefPtr< ValuePool > &VP) const
- Return the value associated with this slot relative to a given value pool.
-
RefPtr< VManagedObject > Owner () const
- Return a possible owner of this slot, telling where these values stem from.
- template<class T> bool setProperty (const string &name, const T &value) const
- Set a certain property of this parameter if it differs, and issue a notification event for the parameter's input object if it has changed.
-
template<class Type> bool setValue (const Type &Variable, const RefPtr< ValuePool > &VP) const
-
RefPtr< VManagedObject > Source () const
-
VSlot (const RefPtr< VParameter > &p, const string &name, const string &member="")
- Construct slot from parameter and local name, optional member reference.
-
VSlot ()
- Empty constructor.
-
~VSlot ()
- Destructor.
Public Attributes
- bool AllowAutoConnection
- Specify whether this slot maybe be automatically connected with the slots of another VObject when connectSlots() is called.
-
string member
- Eventually, the member of the parameter which is used for this VObject.
-
string name
- Local name of this parameter, i.e. how it is accessed from an VObject.
-
RefPtr< VParameter > param
- Reference to the actual parameter.
Friends
- const ValueSetPair & operator+= (const ValueSetPair &VSP, const RefPtr< VSlot > &VS)
- const ValueSetPair & operator, (const ValueSetPair &VSP, const RefPtr< VSlot > &VS)
Classes
Member Function Documentation
template<class T>
bool Wizt::VSlot::forceSetProperty |
( |
const string & |
name, |
|
|
const T & |
value | |
|
) |
| | const [inline] |
Set a certain property of this parameter, and issue a notification event for the parameter's input object.
- Todo:
- Think about clustering of parameter property notifications. Won't be too hard, since the VParameter::setValueParameter() code is the one sending the notification. Just need to conceive a safe and convenient API.
template<class Type>
bool Wizt::VSlot::getValue |
( |
Type & |
Variable, |
|
|
const RefPtr< ValuePool > & |
VP | |
|
) |
| | const [inline] |
Get a value for a certain parameter.
- Returns:
- false, if the value could not be set, because the parameter was not found or there was another error, for instance the parameter has an incompatible type.
void Wizt::VSlot::Globalize |
( |
const RefPtr< ValuePool > & |
GhostValues |
) |
[inline] |
If a context-local parameter should rather be set to a global value, call this function.
Some context needs to be provided though in order to set the global state from this local context.
void Wizt::VSlot::Localize |
( |
|
) |
[inline] |
New object parameters start as global parameters.
If the value of a parameter is supposed to be context-local, then this may be specified by calling this function.
template<class T>
bool Wizt::VSlot::setProperty |
( |
const string & |
name, |
|
|
const T & |
value | |
|
) |
| | const [inline] |
Set a certain property of this parameter if it differs, and issue a notification event for the parameter's input object if it has changed.
- Note:
- An unequality operation must be defined for the template type T
- Returns:
- true if the parameter could be changed.
- See also:
- forceSetProperty Set a property unconditionally.
Friends And Related Function Documentation
const ValueSetPair& operator+= |
( |
const ValueSetPair & |
VSP, |
|
|
const RefPtr< VSlot > & |
VS | |
|
) |
| | [friend] |
RefPtr<ValueSet> Changeables = new ValueSet();
Changeables & R += nLines, X, Y, Z, Length, DistributionWidth;
const ValueSetPair& operator, |
( |
const ValueSetPair & |
VSP, |
|
|
const RefPtr< VSlot > & |
VS | |
|
) |
| | [friend] |
RefPtr<ValueSet> Changeables = new ValueSet();
Changeables & R += nLines, X, Y, Z, Length, DistributionWidth;
Member Data Documentation
Specify whether this slot maybe be automatically connected with the slots of another VObject when connectSlots() is called.
This is the case for instance when a new VObject is created as an input object for some VObject. Here, usually it were beneficial to have all compatible slots (same type, same name) to be connected to the same input. However, there are case where this should not be the case. This flag (default is true) allows to specify such slots that are to be kept private.
The documentation for this struct was generated from the following files:
- ocean/plankton/VSlot.hpp
- ocean/plankton/VSlot.cpp
Generated on Thu Apr 2 16:58:13 2009 for VISH by
1.4.7