2014-11-01から1ヶ月間の記事一覧

C++でプロパティ作成

// プロパティのゲッターセッター変数定義を行う // Property(プロパティ名, 型, 変数名) #define Property(Name, Type, Variable) \ private: \ Type Variable; \ public: \ Type Get##Name(){ return Variable; } \ void Set##Name(Type value){ Variable …

状態遷移のtemplate(適当)

#include <map> template<class T> class TState { typedef void (T::*Func)(); typedef std::map<int, Func> StateMap; typename typedef StateMap::iterator Itr; StateMap map_; public: void Add(int id, Func func){ map_[id] = func;} void Run(T* _this, int id){ if(Find(id))</int,></class></map>…