![]() |
Elementa v8.0.0
Minimalistic library for any C++ application (C++11 and up)
|
Serializers for converting Graphs from/to GraphML format.

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 elementa::adts::graphs::Szer_GraphML |
A serializer for any implementation of graphs that generates GraphML format.


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_GraphML & | operator= (const Szer_GraphML &)=delete |
| Szer_GraphML & | operator= (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... | |
| using elementa::adts::graphs::Szer_GraphML< Vertex, Edge >::BaseGraph = Graph<Vertex,Edge> |
|
inherited |
To access the Sble type parameter of this type.
Definition at line 193 of file serializers.h.
|
inherited |
To access the ReturnDeserType type parameter of this type.
Definition at line 196 of file serializers.h.
|
inherited |
To access the ReturnSerType type parameter of this type.
Definition at line 199 of file serializers.h.
|
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.
|
inline |
|
inline |
|
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.
|
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.
| void elementa::adts::graphs::Szer_GraphML< Vertex, Edge >::ser | ( | elementa::base::OutSerCh & | chout, |
| const BaseGraph & | graph | ||
| ) |
#include <elementa/adts/graphs/graphml.h>
Serializes the data.
Currently this method creates maps of vertices to positions, which requires additional memory.
Definition at line 120 of file graphml.h.
References elementa::adts::graphs::Graph< Vertex, Edge >::VRange_All::begin(), elementa::adts::graphs::Graph< Vertex, Edge >::ERange_All::begin(), elementa::adts::graphs::Graph< Vertex, Edge >::connection(), ELE_CODE_TRACE_OFF, elementa::adts::graphs::Graph< Vertex, Edge >::erangeAll(), elementa::base::MultIterator< Data, BIDIR >::isEnd(), elementa::base::Szer_String::ser(), elementa::adts::graphs::Graph< Vertex, Edge >::size_edges(), elementa::adts::graphs::Graph< Vertex, Edge >::size_vertices(), and elementa::adts::graphs::Graph< Vertex, Edge >::vrangeAll().