Elementa v8.0.0
Minimalistic library for any C++ application (C++11 and up)
Loading...
Searching...
No Matches

Description


Serializers for converting Graphs from/to GraphML format.

See also
Basic graphs support, Serializers, Serial channels
Author
Juan-Antonio Fernandez-Madrigal. http://jafma.net
Date
2018-2019
Collaboration diagram for Support for GraphML:

Classes

class  elementa::adts::graphs::Szer_GraphML< Vertex, Edge >
 A serializer for any implementation of graphs that generates GraphML format. More...
 

Functions

void elementa::adts::graphs::Szer_GraphML< Vertex, Edge >::ser (elementa::base::OutSerCh &chout, const BaseGraph &graph)
 Serializes the data. More...
 

Class Documentation

◆ elementa::adts::graphs::Szer_GraphML

class elementa::adts::graphs::Szer_GraphML
template<class Vertex, class Edge>
class elementa::adts::graphs::Szer_GraphML< Vertex, Edge >

A serializer for any implementation of graphs that generates GraphML format.

Definition at line 51 of file graphml.h.

Inheritance diagram for elementa::adts::graphs::Szer_GraphML< Vertex, Edge >:
Collaboration diagram for elementa::adts::graphs::Szer_GraphML< Vertex, Edge >:

Public Types

using BaseGraph = Graph< Vertex, Edge >
 
using SType = Graph< Vertex, Edge >
 To access the Sble type parameter of this type. More...
 
using RDeserType = Graph< Vertex, Edge >
 To access the ReturnDeserType type parameter of this type. More...
 
using RSerType = Graph< Vertex, Edge >
 To access the ReturnSerType type parameter of this type. More...
 

Public Member Functions

 Szer_GraphML (const std::string &title, elementa::base::Serializer< Vertex > *szerv=nullptr, elementa::base::Serializer< Edge > *szere=nullptr, const std::string &eol="\r\n")
 Constructor. SZERV and SZERE are szers for vertex/edge data. More...
 
 Szer_GraphML (const Szer_GraphML &)=delete
 
 Szer_GraphML (Szer_GraphML &&)=delete
 
Szer_GraphMLoperator= (const Szer_GraphML &)=delete
 
Szer_GraphMLoperator= (Szer_GraphML &&)=delete
 
void setInitialVIt (const typename BaseGraph::viterator vit0)
 Set VIT0 as the vertex iterator to scan all vertices of the graph. More...
 
void setInitialEIt (const typename BaseGraph::eiterator eit0)
 Set EIT0 as the edge iterator to scan all edges of the graph. More...
 
void ser (elementa::base::OutSerCh &chout, const BaseGraph &graph)
 Serializes the data. More...
 
virtual void ser (OutSerCh &chout, const Graph< Vertex, Edge > &obj)
 Serializes an object, writing the resulting chars into CHOUT. More...
 
virtual void deser (InSerCh &chin, Graph< Vertex, Edge > &obj)
 Deserializes an object from a sequence of chars in CHIN. More...
 

Member Typedef Documentation

◆ BaseGraph

template<class Vertex , class Edge >
using elementa::adts::graphs::Szer_GraphML< Vertex, Edge >::BaseGraph = Graph<Vertex,Edge>

Definition at line 55 of file graphml.h.

◆ SType

using elementa::base::Serializer< Graph< Vertex, Edge > , void , void >::SType = Graph< Vertex, Edge >
inherited

To access the Sble type parameter of this type.

Definition at line 193 of file serializers.h.

◆ RDeserType

using elementa::base::Serializer< Graph< Vertex, Edge > , void , void >::RDeserType = Graph< Vertex, Edge >
inherited

To access the ReturnDeserType type parameter of this type.

Definition at line 196 of file serializers.h.

◆ RSerType

using elementa::base::Serializer< Graph< Vertex, Edge > , void , void >::RSerType = Graph< Vertex, Edge >
inherited

To access the ReturnSerType type parameter of this type.

Definition at line 199 of file serializers.h.

Constructor & Destructor Documentation

◆ Szer_GraphML()

template<class Vertex , class Edge >
elementa::adts::graphs::Szer_GraphML< Vertex, Edge >::Szer_GraphML ( const std::string &  title,
elementa::base::Serializer< Vertex > *  szerv = nullptr,
elementa::base::Serializer< Edge > *  szere = nullptr,
const std::string &  eol = "\r\n" 
)
inline

Constructor. SZERV and SZERE are szers for vertex/edge data.

SZERV and SZERE must outlive this serializer. If any of them is nullptr, those data are not serialized.

Definition at line 60 of file graphml.h.

References ELE_CODE_INVARG.

Member Function Documentation

◆ setInitialVIt()

template<class Vertex , class Edge >
void elementa::adts::graphs::Szer_GraphML< Vertex, Edge >::setInitialVIt ( const typename BaseGraph::viterator  vit0)
inline

Set VIT0 as the vertex iterator to scan all vertices of the graph.

By default, the iterator used will be the graph::vrangeAll().begin().

Definition at line 79 of file graphml.h.

◆ setInitialEIt()

template<class Vertex , class Edge >
void elementa::adts::graphs::Szer_GraphML< Vertex, Edge >::setInitialEIt ( const typename BaseGraph::eiterator  eit0)
inline

Set EIT0 as the edge iterator to scan all edges of the graph.

By default, the iterator used will be the graph::erangeAll().begin().

Definition at line 84 of file graphml.h.

◆ ser()

virtual void elementa::base::Serializer< Graph< Vertex, Edge > , void , void >::ser ( OutSerCh chout,
const Graph< Vertex, Edge > &  obj 
)
inlinevirtualinherited

Serializes an object, writing the resulting chars into CHOUT.

Must throw if any error during serialization, including channel errors (in that case, the channel can be left in the state it was when the error occurred).

Definition at line 206 of file serializers.h.

◆ deser()

virtual void elementa::base::Serializer< Graph< Vertex, Edge > , void , void >::deser ( InSerCh chin,
Graph< Vertex, Edge > &  obj 
)
inlinevirtualinherited

Deserializes an object from a sequence of chars in CHIN.

Must change the content of OBJ with the result. Throw if any error during serialization, including channel errors (in that case, the channel and the object are left in the state they were at the moment of the error).

Definition at line 214 of file serializers.h.

Function Documentation

◆ ser()