Wizt::VSlot Struct Reference

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

Inheritance diagram for Wizt::VSlot:

MemCore::ReferenceBase< Object > 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

Public Member Functions

Public Attributes

Friends

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

bool Wizt::VSlot::AllowAutoConnection

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:
Generated on Thu Apr 2 16:58:13 2009 for VISH by  doxygen 1.4.7