TTranslator< T > Class Template Reference

Generic string vs. attribute translator singleton. More...

#include <mia/core/attributes.hh>

Inheritance diagram for TTranslator< T >:
[legend]
Collaboration diagram for TTranslator< T >:
[legend]

Static Public Member Functions

static bool register_for (const std::string &key)
 

Additional Inherited Members

- Public Member Functions inherited from CAttrTranslator
PAttribute from_string (const std::string &value) const
 
virtual ~CAttrTranslator ()
 The virtual destructor just ensures virtual destruction and silences a warning. More...
 
- Protected Member Functions inherited from CAttrTranslator
 CAttrTranslator ()
 
bool do_register (const std::string &key)
 

Detailed Description

template<typename T>
class TTranslator< T >

Generic string vs. attribute translator singleton.

This class defines a generic translator between strings and a specific attribute type. All translaters are registered to a global map of type CStringAttrTranslatorMap that selects the conversion based on a key. The global map is implemented as a singleton can be accessed via CStringAttrTranslatorMap::instance()

Definition at line 509 of file attributes.hh.

Member Function Documentation

◆ register_for()

template<typename T>
static bool TTranslator< T >::register_for ( const std::string &  key)
static

Register this translator for attributed for the given key. The translator is handled as a singleton and is stateless. Any translator type can be registered multiple times but keys must be different if the target translation type is different.


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