Rogue Wave Views
Prototypes Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Friends
IlvAccessor Class Reference

Base class of all dynamic accessors. More...

#include <ilviews/protos/accessor.h>

Inheritance diagram for IlvAccessor:
IlvGroupAccessor IlvMultipleAccessor IlvUserAccessor IlvMultipleGroupAccessor IlvAbstractEventAccessor IlvAnimationAccessor IlvCallbackAccessor IlvCompositeAccessor IlvConditionAccessor IlvCounterAccessor IlvDebugAccessor IlvFillAccessor IlvFormatAccessor IlvGroupUserAccessor IlvJavaScriptAccessor IlvLoopbackAccessor IlvMinMaxAccessor IlvMultipleUserAccessor IlvMultiRepAccessor IlvNodeAccessor IlvOutputAccessor IlvPrototypeAccessor IlvSwitchAccessor IlvToggleAccessor IlvTriggerAccessor IlvValueAccessor IlvZoomXAccessor IlvZoomYAccessor

Public Member Functions

 IlvAccessor (const char *name, IlvValueTypeClass *type)
 Creates a new accessor of name name and type type.
 
virtual IlBoolean changeValue (IlvAccessorHolder *object, const IlvValue &val)
 Called by the method IlvAccessible::changeValue() for each IlvAccessor attached to the IlvAccessorHolder.
 
virtual IlBoolean changeValues (IlvAccessorHolder *object, const IlvValue *values, IlUShort count)
 Called by the method IlvAccessible::changeValues() for each IlvAccessor attached to the IlvAccessorHolder.
 
virtual IlUInt compareValues (const IlvAccessorHolder *object, const IlvAccessible *ref, IlvValue *values, IlUShort count, IlvValueArray &diffs) const
 Compares the values in ref and object and returns the differing values. More...
 
virtual void getAccessors (const IlSymbol *const **accessors, const IlvValueTypeClass *const **types, IlUInt &count) const
 Returns the names and types of the values handled by this accessor. More...
 
const IlSymbolgetName () const
 Returns the name of the accessor. More...
 
IlvValueTypeClassgetType () const
 Returns the type of the accessor. More...
 
virtual IlBoolean isOutputAccessor (IlBoolean &inputAndOutput)
 Queries if the accessor is an output accessor. More...
 
virtual IlBoolean isOutputValue (const IlSymbol *name) const
 Queries if the accessor is an output accessor. More...
 
virtual IlShort matchValues (const IlvAccessorHolder *object, const IlvValue *values, IlUShort count, IlvValue *matchingValues=0) const
 Returns the number of values that are handled by the accessor in the values array of length count. More...
 
virtual IlvValuequeryValue (const IlvAccessorHolder *object, IlvValue &val) const
 Called by the method IlvAccessible::queryValue() for each IlvAccessor attached to the IlvAccessorHolder.
 
virtual void queryValues (const IlvAccessorHolder *object, IlvValue *values, IlUShort count) const
 Called by the method IlvAccessible::queryValues() for each IlvAccessor attached to the IlvAccessorHolder.
 
void setName (const IlSymbol *name)
 Sets the name of the accessor. More...
 

Friends

class IlvAccessorHolder
 

Detailed Description

Base class of all dynamic accessors.

Library: ilvproto

IlvAccessor is the base class of all dynamic accessors in the prototypes library. An IlvAccessor associates a value name, which can be accessed with the changeValue()/queryValue() interface, with methods that will be called when the value is changed, queried, and compared to another value. An IlvAccessor can be dynamically added to an instance of a subclass of IlvAccessorHolder (most often, an IlvPrototype), which will cause the object to respond to changeValue()/queryValue() requests for the new value. IlvAccessor provides methods that are similar to those of the IlvAccessible class, except that they have an additional argument, the object for which the accessor is called. IlvAccessorHolder methods call the corresponding methods of IlvAccessor for all accessors attached to the holder.

IlvAccessor is subclassed into many specialized classes with particular behaviors. These accessor subclasses provide a simple way of programming the side effects of prototype attributes by combining appropriate IlvAccessor objects.

