VISH  0.2
Classes | Public Types | Public Member Functions | Static Public Member Functions
Wizt::ValuePool Class Reference

A ValuePool is the home of local values of certain input objects. More...

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

List of all members.

Classes

Public Types

Public Member Functions

Interface for Named Variables
Interface for Keyed Variables

Static Public Member Functions


Detailed Description

A ValuePool is the home of local values of certain input objects.

When an input object is queried for its value, a VContext is specified. This VContext may refer to a pool of alternative copies.

The ValuePool provides two interfaces to access stored values:

However, the ValuePool may also host a local copy of variables which co-exist permanently. They are used by the VParameter only if it set to local, but are not destroyed when switching to global. As such, these local values may well reside as part of multiple VObjects.

Class skeleton (main purpose is to map ValueNotifierLists to VValueBases. It's basic structure is of the type

  class ValuePool : public map<WeakPtr<ValueNotifierList>, RefPtr<VValueBase> >
  {};

whereby a ValuePool provides some additional properties like being an Intercube and a mutex for multithreaded operations. However, it should be avoided to lock an operation on a ValuePool since accessing the ValuePool is a very frequent operation.

Examples:

LocalCompoundInput.cpp.


Constructor & Destructor Documentation

Wizt::ValuePool::ValuePool ( )

Constructor, should set identifier name later since the default name is somewith unique, but weird.

Calling this constructor should be avoided.


Member Function Documentation

void Wizt::ValuePool::activate ( const RefPtr< ValuePool > &  OldPool,
const WeakPtr< ValueNotifier > &  who = NullPtr(),
const ValueMap VP = 0 
) const

Activate this set of variables, which induces sending a notification request (i.e.

ValueNotifier::valueChanged() ) for all stored values.

Parameters:
OldPoolThe previous pool of variables. It is required to determine which variables are changing at this activate() request and should receive a notify() call. Such circumstances arise when
  1. a local variable doesn't exist in this pool, i.e. its global value is used now
  2. or a variable is local in the new pool

Broadcast a value change event to all listening notifiers.

void Wizt::ValuePool::createVariable ( const Key_t Key,
const RefPtr< VValueBase > &  v 
)

Create the shadow of a variable in this pool, using the specified value.

Parameters:
KeyThe notifier list, which is used as reference
vAn existing variable, which contains the value.
WeakPtr< ValuePool > Wizt::ValuePool::getValuePool ( const string name) [static]

Get a value pool that is associated with a certain name in the global database.

It is not recommended to use this function, value pools should always be passed to calling routines that need them.

bool Wizt::ValuePool::removeValue ( const string name)

Remove the association of a local variable with a name.

Note that this association is removed anyway on destruction of a local variable since only weak pointers are stored here.


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