te::dt::DataType Class Reference

It stores information about a data type. More...

#include <DataType.h>

Public Member Functions

 DataType ()
 Default constructor. More...
 
 DataType (const std::string &name, const std::string &description)
 Constructor. More...
 
const std::string & getDescription () const
 It returns the data type description. More...
 
int getId () const
 It returns the data type id. More...
 
const std::string & getName () const
 It returns the data type name. More...
 
bool operator< (const DataType &rhs) const
 It compares two data types by their ids. More...
 
 ~DataType ()
 Destructor. More...
 

Private Member Functions

 DataType (int id, const std::string &name, const std::string &description)
 Constructor. More...
 
void setId (int id)
 This method can be called only by DataTypeManager. More...
 

Private Attributes

std::string m_description
 Data type description. More...
 
int m_id
 Data type id assigned by TerraLib. More...
 
std::string m_name
 Data type name. More...
 

Friends

class DataTypeManager
 

Detailed Description

It stores information about a data type.

A singleton for managing all data types in the system.

TerraLib keeps information about all available data types in the system in a singleton called DataTypeManager. In this singleton you will find all supported data types.

Some of the data type codes are reserved for the built-in data types of TerraLib (they can be seen in defines).

See also
DataTypeManager, AbstractData

TerraLib keeps information about all available data types in this singleton. Here, you can find all supported data types.

Basic constraints for data types:

  • No two data types may have the same name
  • The id of a data type will be dynamically generated by the manager
  • Data type names must be in capital letters although it can contains numbers and other symbols
See also
DataType

Definition at line 55 of file DataType.h.

Constructor & Destructor Documentation

te::dt::DataType::DataType ( )
inline

Default constructor.

Definition at line 60 of file DataType.h.

te::dt::DataType::DataType ( const std::string &  name,
const std::string &  description 
)
inline

Constructor.

Parameters
nameThe data type name.
descriptionData type description.

Definition at line 128 of file DataType.h.

te::dt::DataType::~DataType ( )
inline

Destructor.

Definition at line 71 of file DataType.h.

te::dt::DataType::DataType ( int  id,
const std::string &  name,
const std::string &  description 
)
inlineprivate

Constructor.

Parameters
idThe data type id assigned by TerraLib.
nameThe data type name.
descriptionData type description.

Definition at line 148 of file DataType.h.

Member Function Documentation

const std::string& te::dt::DataType::getDescription ( ) const

It returns the data type description.

Returns
The data type description.
int te::dt::DataType::getId ( ) const
inline

It returns the data type id.

Returns
The data type id.

Definition at line 133 of file DataType.h.

References m_id.

Referenced by te::dt::DataTypeManager::IdComparer::operator()().

const std::string & te::dt::DataType::getName ( ) const
inline

It returns the data type name.

Returns
The data type name.

Definition at line 138 of file DataType.h.

References m_name.

Referenced by te::dt::DataTypeManager::NameComparer::operator()().

bool te::dt::DataType::operator< ( const DataType rhs) const
inline

It compares two data types by their ids.

Returns
True, if the id of this data type is less than the data type in the right-hand-side.

Definition at line 143 of file DataType.h.

References m_id.

void te::dt::DataType::setId ( int  id)
inlineprivate

This method can be called only by DataTypeManager.

Parameters
idThe type code.

Definition at line 153 of file DataType.h.

References m_id.

Friends And Related Function Documentation

friend class DataTypeManager
friend

Definition at line 125 of file DataType.h.

Member Data Documentation

std::string te::dt::DataType::m_description
private

Data type description.

Definition at line 123 of file DataType.h.

int te::dt::DataType::m_id
private

Data type id assigned by TerraLib.

Definition at line 121 of file DataType.h.

Referenced by getId(), operator<(), and setId().

std::string te::dt::DataType::m_name
private

Data type name.

Definition at line 122 of file DataType.h.

Referenced by getName().


The documentation for this class was generated from the following file: