Show / Hide Table of Contents

Class GraphMLSerializer<TVertex, TEdge, TGraph>

A GraphML (http://graphml.graphdrawing.org/) format serializer.

Inheritance
System.Object
SerializerBase
GraphMLSerializer<TVertex, TEdge, TGraph>
Inherited Members
SerializerBase.EmitDocumentDeclaration
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: QuikGraph.Serialization
Assembly: QuikGraph.Serialization.dll
Syntax
public sealed class GraphMLSerializer<TVertex, TEdge, TGraph> : SerializerBase where TEdge : IEdge<TVertex> where TGraph : IEdgeListGraph<TVertex, TEdge>
Type Parameters
Name Description
TVertex

Vertex type.

TEdge

Edge type.

TGraph

Graph type.

Remarks

Custom vertex, edge and graph attributes can be specified by using the System.Xml.Serialization.XmlAttributeAttribute attribute on properties (field not supported).

The serializer uses LCG (lightweight code generation) to generate the methods that writes the attributes to avoid paying the price of Reflection on each vertex/edge. Since nothing is for free, the first time you will use the serializer *on a particular pair of types*, it will have to bake that method.

Hyper edge, nodes, nested graphs not supported.

Methods

| Improve this Doc View Source

Serialize(XmlWriter, TGraph, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)

Serializes the given graph instance into the given writer.

Declaration
public void Serialize(XmlWriter writer, TGraph graph, VertexIdentity<TVertex> vertexIdentity, EdgeIdentity<TVertex, TEdge> edgeIdentity)
Parameters
Type Name Description
System.Xml.XmlWriter writer

The XML writer.

TGraph graph

Graph instance to serialize.

VertexIdentity<TVertex> vertexIdentity

Vertex identity method.

EdgeIdentity<TVertex, TEdge> edgeIdentity

Edge identity method.

Exceptions
Type Condition
System.ArgumentNullException

writer is null.

System.ArgumentNullException

graph is null.

System.ArgumentNullException

vertexIdentity is null.

System.ArgumentNullException

edgeIdentity is null.

System.InvalidOperationException

Failure while writing elements to GraphML.

System.NotSupportedException

Serializing value on property without getter, or with unsupported property type.

Extension Methods

GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, XmlReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, String, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeAndValidateFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String, Action<XmlWriter, TGraph>, Action<XmlWriter, TVertex>, Action<XmlWriter, TEdge>)
  • Improve this Doc
  • View Source
In This Article
Back to top QuikGraph