25 #ifndef GUM_LEARNING_DB_HANDLER_H 26 #define GUM_LEARNING_DB_HANDLER_H 116 template <
typename T_DATA,
117 template <
typename >
class ALLOC = std::allocator >
134 template <
typename TX_DATA >
135 using DBVector = std::vector< TX_DATA, ALLOC< TX_DATA > >;
149 virtual std::size_t
size()
const = 0;
152 virtual std::size_t
DBSize()
const = 0;
189 virtual std::size_t
numRow()
const = 0;
195 virtual bool hasRows()
const = 0;
198 virtual void reset() = 0;
210 virtual void setRange(std::size_t begin, std::size_t end) = 0;
217 virtual std::pair< std::size_t, std::size_t >
range()
const = 0;
228 #ifndef DOXYGEN_SHOULD_SKIP_THIS 232 static constexpr
int _cache_size{128};
235 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.
gum is the global namespace for all aGrUM entities
std::vector< TX_DATA, ALLOC< TX_DATA > > DBVector
the type for the allocated vectors in IDatabases
The class representing a record stored in a tabular database.
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)