VISH  0.2
Classes | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Attributes
Wizt::VParameter Class Reference

A VParameter enables VObjects to retrieve certain values. More...

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

List of all members.

Classes

Public Types

Public Member Functions

Public Attributes

Protected Types

Protected Attributes


Detailed Description

A VParameter enables VObjects to retrieve certain values.

It provides

A parameter that is associated with one or more VObjects. The same VParameter may be shared among multiple VObjects. For each VObject, it may be accessed via another name which is relative to this VObject. Moreover, there may be many VInputBase objects associated with the same VParameter.

VParameters moreover possess

  1. Creation Preferences - used during construction, originating from the Creator of this VParameter
  2. Properties - used at lifetime to specify inputs, for instance a range of a slider, to be used across all possible Creators, if possible

Constructor & Destructor Documentation

Wizt::VParameter::VParameter ( const RefPtr< VValueBase > &  value,
const string initial_name,
const RefPtr< VCreationPreferences > &  CP 
)
Parameters:
valueAn initial default value, preferably an actually stored value such as VValue<>. Note that child class VValueParameter<> implements the creation of such a default value by virtue of an provided initial type, so using this child class is more convenient than the generic VParameter class in most cases. Only exception is when this initial value should not be a VValue<>, but something else.

However, note that VParameter is an abstract class and cannot be instantiated anyway on their own.


Member Function Documentation

virtual RefPtr<VValueBase> Wizt::VParameter::createLocalVariable ( const RefPtr< ValuePool > &  GhostValues) const [pure virtual]

Cast a shadow of the current parameter's value onto the given ValuePool.

It the same ValuePool is specified on future retrieval, then all getValue()/setValue() calls will operate on this shadow instead of the global image.

Implemented in Wizt::VValueParameter, Wizt::VValueParameter< VThreadManager >, Wizt::VValueParameter< GLFontManager >, and Wizt::VAbstractValueParameter.

RefPtr< VValueBase > Wizt::VParameter::getLocalValue ( const RefPtr< ValuePool > &  VP,
const string member,
bool  forceLocal 
) const

Get the local shadow of the variable.

Returns:
NullPtr() if no such shadow exists.

Looking for eventual shadow value in value pool VP.

template<class Type >
bool Wizt::VParameter::getValue ( Type &  Variable,
const RefPtr< ValuePool > &  VP,
const string member 
) const [inline]

Get the current value of the parameter.

Parameters:
VPAn eventual ValuePool storing shadow copies of the main variable.
int Wizt::VParameter::iterateUserAliases ( UserIterator ,
const WeakPtr< VManagedObject > &  TheUsingObject 
) const

Iterate over all aliases of this parameter as seen from a a specific object.

The UserIterator::apply() function will be called with the same object.

void Wizt::VParameter::notifyInputs ( const ValuePoolPtr VP,
const ValueNotifierList Exclude,
const WeakPtr< ValueNotifier > &  issuer = NullPtr() 
) const [inline]

Broadcast a value change event to all listening notifiers.

Required for VInputBase::notify().

Parameters:
ExcludeIf the notify request is issued from such a notifier, then it is not broadcasted.
void Wizt::VParameter::setProperty ( const string s,
const RefPtr< VValueBase > &  V,
const WeakPtr< ValueNotifier > &  issuer = NullPtr(),
const ValueNotifierList Exclude = 0,
const ValuePoolPtr Ctx = NullPtr() 
)

Set a property of this parameter, and issue a notification event relative to the global context to all listening input instances.

Note that properties are NOT context-local (which might be some TODO to change later).

void Wizt::VParameter::setSilentProperty ( const string s,
const RefPtr< VValueBase > &  V 
) [inline]

Set a parameter's property without sending out a notification event.

A call to sendNotification() MUST be issued ASAP by the caller.

template<class Type >
bool Wizt::VParameter::setValue ( const Type &  Variable,
const RefPtr< ValuePool > &  VP,
const string member,
bool  forceLocalCreation,
const WeakPtr< ValueNotifier > &  issuer,
const ValueNotifierList Exclude = 0,
const ValueMap vParam = 0 
) const [inline]

Set the parameter to a certain value and inform all input listeners about this change.

Todo:
Add shadow parameterization!!
Examples:
exocoetida.cpp.

Member Data Documentation

An optional setting to specify how relevant this parameter is for the entire scene.

This value can be used by a GUI or some logging mechanism, where it is valued against some verbosity. The relevance parameter differs from an Expert Level in that it is not necessarily related to a certain type, but rather its role in a certain session. It may be changed at any time, but it is recommended that objects defining parameters also set their relevance. The initial value is zero. It may be negative to state that the parameter is irrelevant and should not be exposed to the end-user, or positive to state its importance.


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