The Vish Visualization Shell 0.3
Vish
Classes | Public Types | Public Member Functions | Protected Member Functions | Related Symbols | List of all members
Wizt::VSlotContainer< ExpertLevel > Struct Template Reference

Intermediate class managing VSlots. More...

#include <ocean/plankton/VSlotContainer.hpp>

Inheritance diagram for Wizt::VSlotContainer< ExpertLevel >:
Wizt::VManagedObjectBase Wizt::VConnectionValidatorList Wizt::ValueCacheable MemCore::ReferenceBase< VManagedObjectBase > Wizt::VConnectable Wizt::VNutrition Wizt::TimeDependent Wizt::VObject Wizt::VSkale Wizt::AnemoneNutrition FloatsToPoint2D Wizt::CatchStatus Wizt::Coral Wizt::HTTPServer Wizt::MetaViewer Wizt::MovieRecorder Wizt::RemoteVish Wizt::RenderAble Wizt::VChartSelector Wizt::VProxyObject Wizt::VScene Wizt::VStreamObject Wizt::Viewer Wizt::Atlas Wizt::Interactive Wizt::VChartDependent

Classes

struct  Deferred
 Internal helper class used for the construction of VOutput objects. More...
 
struct  in
 Input types. More...
 
struct  in< Type, ExpertLevel, void >
 
struct  in< Type, VSlotContainer::InvalidExpertLevel, void >
 
struct  inout
 Input types that are also visible as outputs, i.e. More...
 
struct  inout< Type, void >
 
struct  out
 Output types. More...
 
struct  out< Type, void >
 
class  VInputSet
 

Public Types

enum  { AllLevels = INT_MAX }
 
typedef void AcceptableInputTypes
 Each VObject may define a set of possible input types, which are types that are provided by some other objects to be used as inputs of this object.
 
typedef VSlotSet CreationSlots_t
 A set of slots.
 
template<int I>
using Empty = VSlot::Empty< I >
 Shortcut typedef to be used in construction of empty slots.
 
- Public Types inherited from MemCore::ReferenceBase< VManagedObjectBase >
using reference_domain_t = VManagedObjectBase
 The type of the base class.
 
using SelfPtr_t = WeakPtr< VManagedObjectBase, VManagedObjectBase >
 Type for a pointer to this object itself.
 

Public Member Functions

Ageableage (const RefPtr< ValuePool > &VP)
 Return the age of this object, which may be modified.
 
const Ageableage (const RefPtr< ValuePool > &VP) const
 Return the age of this object in read-only form.
 
const AgeableConnectionAge () const
 Return the age when connections had last been modified.
 
bool ConnectionsHaveChanged (const RefPtr< ValuePool > &VP) const
 Check whether the connections have changed on this object.
 
bool HasYoungerInput (const RefPtr< ValuePool > &Context, int RecursionLevel=0) const
 
Ageable YoungestInput (const RefPtr< ValuePool > &Context) const
 Return the age of the youngest input.
 
Ageable YoungestOutput (const RefPtr< ValuePool > &Context) const
 Determine the age of the youngest output object.
 
Ageable YoungestUncachedInput (const RefPtr< ValuePool > &Context) const
 Return the age of the youngest input slot that is not cached.
 
virtual ~VSlotContainer ()
 Destructor.
 
- Public Member Functions inherited from Wizt::VManagedObjectBase
 VManagedObjectBase ()
 Constructor.
 
 ~VManagedObjectBase ()
 Destructor.
 
- Public Member Functions inherited from MemCore::ReferenceBase< VManagedObjectBase >
auto getObjectCountID () const noexcept
 Get a unique ID for this object in the given domain.
 
bool isIdentical (const WeakPtr< VManagedObjectBase, VManagedObjectBase > &PossibleSelf) const noexcept
 Check if this object is identical to the one used by the given pointer.
 
void mkAutoDestructive ()
 Marks this object as being automatically destructed, e.g.
 
refcount_t refcount () const noexcept
 The strong reference count.
 
 ReferenceBase (VManagedObjectBase *that) noexcept
 Constructor, initializes reference counter to zero.
 
const auto & self () const
 Return weak pointer to the object self.
 
refcount_t wrefcount () const noexcept
 The weak reference count.
 

Protected Member Functions

virtual void setup (const CreationSlots_t &CreationSlots)
 When a VObject is created as a child of an existing VObject, this variant of the setup function is called, telling which slot is the one connected to the object that triggered creation of this one.
 
- Protected Member Functions inherited from MemCore::ReferenceBase< VManagedObjectBase >
virtual void extremeUnction ()
 A virtual function that will be called just before the object is destroyed.
 
ReferenceBaseoperator= (const ReferenceBase &R)
 Protected assignment operator (should not be called).
 
void suicide ()
 Delete this.
 
virtual ~ReferenceBase ()
 Virtual destructor.
 

Related Symbols

(Note that these are not member symbols.)

bool CheckIfThereExistNewerOutputs (const VRequest &request, bool AdjustObjectAge) const
 Check if there are outputs in this very object that are newer (more recent) than this object itself.
 

