libmoost
|
#include <dataset.hpp>
Public Member Functions | |
writer (const std::string &map_file_name, const std::string &dataset_name, boost::uint32_t format_version) | |
~writer () | |
void | close () |
void | create_section (const std::string &name, const std::string &type, size_t alignment) |
void | uncreate_section (const std::string &name) |
void | write (const std::string §ion, const char *data, size_t size) |
void | commit_section (const std::string §ion) |
template<typename T > | |
void | setattr (const std::string §ion, const std::string &attr, const T &value) |
Private Member Functions | |
section_info & | find (const std::string §ion) |
template<typename T > | |
void | write (const T &data) |
void | set_active_section (const std::string §ion) |
void | align_stream (size_t alignment) |
Private Attributes | |
section_map_type | m_section_map |
std::string | m_active_section |
std::ofstream | m_ofs |
const std::string | m_dataset_name |
const boost::uint32_t | m_format_version |
mmd_header | m_header |
Dataset writer
This class is used to aid dataset creation. It handles all writing of data to the dataset file and keeps track of all its sections. It also takes care of aligning sections properly and writing the section index.
Most of its methods are supposed to be called only by section creating accessors.
Definition at line 187 of file dataset.hpp.
moost::container::memory_mapped_dataset::writer::writer | ( | const std::string & | map_file_name, |
const std::string & | dataset_name, | ||
boost::uint32_t | format_version | ||
) | [inline] |
Dataset writer constructor
Used to open a dataset file for writing.
map_file_name | name of the file to write |
dataset_name | name of the dataset, used for validation when reading the file |
format_version | dataset format version, used for validation when reading the file |
Definition at line 201 of file dataset.hpp.
void moost::container::memory_mapped_dataset::writer::align_stream | ( | size_t | alignment | ) | [inline, private] |
void moost::container::memory_mapped_dataset::writer::close | ( | ) | [inline] |
Close the dataset file
This method should always be called explicitly in order to avoid hidden exceptions when it is called by the destructor.
Definition at line 241 of file dataset.hpp.
void moost::container::memory_mapped_dataset::writer::commit_section | ( | const std::string & | section | ) | [inline] |
Definition at line 308 of file dataset.hpp.
void moost::container::memory_mapped_dataset::writer::create_section | ( | const std::string & | name, |
const std::string & | type, | ||
size_t | alignment | ||
) | [inline] |
section_info& moost::container::memory_mapped_dataset::writer::find | ( | const std::string & | section | ) | [inline, private] |
void moost::container::memory_mapped_dataset::writer::set_active_section | ( | const std::string & | section | ) | [inline, private] |
Definition at line 338 of file dataset.hpp.
void moost::container::memory_mapped_dataset::writer::setattr | ( | const std::string & | section, |
const std::string & | attr, | ||
const T & | value | ||
) | [inline] |
Definition at line 314 of file dataset.hpp.
void moost::container::memory_mapped_dataset::writer::uncreate_section | ( | const std::string & | name | ) | [inline] |
void moost::container::memory_mapped_dataset::writer::write | ( | const std::string & | section, |
const char * | data, | ||
size_t | size | ||
) | [inline] |
Definition at line 302 of file dataset.hpp.
void moost::container::memory_mapped_dataset::writer::write | ( | const T & | data | ) | [inline, private] |
Definition at line 333 of file dataset.hpp.
std::string moost::container::memory_mapped_dataset::writer::m_active_section [private] |
Definition at line 367 of file dataset.hpp.
const std::string moost::container::memory_mapped_dataset::writer::m_dataset_name [private] |
Definition at line 369 of file dataset.hpp.
const boost::uint32_t moost::container::memory_mapped_dataset::writer::m_format_version [private] |
Definition at line 370 of file dataset.hpp.
Definition at line 371 of file dataset.hpp.
std::ofstream moost::container::memory_mapped_dataset::writer::m_ofs [private] |
Definition at line 368 of file dataset.hpp.
Definition at line 366 of file dataset.hpp.