/* * RegistryDeserializer.hpp * * Created on: 09.05.2013 * Author: heber */ #ifndef REGISTRYDESERIALIZER_HPP_ #define REGISTRYDESERIALIZER_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include "CodePatterns/Registry.hpp" #include "Potentials/StreamFactory.hpp" template class RegistryDeserializer { public: /** Constructor for class RegistryDeserializer. * * \param _serialized stream to deseralize from * \param _factory factory class to create instances from stream * \param _registry registry class to register created instances */ RegistryDeserializer( std::istream &_serialized, StreamFactory &_factory, Registry &_registry, const std::string _name = std::string("item")) : serialized(_serialized), factory(_factory), registry(_registry), name(_name) {} /** Destructor for class RegistryDeserializer. * */ ~RegistryDeserializer() {} /** Parses the internally stored input stream for potentials. * */ void operator()(); private: std::istream &serialized; StreamFactory &factory; Registry ®istry; const std::string name; }; #include "RegistryDeserializer_impl.hpp" #endif /* REGISTRYDESERIALIZER_HPP_ */