Functions related to input parameters

enum  AttachErrorCode { }
 
RefPtr< VSlotaddParameter (const ParameterID &name, int EL, const RefPtr< VParameter > &param, bool overwriteExistingSlot)
 Specify a parameter (type) as input for this VObject.
 
virtual bool allowParameterReplacement (const RefPtr< VParameter > &NewParam, const RefPtr< VParameter > &OldParam, const string &localName, int ExpertLevel)
 Virtual callback function invoked by replaceParameter() when the implementation of a parameter is changed by another one.
 
virtual int connectSlots (const VSlotContainerPtr &vobj)
 Tries to connect all slots found in the given VObject with those of the current one.
 
bool removeParameter (const ParameterID &s)
 Remove a parameter from the list of input objects.
 
RefPtr< VParametergetParameter (const ParameterID &s) const
 Return the local input parameter slot for a certain parameter name.
 
RefPtr< VSlotgetSlot (const ParameterID &s, int &EL) const
 A more verbose version of getParameter() which also provides information about which member of a certain parameter is used here; note that the type of the full parameter will be different from the type of a member of the parameter.
 
bool setSlotValueFromText (const ParameterID &s, const string &ValueText, const RefPtr< ValuePool > &VP, const string &theMember={})
 Convenience function to set an input value from its textual representation.
 
RefPtr< VSlotfindSlot (const RefPtr< VParameter > &param) const
 Given a parameter, find a slot that refers to this one.
 
string getSlotName (const RefPtr< VParameter > &param) const
 Check whether this object contains the given parameter, and if so, under which slot's name.
 
bool AddAction (const ParameterID &s, const RefPtr< ValueActionBase > &VAB)
 Associate the change of a certain parameter of this object with a certain action.
 
template<class DerivedObject >
bool AddAction (const RefPtr< VSlot > &ActionSlot, bool(DerivedObject::*Action)(const RefPtr< VValueBase > &value))
 Connect the change of a parameter with the invocation of an object's member function.
 
RefPtr< VParametermkUniqueParameterInput (const ParameterID &s, const string &ContainerName)
 Calls VParameter::copy();.
 
int getExpertLevel (const ParameterID &s) const
 Get the expert level of a parameter.
 
int setExpertLevel (const ParameterID &s, int EL)
 Set the expert level of a parameter.
 
int getExpertLevel (const RefPtr< VParameter > &) const
 Get the expert level of a parameter via pointer.
 
int getExpertLevel (const RefPtr< VSlot > &S) const
 Get the expert level of a parameter via pointer.
 
int setExpertLevel (const RefPtr< VSlot > &S, int EL)
 Set the expert level of a parameter via pointer.
 
int setExpertLevel (const RefPtr< VParameter > &s, int EL)
 Set the expert level of a parameter via pointer.
 
bool hasChanged (const ParameterID &s, const RefPtr< ValuePool > &Context) const
 Check whether a certain input parameter has changed.
 
bool hasChanged (const RefPtr< VSlot > &, const RefPtr< ValuePool > &Context) const
 Check whether a certain input slot has changed.
 
bool hasChanged (const RefPtr< ValuePool > &Context, int n,...) const
 Check a set of input parameters whether one has changed.
 
bool hasChanged (RefPtr< ValuePool > Context,...) const
 Check a set of input parameters whether one has changed.
 
virtual bool ignoreInput (const RefPtr< VSlot > &theSlot) const
 Allow ignoring certain slots on update().
 
template<class Type >
bool getParameterValue (Type &Variable, const ParameterID &s, const RefPtr< ValuePool > &VP) const
 Get a value for a certain parameter.
 
template<class Type >
bool getParameterValue (Type &Variable, const ParameterID &s, const VContext &C) const
 Get a value for a certain parameter.
 
template<class Type >
bool getParameterValue (Type &Variable, const ParameterID &s, const VRequest &R) const
 Get a value for a certain parameter.
 
template<class Type >
bool setParameterValue (const Type &Variable, const ParameterID &s, const RefPtr< ValuePool > &VP, bool autoCreateLocalValue) const
 Set a value for a parameter, given a ValuePool.
 
template<class Type >
bool setParameterValue (const Type &Variable, const ParameterID &s, VContext &C, bool autoCreateLocalValue) const
 Set a value for a parameter, given a context.
 
template<class Type >
bool setParameterValue (const Type &Variable, const ParameterID &s, VRequest &R, bool autoCreateLocalValue=false) const
 Set a value for a parameter, given a context.
 
template<class Type >
RefPtr< VSlotaddParam (const ParameterID &name, const Type &init, const RefPtr< VCreationPreferences > &VP=NullPtr(), int expertLevel=0, bool overwriteExistingSlot=true)
 Add an input parameter to the VObject.
 
bool setParameterProperty (const ParameterID &param, const string &Properties, const RefPtr< VValueBase > &Value=NullPtr())
 Set a property of an input parameter, such as the minimum or maximum of a bounded numerical value.
 
