Rogue Wave Views |
Rogue Wave Views Documentation Home |
Named property class. More...
#include <ilviews/util/proplist.h>
Public Member Functions | |
IlvNamedProperty (IlSymbol *) | |
Constructor. More... | |
IlvNamedProperty (const IlvNamedProperty &source) | |
Constructor. More... | |
IlvNamedProperty * | copy () const =0 |
Copies the property. More... | |
const char * | getName () const |
Gets the name of the property. More... | |
IlSymbol * | getSymbol () const |
Gets the name of the property. More... | |
virtual IlBoolean | isPersistent () const |
Specifies whether the property must save itself. More... | |
void | write (IlvOutputFile &stream) const =0 |
Saves the description of the property. More... | |
Public Attributes | |
IlvNamedProperty *IlvInputFile & | stream |
Reads an instance of the property class. More... | |
Named property class.
Library: views
The class IlvNamedProperty
is used to associate persistent properties with graphic objects. These properties are instances of subclasses of IlvNamedProperty
, and they can save themselves and be read back from a data stream. They are deleted when the graphic object they are associated with is destroyed.
A named property is identified by a name, which is a symbol referred to as the property name. This class is an abstract class, so every named property is an instance of a subclass of IlvNamedProperty
.
To implement the persistence of a new subclass of IlvNamedProperty
, you must use one of the two macros DeclarePropertyInfo
or DeclarePropertyInfoRO
in the body of the class declaration, and register the new class using the macro IlvRegisterPropertyClass
.
IlvGraphic
("Named Properties"), DeclarePropertyInfo
, DeclarePropertyInfoRO
, DeclarePropertyIOConstructors
, IlvPredefinedPropertyIOMembers
, IlvRegisterPropertyClass
. IlvNamedProperty::IlvNamedProperty | ( | IlSymbol * | ) |
Constructor.
Initializes a new instance of IlvNamedProperty
, setting the property name to name.
IlvNamedProperty::IlvNamedProperty | ( | const IlvNamedProperty & | source | ) |
Constructor.
Initializes a new instance of IlvNamedProperty
with a copy of source.
|
pure virtual |
Copies the property.
Creates and returns a copy of the property.
const char* IlvNamedProperty::getName | ( | ) | const |
Gets the name of the property.
Gets the name of this property, as a char*
. This string must not be deleted nor modified by the user.
char*
. IlSymbol* IlvNamedProperty::getSymbol | ( | ) | const |
Gets the name of the property.
Gets the name of this property as an IlSymbol
. This symbol is the one provided in the constructors.
IlSymbol*
.
|
virtual |
Specifies whether the property must save itself.
Specifies whether the property must save itself when the object is saved. The purpose of this function is to have smaller Rogue Wave Views data files when handling named properties that do not need to be persistent (such as temporary flags).
The default implementation returns IlTrue
, so that all named properties are saved and can be loaded by default.
IlTrue
if this property must save itself when the object is saved, and IlFalse
otherwise.
|
pure virtual |
Saves the description of the property.
Saves a description of this property into the output stream stream.
stream | The output stream. |
IlvNamedProperty* IlvInputFile& IlvNamedProperty::stream |
Reads an instance of the property class.
Creates and returns a new instance of this property class, from the input stream stream, with the name name.
stream | The input stream. |
name | The name of the new instance. |
© 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.