// src/backend/serializers_gatekeeper.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 SERIALIZERS_GATEKEEPER_HH
#define SERIALIZERS_GATEKEEPER_HH 1

namespace sgpem
{
  class Serializer;
}

#include "config.h"

#include <vector>

#include <sgpemv2/templates/singleton.hh>

namespace sgpem
{
  class SerializersGatekeeper;

  /** \brief FIXME document me


   */

  class SG_DLLEXPORT SerializersGatekeeper : public Singleton<SerializersGatekeeper>
  {
    friend class Singleton<SerializersGatekeeper>;

  public:
    std::vector<Serializer*>     get_registered() const;

    void       register_serializer(Serializer* serializer);

    void       unregister_serializer(Serializer* serializer);

  private:
    SerializersGatekeeper();     //private constructor.
    SerializersGatekeeper(const SerializersGatekeeper&);
    SerializersGatekeeper& operator=(const SerializersGatekeeper&);

    std::vector<Serializer*>     _registered;
  };

}//~ namespace sgpem

#endif //SERIALIZERS_GATEKEEPER_HH