RefPtr< VSlotaddFloatParam (double init, const ParameterID &param, double min, double max, const RefPtr< VCreationPreferences > &IP=NullPtr(), int expertLevel=0)
 Shortcut function to add a floating point parameter.
 
AttachErrorCode attach (const RefPtr< VParameter > &OldParam, const RefPtr< VParameter > &NewParam, const string &Member={})
 Replace a given parameter of the current object with another parameter.
 
int iterateParameters (int expertLevel, VSlotIterator &VIIt) const
 Iterate over all VInput objects that have an expert level lower or equal to the expertLevel parameter.
 
int iterateInputSlots (int expertLevel, VSlotIterator &VIIt) const
 Same as iterateParameters().
 
int iterateInputs (VSlotIterator &VIIt, int expertLevel=0)
 Iterate all inputs with expert level smaller than zero (default), or as specified.
 
int iterate_inputs (const std::function< bool(VSlot &what, int ExpertLevel)>) const
 Iterate over all VInput objects that have an expert level lower or equal to the expertLevel parameter.
 
RefPtr< VSlotgetUniqueInputSlot (const type_info &what)
 Find an input slot that queries a specific type.
 
int getNumberOfParameters (int expertLevel) const
 Get the number of parameters up to a certain expert level.
 
static const charAttachErrorCodeMessage (AttachErrorCode)
 Given an error code from one of the attach() functions, return some textual description.
 
static bool attachParameter (const RefPtr< VParameter > &theProvidedParam, const WeakPtr< VSlot > &theDestSlot, const string &theMember={})
 This function basically does:
 

Functions related to provided parameter functionality,

i.e.

output objects.

An VObject may serve as input parameter of another VObject; if so, the VObject serves as a VParameter of certain type. Even more, a VObject may incorporate multiple types, and even many types of the same kind which are distinguished by a textual description name.

Use function iterateOutputs() to query information on which types are supported under which names. Function implements() is a simpler, limited but equivalent shortcut function. A certain parameter can be retrieved via the getImplementation() function.

virtual bool implements (const type_info &what) const
 Check whether this VObject implements a certain type.
 
virtual RefPtr< VParametergetImplementation (const type_info &what, const string &name={}, const string &member={}) const
 By querying a type and an optional finer textual description, retrieve an Parameter that is implemented by this VObject.
 
RefPtr< VSlotgetImplementationSlot (const type_info &what, const string &Name={}, const string &Member={}) const
 Query an output slot for the given type.
 
VAcceptInfoList_t getAcceptInfoList (const std::type_info &request_type) const
 Get a list of possible output implementations for the given request type.
 
bool provides (const RefPtr< VSlot > &OutputSlot) const
 Verifies that the specified slot is provided by the current VObject.
 
RefPtr< VSlotfindOutputSlot (const RefPtr< VParameter > &Who) const
 Find an output slot that refers to the given parameter, i.e.
 
bool isYounger (const RefPtr< VParameter > &OutputParam, const RefPtr< ValuePool > &VP) const
 Check if an output parameter is of younger age, which might be the case if it has been recently connected or modified through external means.
 
bool isNewlyConnected (const RefPtr< VParameter > &Who, const RefPtr< ValuePool > &VP) const
 Check if an output parameter has been recently connected or modified through external means.
 
bool hasNewlyConnectedOutputs (const RefPtr< ValuePool > &VP) const
 Check if there are new connections.
 
void findNewlyConnectedOutputs (const RefPtr< ValuePool > &VP, VSlotSet &WhichOnes) const
 Find all output parameters that have been recently connected since the last update() call.
 
RefPtr< VSlotgetOutput (const string &Name) const
 Get the output slot for a given name.
 
RefPtr< MemCore::StringListgetOutputs (const type_info &what=typeid(void)) const
 Get a list of all output names that are provided by this object.
 
virtual int iterateOutputs (VOutputIterator &VOut, const type_info &just_these=typeid(void)) const
 Iterate over all the Outputs of this VObject, i.e.
 
bool registerOutput (const RefPtr< VParameter > &P, const string &AsName={})
 Register a certain parameter as being output by this VObject under the given name (optionally).
 
bool registerOutput (const RefPtr< VParameter > &P, const string &AsName, const type_info &MemberType, const string &UseMember)
 Register a member of a parameter, that is output by this VObject, as being available to external VObjects.
 
bool registerOutput (const RefPtr< VParameter > &P, const type_info &MemberType, const string &UseMember)
 Register a component of a parameter, using the default name of the parameter.
 
int getNumberOfInputs () const
 Get the number of input parameters, ie. on how many parameters does this object depend on?
 
int getNumberOfOutputs () const
 Get the number of output parameters, ie. how many parameters does this object provide?
 
bool hasChangedSlots (const MemCore::Intercube &IC, const RefPtr< ValuePool > &Context) const
 Check if the given Intercube hosts any VSlots that have been changed relative to the given Context.
 
