28 #ifndef GUM_LEARNING_DB_HANDLER_H 29 #define GUM_LEARNING_DB_HANDLER_H 119 template <
typename T_DATA,
120 template <
typename >
class ALLOC = std::allocator >
137 template <
typename TX_DATA >
138 using DBVector = std::vector< TX_DATA, ALLOC< TX_DATA > >;
152 virtual std::size_t
size()
const = 0;
155 virtual std::size_t
DBSize()
const = 0;
192 virtual std::size_t
numRow()
const = 0;
198 virtual bool hasRows()
const = 0;
201 virtual void reset() = 0;
213 virtual void setRange(std::size_t begin, std::size_t end) = 0;
220 virtual std::pair< std::size_t, std::size_t >
range()
const = 0;
231 #ifndef DOXYGEN_SHOULD_SKIP_THIS 235 static constexpr
int _cache_size{128};
238 char _align[_cache_size];
virtual void setRange(std::size_t begin, std::size_t end)=0
sets the range of rows in the database that the handler will parse
std::ptrdiff_t difference_type
Types for STL compliance.
virtual std::size_t nbVariables() const =0
returns the number of variables (columns) of the database
std::size_t size_type
Types for STL compliance.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
std::vector< TX_DATA, ALLOC< TX_DATA > > DBVector
the type for the allocated vectors in IDatabases
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual void nextRow()=0
go to the next row in the database
The base class for all database handlers.
virtual std::size_t size() const =0
returns the number of rows managed by the handler
std::random_access_iterator_tag iterator_category
Types for STL compliance.
virtual bool hasRows() const =0
indicates wether there are still rows to parse in the database
virtual const DBVector< std::string > & variableNames() const =0
returns the names of the variables corresponding to the rows
virtual const_reference rowSafe() const =0
returns the current row of the database (safe version)
The class for storing a record in a database.
virtual void reset()=0
puts the handler to the beginning of the database area it handles
virtual std::size_t numRow() const =0
number of row the handler points to (from the beginning of the area)
virtual std::size_t DBSize() const =0
the number of rows in the whole database
ALLOC< void > allocator_type
Types for STL compliance.
virtual std::pair< std::size_t, std::size_t > range() const =0
returns the current range of rows of the handler
virtual const_reference row() const =0
returns the current row pointed to by the handler (unsafe version)