55#ifndef DOXYGEN_SHOULD_SKIP_THIS
65 GUM_CONS_CPY(DBTranslator4LabelizedVariable);
69 INLINE DBTranslator4LabelizedVariable::DBTranslator4LabelizedVariable(
70 DBTranslator4LabelizedVariable&& from) :
71 DBTranslator(
std::move(from)), _variable_(
std::move(from._variable_)) {
72 GUM_CONS_MOV(DBTranslator4LabelizedVariable);
76 INLINE DBTranslator4LabelizedVariable::~DBTranslator4LabelizedVariable() {
77 GUM_DESTRUCTOR(DBTranslator4LabelizedVariable);
81 INLINE std::string DBTranslator4LabelizedVariable::translateBack(
82 const DBTranslatedValue translated_val)
const {
84 return this->back_dico_.second(translated_val.discr_val);
85 }
catch (Exception
const&) {
87 if ((translated_val.discr_val == std::numeric_limits< std::size_t >::max())
88 && !this->missing_symbols_.empty())
89 return *(this->missing_symbols_.begin());
92 "The back translation of \"" << translated_val.discr_val
93 <<
"\" could not be found");
98 INLINE std::size_t DBTranslator4LabelizedVariable::domainSize()
const {
99 return _variable_.domainSize();
103 INLINE
const LabelizedVariable* DBTranslator4LabelizedVariable::variable()
const {
108 INLINE DBTranslatedValue DBTranslator4LabelizedVariable::missingValue()
const {
109 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