47#ifndef GUM_LEARNING_DB_CELL_H
48#define GUM_LEARNING_DB_CELL_H
204 const
std::
string&
string() const;
235 static const
std::
string&
string(const
int index);
243 const
std::vector<
std::
string >& missingVals);
251 const
std::vector<
std::
string >& missingVals);
271#ifndef DOXYGEN_SHOULD_SKIP_THIS
286 using UnionType =
typename std::conditional<
sizeof(int) <
sizeof(float), float,
int >
::type;
289 std::string _typeErrorMsg_(
const std::string& real_type)
const;
296 static int _string_max_index_;
The inlined implementation of DBCells.
Set of pairs of elements with fast search for both elements.
Set of pairs of elements with fast search for both elements.
EltType type() const noexcept
returns the current type of the DBCell
void setString(const std::string &elt)
sets the content of the DBCell
static EltType bestType(const std::string &str, const std::vector< std::string > &missingVals)
returns the best type to store a given element encoded as a string
DBCell(const std::string &str)
constructor for a string
DBCell()
default constructor (ontains a missing value)
EltType
the set of types possibly taken by the last element read
DBCell & operator=(DBCell &&from)
move operator
static DBCell bestDBCell(const std::string &str, const std::vector< std::string > &missingVals)
returns the DBCell with the best type for an element encoded as a string
void setInteger(const int x)
sets the content of the DBCell
bool operator==(const DBCell &from) const
test of equality
int integer() const
returns the DBcell as an integer
bool isMissing() const
indicates whether the cell contains a missing value
static bool isInteger(const std::string &str)
determines whether a string corresponds precisely to an integer
DBCell & operator=(const int x)
assignment operator
DBCell(const float nb)
constructor for a real number
std::string toString(const std::vector< std::string > &missingVals) const
returns the content of the DBCell as a string, whatever its type
static bool isReal(const std::string &str)
determine whether a string corresponds precisely to a real number
float real() const
returns the DBcell as a real number
DBCell(const DBCell &from)
copy constructor
DBCell & operator=(const DBCell &from)
copy operator
void setMissingState()
sets the DBCell as a missing element
bool operator!=(const DBCell &from) const
test of inequality
int stringIndex() const
returns the DBcell as the index of a string in a static bijection
void setReal(const float x)
sets the content of the DBCell
bool convertType(const EltType newtype)
try to convert the content of the DBCell into another type
DBCell(const int nb)
constructor for an integer number
DBCell & operator=(const std::string &x)
assignment operator
DBCell(DBCell &&from)
move constructor
DBCell & operator=(const float x)
assignment operator
include the inlined functions if necessary
gum is the global namespace for all aGrUM entities