Rogue Wave Views Foundation Package API Reference Guide |
Rogue Wave Views Documentation Home |
Group class. More...
#include <ilviews/graphics/smartset.h>
Public Member Functions | |
IlvSmartSet (const IlvSmartSet &source, const char *name=0) | |
Constructor. More... | |
IlvSmartSet (const char *name=0) | |
Constructor. More... | |
IlvSmartSet (IlvDisplay *display, IlvInputFile &file) | |
Constructor. More... | |
virtual | ~IlvSmartSet () |
Destructor. More... | |
IlBoolean | addObject (IlvGraphic *object) |
Adds an object. More... | |
virtual IlvSmartSet * | copy () const |
Copies this smart set. More... | |
IlUInt | getCardinal () const |
Gets the number of objects. More... | |
const char * | getName () const |
Gets the name. More... | |
const char * | getName (const IlvGraphic *object) |
Gets the original name of an object. More... | |
virtual const char * | getNamesSeparator () const |
Gets the string used to name the objects. More... | |
virtual IlvGraphic * | getObject (const char *) const |
Gets an object by name. More... | |
IlvGraphic *const * | getObjects (IlUInt &count) const |
Gets all the objects. More... | |
IlBoolean | hasObject (IlvGraphic *object) const |
Checks if an object is present. More... | |
IlBoolean | removeObject (IlvGraphic *object, IlBoolean destroy=IlFalse) |
Removes an object. More... | |
void | setName (const char *newName) |
Sets the name. More... | |
void | setName (const IlvGraphic *, const char *) |
Sets the name of an object. More... | |
virtual void | write (IlvOutputFile &file) const |
Writes this smart set to a stream. More... | |
Group class.
Library: views
The IlvSmartSet
class is designed to create logical groups, called SmartSets, in the context of a container or a manager. A SmartSet references a group of objects.
When an object is added to the SmartSet, its name is modified in order to reference the name of the SmartSet. An object cannot be stored simultaneously in more than one SmartSet.
IlvContainer
, IlvManager
. IlvSmartSet::IlvSmartSet | ( | const IlvSmartSet & | source, |
const char * | name = 0 |
||
) |
Constructor.
This constructor initializes a new SmartSet by creating a copy of an existing SmartSet. All the objects stored in the source are copied (by calling their copy()
method) and stored in this new SmartSet. If name is not 0
, the name of this new SmartSet is set to a copy of name, otherwise, this SmartSet is given the same name as source.
IlvSmartSet::IlvSmartSet | ( | const char * | name = 0 | ) |
Constructor.
This constructor initializes a new empty IlvSmartSet
. The name of this new SmartSet is initialized to a copy of the string name
.
IlvSmartSet::IlvSmartSet | ( | IlvDisplay * | display, |
IlvInputFile & | file | ||
) |
Constructor.
This constructor initializes a new SmartSet by reading its definition from the input file file.
|
virtual |
Destructor.
The destructor removes all the objects this SmartSet stores, and gives them their original names. No objects are destroyed.
IlBoolean IlvSmartSet::addObject | ( | IlvGraphic * | object | ) |
Adds an object.
Adds the graphic object object
to this SmartSet. If both this SmartSet and object have names, the name of object is changed to the concatenation of the SmartSet name, the name separator string, and the object name. This function returns IlFalse
on error, that is, if this object is already located in a SmartSet.
|
virtual |
Copies this smart set.
new IlvSmartSet(*this);
IlUInt IlvSmartSet::getCardinal | ( | ) | const |
Gets the number of objects.
const char* IlvSmartSet::getName | ( | ) | const |
Gets the name.
0
if the SmartSet doesn't have a name. This string must not be modified nor deleted. const char* IlvSmartSet::getName | ( | const IlvGraphic * | object | ) |
Gets the original name of an object.
0
if the object cannot be found or has no name.
|
virtual |
Gets the string used to name the objects.
"#"
.
|
virtual |
Gets an object by name.
0
if it cannot be found. IlvGraphic* const* IlvSmartSet::getObjects | ( | IlUInt & | count | ) | const |
Gets all the objects.
IlBoolean IlvSmartSet::hasObject | ( | IlvGraphic * | object | ) | const |
Checks if an object is present.
IlTrue
if object is stored in this SmartSet, and IlFalse
if it is not. IlBoolean IlvSmartSet::removeObject | ( | IlvGraphic * | object, |
IlBoolean | destroy = IlFalse |
||
) |
Removes an object.
Removes the object object from the SmartSet. If destroy is set to IlTrue
, the object is deleted, otherwise, the object is renamed to its original name.
void IlvSmartSet::setName | ( | const char * | newName | ) |
Sets the name.
Sets the name of this SmartSet to a copy of the string newName. If newName is 0
, the SmartSet has no name and the name of the subobjects is hidden.
void IlvSmartSet::setName | ( | const IlvGraphic * | , |
const char * | |||
) |
Sets the name of an object.
Sets the original name of object, that must be stored in this smart set, to a copy of the string name. If name is 0
, the name of the object is removed.
|
virtual |
Writes this smart set to a stream.
Writes in the output file file a description of this SmartSet.
© Copyright 2016, 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.