Thea
Public Member Functions | Static Public Member Functions | List of all members
Serializable Class Referenceabstract

Abstract base class for a serializable object. More...

#include <Serializable.hpp>

Inheritance diagram for Serializable:
BagOfWords HoughForest HoughForest::Options KMeans KMeans::Options Pyramid1d Pyramid2d Pyramid3d Camera MeshGroup< MeshT > Image VariantMatrix< T, DenseMatrixT, SparseMatrixT >

Public Member Functions

virtual void read (BinaryInputStream &input, Codec const &codec=CodecAuto(), bool read_block_header=false)=0
 Read the object from a binary input stream. More...
 
virtual void read (TextInputStream &input, Codec const &codec=CodecAuto())
 Read the object from a text input stream. More...
 
virtual void write (BinaryOutputStream &output, Codec const &codec=CodecAuto(), bool write_block_header=false) const =0
 Write the object to a binary output stream. More...
 
virtual void write (TextOutputStream &output, Codec const &codec=CodecAuto()) const
 Write the object to a text output stream. More...
 
virtual ~Serializable ()
 Destructor. More...
 

Static Public Member Functions

static TextInputStream::Settings const & configReadSettings ()
 Get the default settings for parsing configuration text files. More...
 
static TextOutputStream::Settings const & configWriteSettings ()
 Get the default settings for writing configuration text files. More...
 

Detailed Description

Abstract base class for a serializable object.

Definition at line 25 of file Serializable.hpp.

Constructor & Destructor Documentation

virtual ~Serializable ( )
virtual

Destructor.

Definition at line 31 of file Serializable.hpp.

Member Function Documentation

static TextInputStream::Settings const& configReadSettings ( )
static

Get the default settings for parsing configuration text files.

Definition at line 69 of file Serializable.hpp.

static TextOutputStream::Settings const& configWriteSettings ( )
static

Get the default settings for writing configuration text files.

Definition at line 76 of file Serializable.hpp.

virtual void read ( BinaryInputStream input,
Codec const &  codec = CodecAuto(),
bool  read_block_header = false 
)
pure virtual

Read the object from a binary input stream.

Parameters
inputThe stream from which to read data.
codecThe codec to use. If set to CodecAuto(), the codec will be autodetected (if possible) from the input.
read_block_headerIf true, a Codec::BlockHeader object containing information about the codec and size of the serialized block will be first read from the input, and used to aid codec detection etc. The implementation is free to ignore this directive, e.g. if the codec and input size can be detected through other means. This behavior must be synchronized with write(BinaryOutputStream &, Codec const &, bool): either both must omit block headers, or both must read/write them if directed to do so.

Implemented in HoughForest, Pyramid3d, MeshGroup< MeshT >, KMeans, Camera, VariantMatrix< T, DenseMatrixT, SparseMatrixT >, Pyramid2d, HoughForest::Options, Image, BagOfWords, KMeans::Options, and Pyramid1d.

virtual void read ( TextInputStream input,
Codec const &  codec = CodecAuto() 
)
virtual

Read the object from a text input stream.

Reimplemented in Pyramid3d, KMeans, Pyramid2d, HoughForest::Options, BagOfWords, KMeans::Options, and Pyramid1d.

Definition at line 61 of file Serializable.hpp.

virtual void write ( BinaryOutputStream output,
Codec const &  codec = CodecAuto(),
bool  write_block_header = false 
) const
pure virtual

Write the object to a binary output stream.

Parameters
outputThe stream to which data will be written.
codecThe codec to use. If set to CodecAuto(), an appropriate codec will be automatically selected.
write_block_headerIf true, a Codec::BlockHeader object containing information about the codec and size of the serialized block will be first written to the input. The implementation is free to ignore this directive, e.g. if the codec and input size are encoded through other means. This behavior must be synchronized with read(BinaryInputStream &, Codec const &, bool): either both must omit block headers, or both must read/write them if directed to do so.

Implemented in HoughForest, MeshGroup< MeshT >, Pyramid3d, KMeans, Camera, VariantMatrix< T, DenseMatrixT, SparseMatrixT >, Pyramid2d, HoughForest::Options, Image, BagOfWords, KMeans::Options, and Pyramid1d.

virtual void write ( TextOutputStream output,
Codec const &  codec = CodecAuto() 
) const
virtual

Write the object to a text output stream.

Reimplemented in Pyramid3d, KMeans, Pyramid2d, HoughForest::Options, BagOfWords, KMeans::Options, and Pyramid1d.

Definition at line 65 of file Serializable.hpp.


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