rwlogo

Rogue Wave Views
Maps Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
List of all members | Public Member Functions | Friends
IlvMapAttributeInfo Class Reference

Store the names and types of map attributes. More...

#include <ilviews/maps/attrinfo.h>

Public Member Functions

 IlvMapAttributeInfo (IlUInt count, const char **names, const IlvValueTypeClass **types, const IlBoolean *nullables=0, IlBoolean owned=IlFalse)
 Initializes an instance of IlvMapAttributeInfo with the specified attributes. More...
 
IlUInt getAttributeCount () const
 Returns the number of attributes. More...
 
IlInt getAttributeIndex (const char *name, IlvMapsError *error=0) const
 Returns the index of a given attribute. More...
 
void getAttributeInfos (IlUInt index, const char *&name, const IlvValueTypeClass *&type, IlBoolean &nullable) const
 Returns the information about an attribute. More...
 
const char * getAttributeName (IlUInt index) const
 Returns the name of the attribute of index index. More...
 
const IlvValueTypeClassgetAttributeType (IlUInt index) const
 Returns the type of the attribute of index index. More...
 
IlBoolean isLocked () const
 Tests if this instance is locked by at least one other object. More...
 
IlBoolean isNullable (IlUInt index) const
 Tests if an attribute is nullable. More...
 
void lock ()
 Locks this instance. More...
 
void unLock ()
 Unlocks this instance. More...
 

Friends

class IlvMapAttributeProperty
 

Detailed Description

Store the names and types of map attributes.

Library: ilvmaps

This class is used in conjunction with the IlvMapAttributeProperty class to associate additional attributes with graphic objects. Using this class, for example, an application can associate a number of attributes with a polyline representing a road segment: the ID of the road, the state of the road segment (open, closed, road works...), the speed limit, and so on.
The attribute values (stored by an instance of IlvMapAttributeProperty) and the attribute descriptions (stored by an instance of IlvMapAttributeInfo) are automatically saved to an .ilv file when they are attached to a graphic object because the IlvMapAttributeProperty class extends the IlvNamedProperty class.
Instances of the IlvMapAttributeInfo class can be shared by several instances of IlvMapAttributeProperty.

Constructor & Destructor Documentation

IlvMapAttributeInfo::IlvMapAttributeInfo ( IlUInt  count,
const char **  names,
const IlvValueTypeClass **  types,
const IlBoolean nullables = 0,
IlBoolean  owned = IlFalse 
)

Initializes an instance of IlvMapAttributeInfo with the specified attributes.

Warning
The destructor of this class is protected. To manage destruction of instances of IlvMapAttributeInfo, use the lock() and unLock() member functions.
Parameters
countis the number of attributes that will be attached to the graphic objects.
namesis an array containing the names of the attributes. This array is copied.
typesis an array containing the types of the attributes (see IlvProjectionInterface for a description of IlvValueTypeClass). This array is copied.
nullablescan be set to an array of Boolean value taking the value IlTrue for nullable attributes, that is to say, attributes that do not have a value for all the graphic objects sharing this attribute information. This array is copied.
ownedIf set to IlTrue, this object is not maintained by the lock()/unLock() mechanism: you are responsible for managing its life cycle.

Member Function Documentation

IlUInt IlvMapAttributeInfo::getAttributeCount ( ) const

Returns the number of attributes.

Returns
The number of attributes.
IlInt IlvMapAttributeInfo::getAttributeIndex ( const char *  name,
IlvMapsError *  error = 0 
) const

Returns the index of a given attribute.

Parameters
nameThe name of the attribute to be retrieved.
errorAn error code set to IlvMapAttributeInfo::AttributeNotFoundError() if there is no attribute at index index.
Returns
The index of attribute name or -1 if an error occurs (if there is no attribute with such a name).
void IlvMapAttributeInfo::getAttributeInfos ( IlUInt  index,
const char *&  name,
const IlvValueTypeClass *&  type,
IlBoolean nullable 
) const

Returns the information about an attribute.

Parameters
indexThe index of the attribute.
nameThe returned name.
typeThe returned type.
nullableThe returned nullable property.
const char* IlvMapAttributeInfo::getAttributeName ( IlUInt  index) const

Returns the name of the attribute of index index.

Parameters
indexThe index of the attribute to be retrieved.
Returns
The retrieved attribute or a null pointer if index is not the index of an attribute.
const IlvValueTypeClass* IlvMapAttributeInfo::getAttributeType ( IlUInt  index) const

Returns the type of the attribute of index index.

Returns
The type of the attribute.
IlBoolean IlvMapAttributeInfo::isLocked ( ) const

Tests if this instance is locked by at least one other object.

Returns
IlTrue if the instance is locked, IlFalse otherwise,
IlBoolean IlvMapAttributeInfo::isNullable ( IlUInt  index) const

Tests if an attribute is nullable.

Parameters
indexThe index of attribute to be checked.
Returns
IlTrue if the attribute is nullable, IlFalse otherwise.
void IlvMapAttributeInfo::lock ( )

Locks this instance.

Calling this function ensures that the instance will not be deleted before you call its unLock() method.

void IlvMapAttributeInfo::unLock ( )

Unlocks this instance.

If no lock remains set to the instance, then it is deleted.


© Copyright 2015, 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.