template<typename... SlotList>
auto include_self (const std::tuple< SlotList... > &t) const -> decltype(std::tuple_cat(std::make_tuple(this), t))
 Given a tuple of values, create a new tuple that includes the object itself.
 

Additional Inherited Members

- Static Public Member Functions inherited from Wizt::ValueCacheable
static ValueCacheconsider (MemCore::Intercube &IC, const WeakPtr< VSlot > &VS, const RefPtr< ValuePool > &Context)
 
static ValueCachegetValueCache (MemCore::Intercube &IC)
 Get, and possibly create, a ValueCache that will be stored at the given Intercube.
 
static bool hasChangedSlots (const WeakPtrToVSlotContainer &theSlotOwner, const MemCore::Intercube &IC, const RefPtr< ValuePool > &Context)
 Check if the given Intercube hosts any VSlots that have been changed relative to the given Context.
 

Detailed Description

template<int ExpertLevel>
struct Wizt::VSlotContainer< ExpertLevel >

Intermediate class managing VSlots.


Class Documentation

◆ Wizt::VSlotContainer::Deferred

struct Wizt::VSlotContainer::Deferred
template<int ExpertLevel>
struct Wizt::VSlotContainer< ExpertLevel >::Deferred

Internal helper class used for the construction of VOutput objects.

◆ Wizt::VSlotContainer::inout

struct Wizt::VSlotContainer::inout
template<int ExpertLevel>
template<class Type, class OperatorType = void>
struct Wizt::VSlotContainer< ExpertLevel >::inout< Type, OperatorType >

Input types that are also visible as outputs, i.e.

their value is passed through. These input parameters may be modified by the object.

◆ Wizt::VSlotContainer::out

struct Wizt::VSlotContainer::out
template<int ExpertLevel>
template<class Type, class OperatorType = void>
struct Wizt::VSlotContainer< ExpertLevel >::out< Type, OperatorType >

Output types.

Include <VOutput.hpp> for this to work.

Member Typedef Documentation

◆ AcceptableInputTypes

template<int ExpertLevel>
typedef void Wizt::VSlotContainer< ExpertLevel >::AcceptableInputTypes

Each VObject may define a set of possible input types, which are types that are provided by some other objects to be used as inputs of this object.

The default is void, meaning this object will not require any input types, thus being a data source.

Multiple types may be defined by creating a type list via META::LIST, for instance:

using namespace META;
void AcceptableInputTypes
Each VObject may define a set of possible input types, which are types that are provided by some othe...
Definition VSlotContainer.hpp:158
META is a collection of low-level template metaprograms which can be used in various situations.
Definition ColorSpace.hpp:480
Input types.
Definition VSlotContainer.hpp:966

This input type will allow to use int's and float's .

Member Enumeration Documentation

◆ anonymous enum

template<int ExpertLevel>
anonymous enum
Enumerator
AllLevels 

Enumeration value for maximum expert level.

◆ AttachErrorCode

Enumerator
DestParameterNotFound 

Destination parameter not found.

InvalidDestParameter 

Parameter found but invalid.

Member Function Documentation

◆ AddAction()

template<int ExpertLevel>
template<class DerivedObject >
bool Wizt::VSlotContainer< ExpertLevel >::AddAction ( const RefPtr< VSlot > &  ActionSlot,
bool(DerivedObject::*)(const RefPtr< VValueBase > &value)  Action 
)
inline

Connect the change of a parameter with the invocation of an object's member function.

We assume that this is a member function of the derived VObject and it belongs to the same object. Otherwise, we will get a very cryptic error message here.

◆ addFloatParam()

template<int ExpertLevel>
RefPtr< VSlot > Wizt::VSlotContainer< ExpertLevel >::addFloatParam ( double  init,
const ParameterID param,
double  min,
double  max,
const RefPtr< VCreationPreferences > &  IP = NullPtr(),
int  expertLevel = 0 
)
inline

Shortcut function to add a floating point parameter.

This is a convenience function.

◆ addParam()

template<int ExpertLevel>
template<class Type >
RefPtr< VSlot > Wizt::VSlotContainer< ExpertLevel >::addParam ( const ParameterID name,
const Type &  init,
const RefPtr< VCreationPreferences > &  VP = NullPtr(),
int  expertLevel = 0,
bool  overwriteExistingSlot = true 
)
inline

Add an input parameter to the VObject.

The parameter is initialized with a default value via class VValueParameter.

Parameters
nameParameter name. It will be used to reference the parameter through the current object under this name. It will also be created as a global identifier for parameters, as provided by CreateParameterName(). This global name will be unique as long as this (virtual) function returns a unique name. This is true by default, as it involves this object's name, which is unique by construction of the object creation process in the VCreator<>'s.
initInitialization value (ONLY used for initialization!)
IPDesired input properties
expertLevelVisibility of this parameter
Returna reference to the newly created parameter. It provides an exclusive local storage place for the parameter's value, which is changed on any modification of possible parameter implementations.
Note
There is no need to store a copy of the parameter's type somewhere else in the VObject. The provided initial type is copied to the local storage place within the VParameter. The parameter type can always be accessed through the newly generated VParameter object, which will be of type VValueParameter<Type>. If such a local copy is not intended but a reference to a local storage place is preferred, the do not use this function but call addInput() with another instance of VParameter.
Returns
The newly created VInputSlot, which is referenced byt the VObject. There is no need to remember this VParameter pointer explicitly, i.e. the return value may as well be ignored. If a parameter already exists with the same name, then a NullPtr() is returned here.

