class Gambit::Printers::HDF5Buffer
Class to manage buffer for a single output label. More…
#include <hdf5printer_v2.hpp>
Inherits from Gambit::Printers::HDF5BufferBase
Public Functions
Name | |
---|---|
HDF5Buffer(const std::string & name, const bool sync, const std::vector< PPIDpair > & buffered_points) Constructor. | |
virtual void | update(const PPIDpair & ppid) Make sure buffer includes the specified point (data will be set as ‘invalid’ unless given elsewhere) |
void | append(T const & value, const PPIDpair & ppid) Insert data to print buffer at the specified point (overwrite if it already exists in the buffer) |
virtual void | block_flush(const hid_t loc_id, const std::vector< PPIDpair > & order, const std::size_t target_pos) |
virtual void | random_flush(const hid_t loc_id, const std::map< PPIDpair, std::size_t > & position_map) |
virtual void | reset(hid_t loc_id) |
virtual void | ensure_dataset_exists(const hid_t loc_id, const std::size_t length) Make sure datasets exist on disk with the correct name and size. |
virtual bool | exists_on_disk() const Report whether the dataset for which we are the buffer exists on disk yet. |
virtual std::size_t | N_items_in_buffer() |
void | add_float_block(const HDF5bufferchunk & chunk, const std::size_t buf) |
void | add_int_block(const HDF5bufferchunk & chunk, const std::size_t buf) |
virtual std::pair< std::vector< double >, std::vector< int > > | flush_to_vector_dbl(const std::vector< PPIDpair > & order) |
virtual std::pair< std::vector< long >, std::vector< int > > | flush_to_vector_int(const std::vector< PPIDpair > & order) |
virtual int | get_type_id() const Retrieve the integer type ID for the buffered dataset. |
Additional inherited members
Public Functions inherited from Gambit::Printers::HDF5BufferBase
Name | |
---|---|
HDF5BufferBase(const std::string & name, const bool sync) Constructor. | |
std::string | dset_name() const Report name of dataset for which we are the buffer. |
bool | is_synchronised() const Report whether this buffer is synchronised. |
std::set< PPIDpair > | get_points_set() const Report all the points in this buffer. |
virtual | ~HDF5BufferBase() Destructor. |
Protected Attributes inherited from Gambit::Printers::HDF5BufferBase
Name | |
---|---|
std::set< PPIDpair > | buffer_set Set detailing what points are in the buffer. |
std::map< PPIDpair, int > | buffer_valid Buffer specifying whether the data in the primary buffer is “valid”. |
Detailed Description
template <class T >
class Gambit::Printers::HDF5Buffer;
Class to manage buffer for a single output label.
Public Functions Documentation
function HDF5Buffer
inline HDF5Buffer(
const std::string & name,
const bool sync,
const std::vector< PPIDpair > & buffered_points
)
Constructor.
function update
inline virtual void update(
const PPIDpair & ppid
)
Make sure buffer includes the specified point (data will be set as ‘invalid’ unless given elsewhere)
Reimplements: Gambit::Printers::HDF5BufferBase::update
function append
inline void append(
T const & value,
const PPIDpair & ppid
)
Insert data to print buffer at the specified point (overwrite if it already exists in the buffer)
function block_flush
inline virtual void block_flush(
const hid_t loc_id,
const std::vector< PPIDpair > & order,
const std::size_t target_pos
)
Reimplements: Gambit::Printers::HDF5BufferBase::block_flush
Empty the buffer to disk as block with the specified order into the target position (only allowed if target_pos is beyond the current end of the dataset!)
function random_flush
inline virtual void random_flush(
const hid_t loc_id,
const std::map< PPIDpair, std::size_t > & position_map
)
Reimplements: Gambit::Printers::HDF5BufferBase::random_flush
Empty the buffer to disk as “random access” data at pre-existing positions matching the point IDs May not completely empty the buffer; points will be removed from the buffer if they are included in the supplied position map.
function reset
inline virtual void reset(
hid_t loc_id
)
Reimplements: Gambit::Printers::HDF5BufferBase::reset
Clear all data in the buffer and on disk Only allowed for “random access” buffers
function ensure_dataset_exists
inline virtual void ensure_dataset_exists(
const hid_t loc_id,
const std::size_t length
)
Make sure datasets exist on disk with the correct name and size.
Reimplements: Gambit::Printers::HDF5BufferBase::ensure_dataset_exists
function exists_on_disk
inline virtual bool exists_on_disk() const
Report whether the dataset for which we are the buffer exists on disk yet.
Reimplements: Gambit::Printers::HDF5BufferBase::exists_on_disk
function N_items_in_buffer
inline virtual std::size_t N_items_in_buffer()
Reimplements: Gambit::Printers::HDF5BufferBase::N_items_in_buffer
Might as well check the internal consistency of this buffer while we are at it
function add_float_block
inline void add_float_block(
const HDF5bufferchunk & chunk,
const std::size_t buf
)
function add_int_block
inline void add_int_block(
const HDF5bufferchunk & chunk,
const std::size_t buf
)
function flush_to_vector_dbl
inline virtual std::pair< std::vector< double >, std::vector< int > > flush_to_vector_dbl(
const std::vector< PPIDpair > & order
)
Reimplements: Gambit::Printers::HDF5BufferBase::flush_to_vector_dbl
function flush_to_vector_int
inline virtual std::pair< std::vector< long >, std::vector< int > > flush_to_vector_int(
const std::vector< PPIDpair > & order
)
Reimplements: Gambit::Printers::HDF5BufferBase::flush_to_vector_int
function get_type_id
inline virtual int get_type_id() const
Retrieve the integer type ID for the buffered dataset.
Reimplements: Gambit::Printers::HDF5BufferBase::get_type_id
Updated on 2024-07-18 at 13:53:32 +0000