This feature attribute is itself an array of feature attributes. More...
#include <ilviews/maps/attribute/attrarray.h>
Public Member Functions | |
IlvAttributeArray (const IlvAttributeArray &source) | |
Initializes a new IlvAttributeArray instance as a copy of another one. More... | |
IlvAttributeArray (IlInt size) | |
Initializes a new IlvAttributeArray instance. More... | |
virtual IlvFeatureAttribute * | copy () const |
Returns a copy of the object. More... | |
IlvFeatureAttribute * | getAttribute (IlInt index) const |
Returns the attribute of the specified index. More... | |
const IlvMapClassInfo * | getCommonClass () const |
Returns the common class of element stored in this array. More... | |
IlInt | getSize () const |
Returns the number of elements of this array. More... | |
IlvFeatureAttribute * | setAttribute (IlInt index, IlvFeatureAttribute *attribute, IlvMapsError &status) |
Sets the attribute of the specified index. More... | |
IlvMapsError | setCommonClass (const IlvMapClassInfo *commonClass) |
Sets the common class for the attributes of this attribute array. More... | |
void | setSize (IlInt newSize) |
Sets the size of this array. More... | |
IlvFeatureAttribute * | unsafeSetAttribute (IlInt index, IlvFeatureAttribute *attribute) |
Sets the value of the attribute specified by the index index to attribute, without checking. More... | |
Public Member Functions inherited from IlvFeatureAttribute | |
void | save (IlvOutputFile &file) const |
Saves the object to an IlvOutputFile . More... | |
virtual void | write (IlvOutputFile &output) const =0 |
Writes the object to an IlvOutputFile object. More... | |
Static Public Member Functions | |
static IlvMapsError | IndexError () |
Returns the error code for index errors. More... | |
Static Public Member Functions inherited from IlvFeatureAttribute | |
static IlvFeatureAttribute * | Load (IlvInputFile &file) |
Loads an attribute from an IlvInputFile . More... | |
Additional Inherited Members | |
Protected Member Functions inherited from IlvFeatureAttribute | |
IlvFeatureAttribute () | |
Constructor. More... | |
This feature attribute is itself an array of feature attributes.
Library: ilvmaps
IlvAttributeArray::IlvAttributeArray | ( | IlInt | size | ) |
Initializes a new IlvAttributeArray
instance.
size | The size of the array. |
IlvAttributeArray::IlvAttributeArray | ( | const IlvAttributeArray & | source | ) |
Initializes a new IlvAttributeArray
instance as a copy of another one.
Attributes are copied as well.
source | The object to be copied. |
|
virtual |
IlvFeatureAttribute* IlvAttributeArray::getAttribute | ( | IlInt | index | ) | const |
Returns the attribute of the specified index.
index | The index. |
0
if the index is out of range. const IlvMapClassInfo* IlvAttributeArray::getCommonClass | ( | ) | const |
Returns the common class of element stored in this array.
IlInt IlvAttributeArray::getSize | ( | ) | const |
Returns the number of elements of this array.
|
static |
Returns the error code for index errors.
IlvFeatureAttribute* IlvAttributeArray::setAttribute | ( | IlInt | index, |
IlvFeatureAttribute * | attribute, | ||
IlvMapsError & | status | ||
) |
Sets the attribute of the specified index.
The attribute is owned by the array.
index | The index. |
attribute | The attribute to be set. A null value can be set. |
status | The function puts the status of the operation in this parameter. IlvMaps::NoError() if the operation succeeds, or an error code. |
setCommonClass()
. IlvMapsError IlvAttributeArray::setCommonClass | ( | const IlvMapClassInfo * | commonClass | ) |
Sets the common class for the attributes of this attribute array.
By default, the common class is IlvFeatureAttribute
, intended for any type of data. Providing that a precise common class determines for the application the type of the attribute array.
commonClass | The common class. |
IlvMaps::NoError()
if the operation succeeds, or IlvMaps::ClassError()
if the array contains attributes that are not assignable to the specified class. void IlvAttributeArray::setSize | ( | IlInt | newSize | ) |
Sets the size of this array.
If the new size is greater than the current size, new null
items are added to the end of the array. If the new size is less than the current size, all components at index newSize and greater are deleted.
newSize | The new size of this array. |
IlvFeatureAttribute* IlvAttributeArray::unsafeSetAttribute | ( | IlInt | index, |
IlvFeatureAttribute * | attribute | ||
) |
Sets the value of the attribute specified by the index index to attribute, without checking.
This method must be used with care. If the class of the attribute can not be assigned to the common class of this array, the class will be left in an inconsistent status.
index | The index of the attribute to be set. |
attribute | The value to which the specified attribute will be set. |