◆ addParameter()

template<int ExpertLevel>
RefPtr< VSlot > Wizt::VSlotContainer< ExpertLevel >::addParameter ( const ParameterID name,
int  EL,
const RefPtr< VParameter > &  param,
bool  overwriteExistingSlot 
)

Specify a parameter (type) as input for this VObject.

The parameter may be initialized with a default value. Its implementation may changed any time.

Parameters
nameThe name of this parameter in the context of this VObject.
ELThe expert level of this parameter, determining its visibility in a GUI
paramThe type of this parameter and its default value
overwriteExistingSlotSpecify if an existing slot should be overwritten by this operation or not.
Returns
A reference to the newly added parameter, or a NullPtr() if a parameter already existed under the same name.

Referenced by Wizt::VObject::setObjectAsChild().

◆ allowParameterReplacement()

template<int ExpertLevel>
bool Wizt::VSlotContainer< ExpertLevel >::allowParameterReplacement ( const RefPtr< VParameter > &  NewParam,
const RefPtr< VParameter > &  OldParam,
const string &  localName,
int  ExpertLevel 
)
virtual

Virtual callback function invoked by replaceParameter() when the implementation of a parameter is changed by another one.

This function enables child classes to keep track of VParameters, e.g. to adjust a locally stored VParameter pointer to refer to a new implementation instead of an old one. This is not required when parameters are always accessed through the getParameter() interface, but since getParameter() requires a table lookup, it might me (slightly) less performant than storing a local copy.

Parameters
NewParamThe new parameter instance
OldParamThe old parameter instance, which will be destroyed shortly after this function call if not referenced by other means than through the current VObject's internals.
localNameThe local name under which this parameter appears; this is unchanged
ExpertLevelThe associated ExpertLevel
Returns
This function may inhibit a parameter replacement by returning false. By default, it returns true such that the first found parameter is replaced.

Referenced by Wizt::VConnectable::attach().

◆ attach()

template<int ExpertLevel>
VSlotContainer::AttachErrorCode Wizt::VSlotContainer< ExpertLevel >::attach ( const RefPtr< VParameter > &  OldParam,
const RefPtr< VParameter > &  NewParam,
const string &  Member = {} 
)

Replace a given parameter of the current object with another parameter.

Parameters
OldParamThe old parameter, which is currently an input to this object.
NewParamThe new parameter, which may be newly created, part of another object's input or output, or even already belong to this object itself.
MemberAn optional member of this parameter in case its type is a compound type

References Wizt::VSlotContainer< ExpertLevel >::attachParameter(), and Wizt::VSlotContainer< ExpertLevel >::DestParameterNotFound.

◆ AttachErrorCodeMessage()

template<int ExpertLevel>
const char * Wizt::VSlotContainer< ExpertLevel >::AttachErrorCodeMessage ( AttachErrorCode  AEC)
static

Given an error code from one of the attach() functions, return some textual description.

Returns
A constant string.

Destination parameter not found.

Parameter found but invalid.

References Wizt::VSlotContainer< ExpertLevel >::DestParameterNotFound, and Wizt::VSlotContainer< ExpertLevel >::InvalidDestParameter.

Referenced by Wizt::Viewer::Viewer().

◆ attachParameter()

template<int ExpertLevel>
bool Wizt::VSlotContainer< ExpertLevel >::attachParameter ( const RefPtr< VParameter > &  theProvidedParam,
const WeakPtr< VSlot > &  theDestSlot,
const string &  theMember = {} 
)
static

This function basically does:

and includes some notification requests.

Todo:
Need to verify whether the Member parameter is necessary...

References Wizt::VActionNotifier::AttachParameterPrefix().

Referenced by Wizt::VConnectable::attach(), Wizt::VSlotContainer< ExpertLevel >::attach(), and Wizt::VConnectable::Connect().

◆ ConnectionAge()

template<int ExpertLevel>
const Ageable & Wizt::VSlotContainer< ExpertLevel >::ConnectionAge ( ) const

Return the age when connections had last been modified.

Note that when changing connections, the object might be out of sync with its inputs, even if all inputs are older than the object itself. Most likely the object must then be updated even in case of old inputs.

Referenced by Wizt::VObject::request().

◆ findNewlyConnectedOutputs()

template<int ExpertLevel>
void Wizt::VSlotContainer< ExpertLevel >::findNewlyConnectedOutputs ( const RefPtr< ValuePool > &  VP,
VSlotSet WhichOnes 
) const

Find all output parameters that have been recently connected since the last update() call.

