class Gambit::Printers::SQLitePrinter
The main printer class for output to SQLite database.
#include <sqliteprinter.hpp>
Inherits from Gambit::Printers::BasePrinter, Gambit::Printers::SQLiteBase, Gambit::Printers::BaseBasePrinter
Public Functions
Name | |
---|---|
virtual void | initialise(const std::vector< int > & ) |
virtual void | flush() |
virtual void | reset(bool force =false) Function to signal to the printer to write buffer contents to disk. |
virtual void | finalise(bool abnormal =false) Signal printer that scan is finished, and final output needs to be performed. |
virtual Options | resume_reader_options() |
virtual void | _print_metadata(map_str_str metadata) |
template <typename T > void | _print(T const & , const std::string & label, const int vertexID, const uint, const ulong) Print functions. |
template <typename T > void | _print(T const & in, const std::string & label, const uint rank, const ulong pointID) Print functions. |
SQLitePrinter(const Options & options, BasePrinter *const primary =NULL) Constructor (for construction via inifile options) | |
~SQLitePrinter() Destructor. | |
std::size_t | get_max_buffer_length() |
template <class T > void | template_print(T const & value, const std::string & label, const int , const unsigned int mpirank, const unsigned long pointID, const std::string & col_type) Helper print functions. |
Additional inherited members
Public Functions inherited from Gambit::Printers::BasePrinter
Name | |
---|---|
BasePrinter() | |
BasePrinter(BasePrinter *const primary, bool is_aux_IN) | |
virtual | ~BasePrinter() Destructor. |
void | set_as_aux() Set this as an auxilliary printer. |
void | set_output_metadata(bool use_metadata) Set/Get whether to print the metadata. |
bool | get_output_metadata() |
virtual void | auxilliary_init() |
BasePrinter * | get_primary_printer() |
bool | is_auxilliary_printer() |
template <typename T > void | print(T const & in, const std::string & label, const int vertexID, const uint rank, const ulong pointID) |
template <typename T > void | print(T const & in, const std::string & label, const uint rank, const ulong pointID) |
Public Functions inherited from Gambit::Printers::SQLiteBase
Name | |
---|---|
SQLiteBase() | |
~SQLiteBase() |
Protected Functions inherited from Gambit::Printers::SQLiteBase
Name | |
---|---|
std::string | get_database_file() |
std::string | get_table_name() |
std::string | get_metadata_table_name() |
void | set_table_name(const std::string & table_name) |
void | set_metadata_table_name(const std::string & metadata_table_name) |
void | require_output_ready() |
void | open_db(const std::string & path, char access =‘r’) |
void | close_db() |
sqlite3 * | get_db() |
void | cout_row(sqlite3_stmt * tmp_stmt) |
void | check_table_exists() |
void | set_table_exists() |
std::map< std::string, std::string, Utils::ci_less > | get_column_info() |
int | submit_sql(const std::string & local_info, const std::string & sqlstr, bool allow_fail =false, sql_callback_fptr callback =NULL, void * data =NULL, char ** zErrMsg =NULL) |
Public Functions inherited from Gambit::Printers::BaseBasePrinter
Name | |
---|---|
BaseBasePrinter() | |
virtual | ~BaseBasePrinter() |
int | getRank() Retrieve/Set MPI rank (setting is useful for e.g. the postprocessor to re-print points from other ranks) |
void | setRank(int r) |
bool & | get_printUnitcube() |
void | set_printUnitcube(const bool & rflag) |
std::set< std::string > | getPrintList() |
void | setPrintList(const std::set< std::string > & in) |
void | addToPrintList(const std::string & in) |
bool | get_resume() |
void | set_resume(bool rflag) |
void | disable(int n =-1) |
void | enable() |
template <typename T > void | print(T const & in, const std::string & label, const int vertexID, const uint rank, const ulong pointID) |
template <typename T > void | print(T const & in, const std::string & label, const uint rank, const ulong pointID) |
void | print_metadata(map_str_str datasets) |
Protected Attributes inherited from Gambit::Printers::BaseBasePrinter
Name | |
---|---|
bool | printer_enabled Flag to check if print functions are enabled or disabled. |
int | printer_cooldown Counter for printer cooldown. If non-zero printer can be disabled for a fixed number of print calls. |
Public Functions Documentation
function initialise
virtual void initialise(
const std::vector< int > &
)
Reimplements: Gambit::Printers::BasePrinter::initialise
Virtual function overloads:
function flush
virtual void flush()
Reimplements: Gambit::Printers::BasePrinter::flush
Signal printer to flush data in buffers to disk Printers should do this automatically as needed, but this is useful if a scanner is printing a bunch of data as a batch, to make sure it is all on disk after the batch is done.
function reset
virtual void reset(
bool force =false
)
Function to signal to the printer to write buffer contents to disk.
Reimplements: Gambit::Printers::BaseBasePrinter::reset
Signal printer to reset contents, i.e. delete old data in preperation for replacement
function finalise
virtual void finalise(
bool abnormal =false
)
Signal printer that scan is finished, and final output needs to be performed.
Reimplements: Gambit::Printers::BaseBasePrinter::finalise
function resume_reader_options
virtual Options resume_reader_options()
Reimplements: Gambit::Printers::BasePrinter::resume_reader_options
function _print_metadata
virtual void _print_metadata(
map_str_str metadata
)
Reimplements: Gambit::Printers::BaseBasePrinter::_print_metadata
function _print
template <typename T >
inline void _print(
T const & ,
const std::string & label,
const int vertexID,
const uint,
const ulong
)
Print functions.
function _print
template <typename T >
inline void _print(
T const & in,
const std::string & label,
const uint rank,
const ulong pointID
)
Print functions.
function SQLitePrinter
SQLitePrinter(
const Options & options,
BasePrinter *const primary =NULL
)
Constructor (for construction via inifile options)
function ~SQLitePrinter
inline ~SQLitePrinter()
Destructor.
function get_max_buffer_length
std::size_t get_max_buffer_length()
function template_print
template <class T >
inline void template_print(
T const & value,
const std::string & label,
const int ,
const unsigned int mpirank,
const unsigned long pointID,
const std::string & col_type
)
Helper print functions.
Updated on 2024-07-18 at 13:53:32 +0000