TPIE

2362a60
tpie::serialization_writer Class Reference

Inherits tpie::bits::serialization_writer_base.

Classes

class  serializer
 

Public Member Functions

void open (std::string path)
 
void open (temp_file &tempFile)
 
void close ()
 
template<typename T >
void serialize (const T &v)
 Serialize a serializable item and write it to the stream. More...
 
template<typename IT >
void serialize (IT a, IT b)
 Serialize a sequence of serializable items and write them to the stream. More...
 
stream_size_type file_size ()
 

Static Public Member Functions

static memory_size_type block_size ()
 
static memory_size_type memory_usage ()
 

Protected Member Functions

void open (std::string path, bool reverse)
 
void open (temp_file &tempFile, bool reverse)
 
void write_block (const char *const s, const memory_size_type n)
 Write n bytes from memory area s to next block in stream. More...
 
void close (bool reverse)
 

Friends

class serializer
 

Detailed Description

Definition at line 83 of file serialization_stream.h.

Member Function Documentation

template<typename T >
void tpie::serialization_writer::serialize ( const T &  v)
inline

Serialize a serializable item and write it to the stream.

The code stream.serialize(v) just calls serialize(stream, v) via ADL.

Definition at line 135 of file serialization_stream.h.

References tpie::serialize().

Referenced by serialize().

135  {
136  using tpie::serialize;
137  serializer s(*this);
138  serialize(s, v);
139  }
void serialize(const T &v)
Serialize a serializable item and write it to the stream.
void serialize(D &dst, const foo &v)
Sample tpie::serialize prototype.
template<typename IT >
void tpie::serialization_writer::serialize ( IT  a,
IT  b 
)
inline

Serialize a sequence of serializable items and write them to the stream.

The code stream.serialize(a, b) just calls serialize(stream, a, b) via ADL.

Definition at line 149 of file serialization_stream.h.

References tpie::serialize(), and serialize().

149  {
150  using tpie::serialize;
151  serializer s(*this);
152  serialize(s, a, b);
153  }
void serialize(const T &v)
Serialize a serializable item and write it to the stream.
void serialize(D &dst, const foo &v)
Sample tpie::serialize prototype.
void tpie::bits::serialization_writer_base::write_block ( const char *const  s,
const memory_size_type  n 
)
protectedinherited

Write n bytes from memory area s to next block in stream.

n must be less or equal to block_size().

Parameters
sMemory area with data to write.
nNumber of bytes to write.

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