sgpemv2/plugins/xmlsave/src/xml_visitor.hh

70 lines
2.0 KiB
C++
Raw Normal View History

// 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"
#include "serializer_visitor.hh"
#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);
virtual void from_resource(const Resource& obj, const Glib::ustring& key);
private:
void from_resource(xmlNodePtr parent, const Resource& obj, const Glib::ustring& key);
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);
xmlNodePtr _current;
};
}
#endif