libmoost
|
#include <section_writer_base.hpp>
Public Member Functions | |
mmd_section_writer_base (memory_mapped_dataset::writer &wr, const std::string &name, const std::string &type, size_t alignment) | |
virtual | ~mmd_section_writer_base () |
void | commit () |
Protected Member Functions | |
void | rollback () |
template<typename T > | |
void | setattr (const std::string &attr, const T &value) |
template<typename T > | |
void | write (const std::vector< T > &vec) |
template<typename T > | |
void | write (const T &value) |
void | write (const std::string &value) |
void | write (const char *value, size_t size) |
virtual void | pre_commit () |
Private Attributes | |
const std::string | m_name |
memory_mapped_dataset::writer & | m_wr |
bool | m_committed |
Base class for section writing accessors
Definition at line 45 of file section_writer_base.hpp.
moost::container::mmd_section_writer_base::mmd_section_writer_base | ( | memory_mapped_dataset::writer & | wr, |
const std::string & | name, | ||
const std::string & | type, | ||
size_t | alignment | ||
) | [inline] |
Constructor for section writer
wr | reference to a dataset writer |
name | section name |
type | section type |
alignment | section alignment (section will always start at an offset that is a multiple of this value); must be a power of 2 |
Definition at line 58 of file section_writer_base.hpp.
virtual moost::container::mmd_section_writer_base::~mmd_section_writer_base | ( | ) | [inline, virtual] |
void moost::container::mmd_section_writer_base::commit | ( | ) | [inline] |
Commit the section
All data has been written to the section and the accessor can now finish writing the section to the dataset and updating the index.
This method should always be called explicitly in order to avoid hidden exceptions when it is called by the destructor.
Definition at line 87 of file section_writer_base.hpp.
virtual void moost::container::mmd_section_writer_base::pre_commit | ( | ) | [inline, protected, virtual] |
Reimplemented in moost::container::mmd_dense_hash_map< Key, T, HashFcn >::writer, moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::writer, moost::container::mmd_vector< T >::writer, and moost::container::mmd_generic_archive< ArchivePolicy >::writer.
Definition at line 137 of file section_writer_base.hpp.
void moost::container::mmd_section_writer_base::rollback | ( | ) | [inline, protected] |
Definition at line 98 of file section_writer_base.hpp.
void moost::container::mmd_section_writer_base::setattr | ( | const std::string & | attr, |
const T & | value | ||
) | [inline, protected] |
Definition at line 104 of file section_writer_base.hpp.
void moost::container::mmd_section_writer_base::write | ( | const std::vector< T > & | vec | ) | [inline, protected] |
Definition at line 110 of file section_writer_base.hpp.
void moost::container::mmd_section_writer_base::write | ( | const T & | value | ) | [inline, protected] |
void moost::container::mmd_section_writer_base::write | ( | const std::string & | value | ) | [inline, protected] |
void moost::container::mmd_section_writer_base::write | ( | const char * | value, |
size_t | size | ||
) | [inline, protected] |
bool moost::container::mmd_section_writer_base::m_committed [private] |
Definition at line 144 of file section_writer_base.hpp.
const std::string moost::container::mmd_section_writer_base::m_name [private] |
Definition at line 142 of file section_writer_base.hpp.
Definition at line 143 of file section_writer_base.hpp.