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

#include <serializable.hpp>

Inheritance diagram for handlegraph::Serializable:
handlegraph::SerializableHandleGraph handlegraph::TriviallySerializable xg::XG

Public Member Functions

virtual ~Serializable ()=default
 
virtual uint32_t get_magic_number () const =0
 
virtual void serialize (std::ostream &out) const
 
virtual void serialize (const std::string &filename) const
 
virtual void deserialize (std::istream &in)
 
virtual void deserialize (const std::string &filename)
 
virtual void serialize (std::ostream &out)
 
virtual void serialize (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

◆ ~Serializable()

virtual handlegraph::Serializable::~Serializable ( )
virtualdefault

Member Function Documentation

◆ deserialize() [1/2]

void handlegraph::Serializable::deserialize ( const std::string &  filename)
virtual

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

Reimplemented in handlegraph::TriviallySerializable.

◆ deserialize() [2/2]

void handlegraph::Serializable::deserialize ( std::istream &  in)
virtual

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

Reimplemented in handlegraph::TriviallySerializable.

◆ deserialize_members()

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

Underlying implementation to "deserialize" method.

Implemented in xg::XG.

◆ get_magic_number()

virtual uint32_t handlegraph::Serializable::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.

◆ serialize() [1/4]

void handlegraph::Serializable::serialize ( const std::string &  filename)
virtual

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

Reimplemented in handlegraph::TriviallySerializable.

◆ serialize() [2/4]

void handlegraph::Serializable::serialize ( const std::string &  filename) const
virtual

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

Reimplemented in handlegraph::TriviallySerializable.

◆ serialize() [3/4]

void handlegraph::Serializable::serialize ( std::ostream &  out)
virtual

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

Reimplemented in handlegraph::TriviallySerializable.

◆ serialize() [4/4]

void handlegraph::Serializable::serialize ( std::ostream &  out) const
virtual

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

Reimplemented in handlegraph::TriviallySerializable.

◆ serialize_members()

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

Underlying implementation for "serialize" method.

Implemented in xg::XG.


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