Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Clonable group. More...
#include <ilviews/protos/proto.h>
Public Member Functions | |
IlvPrototype (IlvGroup &group) | |
Creates a prototype by copying an existing group. | |
IlvPrototype (const char *name) | |
Creates an empty prototype. | |
IlvProtoInstance * | clone (const char *name=0) |
Creates a new instance of the prototype, with the name name. | |
void | deleteInstance (IlvProtoInstance *instance) |
Deletes an instance. | |
IlvProtoInstance * | getInstance (const char *name) const |
Finds an instance of the prototype by name. | |
IlvProtoInstance * | nextInstance (IlAny &link) const |
Iterator on the instances of the prototype. | |
virtual void | setName (const char *name) |
Changes the name of this group. | |
IlBoolean | update (const IlvGroup &group) |
Updates the prototype and all its instances to a new definition. | |
Friends | |
class | IlvAbstractProtoLibrary |
class | IlvProtoInstance |
class | IlvProtoLibrary |
Clonable group.
Library: ilvproto
An IlvPrototype
is a group that can create instances of the IlvProtoInstance
class. Prototype instances can be updated if the prototype is changed. When prototype instances are saved to streams or files, only the values that are changed with respect to the prototype will be saved; the other values will be inherited from the prototype. Prototypes are loaded automatically when you load a file containing prototype instances. You can also load a prototype explicitly using the IlvLoadPrototype
method.
IlvPrototype::IlvPrototype | ( | const char * | name | ) |
Creates an empty prototype.
name | Name of the prototype. Prototypes cannot have a null name. |
IlvPrototype::IlvPrototype | ( | IlvGroup & | group | ) |
Creates a prototype by copying an existing group.
group | Group to transform into a prototype. A full copy of group is made. |
IlvProtoInstance* IlvPrototype::clone | ( | const char * | name = 0 |
) |
Creates a new instance of the prototype, with the name name.
If name is NULL
, a unique name of the form <prototype-name>_<index>
is assigned to the instance.
name | Name of the newly created instance. |
void IlvPrototype::deleteInstance | ( | IlvProtoInstance * | instance | ) |
Deletes an instance.
You can also delete the instance directly using the delete
operator, which will remove it from the instance list of the prototype. All instances of a prototype are destroyed when the prototype is destroyed.
instance | Instance of the prototype to delete. |
IlvProtoInstance* IlvPrototype::getInstance | ( | const char * | name | ) | const |
Finds an instance of the prototype by name.
name | The name of the prototype that is searched. |
0
if there is none. IlvProtoInstance* IlvPrototype::nextInstance | ( | IlAny & | link | ) | const |
Iterator on the instances of the prototype.
link | If 0 , the function returns the first instance of the prototype, and modifies link so that subsequent calls will iterate through all the instances of the prototype. Returns NULL (and sets link to NULL ) when all the instances have been returned. |
virtual void IlvPrototype::setName | ( | const char * | name | ) | [virtual] |
Changes the name of this group.
name | The new name of this group. The string is copied. |
Reimplemented from IlvGroup.
Updates the prototype and all its instances to a new definition.
When a prototype is edited (for example, by adding graphic nodes or accessors) its instances need to be updated at some point to reflect the new definition. This method does so by proceeding in the following order:
IlvGroup::update(group)
). IlvGroup::update(*this)
on each instance). Some information may be lost in the process, such as links the instances were connected to: if the new definition for the prototype has changed drastically, connections and subscriptions may be lost. However, for localized changes, this process is necessary to allow a prototype to evolve from one version to another with the instances still being used in other panels.
In Studio, update
is called each time a prototype definition window is saved.
group | The group to update the prototype from. |
IlTrue
if the update process was successful. Reimplemented from IlvGroup.
© 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.