Might be none.

References Wizt::VSlotContainer< ExpertLevel >::age().

◆ findOutputSlot()

template<int ExpertLevel>
RefPtr< VSlot > Wizt::VSlotContainer< ExpertLevel >::findOutputSlot ( const RefPtr< VParameter > &  Who) const

Find an output slot that refers to the given parameter, i.e.

this slot's parameter is identical to the specified one.

Referenced by Wizt::VSlotContainer< ExpertLevel >::isNewlyConnected(), and Wizt::VSlotContainer< ExpertLevel >::isYounger().

◆ getImplementation()

template<int ExpertLevel>
RefPtr< VParameter > Wizt::VSlotContainer< ExpertLevel >::getImplementation ( const type_info &  what,
const string &  name = {},
const string &  member = {} 
) const
virtual

By querying a type and an optional finer textual description, retrieve an Parameter that is implemented by this VObject.

This parameter is suitable for usage in replaceParameter() in a subsequent child VObject. The returned VParameter should be existent through the lifetime of the current VObject.

Referenced by Wizt::VObject::connectChild().

◆ getImplementationSlot()

template<int ExpertLevel>
RefPtr< VSlot > Wizt::VSlotContainer< ExpertLevel >::getImplementationSlot ( const type_info &  what,
const string &  Name = {},
const string &  Member = {} 
) const

Query an output slot for the given type.

Parameters
NameOptionally return the slot only if found under the given name.

Referenced by Wizt::VConnectable::attach().

◆ getNumberOfParameters()

template<int ExpertLevel>
int Wizt::VSlotContainer< ExpertLevel >::getNumberOfParameters ( int  expertLevel) const

Get the number of parameters up to a certain expert level.

All Parameters with an expert level below the specified one are counted.

Referenced by Wizt::VSlotContainer< ExpertLevel >::getNumberOfInputs(), and Wizt::VObject::request().

◆ getParameter()

template<int ExpertLevel>
RefPtr< VParameter > Wizt::VSlotContainer< ExpertLevel >::getParameter ( const ParameterID s) const

Return the local input parameter slot for a certain parameter name.

References to VInput objects are indirect via VParameter's, because the VInput object itself may change arbitrarily anytime. However, the VParameter referring to the current VInput object stays permanently at the same location during the lifetime of the VInput request. In other words, the result of the getInput() call may be cached in a derived class and is guaranteed to be valid during the lifetime of the current VObject. Still, the dereference of the result may be a NULL pointer, indicating that there is no VInput object available yet at all.

References Wizt::VSlotContainer< ExpertLevel >::getSlot().

◆ getParameterValue()

