rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Maps Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

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 count of attributes, names, and types. More...
 
IlUInt getAttributeCount () const
 Returns the number of attributes. More...
 
IlInt getAttributeIndex (const char *name, IlvMapsError *error=0) const
 Returns the index of the attribute name. More...
 
void getAttributeInfos (IlUInt index, const char *&name, const IlvValueTypeClass *&type, IlBoolean &nullable) const
 Returns the information about the attribute of index index. 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
 Returns IlTrue if the instance is locked by at least one other object. More...
 
IlBoolean isNullable (IlUInt index) const
 Returns IlTrue if the attribute of index index is nullable. More...
 
void lock ()
 Locks the instance of IlvMapAttributeInfo. More...
 
void unLock ()
 Unlocks the instance of IlvMapAttributeInfo. More...
 

Friends

class IlvMapAttributeProperty
 

Detailed Description

Store the names and types of map attributes.

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. Library: ilvmaps

See Also
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 count of attributes, names, and types.

The arrays: names, types, and nullables, are copied by the constructor.

  • count is the number of attributes that will be attached to the graphic objects.
  • names is an array containing the names of the attributes.
  • types is an array containing the types of the attributes (see IlvProjectionInterface for a description of IlvValueTypeClass).
  • nullable is an optional argument. If it is passed, it should be an array of Boolean value taking the IlTrue value for nullable attributes, that is to say, attributes that do not have a value for all the graphic objects sharing this attribute information.
Warning
The destructor of this class is protected. To manage destruction of instances of IlvMapAttributeInfo, use the lock and unLock member functions.

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 the attribute name.

If there is no attribute of the specified name, the function returns -1.

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.
void IlvMapAttributeInfo::getAttributeInfos ( IlUInt  index,
const char *&  name,
const IlvValueTypeClass *&  type,
IlBoolean nullable 
) const

Returns the information about the attribute of index index.

Namely, its name, type, and whether it can have a null value.

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.

The function returns a null pointer if index is not the index of an attribute.

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

Returns IlTrue if the instance is locked by at least one other object.

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

Returns IlTrue if the attribute of index index is nullable.

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

Locks the instance of IlvMapAttributeInfo.

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

void IlvMapAttributeInfo::unLock ( )

Unlocks the instance of IlvMapAttributeInfo.

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


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