Rogue Wave Views
Prototypes Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Friends
IlvAccessorHolder Class Referenceabstract

Owns a list of objects of the class IlvAccessor class. More...

#include <ilviews/protos/accessor.h>

Inheritance diagram for IlvAccessorHolder:
IlvAccessible IlvValueInterface IlvGroup IlvProtoInstance IlvPrototype

Public Member Functions

virtual IlBoolean changeValue (const IlvValue &val)
 Changes the object's value. Both the name and the new value are contained in val. More...
 
virtual IlBoolean changeValues (const IlvValue *values, IlUShort count)
 Changes several values of an object in a single call. The default implementation calls changeValue() for all values. More...
 
virtual IlUInt compareValues (const IlvAccessible *ref, IlvValue *values, IlUShort count, IlvValueArray &diffs) const
 Compares two objects and returns the differing attributes. More...
 
virtual void getAccessors (const IlSymbol *const **accessors, const IlvValueTypeClass *const **types, IlUInt &count) const
 Returns the names of all the accessors known by this object. More...
 
virtual IlBoolean isOutputValue (const IlSymbol *valueName) const
 Indicates whether value designates an accessor that can generate notifying values. More...
 
virtual IlvAccessornextAccessor (IlAny &link) const =0
 Iterator through the accessors. More...
 
virtual IlvValuequeryValue (IlvValue &val) const
 Queries the value designated by value from the object. Both the value and the value type are stored in value. More...
 
virtual void queryValues (IlvValue *values, IlUShort count) const
 Queries several values in a single call. The default implementation calls queryValue() for each value. More...
 
- Public Member Functions inherited from IlvAccessible
virtual IlUInt compareAllValues (const IlvAccessible *ref, IlvValueArray &diffs, IlBoolean any=IlFalse) const
 Compares two objects and returns the differing attributes. More...
 
virtual IlBoolean convertValues (IlvValue *v, IlUShort c, IlvDisplay *d) const
 Convert values to match the types defined by the object accessors. More...
 
virtual const char * getName () const =0
 Returns the object name. More...
 
IlUInt getSubscriptions (IlvAccessible *subscriber, IlSymbol **&sourceValue, IlSymbol **&subscriberValue, IlvValueTypeClass **&type, IlvValueSubscriptionMode *&mode, IlvAccessible ***subscribers=0) const
 Returns alls subscriptions made by subscriber. More...
 
virtual const IlvValueTypeClassgetValueType (const IlSymbol *s) const
 Returns the type of a given attribute. More...
 
virtual IlvValuepullValue (IlvValue &v) const
 See below.
 
virtual void pullValues (IlvValue *vals, IlUShort c) const
 Propagates value queries to the subscribers to this object. More...
 
virtual IlBoolean pushValue (const IlvValue &v) const
 See below.
 
virtual IlBoolean pushValues (const IlvValue *vals, IlUShort c) const
 Propagates value changes to the subscribers to this object. More...
 
virtual void subscribe (IlvAccessible *subscriber, IlSymbol *sourceValue, IlSymbol *subscriberValue, IlvValueTypeClass *type, IlvValueSubscriptionMode mode=IlvValueSubscriptionChange)
 Subscribes the subscriber object to the value sourceValue of this object. More...
 
virtual void unSubscribe (IlvAccessible *subscriber, IlSymbol *sourceValue=0, IlSymbol *subscriberValue=0)
 Cancels subscriptions previously made. More...
 

Friends

class IlvAccessor
 

Additional Inherited Members

- Static Public Member Functions inherited from IlvAccessible
static void DeclareAccessor (const IlSymbol *attr, IlvValueTypeClass *type, const IlSymbol *const **accessors, const IlvValueTypeClass *const **types, IlUInt &count, IlBoolean checkDuplicates=IlFalse, IlAny accessorList=0)
 
static const IlvValueTypeClassGetType (IlSymbol *name)
 Returns the type instance from a name. More...
 
static IlBoolean StringToValue (const char *s, IlSymbol *type, IlvValue &v, IlvDisplay *display)
 Converts the character string s to an IlvValue with the type type. More...
 
static IlBoolean StringToValue (const char *s, const IlvValueTypeClass *typeClass, IlvValue &v, IlvDisplay *d)
 Converts the character string s to an IlvValue with the type type. More...
 
static IlBoolean ValuesAreEqual (IlvValue &v1, IlvValue &v2, IlBoolean compareNames=IlTrue)
 Compares two values. More...
 

Detailed Description

Owns a list of objects of the class IlvAccessor class.

Library: ilvproto

