Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 1.06 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. template types in a container class
  2. template <typename T>
  3. class Effect
  4. {
  5.   private:
  6.   Vbo<T>  m_Vbo;
  7. };
  8.        
  9. class EffectMgr : public Singleton <EffectMgr>
  10. {
  11. private:
  12.     typedef std::map<std::string, Effect<T> & > EffectMap;
  13. };
  14.        
  15. class EffectMgr : public Singleton <EffectMgr>,
  16. {
  17. private:
  18.     template <typename T>
  19.     typedef std::map<std::string, Effect<T> & > EffectMap;
  20. };
  21.        
  22. template <typename T>
  23. class EffectMgr : public Singleton <EffectMgr>
  24. {
  25. private:
  26.     typedef std::map<std::string, Effect<T> & > EffectMap;
  27. };
  28. // use: EffectMgr<type>::EffectMap
  29.        
  30. class EffectMgr : public Singleton <EffectMgr>
  31. {
  32. private:
  33.     template <typename T>
  34.     using EffectMap = std::map<std::string, Effect<T> & >; // C++11 feature
  35. };
  36. // use: EffectMgr::EffectMap<type>
  37.        
  38. template<typename T>
  39. class EffectMgr : public Singleton <EffectMgr>
  40. {
  41. private:
  42.     typedef std::map<std::string, Effect<T> & > EffectMap;
  43. };
  44.        
  45. class IEffect
  46. {
  47. public:
  48.    virtual ~IEffect() = 0;
  49. }
  50.  
  51. IEffect::~IEffect()
  52. {
  53. }
  54.        
  55. template <typename T>
  56. class Effect: public IEffect
  57. {
  58.   private:
  59.   Vbo<T>  m_Vbo;
  60. };