rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Prototypes Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvAccessible Class Reference

Abstract class providing queryValue, changeValue, conversion, and introspection methods. More...

#include <ilviews/protos/value.h>

Inheritance diagram for IlvAccessible:
IlvAccessorHolder IlvGroupMediator IlvGroupNode IlvGroup IlvProtoMediator IlvGraphicNode IlvSubGroupNode IlvProtoInstance IlvPrototype

List of all members.

Public Member Functions

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

Static Public Member Functions

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.
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.
static IlBoolean StringToValue (const char *s, IlSymbol *type, IlvValue &v, IlvDisplay *display)
 Converts the character string s to an IlvValue with the type type.
static IlBoolean ValuesAreEqual (IlvValue &v1, IlvValue &v2, IlBoolean compareNames=IlTrue)
 Compares two values.

Detailed Description

Abstract class providing queryValue, changeValue, conversion, and introspection methods.

Library: ilvproto

IlvAccessible is an abstract base class used as a superclass for all objects in the prototype library that provide an interface based on the queryValue/changeValue methods. IlvAccessible also provides methods for converting and comparing values, and implements the value subscription interface.

See also:
IlvValue, IlvValueInterface, IlvAccessorHolder, IlvGroupNode.

Member Function Documentation

virtual IlBoolean IlvAccessible::changeValue ( const IlvValue v  )  [virtual]

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

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

Reimplemented in IlvAccessorHolder, IlvGroup, IlvSubGroupNode, IlvGroupMediator, and IlvGraphicNode.

virtual IlBoolean IlvAccessible::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:
v The changed values (both name and values).
c The number of values.
Returns:
Whether the object considered the operation successful or not.

Reimplemented in IlvAccessorHolder, IlvGroup, IlvSubGroupNode, IlvGroupMediator, and IlvGraphicNode.

virtual IlUInt IlvAccessible::compareAllValues ( const IlvAccessible ref,
IlvValueArray diffs,
IlBoolean  any = IlFalse 
) const [virtual]

Compares two objects and returns the differing attributes.

See below.

virtual IlUInt IlvAccessible::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:
ref The object to compare to.
any Specifies whether to compare values of unknown types and pointer types.
diffs The differing attributes.
values The attributes to compare in both objects.
count The number of attributes to compare.

Reimplemented in IlvAccessorHolder, and IlvSubGroupNode.

virtual IlBoolean IlvAccessible::convertValues ( IlvValue v,
IlUShort  c,
IlvDisplay d 
) const [virtual]

Convert values to match the types defined by the object accessors.

Converts a set of values so their type match the type of accessors corresponding to the object. The values are normally stored in values as strings. They will be converted to the appropriate types. The result is returned in values.

Returns:
Whether the conversion process was successful.
Parameters:
v The values to convert.
c The number of values to convert.
d A display, needed to allow font, color, and other resource conversions.
static void IlvAccessible::DeclareAccessor ( const IlSymbol attr,
IlvValueTypeClass type,
const IlSymbol *const **  accessors,
const IlvValueTypeClass *const **  types,
IlUInt count,
IlBoolean  checkDuplicates = IlFalse,
IlAny  accessorList = 0 
) [static]

Adds the accessor name attr and its type type to the accessors and types lists, and increments the count parameter. To add an accessor to the list, this method must be called from getAccessors.

