Public Member Functions | Protected Member Functions
Typelib::Exporter Class Reference

#include <exporter.hh>

Inheritance diagram for Typelib::Exporter:
Inheritance graph
[legend]

List of all members.

Public Member Functions

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 bool save (std::ostream &stream, RegistryIterator const &type)=0
virtual ~Exporter ()

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

Definition at line 32 of file exporter.hh.


Constructor & Destructor Documentation

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

Definition at line 45 of file exporter.hh.


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

Reimplemented in TlbExport.

Definition at line 130 of file exporter.cc.

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

Reimplemented in IDLExport, and TlbExport.

Definition at line 131 of file exporter.cc.

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

Serialize a whole registry in a file

Definition at line 14 of file exporter.cc.

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:
UnsupportedTypeif a type cannot be serialized in this format. In particular, this is thrown if the registry contains recursive types
ExportErrorfor all export errors

Reimplemented in IDLExport.

Definition at line 20 of file exporter.cc.

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

Definition at line 121 of file exporter.cc.

virtual bool 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
    Returns:
    true if the type has been saved and false if it is ignored by this exporter

Implemented in IDLExport, and TlbExport.


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


typelib
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Mon Oct 6 2014 03:17:12