Templates -- Meow  1.1.4
A C++ template which is unable and also not allowed to compile to obj-file first.
Register_Implement.h
Go to the documentation of this file.
1 #ifndef REGISTER_IMPLEMENT_H_
2 #define REGISTER_IMPLEMENT_H_
3 
4 #include <map>
5 
6 namespace meow{
7  template<class T> class ImplementInterface{
8  private:
9  T identify_;
10  protected:
11  ImplementInterface(T const& id): identify_(id) { }
12  public:
13  T const& identify() const { return identify_; }
14  virtual ~ImplementInterface(){ }
15  };
16  //
17  template<class T> class RegisterInterface{
18  private:
19  std::map<T, ImplementInterface<T>*> implements;
20  protected:
22  public:
23  virtual bool regImplement(ImplementInterface<T>*imp);
24  virtual ImplementInterface<T>*getImplement(T const& identify);
25  virtual ~RegisterInterface(){ }
26  };
27 }
28 
29 #include "Register_Implement.hpp"
30 
31 #endif // REGISTER_IMPLEMENT_H_
virtual ImplementInterface< T > * getImplement(T const &identify)
virtual bool regImplement(ImplementInterface< T > *imp)
T const & identify() const