io::legacy_writer Class Reference

Implements the io::writer interface using the "legacy" data format. More...

#include <io/iolegacy.h>

Inheritance diagram for io::legacy_writer:

Inheritance graph
[legend]
Collaboration diagram for io::legacy_writer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 legacy_writer (std::ostream &os, bool write_bases=true)
void use_pretty_print (bool yes=true)
virtual void write_char (const char *name, char val)
 Store the char attribute val in association with the tag name.
virtual void write_int (const char *name, int val)
 Store the int attribute val in association with the tag name.
virtual void write_bool (const char *name, bool val)
 Store the bool attribute val in association with the tag name.
virtual void write_double (const char *name, double val)
 Store the double attribute val in association with the tag name.
virtual void write_value_obj (const char *name, const rutz::value &v)
 Store the rutz::value attribute val in association with the tag name.
virtual void write_byte_array (const char *name, const unsigned char *data, unsigned int length)
 Store the raw data array in association with the tag name.
virtual void write_object (const char *name, nub::soft_ref< const io::serializable > obj)
 Store the io object val in association with the tag name.
virtual void write_owned_object (const char *name, nub::ref< const io::serializable > obj)
virtual void write_base_class (const char *base_class_name, nub::ref< const io::serializable > base_part)
virtual void write_root (const io::serializable *root)
int ensure_output_version_id (const char *name, io::version_id actual_version, io::version_id lowest_supported_version, const char *msg, const rutz::file_pos &pos)
Overloaded write functions
These functions offer a set of overloads to provide compile-time polymorphism so that any supported type (any basic type, or rutz::value, a string type) or can be written with the same source code.

void write_value (const char *name, char val)
void write_value (const char *name, int val)
void write_value (const char *name, unsigned int val)
void write_value (const char *name, unsigned long val)
void write_value (const char *name, bool val)
void write_value (const char *name, double val)
void write_value (const char *name, const rutz::fstring &val)
void write_value (const char *name, const rutz::value &v)

Protected Member Functions

virtual void write_cstring (const char *name, const char *val)
 Store the C-style string (char*) attribute val in association with the tag name.
void default_write_byte_array (const char *name, const unsigned char *data, unsigned int length)
 Base64 implementation of write_byte_array() for use by subclasses.

Friends

class impl

Classes

class  impl


Detailed Description

Implements the io::writer interface using the "legacy" data format.

Definition at line 100 of file iolegacy.h.


Member Function Documentation

void io::legacy_writer::write_owned_object ( const char *  name,
nub::ref< const io::serializable obj 
) [virtual]

Store the owned io object obj in association with the tag name. This function should only be used if obj is owned by the storing object; no other objects should reference obj. This allows the writer subclass to implement the storage of an owned object as a contained object.

Implements io::writer.

Definition at line 617 of file iolegacy.cc.

void io::legacy_writer::write_base_class ( const char *  base_class_name,
nub::ref< const io::serializable base_part 
) [virtual]

Write the named base class using the io object obj, which should be arranged to point or refer to the appropriate base class part of the object. In particular, obj's virtual functions must NOT call the fully derived versions. This effect can be best accomplished with an io::proxy.

Implements io::writer.

Definition at line 625 of file iolegacy.cc.

void io::legacy_writer::write_root ( const io::serializable root  )  [virtual]

Store an entire object hierarchy, starting with the root object root. All objects and values referenced by root will be stored recursively, until there are no more remaining references.

Implements io::writer.

Definition at line 639 of file iolegacy.cc.

int io::writer::ensure_output_version_id ( const char *  name,
io::version_id  actual_version,
io::version_id  lowest_supported_version,
const char *  msg,
const rutz::file_pos pos 
) [inherited]

A convenience function to ensure that the current serial version is no less than the lowest_supported_version. Returns the actual_version. If this test fails, a write_version_error will be thrown.

Definition at line 84 of file writer.cc.

Referenced by Trial::write_to(), TimingHdlr::write_to(), TimingHandler::write_to(), MorphyFace::write_to(), MaskHatch::write_to(), Jitter::write_to(), House::write_to(), Gabor::write_to(), FixPt::write_to(), Fish::write_to(), Face::write_to(), ExptDriver::write_to(), EventResponseHdlr::write_to(), Block::write_to(), GxTransform::write_to(), GxText::write_to(), GxShapeKit::write_to(), GxPixmap::write_to(), GxDrawStyle::write_to(), and GxColor::write_to().


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

The software described here is Copyright (c) 1998-2005, Rob Peters.
This page was generated Wed Dec 3 06:56:18 2008 by Doxygen version 1.5.5.