56#ifndef DOXYGEN_SHOULD_SKIP_THIS
66 GUM_CONS_CPY(DBTranslator4LabelizedVariable);
70 INLINE DBTranslator4LabelizedVariable::DBTranslator4LabelizedVariable(
71 DBTranslator4LabelizedVariable&& from) :
72 DBTranslator(
std::move(from)), _variable_(
std::move(from._variable_)) {
73 GUM_CONS_MOV(DBTranslator4LabelizedVariable);
77 INLINE DBTranslator4LabelizedVariable::~DBTranslator4LabelizedVariable() {
78 GUM_DESTRUCTOR(DBTranslator4LabelizedVariable);
82 INLINE std::string DBTranslator4LabelizedVariable::translateBack(
83 const DBTranslatedValue translated_val)
const {
85 return this->back_dico_.second(translated_val.discr_val);
86 }
catch (Exception
const&) {
88 if ((translated_val.discr_val == std::numeric_limits< std::size_t >::max())
89 && !this->missing_symbols_.empty())
91 return *(this->missing_symbols_.begin());
94 "The back translation of \"" << translated_val.discr_val
95 <<
"\" could not be found");
100 INLINE std::size_t DBTranslator4LabelizedVariable::domainSize()
const {
101 return _variable_.domainSize();
105 INLINE
const LabelizedVariable* DBTranslator4LabelizedVariable::variable()
const {
110 INLINE DBTranslatedValue DBTranslator4LabelizedVariable::missingValue()
const {
111 return DBTranslatedValue{std::numeric_limits< std::size_t >::max()};
The class representing the original values of the cells of databases.
The databases' cell translators for labelized variables.
Error: An unknown label is found in the database.
The databases' cell translators for labelized variables.
DBTranslator4LabelizedVariable(const std::vector< std::string > &missing_symbols, std::size_t max_dico_entries=std::numeric_limits< std::size_t >::max())
default constructor without any initial variable
The base class for all the tabular database cell translators.
#define GUM_ERROR(type, msg)
include the inlined functions if necessary
gum is the global namespace for all aGrUM entities