Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Base class for persistent behaviors. More...
#include <ilviews/protos/useracc.h>
Public Member Functions | |
IlvUserAccessor (const char *name, const IlvValueTypeClass *type, IlUInt flags=0) | |
Creates a new user accessor of name name and type type. | |
virtual void | initialize (const IlvAccessorHolder *object) |
Attachment method to an IlvAccessorHolder . | |
virtual IlBoolean | isOutputValue (const IlSymbol *name) const |
Queries if the accessor is an output accessor. | |
IlBoolean | isPrivate () const |
Returns IlTrue if the accessor has the private flag set. Otherwise, it returns IlFalse . | |
IlBoolean | isRuntime () const |
Returns IlTrue if the accessor has the RunTime flag set. Otherwise, it returns IlFalse . | |
void | setPrivate (IlBoolean val) |
Sets the Private flag of this accessor. | |
void | setRuntime (IlBoolean runTime) |
Sets the RunTime flag of this accessor. | |
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. | |
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. | |
Friends | |
class | IlvAccessorHolder |
class | IlvGroup |
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.
IlvUserAccessor::IlvUserAccessor | ( | const char * | name, | |
const IlvValueTypeClass * | type, | |||
IlUInt | flags = 0 | |||
) |
Creates a new user accessor of name name and type type.
name | 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) . | |
type | 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. | |
flags | Attributes of the new accessors. It is a combination of the following values:
|
virtual IlUInt IlvUserAccessor::compareValues | ( | const IlvAccessorHolder * | object, | |
const IlvAccessible * | ref, | |||
IlvValue * | values, | |||
IlUShort | count, | |||
IlvValueArray & | diffs | |||
) | const [protected, 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 differences are stored in the diffs array, and the method returns the number of differences. The default implementation simply calls the IlvAccessible::compareValues
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.
Reimplemented from IlvAccessor.
Reimplemented in IlvPrototypeAccessor, IlvCompositeAccessor, and IlvGroupUserAccessor.
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 conversion (optional) is stored in the val parameter.
val | Input/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. | |
object | Object holding the accessor. Used to access other attributes in the object that can be referenced by the input value. | |
typeVal | (see typeClass). | |
typeClass | If 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. | |
arg | An argument that can be used as input by the evaluation process. |
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.
object | The object the accessor is attached to. |
Reimplemented in IlvAnimationAccessor, IlvCallbackAccessor, IlvLoopbackAccessor, IlvAbstractEventAccessor, IlvRotationAccessor, IlvSlideXAccessor, IlvSlideYAccessor, IlvJavaScriptAccessor, and IlvPrototypeAccessor.
Queries if the accessor is an output accessor.
IlTrue
if the accessor is an output accessor, and IlFalse
otherwize. Reimplemented from IlvAccessor.
Reimplemented in IlvCallbackAccessor, IlvOutputAccessor, IlvExportOutputAccessor, and IlvPrototypeAccessor.
void IlvUserAccessor::setPrivate | ( | IlBoolean | val | ) |
Sets the Private flag of this accessor.
val | The new Private flag value. |
void IlvUserAccessor::setRuntime | ( | IlBoolean | runTime | ) |
Sets the RunTime flag of this accessor.
runTime | The new RunTime flag value. |
© Copyright 2012, 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.