virtual void IlvAccessible::getAccessors ( const IlSymbol *const **  a,
const IlvValueTypeClass *const **  t,
IlUInt c 
) const [pure 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:
a Pointer to an array filled on return with the names of the accessors defined for the object.
t Pointer to an array filled on return with the type of each accessor.
c Number of accessors, set by the method.

Implemented in IlvAccessorHolder, IlvGroup, IlvSubGroupNode, IlvGroupMediator, and IlvGraphicNode.

virtual const char* IlvAccessible::getName (  )  const [pure virtual]

Returns the object name.

Returns:
The object name. This pointer must not be freed.

Implemented in IlvGroup, IlvGroupNode, IlvSubGroupNode, IlvGroupMediator, and IlvGraphicNode.

IlUInt IlvAccessible::getSubscriptions ( IlvAccessible subscriber,
IlSymbol **&  sourceValue,
IlSymbol **&  subscriberValue,
IlvValueTypeClass **&  type,
IlvValueSubscriptionMode *&  mode,
IlvAccessible ***  subscribers = 0 
) const

Returns alls subscriptions made by subscriber.

The sourceValue, subscriberValues, types, and modes arguments are modified to contain the parameters of all the subscriptions for the specified subscriber. These parameters must be released using the delete[] operator when they are no longer needed. The method returns the number of elements returned in each array.

Returns:
The number of subscriptions.
Parameters:
sourceValue The names of the attributes observed by the subscription.
subscriberValue The names of the attributes to be notified in the subscriber.
type The types of the expected values pushed in subscriber.
mode The modes of the subscriptions.
subscribers The subscribers also observing the object.
static const IlvValueTypeClass* IlvAccessible::GetType ( IlSymbol name  )  [static]

Returns the type instance from a name.

Parameters:
name The name of the type that is requested.
return A pointer to the type instance that corresponds to the name name.
virtual const IlvValueTypeClass* IlvAccessible::getValueType ( const IlSymbol s  )  const [virtual]

Returns the type of a given attribute.

Returns:
The type of this object accessor, or IlvValueNoType if the accessor does not exist.
Parameters:
The name of the accessor.

Reimplemented in IlvGroup.

virtual IlBoolean IlvAccessible::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:
value Name of the accessor.
See also:
pushValue.

Reimplemented in IlvAccessorHolder, IlvGroup, and IlvSubGroupNode.

virtual void IlvAccessible::pullValues ( IlvValue vals,
IlUShort  c 
) const [virtual]

Propagates value queries to the subscribers to this object.

Must be called to propagate value queries to the subscribers to this object. When pullValue or pullValues is called, every IlvAccessible object subscribed to the value identified by val with a mode of IlvValueSubscriptionQuery is notified through a call to the subscriber queryValue or queryValues methods. The value name is equal to the subscriberValue passed to the subscribe method when the subscription was made. The first method returns the last value returned by the queryValue methods of the subscribers. The second method returns whether the object considered the call successful.

Parameters:
vals The pulled values.
c The number of values.
Returns:
Whether the object considered the call successful, or the last value returned by the queryValue methods of the subscribers.
virtual IlBoolean IlvAccessible::pushValues ( const IlvValue vals,
IlUShort  c 
) const [virtual]

Propagates value changes to the subscribers to this object.

Must be called to propagate value changes to the subscribers to this object. When pushValue or pushValues is called, every IlvAccessible object subscribed to the value identified by v with a mode of IlvValueSubscriptionChange is notified through a call to the subscriber changeValue or changeValues methods. The value name is equal to the subscriberValue passed to the subscribe method when the subscription was made, with a data value equal to the data contained in val. The method returns IlTrue if at least one of the changeValue methods of the subscribers returns IlTrue, and IlFalse otherwise.

Returns:
Whether the object considered the call successful.
Parameters:
vals The pushed values.
c The number of values.
virtual IlvValue& IlvAccessible::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:
value The queried value name.
Returns:
The value passed in argument, set to the object value.

Reimplemented in IlvAccessorHolder, IlvGroup, IlvSubGroupNode, IlvGroupMediator, and IlvGraphicNode.

virtual void IlvAccessible::queryValues ( IlvValue v,
IlUShort  c 
) const [virtual]

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

Parameters:
v The array of value names to be queried
c The number of values to be queried.

Reimplemented in IlvAccessorHolder, IlvGroup, IlvSubGroupNode, and IlvGroupMediator.

static IlBoolean IlvAccessible::StringToValue ( const char *  s,
const IlvValueTypeClass typeClass,
IlvValue v,
IlvDisplay d 
) [static]

Converts the character string s to an IlvValue with the type type.

Returns:
IlTrue if the conversion was successful, and IlFalse otherwise.
Parameters:
s Input string.
type Name of the IlvValueTypeClass to be used to do the conversion.
typeClass Type of the value to convert the string into.
v Resulting value.
d Display used to convert resources such as colors, fonts, and so on.
static IlBoolean IlvAccessible::StringToValue ( const char *  s,
IlSymbol type,
IlvValue v,
IlvDisplay display 
) [static]

Converts the character string s to an IlvValue with the type type.

See below.

virtual void IlvAccessible::subscribe ( IlvAccessible subscriber,
IlSymbol sourceValue,
IlSymbol subscriberValue,
IlvValueTypeClass type,
IlvValueSubscriptionMode  mode = IlvValueSubscriptionChange 
) [virtual]

Subscribes the subscriber object to the value sourceValue of this object.

After this subscription, every call to this object pushValue method with a value name of sourceValue will cause the subscriber changeValue method to be called with the value name subscriberValue, and with the value data passed to the initial pushValue call of the value source. The type parameter specifies the type of the sourceValue and subscriberValue values. An IlvAccessible object can subscribe several times to another IlvAccessible object for different source values and/or subscriber values, but it may not subscribe several times to the same object and subscriber values. The mode argument specifies whether the subscriber wants to be notified of value changes (this is the default mode IlvValueSubscriptionChange), or if it wants to be notified of value queries (mode IlvValueSubscriptionQuery). In this last case, the source object notifies its subscribers of calls to pullValue instead of pushValue by calling queryValue instead of changeValue.

Parameters:
subscriber The object to be notified of accesses to sourceValue.
sourceValue The name of the attribute to be observed by the subscription.
subscriberValue The name of the attribute to be notified in the subscriber.
type The expected value type to be pushed to the subscriber.
mode The type of access to sourceValue to be reported to subscriber.
See also:
IlvValueSubscriptionMode

Reimplemented in IlvGroup, and IlvSubGroupNode.

virtual void IlvAccessible::unSubscribe ( IlvAccessible subscriber,
IlSymbol sourceValue = 0,
IlSymbol subscriberValue = 0 
) [virtual]

Cancels subscriptions previously made.

Cancels the subscription of the subscriber object to the specified sourceValue and subscriberValue. If sourceValue is 0, the subscriptions of subscriber to all source values are cancelled. If subscriberValue is 0, the subscriptions of subscriber for all subscriber values are removed. If both are 0, all subscriptions of subscriber to this source object are cancelled.

Parameters:
subscriber The object that is to be notified of accesses to sourceValue.
sourceValue The name of the attribute to be observed by the subscription.
subscriberValue The name of the attribute to be notified in the subscriber.

Reimplemented in IlvGroup, and IlvSubGroupNode.

static IlBoolean IlvAccessible::ValuesAreEqual ( IlvValue v1,
IlvValue v2,
IlBoolean  compareNames = IlTrue 
) [static]

Compares two values.

The actual comparison depends on the type of the values: scalar types are compared using their == operators, strings are compared using the strcmp function, and resource values (such as IlvColors) are compared using their pointers (that is, two distinct instances of IlvColor representing the same RGB values will still be considered as different).

Returns:
IlTrue if the values are equal, and IlFalse if they differ.
Parameters:
v1 First value.
v2 Second value.
compareNames Specifies whether names should also be identical.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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