b2api
B2000++ API Reference Manual, VERSION 4.6
 
Loading...
Searching...
No Matches
b2000::DataBase Class Reference

The object associated with the B2000++ database. More...

#include "b2database.H"

Inherited by b2000::DataBaseFieldSet.

Collaboration diagram for b2000::DataBase:

Classes

class  ArrayTableCol
 A column in an array table dataset. More...
 

Public Types

typedef std::set< SetNameSetNameSet
 A collection of dataset names.
 

Public Member Functions

void init (const std::string &name)
 Set the name of the MemCom database directory.
 
std::string get_name () const
 
void open (bool readonly=false)
 Open the database.
 
virtual void close ()
 Flush all pending data and close the database.
 
int get_handle ()
 
bool has_key (const std::string &key) const
 
void add_keys (const std::string &pattern, SetNameSet &set_names) const
 
virtual void sync ()
 Write all pending data to the files, in particular the index.
 
void sync_delayed ()
 
size_t ndim (const std::string &key) const
 
const std::vector< size_t > dims (const std::string &key) const
 
const std::type_info & element_type (const std::string &key) const
 
void remove (const std::string &key)
 Remove a dataset.
 
void rename (const std::string &oldkey, const std::string &newkey)
 Rename a dataset.
 
template<typename T >
void get (const std::string &key, std::vector< T > &v, const DBSlice &s1=DBSlice::all) const
 Read a positional dataset.
 
template<typename T >
void get (const std::string &key, std::vector< T > &v, const DBSlice &s1, const DBSlice &s2)
 Read a positional dataset.
 
template<typename T >
void get (const std::string &key, b2linalg::Vector< T, b2linalg::Vincrement_ref > v, const DBSlice &s1=DBSlice::all)
 Read a positional dataset.
 
template<typename T >
void get (const std::string &key, b2linalg::Vector< T, b2linalg::Vincrement_ref > v, const DBSlice &s1, const DBSlice &s2)
 Read a positional dataset.
 
template<typename T >
void get (const std::string &key, b2linalg::Matrix< T, b2linalg::Mrectangle > &m, const DBSlice &s1=DBSlice::all, const DBSlice &s2=DBSlice::all)
 Read a positional dataset.
 
template<typename T >
void get (const std::string &key, b2linalg::Matrix< T, b2linalg::Mrectangle_increment_ref > m, const DBSlice &s1=DBSlice::all, const DBSlice &s2=DBSlice::all)
 Read a positional dataset.
 
template<typename T >
void set (const std::string &key, const std::vector< T > &v, const DBSlice &s1=DBSlice::all, bool new_set=false)
 Write a positional dataset.
 
template<typename T >
void set (const std::string &key, const b2linalg::Vector< T, b2linalg::Vincrement_constref > &v, const DBSlice &s1=DBSlice::all, bool new_set=false)
 Write a positional dataset.
 
template<typename T >
void set (const std::string &key, const b2linalg::Vector< T, b2linalg::Vincrement_constref > &v, const DBSlice &s1, const DBSlice &s2, bool new_set=false)
 Write a positional dataset.
 
template<typename T >
void set (const std::string &key, const b2linalg::Matrix< T, b2linalg::Mrectangle > &m, const DBSlice &s1=DBSlice::all, const DBSlice &s2=DBSlice::all, bool new_set=false)
 Write a positional dataset.
 
template<typename T >
void set (const std::string &key, const b2linalg::Matrix< T, b2linalg::Mrectangle_constref > &m, const DBSlice &s1=DBSlice::all, const DBSlice &s2=DBSlice::all, bool new_set=false)
 Write a positional dataset.
 
template<typename T >
void set (const std::string &key, const b2linalg::Matrix< T, b2linalg::Mpacked > &m, bool new_set=false)
 Write a positional dataset.
 
void get (const std::string &key, RTable &rtable, const DBSlice &s1=DBSlice::all) const
 Read a relational table.
 
void set (const std::string &key, const RTable &rtable, bool new_set=false)
 Write a relational table.
 
void set (const std::string &key, const RTable &rtable, size_t pos)
 Write a relational table.
 
bool get_desc (const std::string &key, RTable &rtable, bool raise_exception_on_missing_desc=true) const
 Read the dataset descriptor.
 
void set_desc (const std::string &key, const RTable &rtable)
 Write the dataset descriptor.
 
void get (const std::string &key, ArrayRTable &rtable) const
 Read a complete relational table or sparse table dataset.
 
void set (const std::string &key, const std::vector< RTable > &array_rtable, bool new_set=false, bool new_sparse_table=false)
 Write a complete relational table or sparse table dataset.
 
void set (const std::string &key, const std::vector< ArrayTableCol > &cols, bool new_set=false)
 Write an array table dataset.
 

Detailed Description

The object associated with the B2000++ database.

Member Function Documentation

◆ add_keys()

void b2000::DataBase::add_keys ( const std::string &  pattern,
SetNameSet set_names 
) const
inline

Add all existing datasets that match pattern to the collection set_names.

◆ dims()

const std::vector< size_t > b2000::DataBase::dims ( const std::string &  key) const
inline
Returns
The dimensions of a dataset.

◆ element_type()

const std::type_info & b2000::DataBase::element_type ( const std::string &  key) const
inline
Returns
The element type of a dataset.

◆ get_handle()

int b2000::DataBase::get_handle ( )
inline
Returns
The MemCom file handle.

◆ get_name()

std::string b2000::DataBase::get_name ( ) const
inline
Returns
The name of the MemCom database directory.

◆ has_key()

bool b2000::DataBase::has_key ( const std::string &  key) const
inline
Returns
Whether the dataset key exists.

◆ ndim()

size_t b2000::DataBase::ndim ( const std::string &  key) const
inline
Returns
The number of dimensions of a dataset.

◆ sync_delayed()

void b2000::DataBase::sync_delayed ( )
inline

Write all pending data to the files, in particular the index, but only if the time since the last sync is 10 times greater than the time needed to do the sync.


The documentation for this class was generated from the following files: