libmoost
moost::container::memory_mapped_dataset::writer Class Reference

#include <dataset.hpp>

Inheritance diagram for moost::container::memory_mapped_dataset::writer:
Collaboration diagram for moost::container::memory_mapped_dataset::writer:

List of all members.

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 &section, const char *data, size_t size)
void commit_section (const std::string &section)
template<typename T >
void setattr (const std::string &section, const std::string &attr, const T &value)

Private Member Functions

section_infofind (const std::string &section)
template<typename T >
void write (const T &data)
void set_active_section (const std::string &section)
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

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
map_file_namename of the file to write
dataset_namename of the dataset, used for validation when reading the file
format_versiondataset format version, used for validation when reading the file

Definition at line 201 of file dataset.hpp.

Here is the call graph for this function:

Definition at line 224 of file dataset.hpp.

Here is the call graph for this function:


Member Function Documentation

void moost::container::memory_mapped_dataset::writer::align_stream ( size_t  alignment) [inline, private]

Definition at line 358 of file dataset.hpp.

Here is the caller graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

void moost::container::memory_mapped_dataset::writer::commit_section ( const std::string &  section) [inline]

Definition at line 308 of file dataset.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void moost::container::memory_mapped_dataset::writer::create_section ( const std::string &  name,
const std::string &  type,
size_t  alignment 
) [inline]

Definition at line 255 of file dataset.hpp.

Here is the caller graph for this function:

section_info& moost::container::memory_mapped_dataset::writer::find ( const std::string &  section) [inline, private]

Definition at line 320 of file dataset.hpp.

Here is the caller graph for this function:

void moost::container::memory_mapped_dataset::writer::set_active_section ( const std::string &  section) [inline, private]

Definition at line 338 of file dataset.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
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.

Here is the call graph for this function:

Here is the caller graph for this function:

void moost::container::memory_mapped_dataset::writer::uncreate_section ( const std::string &  name) [inline]

Definition at line 280 of file dataset.hpp.

Here is the caller graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
void moost::container::memory_mapped_dataset::writer::write ( const T &  data) [inline, private]

Definition at line 333 of file dataset.hpp.


Member Data Documentation

Definition at line 367 of file dataset.hpp.

Definition at line 369 of file dataset.hpp.

Definition at line 370 of file dataset.hpp.

Definition at line 368 of file dataset.hpp.


The documentation for this class was generated from the following file: