aboutsummaryrefslogtreecommitdiffstats
path: root/meowpp/oo/Register_Implement.h
blob: e46f86c8ea79da37d889bce53184e713532b9b8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef   REGISTER_IMPLEMENT_H_
#define   REGISTER_IMPLEMENT_H_

#include <map>

namespace meow{
  template<class T>
  class ImplementInterface{
    private:
      T identify_;
    protected:
      ImplementInterface(T const& id): identify_(id) { }
    public:
      T const& identify() const { return identify_; }
      virtual ~ImplementInterface(){ }
  };
  //
  template<class T>
  class RegisterInterface{
    private:
      std::map<T, ImplementInterface<T>*> implements;
    protected:
      RegisterInterface();
    public:
      virtual bool                   regImplement(ImplementInterface<T>*imp);
      virtual ImplementInterface<T>* getImplement(T const& identify);
      virtual ~RegisterInterface(){ }
  };
}

#include "Register_Implement.hpp"

#endif // REGISTER_IMPLEMENT_H_