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 >, DataTypeConverterm_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

◆ DataConverterManager()

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

Constructor.

◆ ~DataConverterManager()

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

Destructor.

Member Function Documentation

◆ add()

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.

◆ clear()

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

Clear the container.

◆ get() [1/2]

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.

◆ get() [2/2]

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

◆ getInstance()

DataConverterManager & te::common::Singleton< DataConverterManager >::getInstance ( )
inlinestaticinherited

It returns a reference to the singleton instance.

Returns
A reference to the singleton instance.

Definition at line 126 of file Singleton.h.

Friends And Related Function Documentation

◆ te::common::Singleton< DataConverterManager >

Definition at line 53 of file DataConverterManager.h.

Member Data Documentation

◆ m_convMap

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.


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