sgpemv2/plugins/xmlsave/src/xml_serializer_factory.hh

87 lines
2.5 KiB
C++
Raw Normal View History

// src/xml_serializer_factory.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_SERIALIZER_FACTORY_HH
#define XML_SERIALIZER_FACTORY_HH 1
#include "config.h"
#include "history.hh"
#include "environment.hh"
#include <glibmm/ustring.h>
#include <map>
namespace sgpem
{
class History;
class Resource;
class Process;
class Thread;
class Request;
class SubRequest;
}
namespace sgpem
{
class XMLSerializerFactory;
class XMLSerializerFactory
{
public:
XMLSerializerFactory(History& hist);
~XMLSerializerFactory();
History* get_history();
typedef Environment::resource_key_t resource_key_t;
// typedef const std::pair<resource_key_t, Resource*> ResourcePair;
//NOUSE typedef const std::map<const Glib::ustring&, const Glib::ustring&> Parameters;
// associate old keys with new ones
typedef std::map<Glib::ustring, Glib::ustring> Parameters;
// associate old keys with new ones
//typedef pair<resource_key_t, resource_key_t> TempPair;
typedef std::map<resource_key_t, resource_key_t> TempMap;
void factory_method(const Glib::ustring& class_name, Parameters& parameters);
protected:
private:
History::ResourcePair create_resource(Parameters& parameters);
Process& create_process(Parameters& parameters);
Thread& create_thread(Parameters& parameters);
Request& create_request(Parameters& parameters);
SubRequest& create_subrequest(Parameters& parameters);
// history object to add to resources processes etc...
History* _hist;
// memory of last objects to link to
Process* _last_process;
Thread* _last_thread;
Request* _last_request;
// take association with old keys an new keys
// to reslove sub requests
TempMap _temp_map;
};
}
#endif