The most important IlvAccessor subclass is IlvUserAccessor. It provides persistence methods, which make it possible to save accessors to files (in particular, prototype description files). Unless you write new subclasses of IlvGroupNode that define built-in accessors, you will not need to use IlvAccessor subclasses that are not IlvUserAccessor subclasses.

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
IlvAccessible, IlvAccessorHolder, IlvGroupAccessor, IlvGroupNode, IlvMultipleAccessor, IlvProtoInstance, IlvUserAccessor.

Member Function Documentation

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

Compares the values in ref and object and returns the differing values.

Compares the objects object and ref for the values specified by the values array of length count.

The default implementation simply calls the IlvAccessible::compareValues(const IlvAccessible*, IlvValue*, IlUShort, IlvValueArray&) const method, which will query the values for the two objects and compare them one by one. Subclasses may compare values more cleverly by grouping differences: for example, the IlvGroupAccessor subclass detects when all nodes of a group differ homogeneously and reports only one difference for the whole group.

Parameters
objectThe object to compare.
refThe reference to compare to.
valuesThe values to be compared.
countThe number of elements in the array values.
diffsWhere the differences are stored.
Returns
The number of differences found. This is therefore the size of the output array diffs.
See also
IlvAccessible::compareValues().
IlvProtoInstance, IlvPrototype.

Reimplemented in IlvGroupUserAccessor, IlvCompositeAccessor, IlvMultipleGroupAccessor, IlvGroupAccessor, IlvUserAccessor, and IlvPrototypeAccessor.

virtual void IlvAccessor::getAccessors ( const IlSymbol *const **  accessors,
const IlvValueTypeClass *const **  types,
IlUInt count 
) const
virtual

Returns the names and types of the values handled by this accessor.

Returns
The names and types of the values handled by this accessor. The base class implementation adds only the name and type of this accessor to the accessors and types lists, but subclasses (for example IlvMultipleAccessor) may add several names and types to signal that the accessor can respond to requests for several values.

Reimplemented in IlvMultipleUserAccessor, IlvMultipleAccessor, and IlvPrototypeAccessor.

const IlSymbol* IlvAccessor::getName ( ) const

Returns the name of the accessor.

Returns
The name of the accessor.
IlvValueTypeClass* IlvAccessor::getType ( ) const

Returns the type of the accessor.

Returns
A pointer to the type instance of the accessor.
virtual IlBoolean IlvAccessor::isOutputAccessor ( IlBoolean inputAndOutput)
virtual

Queries if the accessor is an output accessor.

Parameters
inputAndOutputIs set to IlTrue if this accessor is both an input and an output accessor. If this is not the case, inputAndOutput is set to IlFalse when returning from this member function.
Returns
IlTrue if the accessor is an output accessor, and IlFalse otherwise.
virtual IlBoolean IlvAccessor::isOutputValue ( const IlSymbol name) const
virtual

Queries if the accessor is an output accessor.

Returns
IlTrue if the accessor is an output accessor, and IlFalse otherwise.

Reimplemented in IlvExportOutputAccessor, IlvUserAccessor, IlvPrototypeAccessor, IlvOutputAccessor, and IlvCallbackAccessor.

virtual IlShort IlvAccessor::matchValues ( const IlvAccessorHolder object,
const IlvValue values,
IlUShort  count,
IlvValue matchingValues = 0 
) const
virtual

Returns the number of values that are handled by the accessor in the values array of length count.

The matching values are copied to the matchingValues array, which must have a length of at least count. This method is called by the changeValue()[s]/queryValue()[s] methods of the IlvAccessorHolder class to determine which IlvAccessor objects respond to a request for a set of value names. All the accessors that return a non-null count of matching values will be called by the IlvAccessorHolder, with the matching values as arguments. The base class implementation looks for a value corresponding to the accessor name given in values and copies it to matchingValues. Subclasses of IlvAccessor (for example IlvMultipleAccessor) may match several values.

Reimplemented in IlvMultipleUserAccessor, IlvMultipleAccessor, and IlvPrototypeAccessor.

void IlvAccessor::setName ( const IlSymbol name)

Sets the name of the accessor.

Parameters
nameThe new name of the accessor.

© 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.