TPIE

v1.1rc1-6-g0c97303
tpie::serialization_writer Class Reference

Inherits tpie::bits::serialization_writer_base.

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 82 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 130 of file serialization_stream.h.

References tpie::serialize().

Referenced by serialize().

130  {
131  using tpie::serialize;
132  serializer s(*this);
133  serialize(s, v);
134  }
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 144 of file serialization_stream.h.

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

144  {
145  using tpie::serialize;
146  serializer s(*this);
147  serialize(s, a, b);
148  }
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: