Ingen  0.5.1
Public Member Functions | List of all members
Ingen::Serialiser Class Reference

Write Ingen objects to Turtle files or strings. More...

#include <Serialiser.hpp>

Public Member Functions

 Serialiser (World &world)
 
virtual void write_bundle (SPtr< const Node > graph, const std::string &path)
 Write a graph and all its contents as a complete bundle. More...
 
virtual void start_to_string (const Raul::Path &root, const std::string &base_uri)
 Begin a serialization to a string. More...
 
virtual void start_to_file (const Raul::Path &root, const std::string &filename)
 Begin a serialization to a file. More...
 
virtual void serialise (SPtr< const Node > object) throw (std::logic_error)
 Serialize an object (graph, block, or port). More...
 
virtual void serialise_arc (const Sord::Node &parent, SPtr< const Arc > arc) throw (std::logic_error)
 Serialize an arc. More...
 
virtual std::string finish ()
 Finish serialization. More...
 

Detailed Description

Write Ingen objects to Turtle files or strings.

Member Function Documentation

§ write_bundle()

void Ingen::Serialiser::write_bundle ( SPtr< const Node graph,
const std::string &  path 
)
virtual

Write a graph and all its contents as a complete bundle.

§ start_to_string()

void Ingen::Serialiser::start_to_string ( const Raul::Path &  root,
const std::string &  base_uri 
)
virtual

Begin a serialization to a string.

This must be called before any serializing methods.

The results of the serialization will be returned by the finish() method after the desired objects have been serialised.

All serialized paths will have the root path chopped from their prefix (therefore all serialized paths must be descendants of the root)

§ start_to_file()

void Ingen::Serialiser::start_to_file ( const Raul::Path &  root,
const std::string &  filename 
)
virtual

Begin a serialization to a file.

This must be called before any serializing methods.

All serialized paths will have the root path chopped from their prefix (therefore all serialized paths must be descendants of the root)

§ serialise()

void Ingen::Serialiser::serialise ( SPtr< const Node object)
throw (std::logic_error
)
virtual

§ serialise_arc()

void Ingen::Serialiser::serialise_arc ( const Sord::Node &  parent,
SPtr< const Arc arc 
)
throw (std::logic_error
)
virtual

Serialize an arc.

§ finish()

std::string Ingen::Serialiser::finish ( )
virtual

Finish serialization.

If this is a file serialization, this must be called to finish and close the output file, and the empty string is returned.

If this is a string serialization, the serialized result is returned.


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