vg
tools for working with variation graphs
Public Member Functions | Protected Member Functions | List of all members
handlegraph::SerializableHandleGraph Class Referenceabstract

#include <serializable_handle_graph.hpp>

Inheritance diagram for handlegraph::SerializableHandleGraph:
bdsg::HashGraph bdsg::ODGI bdsg::PackedGraph xg::XG

Public Member Functions

virtual ~SerializableHandleGraph ()=default
 
virtual uint32_t get_magic_number () const =0
 
void serialize (std::ostream &out) const
 
void serialize (const std::string &filename) const
 
void deserialize (std::istream &in)
 
void deserialize (const std::string &filename)
 

Protected Member Functions

virtual void serialize_members (std::ostream &out) const =0
 Underlying implementation for "serialize" method. More...
 
virtual void deserialize_members (std::istream &in)=0
 Underlying implementation to "deserialize" method. More...
 

Constructor & Destructor Documentation

◆ ~SerializableHandleGraph()

virtual handlegraph::SerializableHandleGraph::~SerializableHandleGraph ( )
virtualdefault

Member Function Documentation

◆ deserialize() [1/2]

void handlegraph::SerializableHandleGraph::deserialize ( const std::string &  filename)
inline

Sets the contents of this graph to the contents of a serialized graph from a file. The serialized graph must be from the same implementation of the HandleGraph interface as is calling deserialize(). Can only be called on an empty graph.

◆ deserialize() [2/2]

void handlegraph::SerializableHandleGraph::deserialize ( std::istream &  in)
inline

Sets the contents of this graph to the contents of a serialized graph from an istream. The serialized graph must be from the same implementation of the HandleGraph interface as is calling deserialize(). Can only be called on an empty graph.

◆ deserialize_members()

virtual void handlegraph::SerializableHandleGraph::deserialize_members ( std::istream &  in)
protectedpure virtual

Underlying implementation to "deserialize" method.

Implemented in xg::XG, bdsg::ODGI, bdsg::PackedGraph, and bdsg::HashGraph.

◆ get_magic_number()

virtual uint32_t handlegraph::SerializableHandleGraph::get_magic_number ( ) const
pure virtual

Returns a number that is specific to the serialized implementation for type checking. Does not depend on the contents of any particular instantiation (i.e. behaves as if static, but cannot be static and virtual).

Implemented in xg::XG, bdsg::PackedGraph, bdsg::HashGraph, and bdsg::ODGI.

◆ serialize() [1/2]

void handlegraph::SerializableHandleGraph::serialize ( const std::string &  filename) const
inline

Write the contents of this graph to a named file. Makes sure to include a leading magic number.

◆ serialize() [2/2]

void handlegraph::SerializableHandleGraph::serialize ( std::ostream &  out) const
inline

Write the contents of this graph to an ostream. Makes sure to include a leading magic number.

Inline implementations

◆ serialize_members()

virtual void handlegraph::SerializableHandleGraph::serialize_members ( std::ostream &  out) const
protectedpure virtual

Underlying implementation for "serialize" method.

Implemented in xg::XG, bdsg::ODGI, bdsg::PackedGraph, and bdsg::HashGraph.


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