class Gambit::Printers::BasePrinter
BASE PRINTER CLASS.
#include <baseprinter.hpp>
Inherits from Gambit::Printers::BaseBasePrinter
Inherited by Gambit::Printers::HDF5Printer, Gambit::Printers::HDF5Printer2, Gambit::Printers::SQLitePrinter, Gambit::Printers::asciiPrinter, Gambit::Printers::coutPrinter, Gambit::Printers::nonePrinter
Public Functions
| Name | |
|---|---|
| BasePrinter() | |
| BasePrinter(BasePrinter *const primary, bool is_aux_IN) | |
| virtual | ~BasePrinter() Destructor. |
| virtual void | initialise(const std::vector< int > & ) =0 Initialisation function. |
| virtual void | flush() =0 |
| virtual Options | resume_reader_options() =0 |
| 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) |
Protected Functions
| Name | |
|---|---|
| template <typename T > void | _print(T const & , const std::string & label, const int vertexID, const uint, const ulong) |
| template <typename T > void | _print(T const & in, const std::string & label, const uint rank, const ulong pointID) Same for overloaded function. |
Additional inherited members
Public Functions inherited from Gambit::Printers::BaseBasePrinter
| Name | |
|---|---|
| BaseBasePrinter() | |
| virtual | ~BaseBasePrinter() |
| virtual void | reset(bool force =false) =0 Function to signal to the printer to write buffer contents to disk. |
| 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) |
| virtual void | finalise(bool abnormal =false) =0 Signal printer that scan is finished, and final output needs to be performed. |
| void | disable(int n =-1) |
| void | enable() |
| void | print_metadata(map_str_str datasets) |
Protected Functions inherited from Gambit::Printers::BaseBasePrinter
| Name | |
|---|---|
| virtual void | _print_metadata(map_str_str ) |
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 BasePrinter
inline BasePrinter()
function BasePrinter
inline BasePrinter(
BasePrinter *const primary,
bool is_aux_IN
)
function ~BasePrinter
inline virtual ~BasePrinter()
Destructor.
function initialise
virtual void initialise(
const std::vector< int > &
) =0
Initialisation function.
Reimplemented by: Gambit::Printers::asciiPrinter::initialise, Gambit::Printers::coutPrinter::initialise, Gambit::Printers::HDF5Printer::initialise, Gambit::Printers::HDF5Printer2::initialise, Gambit::Printers::nonePrinter::initialise, Gambit::Printers::SQLitePrinter::initialise
function flush
virtual void flush() =0
Reimplements: Gambit::Printers::BaseBasePrinter::flush
Reimplemented by: Gambit::Printers::asciiPrinter::flush, Gambit::Printers::coutPrinter::flush, Gambit::Printers::HDF5Printer::flush, Gambit::Printers::HDF5Printer2::flush, Gambit::Printers::nonePrinter::flush, Gambit::Printers::SQLitePrinter::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 resume_reader_options
virtual Options resume_reader_options() =0
Reimplements: Gambit::Printers::BaseBasePrinter::resume_reader_options
Reimplemented by: Gambit::Printers::asciiPrinter::resume_reader_options, Gambit::Printers::coutPrinter::resume_reader_options, Gambit::Printers::HDF5Printer::resume_reader_options, Gambit::Printers::HDF5Printer2::resume_reader_options, Gambit::Printers::nonePrinter::resume_reader_options, Gambit::Printers::SQLitePrinter::resume_reader_options
function set_as_aux
inline void set_as_aux()
Set this as an auxilliary printer.
function set_output_metadata
inline void set_output_metadata(
bool use_metadata
)
Set/Get whether to print the metadata.
function get_output_metadata
inline bool get_output_metadata()
function auxilliary_init
inline virtual void auxilliary_init()
Helper initialisation for auxilliary printers Will be run when the auxilliary printer is created by a PrinterManager. Define override of this if two-stage initialisation is needed
function get_primary_printer
inline BasePrinter * get_primary_printer()
function is_auxilliary_printer
inline bool is_auxilliary_printer()
function print
template <typename T >
inline void print(
T const & in,
const std::string & label,
const int vertexID,
const uint rank,
const ulong pointID
)
function print
template <typename T >
inline void print(
T const & in,
const std::string & label,
const uint rank,
const ulong pointID
)
Protected Functions Documentation
function _print
template <typename T >
inline void _print(
T const & ,
const std::string & label,
const int vertexID,
const uint,
const ulong
)
Default _print function. Throws an error if no matching virtual function for the type of the attempted print is found.
function _print
template <typename T >
inline void _print(
T const & in,
const std::string & label,
const uint rank,
const ulong pointID
)
Same for overloaded function.
Updated on 2025-02-12 at 16:10:32 +0000