Views
Maps Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
IlvAttributeArray Class Reference

This feature attribute is itself an array of feature attributes. More...

#include <ilviews/maps/attribute/attrarray.h>

Inheritance diagram for IlvAttributeArray:
IlvFeatureAttribute

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 IlvFeatureAttributecopy () const
 Returns a copy of the object. More...
 
IlvFeatureAttributegetAttribute (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...
 
IlvFeatureAttributesetAttribute (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...
 
IlvFeatureAttributeunsafeSetAttribute (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 IlvFeatureAttributeLoad (IlvInputFile &file)
 Loads an attribute from an IlvInputFile. More...
 

Additional Inherited Members

- Protected Member Functions inherited from IlvFeatureAttribute
 IlvFeatureAttribute ()
 Constructor. More...
 

Detailed Description

This feature attribute is itself an array of feature attributes.

Library: ilvmaps

Constructor & Destructor Documentation

◆ IlvAttributeArray() [1/2]

IlvAttributeArray::IlvAttributeArray ( IlInt  size)

Initializes a new IlvAttributeArray instance.

Parameters
sizeThe size of the array.

◆ IlvAttributeArray() [2/2]

IlvAttributeArray::IlvAttributeArray ( const IlvAttributeArray source)

Initializes a new IlvAttributeArray instance as a copy of another one.

Attributes are copied as well.

Parameters
sourceThe object to be copied.

Member Function Documentation

◆ copy()

virtual IlvFeatureAttribute* IlvAttributeArray::copy ( ) const
virtual

Returns a copy of the object.

Returns
A copy of the object.

Implements IlvFeatureAttribute.

◆ getAttribute()

IlvFeatureAttribute* IlvAttributeArray::getAttribute ( IlInt  index) const

Returns the attribute of the specified index.

Parameters
indexThe index.
Returns
The attribute of the specified index or 0 if the index is out of range.

◆ getCommonClass()

const IlvMapClassInfo* IlvAttributeArray::getCommonClass ( ) const

Returns the common class of element stored in this array.

Returns
The class of this array.

◆ getSize()

IlInt IlvAttributeArray::getSize ( ) const

Returns the number of elements of this array.

Returns
The number of elements of this array.

◆ IndexError()

static IlvMapsError IlvAttributeArray::IndexError ( )
static

Returns the error code for index errors.

Returns
The error code.

◆ setAttribute()

IlvFeatureAttribute* IlvAttributeArray::setAttribute ( IlInt  index,
IlvFeatureAttribute attribute,
IlvMapsError &  status 
)

Sets the attribute of the specified index.

The attribute is owned by the array.

Parameters
indexThe index.
attributeThe attribute to be set. A null value can be set.
statusThe function puts the status of the operation in this parameter. IlvMaps::NoError() if the operation succeeds, or an error code.
Returns
The value of the previous attribute, which is then no more owned by the attribute.
See also
setCommonClass().

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

Parameters
commonClassThe common class.
Returns
The status of the operation : IlvMaps::NoError() if the operation succeeds, or IlvMaps::ClassError() if the array contains attributes that are not assignable to the specified class.

◆ setSize()

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.

Parameters
newSizeThe new size of this array.

◆ unsafeSetAttribute()

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.

Parameters
indexThe index of the attribute to be set.
attributeThe value to which the specified attribute will be set.
Returns
The value of the previous attribute.