2 Qanava - Graph drawing library for QT
3 Copyright (C) 2006 Benoit AUTHEMAN
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 //-----------------------------------------------------------------------------
21 // This file is a part of the Qanava software.
23 // \file qanRepository.h
24 // \author Benoit Autheman (benoit@libqanava.org)
25 // \date 2005 December 23
26 //-----------------------------------------------------------------------------
29 #ifndef qanRepository_h
30 #define qanRepository_h
34 #include "./qanConfig.h"
35 #include "./qanGraph.h"
43 #include <QDomDocument>
46 //-----------------------------------------------------------------------------
47 namespace qan
{ // ::qan
49 //! Model an abstract storage object for graphs.
55 /*! \name Graph Serialization Management *///----------------------
59 //! Repository constructor with name initialization.
60 Repository( const std::string
& name
) : _name( name
) { }
62 //! Repsoitory standard virtual destructor.
63 virtual ~Repository( ) { }
66 virtual void load( Graph
* graph
) = 0;
69 virtual void save( Graph
* graph
) = 0;
71 //! Get the repository name.
72 const std::string
& getName( ) const { return _name
; }
76 //! Repository name (usually a file name).
79 //-----------------------------------------------------------------
88 class PajekRepository
: public Repository
90 /*! \name Graph Serialization Management *///----------------------
94 PajekRepository( const std::string
& name
) : Repository( name
) { }
96 virtual ~PajekRepository( ) { }
99 virtual void load( Graph
* graph
);
102 virtual void save( Graph
* graph
);
106 //! Current data mode (Pajek Vertices, Arcs or Edges)
115 //-----------------------------------------------------------------
121 /*! DEPRECATED, used for debugging purposes only.
124 class GraphvizRepository
: public Repository
126 /*! \name Graph Serialization Management *///----------------------
130 GraphvizRepository( const std::string
& name
) : Repository( name
) { }
132 virtual ~GraphvizRepository( ) { }
135 virtual void load( Graph
* graph
);
138 virtual void save( Graph
* graph
);
140 //-----------------------------------------------------------------
143 //! GML (XML based Graph Markup Language) repository.
147 class GMLRepository
: public Repository
149 /*! \name Graph Serialization Management *///----------------------
153 GMLRepository( const std::string
& name
);
155 virtual ~GMLRepository( ) { }
158 virtual void load( Graph
* graph
);
161 virtual void save( Graph
* graph
);
165 void parseGraph( QDomDocument domDocument
, QDomElement graphChild
, Graph
* graph
);
167 //-----------------------------------------------------------------
170 //-----------------------------------------------------------------------------
173 #endif // qanRepository_h