rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

List of all members | Public Member Functions
IlvSmartSet Class Reference

Group class. More...

#include <ilviews/graphics/smartset.h>

Public Member Functions

 IlvSmartSet (const IlvSmartSet &, 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 IlvSmartSetcopy () 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 IlvGraphicgetObject (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...
 

Detailed Description

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.

See Also
IlvContainer, IlvManager.

Constructor & Destructor Documentation

IlvSmartSet::IlvSmartSet ( const IlvSmartSet ,
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 set.

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 IlvSmartSet::~IlvSmartSet ( )
virtual

Destructor.

The destructor removes all the objects this SmartSet stores, and gives them their original names. No objects are destroyed.

Member Function Documentation

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 IlvSmartSet* IlvSmartSet::copy ( ) const
virtual

Copies this smart set.

Returns
A copy of this SmartSet. It is equivalent to: new IlvSmartSet(*this);
IlUInt IlvSmartSet::getCardinal ( ) const

Gets the number of objects.

Returns
The number of objects stored in this SmartSet.
const char* IlvSmartSet::getName ( ) const

Gets the name.

Returns
the name of this SmartSet or 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.

Returns
The original name of the object object, or 0 if the object cannot be found or has no name.
virtual const char* IlvSmartSet::getNamesSeparator ( ) const
virtual

Gets the string used to name the objects.

Returns
The string used to build the names of the objects when stored in this SmartSet. The default implementation returns "#".
virtual IlvGraphic* IlvSmartSet::getObject ( const char *  ) const
virtual

Gets an object by name.

Returns
A pointer to the object that has the original name name, or 0 if it cannot be found.
IlvGraphic* const* IlvSmartSet::getObjects ( IlUInt count) const

Gets all the objects.

Returns
An array of graphic object stored in this SmartSet. The number of objects is returned in count. This array must not be modified nor deleted. Other Rogue Wave Views functions can overwrite this array so the caller of this method should consider copying it.
IlBoolean IlvSmartSet::hasObject ( IlvGraphic object) const

Checks if an object is present.

Returns
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 SmartSet, to a copy of the string name. If name is 0, the name of the object is removed.

virtual void IlvSmartSet::write ( IlvOutputFile file) const
virtual

Writes this smart set to a stream.

Writes in the output file file a description of this SmartSet.


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