Rogue Wave Views Charts Package API Reference Guide |
Rogue Wave Views Documentation Home |
Abstract base class for managing all the data displayed within a chart. More...
#include <ilviews/charts/data.h>
Public Member Functions | |
virtual | ~IlvAbstractChartData () |
Destructor. More... | |
virtual IlBoolean | addDataSet (IlvChartDataSet *dataSet, IlBoolean copy=IlFalse)=0 |
Adds a managed data set. More... | |
void | addListener (IlvChartDataListener *lst) |
Adds a listener. More... | |
virtual IlvAbstractChartData * | copy () const =0 |
Creates and returns a copy of the current object. More... | |
virtual void | dataAllPointsRemoved (const IlvChartDataSet *ds) const |
Performs the updates needed when a data point is removed. More... | |
virtual void | dataPointAdded (const IlvChartDataSet *dataSet, IlUInt position) const |
Performs the updates needed when a data point is added. More... | |
virtual void | dataPointChanged (const IlvChartDataSet *dataSet, IlUInt ptidx, IlBoolean beforeChange) const |
Performs the updates needed when a data point is changed. More... | |
virtual void | dataPointRemoved (const IlvChartDataSet *dataSet, IlUInt ptidx) const |
Performs the updates needed when a data point is removed. More... | |
virtual void | dataSetAdded (IlvChartDataSet *dataSet, IlUInt position) |
Performs the updates needed when a data set is added. More... | |
virtual void | dataSetChanged (IlvChartDataSet *oldSet, IlvChartDataSet *newSet) |
Performs the updates needed when a data set is changed. More... | |
virtual void | dataSetRemoved (IlvChartDataSet *dataSet) |
Performs the necessary updates when a data set is removed. More... | |
virtual void | endBatch (const IlvChartDataSet *dataSet) const |
Specifies the end of a set of modifications on a data set. More... | |
virtual IlvChartDataSet * | getDataSet (IlUInt index) const =0 |
Gets a managed data set by its index. More... | |
IlvChartDataSet * | getDataSetByName (const char *name) const |
Gets a managed data set by its name. More... | |
IlUInt | getDataSetIndex (const IlvChartDataSet *dataSet) const |
Returns the index of a managed data set. More... | |
virtual IlvChartDataSet *const * | getDataSets (IlUInt &nbDataSets) const |
Returns all the managed data sets. More... | |
virtual IlUInt | getDataSetsCount () const =0 |
Returns the number of managed data sets. More... | |
IlvChartDataListener *const * | getListeners (IlUInt &count) const |
Returns all the listeners. More... | |
virtual IlBoolean | insertDataSet (IlvChartDataSet *dataSet, IlUInt index=IlvLastPositionIndex, IlBoolean copy=IlFalse)=0 |
Inserts a managed data set. More... | |
virtual IlBoolean | isLimited () const |
Indicates whether the number of managed data sets is limited. More... | |
virtual IlBoolean | isRemovalAllowed () const |
Indicates whether the managed data sets can be removed. More... | |
virtual IlBoolean | isWritable () const |
Indicates whether the managed data sets can be modified. More... | |
void | lock () |
Locks the current IlvAbstractChartData object. More... | |
IlvChartDataSet * | operator[] (IlUInt index) |
Gets a managed data set by its index. More... | |
const IlvChartDataSet * | operator[] (IlUInt index) const |
Gets a managed data set by its index. More... | |
virtual IlBoolean | removeDataSet (IlUInt dataSetIndex)=0 |
Removes a managed data set. More... | |
virtual void | removeDataSets ()=0 |
Removes all the managed data sets. More... | |
IlvChartDataListener * | removeListener (IlvChartDataListener *lst) |
Removes a listener. More... | |
void | removeListeners () |
Removes all the listeners. | |
IlBoolean | replaceDataSet (IlvChartDataSet *oldDataSet, IlvChartDataSet *newDataSet) |
Replaces a managed data set by another one. More... | |
IlvOutputFile & | save (IlvOutputFile &file) const |
Writes a complete description of the current object in a file. More... | |
virtual IlBoolean | setDataSet (IlUInt dataSetIndex, IlvChartDataSet *dataSet, IlBoolean copy=IlFalse)=0 |
Sets a managed data set. More... | |
virtual IlBoolean | setDataSets (IlUInt &count, IlvChartDataSet *const *dataSets, IlBoolean copy=IlFalse)=0 |
Sets the managed data sets. More... | |
virtual void | startBatch (const IlvChartDataSet *dataSet) const |
Specifies the beginning of a set of modifications on a data set. More... | |
void | unLock () |
Unlocks the current IlvAbstractChartData object. More... | |
virtual void | write (IlvOutputFile &file) const =0 |
Writes the attributes of the current object in a file. More... | |
Static Public Member Functions | |
static IlvAbstractChartData * | Load (IlvInputFile &file) |
Reads a chart data object from a file. More... | |
Protected Member Functions | |
IlvAbstractChartData () | |
Initializes a new IlvAbstractChartData object. | |
IlvAbstractChartData (const IlvAbstractChartData &cData) | |
Initializes a new IlvAbstractChartData object as a copy of another IlvAbstractChartData . More... | |
IlvAbstractChartData (IlvInputFile &file) | |
Initializes a new IlvAbstractChartData object from an input file. More... | |
Abstract base class for managing all the data displayed within a chart.
Library: ilvcharts
This abstract class manages all the data that are displayed within a chart.
These data are divided into data sets. Each data set can be displayed with a given type of representation (for example, markers or polylines).
A data set is represented by an IlvChartDataSet
object and so the IlvAbstractChartData
class manages a set of IlvChartDataSet
objects.
A lock/unlock system is provided to share an object managing the data among different charts. The lock/unlock system ensures that the object will not be deleted as long as an object needs it. (See the methods IlvAbstractChartData::lock()
and IlvAbstractChartData::unLock()
methods for more details.)
In order to propagate all modifications that are made to an IlvAbstractChartData
object (or one of its derived objects) to all the objects that use it (which is the case for all the chart graphics that use it to manage the data sets they display), listeners are set on the IlvAbstractChartData
object.
These listeners are automatically set when a derived object of IlvAbstractChartData
is set on a chart graphic as the object used to manage the data it displays.
IlvAbstractChartData
is an abstract class. Its constructors are defined as protected because it is not possible to create an instance of this class directly.
|
virtual |
Destructor.
The destructor removes the listeners that have been added to the current object.
|
protected |
Initializes a new IlvAbstractChartData
object as a copy of another IlvAbstractChartData
.
cData | The object used to initialize the new one. |
|
protected |
Initializes a new IlvAbstractChartData
object from an input file.
file | The file that is read to initialize the new chart data object. |
|
pure virtual |
Adds a managed data set.
dataSet | The data set to add to the current object. |
copy | Indicates whether the data set passed as a parameter must be copied. If copy is IlTrue , the data set is copied. Otherwise, a pointer to the data set stored in dataSet is kept. Therefore, its contents should not be deleted. |
IlTrue
if the data set has been successfully added or IlFalse
otherwise.Implemented in IlvMemoryChartData, and IlvXMLChartData.
void IlvAbstractChartData::addListener | ( | IlvChartDataListener * | lst | ) |
Adds a listener.
lst | The new listener that is added to the current object. |
|
pure virtual |
Creates and returns a copy of the current object.
This method must be overloaded in subclasses. It is automatically declared by the DeclareChartDataTypeInfo
macro. The IlvPredefinedChartDataIOMembers
macro lets you define a default implementation, which returns an instance initialized with the copy constructor.
Implemented in IlvXMLChartData.
|
virtual |
Performs the updates needed when a data point is removed.
The modification is propagated to the listeners by calling the IlvChartDataListener::dataPointRemoved()
method for each listener defined for the current object.
ds | The data set of the current object from which a data point is removed. |
|
virtual |
Performs the updates needed when a data point is added.
The modification is propagated to the listeners by calling the IlvChartDataListener::dataPointAdded()
method for each listener defined for the current object.
dataSet | The data set of the current object to which a data point is added. |
position | The index at which the data point is added in the data set dataSet. |
|
virtual |
Performs the updates needed when a data point is changed.
The modification is propagated to the listeners by calling the IlvChartDataListener::dataPointChanged()
method for each listener defined for the current object.
dataSet | The data set of the current object in which a data point is changed. |
ptidx | The index at which the data point is changed in the data set dataSet. |
beforeChange | indicates whether the method is called before the data point is changed or after it has been changed. |
|
virtual |
Performs the updates needed when a data point is removed.
The modification is propagated to the listeners by calling the IlvChartDataListener::dataPointRemoved()
method for each listener defined for the current object.
dataSet | The data set of the current object from which a data point is removed. |
ptidx | The index of the data point that is removed from the data set dataSet. |
|
virtual |
Performs the updates needed when a data set is added.
The modification is propagated to the listeners by calling the IlvChartDataListener::dataSetAdded()
method for each listener defined for the current object.
dataSet | The data set that is added to the current object. |
position | The index at which the data set is added to the current object. |
|
virtual |
Performs the updates needed when a data set is changed.
The modification is propagated to the listeners by calling the IlvChartDataListener::dataSetChanged()
method for each listener defined for the current object.
oldSet | The old data set before the change in the current object. |
newSet | The new data set that replaces the old data set oldSet in the current object. |
|
virtual |
Performs the necessary updates when a data set is removed.
The modification is propagated to the listeners by calling the IlvChartDataListener::dataSetRemoved()
method for each listener defined for the current object.
dataSet | The data set that is removed from the current object. |
|
virtual |
Specifies the end of a set of modifications on a data set.
The purpose of this method is to notify all the subscribed listeners that a set of modifications has occurred on the data set dataSet.
dataSet | The data set that is modified. |
|
pure virtual |
Gets a managed data set by its index.
index | The index of the returned data set in the current object. |
0
otherwise.Implemented in IlvMemoryChartData, and IlvXMLChartData.
IlvChartDataSet* IlvAbstractChartData::getDataSetByName | ( | const char * | name | ) | const |
Gets a managed data set by its name.
name | The name of the returned data set in the current object. |
0
otherwise.IlUInt IlvAbstractChartData::getDataSetIndex | ( | const IlvChartDataSet * | dataSet | ) | const |
Returns the index of a managed data set.
dataSet | The data set for which we want to get the index. |
IlvBadIndex
.
|
virtual |
Returns all the managed data sets.
nbDataSets | The number of data sets managed by the current object. |
IlPoolOf(Pointer)
and should not be deleted or modified. Reimplemented in IlvXMLChartData.
|
pure virtual |
Returns the number of managed data sets.
Implemented in IlvMemoryChartData, and IlvXMLChartData.
IlvChartDataListener* const* IlvAbstractChartData::getListeners | ( | IlUInt & | count | ) | const |
Returns all the listeners.
count | The number of listeners defined for the current object. |
|
pure virtual |
Inserts a managed data set.
dataSet | The data set to insert in the current object. |
index | The index at which the data set dataSet must be inserted in the current object. |
copy | Indicates whether the data set passed as a parameter must be copied. If copy is IlTrue , the data set is copied. Otherwise, a pointer to the data set stored in dataSet is kept. Therefore, its contents should not be deleted. |
IlTrue
if the data set has been successfully inserted or IlFalse
otherwise.Implemented in IlvMemoryChartData, and IlvXMLChartData.
|
virtual |
Indicates whether the number of managed data sets is limited.
Returns a value that indicates whether the number of data sets that can be managed by the object is limited.
IlFalse
by default. Reimplemented in IlvMemoryChartData, and IlvXMLChartData.
|
virtual |
Indicates whether the managed data sets can be removed.
Returns a value that indicates whether the data can be removed.
IlTrue
by default.Reimplemented in IlvXMLChartData.
|
virtual |
Indicates whether the managed data sets can be modified.
Returns a value that indicates whether the existing data can be modified or whether new data sets can be created.
IlTrue
by default.Reimplemented in IlvXMLChartData.
|
static |
Reads a chart data object from a file.
Creates a chart data instance from the description stored in the file file. The object description must have been written with the IlvAbstractChartData::save()
method.
file | The file where the object description is stored. |
void IlvAbstractChartData::lock | ( | ) |
Locks the current IlvAbstractChartData
object.
Ensures that the IlvAbstractChartData
will not be destroyed before it is unlocked.
This method increments a reference count initially set to 0
. When you keep a pointer to an IlvAbstractChartData
object (because you store it in the field of an object or it is in a variable), you should lock it for the duration of its use so that it is not destroyed by some other object or component. When you do not need the IlvAbstractChartData
any more, you should release it with a call to unLock()
; if the lock you just removed was the last one, Rogue Wave Views will free the IlvAbstractChartData
.
IlvChartDataSet* IlvAbstractChartData::operator[] | ( | IlUInt | index | ) |
Gets a managed data set by its index.
index | The index of the returned data set in the current object. |
0
otherwise.const IlvChartDataSet* IlvAbstractChartData::operator[] | ( | IlUInt | index | ) | const |
Gets a managed data set by its index.
index | The index of the returned data set in the current object. |
0
otherwise. Removes a managed data set.
dataSetIndex | The index at which the data set must be removed from the current object. |
IlTrue
if the data set has been removed or IlFalse
otherwise.IlvChartDataSet::unLock()
method is called). It will be deleted only when no objects reference it. Implemented in IlvMemoryChartData, and IlvXMLChartData.
|
pure virtual |
Removes all the managed data sets.
IlvChartDataSet::unLock()
method is called). It will be deleted only when no objects reference it. Implemented in IlvMemoryChartData, and IlvXMLChartData.
IlvChartDataListener* IlvAbstractChartData::removeListener | ( | IlvChartDataListener * | lst | ) |
Removes a listener.
lst | The listener that is removed from the current object. |
0
otherwise.IlBoolean IlvAbstractChartData::replaceDataSet | ( | IlvChartDataSet * | oldDataSet, |
IlvChartDataSet * | newDataSet | ||
) |
Replaces a managed data set by another one.
oldDataSet | The old data set that must be replaced in the current object. |
newDataSet | The new data set that replaces the old data set oldDataSet in the current object. |
IlTrue
if the data set replacement has been successfully performed and IlFalse
otherwise. IlvOutputFile& IlvAbstractChartData::save | ( | IlvOutputFile & | file | ) | const |
Writes a complete description of the current object in a file.
Writes the complete object description in a file. This description contains all the information necessary to read back this object with the IlvAbstractChartData::Load()
member function. This method first writes information regarding the type of the object and calls the IlvAbstractChartData::write()
method.
file | The file where the complete object description is written. |
|
pure virtual |
Sets a managed data set.
If a data set already exists at the index dataSetIndex, the data set is replaced by the new one. Otherwise, the new one is added at the end.
dataSetIndex | The index at which the data set dataSet must be set in the current object. |
dataSet | The data set to set in the current object. |
copy | Indicates whether the data set passed as a parameter must be copied. If copy is IlTrue , the data set is copied. Otherwise, a pointer to the data set stored in dataSet is kept. Therefore, its contents should not be deleted. |
IlTrue
if the data set has been successfully set or IlFalse
otherwise.Implemented in IlvMemoryChartData, and IlvXMLChartData.
|
pure virtual |
Sets the managed data sets.
count | This parameter first contains the number of data sets in the array dataSets. It is eventually modified to contain the number of data sets that have actually been set, if not all the data sets have been set in the current object. |
dataSets | An array of the data sets to set in the current object. |
copy | Indicates whether the data sets passed as parameters must be copied. If copy is IlTrue , the data sets are copied. Otherwise, the data sets that are stored in the array dataSets are kept. Therefore, the contents of the array should not be deleted. |
IlTrue
if data sets have been set. If not all the data sets could be set, the parameter count is modified to indicate the number of data sets that have been successfully set.Implemented in IlvMemoryChartData, and IlvXMLChartData.
|
virtual |
Specifies the beginning of a set of modifications on a data set.
The purpose of this method is to notify all the subscribed listeners that a set of modifications is under way on the data set dataSet.
dataSet | The data set that is modified. |
void IlvAbstractChartData::unLock | ( | ) |
Unlocks the current IlvAbstractChartData
object.
Decrements the reference count of this object and deletes it when the count becomes 0
.
|
pure virtual |
Writes the attributes of the current object in a file.
Called by the IlvAbstractChartData::save()
method. This method can be overloaded in subclasses that define new attributes. The information written by the write()
method is read by the IO constructor, which takes an IlvInputFile
as its only argument. Both this method and the IO constructor can be automatically declared by using the DeclareChartDataTypeInfo
macro within the class declaration.
file | The file where the attributes of the current object are written. |
Implemented in IlvXMLChartData.
© Copyright 2018, 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.