rwlogo

Rogue Wave Views
Prototypes Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
List of all members | Public Member Functions | Protected Member Functions | Friends
IlvUserAccessor Class Reference

Base class for persistent behaviors. More...

#include <ilviews/protos/useracc.h>

Inheritance diagram for IlvUserAccessor:
IlvAccessor 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

 IlvUserAccessor (const char *name, const IlvValueTypeClass *type, IlUInt flags=0)
 Constructor. More...
 
virtual void initialize (const IlvAccessorHolder *object)
 Attachment method to an IlvAccessorHolder. More...
 
virtual IlBoolean isOutputValue (const IlSymbol *) const
 Queries if the accessor is an output accessor. More...
 
IlBoolean isPrivate () const
 Checks the private status. More...
 
IlBoolean isRuntime () const
 Checks the RunTime status. More...
 
void setPrivate (IlBoolean val)
 Sets the Private flag of this accessor. More...
 
void setRuntime (IlBoolean runTime)
 Sets the RunTime flag of this accessor. More...
 
- Public Member Functions inherited from IlvAccessor
 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 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 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...
 

Protected Member Functions

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...
 
IlBoolean getValue (IlvValue &val, const IlvAccessorHolder *object, IlvDisplay *display, IlvValueTypeClass *typeClass=0, IlSymbol *typeVal=0, const IlvValue *arg=0) const
 Evaluates a parameter of a user accessor. More...
 

Friends

class IlvAccessorHolder
 
class IlvGroup
 

Detailed Description

Base class for persistent behaviors.

Library: ilvproto

An IlvUserAccessor is an accessor that can be saved and restored. IlvUserAccessor is the base class for all accessors that are to be added dynamically by the user when building a prototype.

See Also
IlvAccessorHolder, IlvGroup.

Constructor & Destructor Documentation

IlvUserAccessor::IlvUserAccessor ( const char *  name,
const IlvValueTypeClass type,
IlUInt  flags = 0 
)

Constructor.

Parameters
nameThe name of the accessor, that is, the attribute by which one accesses this accessor in an accessor holder. Calls to object->queryValue(IlvValue(name, ...)) and object->changeValue(IlvValue(name, ...)) on the object will result in a corresponding call to accessor->queryValue(object, value).
typeThe type of the accessors. Some accessors hold internal data in the form of an IlvValue. This argument allows you to set the type of this value.
flagsThe attributes of the new accessors. It is a combination of the following values:
  • IlvUserAccessorRuntime. The value associated with this accessor must not be saved to the file.
  • IlvUserAccessorPrivate. This accessor is used internally by the prototype, and should not be listed in graphical user interfaces used to edit instances of the prototype.

Member Function Documentation

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

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 from IlvAccessor.

Reimplemented in IlvGroupUserAccessor, IlvCompositeAccessor, and IlvPrototypeAccessor.

IlBoolean IlvUserAccessor::getValue ( IlvValue val,
const IlvAccessorHolder object,
IlvDisplay display,
IlvValueTypeClass typeClass = 0,
IlSymbol typeVal = 0,
const IlvValue arg = 0 
) const
protected

Evaluates a parameter of a user accessor.

A user accessor parameter is often specified as a character string (which can contain a constant value, such as "100"), the name of another accessor, or an arbitrary expression containing constants and/or accessor names. This method takes an input value and evaluates it.

The result of the evaluation and potential conversion is stored in the val parameter.

Parameters
valInput/output parameter that initially contains the character string to convert. The getValue() method converts this character string as explained below, and stores the resulting value in val. If the value contains any of the characters "()+*-/&|^!>;<;=", it is considered as an expression and it is evaluated (see further). Otherwise, if the value starts with a quotation mark ("), or a digit, or if it is equal to the values "IlTrue" or "IlFalse", it is converted to the appropriate type (string or integer).
If the value consists of a single identifier, it is interpreted as an accessor name, and the accessor value is retrieved from object.
objectObject holding the accessor. Used to access other attributes in the object that can be referenced by the input value.
displayThe display instance that is used should the value type be a graphical resource type, that all need a display.
typeVal(see typeClass).
typeClassIf non-null, the value is converted to that type. If typeVal is non-null and typeClass is 0, the value is converted to the type of the typeVal property of object.
argAn argument that can be used as input by the evaluation process.
Returns
IlTrue if the conversion was successful, or IlFalse if an error occurred while retrieving or converting the value.

Expressions follow the usual C++ syntax. You can use the operators +, -, *, /, %, <, >, =, >=, <=, &&, ||, and parentheses. The ternary conditional operator "*?*:*" is not supported. The operands can be integer constants (in decimal or hexadecimal format) or floating-point constants (with the format defined by the C library function strtod()). The operands can also be string constants (which must be placed in quotation marks), or identifiers that are interpreted as accessors of object. When the two operands are strings, the + operator returns the concatenation of its operands, and the == and != operators compare their operands as strings.

Expressions must not contain blank spaces between their operands or operators, or they will not be saved correctly to .ivp files.

virtual void IlvUserAccessor::initialize ( const IlvAccessorHolder object)
virtual

Attachment method to an IlvAccessorHolder.

This method is called when the accessor object is attached to a group. You can redefine it in subclasses of IlvUserAccessor to perform any kind of initialization.

Parameters
objectThe object the accessor is attached to.

Reimplemented in IlvSlideYAccessor, IlvSlideXAccessor, IlvLoopbackAccessor, IlvPrototypeAccessor, IlvAnimationAccessor, IlvJavaScriptAccessor, IlvRotationAccessor, IlvCallbackAccessor, and IlvAbstractEventAccessor.

virtual IlBoolean IlvUserAccessor::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 from IlvAccessor.

Reimplemented in IlvExportOutputAccessor, IlvPrototypeAccessor, IlvOutputAccessor, and IlvCallbackAccessor.

IlBoolean IlvUserAccessor::isPrivate ( ) const

Checks the private status.

Returns
IlTrue if the accessor has the private flag set. Otherwise, it returns IlFalse.
IlBoolean IlvUserAccessor::isRuntime ( ) const

Checks the RunTime status.

Returns
IlTrue if the accessor has the RunTime flag set. Otherwise, it returns IlFalse.
void IlvUserAccessor::setPrivate ( IlBoolean  val)

Sets the Private flag of this accessor.

Parameters
valThe new Private flag value.
void IlvUserAccessor::setRuntime ( IlBoolean  runTime)

Sets the RunTime flag of this accessor.

Parameters
runTimeThe new RunTime flag value.

© Copyright 2015, 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.