template<int ExpertLevel>
template<class Type >
bool Wizt::VSlotContainer< ExpertLevel >::getParameterValue ( Type &  Variable,
const ParameterID s,
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.

◆ getSlot()

template<int ExpertLevel>
RefPtr< VSlot > Wizt::VSlotContainer< ExpertLevel >::getSlot ( const ParameterID s,
int EL 
) const

A more verbose version of getParameter() which also provides information about which member of a certain parameter is used here; note that the type of the full parameter will be different from the type of a member of the parameter.

Parameters
ELOptional information of associated expert level (output only)
Returns
yields a null pointer if the parameter was not found.

Referenced by Wizt::VConnectable::attach(), Wizt::VSlotContainer< ExpertLevel >::getParameter(), and Wizt::VSlotContainer< ExpertLevel >::hasChanged().

◆ getSlotName()

template<int ExpertLevel>
string Wizt::VSlotContainer< ExpertLevel >::getSlotName ( const RefPtr< VParameter > &  param) const

Check whether this object contains the given parameter, and if so, under which slot's name.

Returns
A string of length zero if it is not contained.

References Wizt::VSlotContainer< ExpertLevel >::findSlot().

◆ hasChanged() [1/3]

template<int ExpertLevel>
bool Wizt::VSlotContainer< ExpertLevel >::hasChanged ( const ParameterID s,
const RefPtr< ValuePool > &  Context 
) const

◆ hasChanged() [2/3]

template<int ExpertLevel>
bool Wizt::VSlotContainer< ExpertLevel >::hasChanged ( const RefPtr< ValuePool > &  Context,
int  n,
  ... 
) const

Check a set of input parameters whether one has changed.

The variable argument list must be a set of const char* giving the names of the respective slots.

VObject & vobj;
if (vobj.hasChanged( Context, 2, "alpha", "beta") )
{
...
}
A set of variable names, with indices associated to each type.
Definition Context.hpp:18
Generic base class for all VObjects.
Definition VObject.hpp:186
bool hasChanged(const ParameterID &s, const RefPtr< ValuePool > &Context) const
Check whether a certain input parameter has changed.
Definition VSlotContainer.cpp:1563

References Wizt::VSlotContainer< ExpertLevel >::hasChanged().

◆ hasChanged() [3/3]

template<int ExpertLevel>
bool Wizt::VSlotContainer< ExpertLevel >::hasChanged ( RefPtr< ValuePool Context,
  ... 
) const

Check a set of input parameters whether one has changed.

The variable argument list must be a sequence of const char* terminated with a null pointer:

VObject & vobj;
if (vobj.hasChanged( Context, "alpha", "beta", 0) )
{
...
}

References Wizt::VSlotContainer< ExpertLevel >::hasChanged().

◆ HasYoungerInput()

template<int ExpertLevel>
bool Wizt::VSlotContainer< ExpertLevel >::HasYoungerInput ( const RefPtr< ValuePool > &  Context,
int  RecursionLevel = 0 
) const
Parameters
RecursionLevelSpecify how many levels to look in the child/parent relationship graph. Zero means just look at the input objects of this object (fastest), negative values mean full traversal of the graph, including detection of loops.

References Wizt::VSlotContainer< ExpertLevel >::age(), and Wizt::VSlotContainer< ExpertLevel >::YoungestInput().

◆ isNewlyConnected()

template<int ExpertLevel>
bool Wizt::VSlotContainer< ExpertLevel >::isNewlyConnected ( const RefPtr< VParameter > &  Who,
const RefPtr< ValuePool > &  VP 
) const

Check if an output parameter has been recently connected or modified through external means.

Parameters
OutputParamAn output parameter of the current VObject, one of those VOutput<>s usually

This function checks the VSlot::ConnectionAge() of the output slot and is equivalent to:

if (RefPtr<VSlot> mySlot = findOutputSlot(Who) )
{
return mySlot->ConnectionAge().isYoungerThan( age(Context) );
}
Ageable & age(const RefPtr< ValuePool > &VP)
Return the age of this object, which may be modified.
Definition VSlotContainer.cpp:820
RefPtr< VSlot > findOutputSlot(const RefPtr< VParameter > &Who) const
Find an output slot that refers to the given parameter, i.e.
Definition VSlotContainer.cpp:1667

References Wizt::VSlotContainer< ExpertLevel >::age(), and Wizt::VSlotContainer< ExpertLevel >::findOutputSlot().

◆ isYounger()

template<int ExpertLevel>
bool Wizt::VSlotContainer< ExpertLevel >::isYounger ( const RefPtr< VParameter > &  OutputParam,
const RefPtr< ValuePool > &  VP 
) const

Check if an output parameter is of younger age, which might be the case if it has been recently connected or modified through external means.

This function also checks for the value's age, use isNewlyConnected() of only the connection should be checked.

Parameters
OutputParamAn output parameter of the current VObject, one of those VOutput<>s usually

References Wizt::VSlotContainer< ExpertLevel >::age(), and Wizt::VSlotContainer< ExpertLevel >::findOutputSlot().

Referenced by Wizt::VCameraBase::must_update().

◆ iterate_inputs()

template<int ExpertLevel>
int Wizt::VSlotContainer< ExpertLevel >::iterate_inputs ( const std::function< bool(VSlot &what, int ExpertLevel)>  F) const

Iterate over all VInput objects that have an expert level lower or equal to the expertLevel parameter.

Parameters
expertLevelThe visibility level. All VInputs with an higher expert level will remain invisible.
VIItAn user-specified iterator object.
Returns
The number of parameters that has been iterated over.

◆ iterateInputs()

template<int ExpertLevel>
int Wizt::VSlotContainer< ExpertLevel >::iterateInputs ( VSlotIterator VIIt,
int  expertLevel = 0 
)
inline

Iterate all inputs with expert level smaller than zero (default), or as specified.

Same as iterateParameters().

◆ iterateOutputs()

template<int ExpertLevel>
int Wizt::VSlotContainer< ExpertLevel >::iterateOutputs ( VOutputIterator VOut,
const type_info &  just_these = typeid(void) 
) const
virtual

Iterate over all the Outputs of this VObject, i.e.

all the functionality which this object provides.

Referenced by Wizt::VObject::iterateChildren(), and Wizt::VSlotContainer< ExpertLevel >::YoungestOutput().

◆ iterateParameters()

template<int ExpertLevel>
int Wizt::VSlotContainer< ExpertLevel >::iterateParameters ( int  expertLevel,
VSlotIterator VIIt 
) const

Iterate over all VInput objects that have an expert level lower or equal to the expertLevel parameter.

Parameters
expertLevelThe visibility level. All VInputs with an higher expert level will remain invisible.
VIItAn user-specified iterator object.
Returns
The number of parameters that has been iterated over.

References Wizt::Vprintf().

Referenced by Wizt::VConnectable::ConnectInterface(), Wizt::VSlotContainer< ExpertLevel >::connectSlots(), Wizt::VSlotContainer< ExpertLevel >::getUniqueInputSlot(), Wizt::VObject::iterateParents(), Wizt::VObject::iterateParents(), Wizt::VObject::request(), Wizt::VSlotContainer< ExpertLevel >::YoungestInput(), and Wizt::VSlotContainer< ExpertLevel >::YoungestUncachedInput().

◆ registerOutput()

template<int ExpertLevel>
bool Wizt::VSlotContainer< ExpertLevel >::registerOutput ( const RefPtr< VParameter > &  P,
const string &  AsName = {} 
)

Register a certain parameter as being output by this VObject under the given name (optionally).

Parameters
PThe parameter which is provided by the object. It will be referenced internally, there is no need to keep an extra reference from the providing object. However, a specific reference is useful to assign values to this parameter from the object when it updates, so in practice a VObject will contain explicit references to the parameters that it provides.
AsNameOptionally, the name under which this parameter is accessed from the VObject, can be specified. By default, the parameter's intrinsic default name will be used. Note that parameter lookup is done mainly on type information, such that the name of the parameter is only of relevance if an object provides the same type (e.g. many integers).

References MemCore::ReferenceBase< VManagedObjectBase >::self().

Referenced by Wizt::VSlotContainer< ExpertLevel >::inout< Type, void >::inout(), Wizt::VSlotContainer< ExpertLevel >::inout< Type, void >::inout(), Wizt::RenderAble::RenderAble(), Wizt::VObject::setObjectAsChild(), Wizt::TimeDependent::TimeDependent(), and Wizt::VOutput< Type >::VOutput().

◆ setParameterProperty()

template<int ExpertLevel>
bool Wizt::VSlotContainer< ExpertLevel >::setParameterProperty ( const ParameterID param,
const string &  Properties,
const RefPtr< VValueBase > &  Value = NullPtr() 
)
inline

Set a property of an input parameter, such as the minimum or maximum of a bounded numerical value.

Parameters
PropertiesTextual identification of the property; must be understood by the input implementation.
Returns
false, if no such parameter exists - see addParam().

◆ setParameterValue() [1/3]

template<int ExpertLevel>
template<class Type >
bool Wizt::VSlotContainer< ExpertLevel >::setParameterValue ( const Type &  Variable,
const ParameterID s,
const RefPtr< ValuePool > &  VP,
bool  autoCreateLocalValue 
) const
inline

Set a value for a parameter, given a ValuePool.

Parameters
autoCreateLocalValueShall the variable be relative to the local value pool?

◆ setParameterValue() [2/3]

template<int ExpertLevel>
template<class Type >
bool Wizt::VSlotContainer< ExpertLevel >::setParameterValue ( const Type &  Variable,
const ParameterID s,
VContext C,
bool  autoCreateLocalValue 
) const
inline

Set a value for a parameter, given a context.

Parameters
autoCreateLocalValueShall the variable be relative to the local value pool?

References Wizt::VContext::GhostValues.

◆ setParameterValue() [3/3]

template<int ExpertLevel>
template<class Type >
bool Wizt::VSlotContainer< ExpertLevel >::setParameterValue ( const Type &  Variable,
const ParameterID s,
VRequest R,
bool  autoCreateLocalValue = false 
) const
inline

Set a value for a parameter, given a context.

Parameters
autoCreateLocalValueShall the variable be relative to the local value pool?

◆ setSlotValueFromText()

template<int ExpertLevel>
bool Wizt::VSlotContainer< ExpertLevel >::setSlotValueFromText ( const ParameterID s,
const string &  ValueText,
const RefPtr< ValuePool > &  VP,
const string &  theMember = {} 
)
inline

Convenience function to set an input value from its textual representation.

Parameters
VPThe value pool specifying the context. Has no effect if the parameter is not set to local.
Returns
false if the Slot cannot be found or the value cannot be set, i.e. type mismatch or parse error.

◆ setup()

template<int ExpertLevel>
void Wizt::VSlotContainer< ExpertLevel >::setup ( const CreationSlots_t CreationSlots)
protectedvirtual

When a VObject is created as a child of an existing VObject, this variant of the setup function is called, telling which slot is the one connected to the object that triggered creation of this one.

If the provided list of slots is empty, then a newly created VObject shall be initialized with some convenience values. In such a case a VObject may create other objects as it sees fit to provide a good initialized default state.

◆ YoungestUncachedInput()

template<int ExpertLevel>
Ageable Wizt::VSlotContainer< ExpertLevel >::YoungestUncachedInput ( const RefPtr< ValuePool > &  Context) const

Return the age of the youngest input slot that is not cached.

ignore cached input parameters here

References Wizt::VSlotContainer< ExpertLevel >::AllLevels, Wizt::VSlotContainer< ExpertLevel >::iterateParameters(), and MemCore::Ageable::update().

Friends And Related Symbol Documentation

◆ CheckIfThereExistNewerOutputs()

template<int ExpertLevel>
bool CheckIfThereExistNewerOutputs ( const VRequest request,
bool  AdjustObjectAge 
) const
related

Check if there are outputs in this very object that are newer (more recent) than this object itself.

This can happen if such an output object has been updated by another object. It indicates that this object here is out of sync with the output it provides; but as it is newer, there would be no reason to re-create it. So this may be adjusted by just setting this object's date to the age of the most recent output.

Referenced by Wizt::VObject::request().