#ifndef PROTOTYPE_REPOSITORY_IMPL_H
#define PROTOTYPE_REPOSITORY_IMPL_H

#ifndef DBC_H
#include "DbC.h"
#endif

#ifndef TEXT_H
#include "Text.h"
#endif

#ifndef ANY_H
#include "Any.h"
#endif

#if defined WIN32
#pragma warning( disable : 4786)
#endif

#include <map>
#include <stack>
#include <typeinfo>
#include "Prototype_repository_protocol.h"

namespace MM
{
//class Object;

class Prototype_repository_impl
    : public Prototype_repository_protocol, protected DbC
{
    //std::map   <Text, void*>    map_;
    //std::stack <void*>          stack_;
    std::map   <Text, Any>    map_;
    std::stack <Any>          stack_;

public:    
    ~Prototype_repository_impl();
    //void *                      find  (const std::type_info & type);
    Any &       find  (std::type_info const& type);
    void        adopt (Any const & prototype, std::type_info const& type);

    Any &       find  (Text const& type);
    void        adopt (Text const& type, Any  const& prototype);
};

}//MM

#endif //PROTOTYPE_REPOSITORY_IMPL_H
