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 | Friends
IlvProtoInstance Class Reference

Clone of a prototype. More...

#include <ilviews/protos/proto.h>

Inheritance diagram for IlvProtoInstance:
IlvGroup IlvAccessorHolder IlvAccessible

Public Member Functions

 IlvProtoInstance (const IlvProtoInstance &source)
 Copies an existing instance. More...
 
IlUInt getModifiedValues (IlvValueArray &diffs, IlBoolean any=IlFalse) const
 Computes the values that have been modified for this instance with respect to its prototype. More...
 
IlvPrototypegetPrototype () const
 Returns the prototype of the instance. More...
 
IlBoolean update (const IlvGroup &)
 Updates the group (deep-inplace copy). More...
 
- Public Member Functions inherited from IlvGroup
 IlvGroup (const char *name=0)
 Creates a new, empty group with the specified name. More...
 
 IlvGroup (const IlvGroup &source)
 Creates a copy of the source group. More...
 
void addAccessor (IlvUserAccessor *accessor, IlBoolean owner=IlTrue, IlBoolean initialize=IlTrue, IlBoolean sort=IlFalse, IlvUserAccessor *previous=0)
 Adds an accessor to the group. More...
 
void addNode (IlvGroupNode *node, IlBoolean uniqueName=IlFalse)
 Adds the node node to the group. More...
 
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...
 
IlvGroupNodefindNode (const char *name, IlBoolean actual=IlTrue) const
 Finds the node whose name is specified as argument. More...
 
IlUInt getAccessorList (const char **&names, const char **&types, IlBoolean all=IlFalse, IlBoolean output=IlFalse) const
 Returns names and types of the attributes defined in the group. 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 const char * getName () const
 Returns the object name. More...
 
IlUInt getNodeCount () const
 Returns the number of nodes in the group. More...
 
const char ** getNodeNames (IlUInt &count)
 Returns the names of all the nodes of the group, including the nodes of subgroups. More...
 
IlvGroupNode ** getNodes (IlUInt &count)
 Returns the nodes in the group. More...
 
IlvGroupgetParent () const
 If this group is a subgroup of another group, returns the parent group. Otherwise, returns 0.
 
IlvGroupNodegetParentNode () const
 Returns the instance of IlvSubGroupNode that contains the group if this group is a subgroup of another group, or 0 otherwise.
 
IlvGroupgetTopGroup ()
 Returns the top-most parent of the group if this group is a subgroup. Otherwise, it returns 0.
 
virtual const IlvValueTypeClassgetValueType (const IlSymbol *) const
 Returns the type of a given attribute. More...
 
IlBoolean hasAccessor (IlvAccessor *accessor)
 Returns IlTrue if accessor is already contained in the group. Otherwise, it returns IlFalse.
 
IlBoolean isEmpty () const
 Returns IlTrue if the group contains no nodes. Otherwise, it returns IlFalse.
 
virtual IlBoolean isOutputValue (const IlSymbol *valueName) const
 Indicates whether value designates an accessor that can generate notifying values. More...
 
virtual IlvAccessornextAccessor (IlAny &link) const
 Iterator through the accessors. More...
 
IlvGroupNodenextNode (IlAny &link) const
 Node iterator. More...
 
virtual IlvUserAccessornextUserAccessor (IlAny &link) const
 User accessor iterator. 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...
 
void removeAccessor (IlvAccessor *accessor, IlBoolean deleteIt=IlTrue)
 Removes an accessor from the group. More...
 
void removeNode (IlvGroupNode *node, IlBoolean deleteIt=IlTrue)
 Removes a node from the group. More...
 
IlBoolean save (ILVSTDPREF ostream *stream=0, const char *path=0)
 Saves a group to an output stream or to a disk file. More...
 
virtual void setName (const char *name)
 Changes the name of this group. 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...
 
- Public Member Functions inherited from IlvAccessorHolder
virtual IlUInt compareValues (const IlvAccessible *ref, IlvValue *values, IlUShort count, IlvValueArray &diffs) const
 Compares two objects and returns the differing attributes. 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...
 
IlUInt getSubscriptions (IlvAccessible *subscriber, IlSymbol **&sourceValue, IlSymbol **&subscriberValue, IlvValueTypeClass **&type, IlvValueSubscriptionMode *&mode, IlvAccessible ***subscribers=0) const
 Returns alls subscriptions made by subscriber. 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...
 

Friends

class IlvPrototype
 

Additional Inherited Members

- Static Public Member Functions inherited from IlvGroup
static IlvGroupload (const char *name, IlvDisplay *display, ILVSTDPREF istream *stream=0, const char *path=0)
 Loads a group from an input stream or from a disk file. More...
 

Detailed Description

Clone of a prototype.

Library: ilvproto

IlvProtoInstance is a subclass of IlvGroup that represents instances of IlvPrototype. An IlvProtoInstance points to its prototype, and can automatically save (to a file) only the accessor values that have been changed with respect to its prototype.

See Also
IlvPrototype.

Constructor & Destructor Documentation

IlvProtoInstance::IlvProtoInstance ( const IlvProtoInstance source)

Copies an existing instance.

The new instance is added to the prototype instance list. There is no other public constructor for IlvProtoInstance. Instances must be created by calling the IlvPrototype::clone method.

Member Function Documentation

IlUInt IlvProtoInstance::getModifiedValues ( IlvValueArray diffs,
IlBoolean  any = IlFalse 
) const

Computes the values that have been modified for this instance with respect to its prototype.

The list of these values is added to the end of the diffs table (if this table already contains elements, they will not be overwritten).

This method is used when saving prototype instances. Storing the modified values between a prototype and a prototype instance allows you to edit the prototype, and then propagate the improvements to all the instances of the prototype. This propagation is done with the update method. This has some restrictions: if the prototype evolves drastically, the modified values may no longer be relevant.

Parameters
diffsArray of values that differ between the prototype and its instance.
anySet to IlTrue if the difference is to account for values of class IlvValueAnyType or other values whose type is unknown.
IlvPrototype* IlvProtoInstance::getPrototype ( ) const

Returns the prototype of the instance.

Returns
The prototype of this instance.
IlBoolean IlvProtoInstance::update ( const IlvGroup source)
virtual

Updates the group (deep-inplace copy).

Uses compareValues to store the differing values between this and source, replaces all the nodes and behaviors of this by those of source, and then reassigns the previously stored differing values to this (by calling changeValues. This method is mainly used to update IlvProtoInstances when a prototype is modified.

Parameters
sourceGroup to update from.
See Also
IlvPrototype, IlvProtoInstance.

Reimplemented from IlvGroup.


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