Typelib::Exporter Class Reference

#include <typelib/exporter.hh>

List of all members.

Public Member Functions

virtual ~Exporter ()
virtual void save (std::string const &file_name, utilmm::config_set const &config, Registry const &registry)
virtual void save (std::ostream &stream, utilmm::config_set const &config, Registry const &registry)
virtual bool save (std::ostream &stream, Registry const &registry)
virtual void save (std::ostream &stream, RegistryIterator const &type)=0

Protected Member Functions

virtual void begin (std::ostream &stream, Registry const &registry)
virtual void end (std::ostream &stream, Registry const &registry)


Detailed Description

Base class for export objects

Constructor & Destructor Documentation

virtual Typelib::Exporter::~Exporter (  )  [inline, virtual]


Member Function Documentation

void Exporter::begin ( std::ostream &  stream,
Registry const &  registry 
) [protected, virtual]

Called by save to add a preamble before saving all registry types

See also:
save

Referenced by save().

void Exporter::end ( std::ostream &  stream,
Registry const &  registry 
) [protected, virtual]

Called by save to add data after saving all registry types

See also:
save

Referenced by save().

void Exporter::save ( std::string const &  file_name,
utilmm::config_set const &  config,
Registry const &  registry 
) [virtual]

Serialize a whole registry in a file

Referenced by Typelib::PluginManager::save(), and save().

void Exporter::save ( std::ostream &  stream,
utilmm::config_set const &  config,
Registry const &  registry 
) [virtual]

Serialize a whole registry using this exporter

  • stream the stream to write to
  • config configuration object if per-exporter configuration is needed
  • registry the registry to be saved
The default implementation calls begin(), iterates on all elements in registry, taking into account dependencies (i.e. a type will be serialized before another type which references it) and finally calls end()

Exceptions:
UnsupportedType if a type cannot be serialized in this format. In particular, this is thrown if the registry contains recursive types
ExportError for all export errors

References Typelib::Registry::begin(), begin(), end(), Typelib::Registry::end(), save(), and Typelib::Registry::size().

bool Exporter::save ( std::ostream &  stream,
Registry const &  registry 
) [virtual]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This version of save is provided for backward-compatibility only

Returns:
true if the export has succeeded, false otherwise

References save().

virtual void Typelib::Exporter::save ( std::ostream &  stream,
RegistryIterator const &  type 
) [pure virtual]

Serialize one type in stream. It is called by Registry::save(ostream&, Registry const&)

  • stream the stream to write to
  • type the type to be serialized


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

Generated on Thu Jan 22 16:37:54 2009 for typeLib by doxygen 1.5.6
SourceForge.net Project Page