2006-07-08 07:54:21 +02:00
|
|
|
// src/backend/serialize_visitor.hh - Copyright 2005, 2006, University
|
|
|
|
// of Padova, dept. of Pure and Applied
|
|
|
|
// Mathematics
|
|
|
|
//
|
|
|
|
// This file is part of SGPEMv2.
|
|
|
|
//
|
|
|
|
// This is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// SGPEMv2 is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with SGPEMv2; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
|
|
|
#ifndef XML_VISITOR_HH
|
|
|
|
#define XML_VISITOR_HH 1
|
|
|
|
|
|
|
|
namespace sgpem
|
|
|
|
{
|
|
|
|
class Resource;
|
|
|
|
class Process;
|
|
|
|
class Thread;
|
|
|
|
class Request;
|
|
|
|
class SubRequest;
|
|
|
|
}
|
|
|
|
|
|
|
|
#include "config.h"
|
2006-07-11 02:06:40 +02:00
|
|
|
#include "serializer_visitor.hh"
|
2006-07-08 07:54:21 +02:00
|
|
|
|
|
|
|
#include <glibmm/ustring.h>
|
|
|
|
#include <libxml/xmlmemory.h>
|
|
|
|
#include <libxml/parser.h>
|
|
|
|
|
|
|
|
namespace sgpem
|
|
|
|
{
|
|
|
|
class XMLVisitor;
|
|
|
|
|
|
|
|
class XMLVisitor : public SerializerVisitor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
XMLVisitor(xmlNodePtr current);
|
|
|
|
virtual ~XMLVisitor();
|
|
|
|
|
|
|
|
virtual void from_resource(const Resource& obj);
|
|
|
|
virtual void from_process(const Process& obj);
|
|
|
|
virtual void from_thread(const Thread& obj);
|
|
|
|
virtual void from_request(const Request& obj);
|
|
|
|
virtual void from_subrequest(const SubRequest& obj);
|
2006-07-11 02:06:40 +02:00
|
|
|
|
|
|
|
virtual void from_resource(const Resource& obj, const Glib::ustring& key);
|
2006-07-08 07:54:21 +02:00
|
|
|
private:
|
2006-07-11 02:06:40 +02:00
|
|
|
void from_resource(xmlNodePtr parent, const Resource& obj, const Glib::ustring& key);
|
2006-07-08 07:54:21 +02:00
|
|
|
void from_process(xmlNodePtr parent, const Process& obj);
|
|
|
|
void from_thread(xmlNodePtr parent, const Thread& obj);
|
|
|
|
void from_request(xmlNodePtr parent, const Request& obj);
|
|
|
|
void from_subrequest(xmlNodePtr parent, const SubRequest& obj);
|
2006-07-11 02:06:40 +02:00
|
|
|
|
2006-07-08 07:54:21 +02:00
|
|
|
xmlNodePtr _current;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|