All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::dt::DataConverterManager Class Reference

A singleton for managing the data type converter available in the system. More...

#include <DataConverterManager.h>

Inheritance diagram for te::dt::DataConverterManager:
te::common::Singleton< DataConverterManager >

Public Member Functions

void add (int src, int dst, DataTypeConverter conv) throw (Exception)
 It adds a converter to the list of known data type mappings. More...
 
void clear ()
 Clear the container. More...
 
const DataTypeConverterget (int src, int dst) throw (Exception)
 It returns a data type converter for the given source and destination data types. More...
 
const DataTypeConverterget (const std::pair< int, int > &typeMap) throw (Exception)
 It returns a data type converter for the given source and destination data types. More...
 

Static Public Member Functions

static DataConverterManagergetInstance ()
 It returns a reference to the singleton instance. More...
 

Protected Member Functions

 DataConverterManager ()
 Constructor. More...
 
 ~DataConverterManager ()
 Destructor. More...
 

Private Attributes

std::map< std::pair< int, int >
, DataTypeConverter
m_convMap
 A map: (source-data-type, target-data-type) -> data type converter. More...
 

Friends

class te::common::Singleton< DataConverterManager >
 

Detailed Description

A singleton for managing the data type converter available in the system.

See also
DataTypeConverter

Definition at line 51 of file DataConverterManager.h.

Constructor & Destructor Documentation

te::dt::DataConverterManager::DataConverterManager ( )
protected

Constructor.

Definition at line 58 of file DataConverterManager.cpp.

te::dt::DataConverterManager::~DataConverterManager ( )
protected

Destructor.

Definition at line 62 of file DataConverterManager.cpp.

Member Function Documentation

void te::dt::DataConverterManager::add ( int  src,
int  dst,
DataTypeConverter  conv 
)
throw (Exception
)

It adds a converter to the list of known data type mappings.

Parameters
srcThe source data type of the converter.
dstThe destination data type of the converter.
convThe data type converter.
Exceptions
ExceptionIt throws an exception if a converter for the same source and destination data types already exists.

Definition at line 33 of file DataConverterManager.cpp.

References TE_TR.

Referenced by te::dt::Module::initialize().

void te::dt::DataConverterManager::clear ( )

Clear the container.

Definition at line 53 of file DataConverterManager.cpp.

References m_convMap.

Referenced by te::dt::Module::finalize().

const DataTypeConverter & te::dt::DataConverterManager::get ( int  src,
int  dst 
)
throw (Exception
)
inline

It returns a data type converter for the given source and destination data types.

Parameters
srcThe source data type of the converter.
dstThe destination data type of the converter.
Returns
A data type converter for the given source and destination data types. or NULL if none is found.
Exceptions
ExceptionIt throws an exception if none is found.

Definition at line 107 of file DataConverterManager.h.

const te::dt::DataTypeConverter & te::dt::DataConverterManager::get ( const std::pair< int, int > &  typeMap)
throw (Exception
)

It returns a data type converter for the given source and destination data types.

Parameters
typeMapThe type of converter: source-data-type -> destination-data-type.
Returns
A data type converter for the given map.
Exceptions
ExceptionIt throws an exception if none is found.

Definition at line 44 of file DataConverterManager.cpp.

References TE_TR.

static DataConverterManager & te::common::Singleton< DataConverterManager >::getInstance ( )
staticinherited

It returns a reference to the singleton instance.

Returns
A reference to the singleton instance.

Referenced by te::dt::Module::finalize(), te::da::GenericAttributeConverter(), te::gm::Module::initialize(), and te::dt::Module::initialize().

Friends And Related Function Documentation

Definition at line 53 of file DataConverterManager.h.

Member Data Documentation

std::map<std::pair<int, int>, DataTypeConverter> te::dt::DataConverterManager::m_convMap
private

A map: (source-data-type, target-data-type) -> data type converter.

Definition at line 104 of file DataConverterManager.h.

Referenced by clear().


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