An IlvAccessorHolder owns a list of objects of the IlvAccessor class. Each of these IlvAccessor objects defines an accessor that is handled by the IlvAccessorHolder object. Therefore, the accessors in an IlvAccessorHolder can be defined dynamically by adding or removing IlvAccessor objects to and from the IlvAccessorHolder. The IlvAccessorHolder class overrides the changeValue()[s], queryValue()[s], getAccessors() and compareValues() methods of the IlvAccessible class. Each of these methods looks at all the IlvAccessor objects owned by the IlvAccessorHolder, finds all the accessors that match the requested values, and calls the corresponding method of the matching IlvAccessor objects. IlvAccessorHolder is an abstract class that does not define the way an IlvAccessor is actually stored in the object. To do so, the nextAccessor() method must be overridden.

Accessors are base 'bricks' of behavior that hold data (in which case they are called 'attributes') or perform side effects. Therefore, an attribute is a name that can be referenced to store data or perform side effects when a call to changeValue() or queryValue() is made. An attribute can consist of several accessors, each of them defining part of what the attribute is meant to do.

See also
IlvAccessor, IlvGroup, IlvPrototype, IlvProtoInstance.

Member Function Documentation

virtual IlBoolean IlvAccessorHolder::changeValue ( const IlvValue v)
virtual

Changes the object's value. Both the name and the new value are contained in val.

Parameters
vThe value to be set (both name and value).
Returns
Whether the object considered the operation successful or not.

Reimplemented from IlvAccessible.

Reimplemented in IlvGroup.

virtual IlBoolean IlvAccessorHolder::changeValues ( const IlvValue v,
IlUShort  c 
)
virtual

Changes several values of an object in a single call. The default implementation calls changeValue() for all values.

Parameters
vThe changed values (both name and values).
cThe number of values.
Returns
Whether the object considered the operation successful or not.

Reimplemented from IlvAccessible.

Reimplemented in IlvGroup.

virtual IlUInt IlvAccessorHolder::compareValues ( const IlvAccessible ref,
IlvValue values,
IlUShort  count,
IlvValueArray diffs 
) const
virtual

Compares two objects and returns the differing attributes.

Compares the values of accessors known by this object with the corresponding values in the object ref. The values that differ are stored in diffs. The values stored are taken from the calling object (this), not from ref. The first method calls the getAccessors() method to get the list of all known accessors, while the second only compares the provided values. Then, both methods call compareValues() to actually compare the values.

Returns
The number of differing attributes.
Parameters
refThe object to compare to.
valuesThe attributes to compare in both objects.
countThe number of attributes to compare.
diffsThe differing attributes.

Reimplemented from IlvAccessible.

virtual void IlvAccessorHolder::getAccessors ( const IlSymbol *const **  a,
const IlvValueTypeClass *const **  t,
IlUInt c 
) const
virtual

Returns the names of all the accessors known by this object.

Subclasses of IlvAccessible must override this method by calling the static method DeclareAccessor() for each accessor handled by the subclass. The returned arrays are filled by the method and must not be freed.

Parameters
aPointer to an array filled on return with the names of the accessors defined for the object.
tPointer to an array filled on return with the type of each accessor.
cNumber of accessors, set by the method.

Implements IlvAccessible.

Reimplemented in IlvGroup.

virtual IlBoolean IlvAccessorHolder::isOutputValue ( const IlSymbol value) const
virtual

Indicates whether value designates an accessor that can generate notifying values.

Returns
IlTrue if value designates an accessor that can generate notifying values, that is, a value for which pushValue() calls may be issued. The default implementation returns IlFalse. Subclasses such as IlvAccessorHolder redefine this method.
Parameters
valueName of the accessor.
See also
pushValue().

Reimplemented from IlvAccessible.

Reimplemented in IlvGroup.

virtual IlvAccessor* IlvAccessorHolder::nextAccessor ( IlAny link) const
pure virtual

Iterator through the accessors.

Parameters
linka placeholder for an internal marker in the accessors list that allows for iterating.
Returns
The next accessor from a list of accessors owned by the IlvAccessorHolder object. If link is NULL, the first accessor is returned, and link is modified so that the next call to nextAccessor() will return all the accessors successively. When all the accessors have been returned, the method returns 0.

Implemented in IlvGroup.

virtual IlvValue& IlvAccessorHolder::queryValue ( IlvValue value) const
virtual

Queries the value designated by value from the object. Both the value and the value type are stored in value.

Parameters
valueThe queried value name.
Returns
The value passed in argument, set to the object value.

Reimplemented from IlvAccessible.

Reimplemented in IlvGroup.

virtual void IlvAccessorHolder::queryValues ( IlvValue v,
IlUShort  c 
) const
virtual

Queries several values in a single call. The default implementation calls queryValue() for each value.

Parameters
vThe array of value names to be queried
cThe number of values to be queried.

Reimplemented from IlvAccessible.

Reimplemented in IlvGroup.


© Copyright 2016, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.