Alex Bikfalvi
SimStream Documentation
ICall.h
00001 #pragma once 00002 00003 #include "IDelegate.h" 00004 00005 class ICall 00006 { 00007 public: 00008 virtual void operator()() = 0; 00009 }; 00010 00011 class ICall0 : public ICall 00012 { 00013 private: 00014 IDelegate0<void>* del; 00015 00016 public: 00017 ICall0(IDelegate0<void>* del) { this->del = del; } 00018 virtual ~ICall0() { } 00019 00020 inline virtual void operator()() { (*this->del)(); } 00021 }; 00022 00023 00024 template<typename P1> class ICall1 : public ICall 00025 { 00026 private: 00027 IDelegate1<void, P1>* del; 00028 P1 p1; 00029 00030 public: 00031 ICall1(IDelegate1<void, P1>* del, P1 p1) { this->del = del; this->p1 = p1; } 00032 virtual ~ICall1() { } 00033 00034 inline virtual void operator()() { (*this->del)(p1); } 00035 }; 00036 00037 template<typename P1, typename P2> class ICall2 : public ICall 00038 { 00039 private: 00040 IDelegate2<void, P1, P2>* del; 00041 P1 p1; 00042 P2 p2; 00043 00044 public: 00045 ICall2(IDelegate2<void, P1, P2>* del, P1 p1, P2 p2) { this->del = del; this->p1 = p1; this->p2 = p2; } 00046 virtual ~ICall2() { } 00047 00048 inline virtual void operator()() { (*this->del)(p1, p2); } 00049 }; 00050 00051 template<typename P1, typename P2, typename P3> class ICall3 : public ICall 00052 { 00053 private: 00054 IDelegate3<void, P1, P2, P3>* del; 00055 P1 p1; 00056 P2 p2; 00057 P3 p3; 00058 00059 public: 00060 ICall3(IDelegate3<void, P1, P2, P3>* del, P1 p1, P2 p2, P3 p3) { this->del = del; this->p1 = p1; this->p2 = p2; this->p3 = p3; } 00061 virtual ~ICall3() { } 00062 00063 inline virtual void operator()() { (*this->del)(p1, p2, p3); } 00064 }; 00065 00066 template<typename P1, typename P2, typename P3, typename P4> class ICall4 : public ICall 00067 { 00068 private: 00069 IDelegate4<void, P1, P2, P3, P4>* del; 00070 P1 p1; 00071 P2 p2; 00072 P3 p3; 00073 P4 p4; 00074 00075 public: 00076 ICall4(IDelegate4<void, P1, P2, P3, P4>* del, P1 p1, P2 p2, P3 p3, P4 p4) { this->del = del; this->p1 = p1; this->p2 = p2; this->p3 = p3; this->p4 = p4; } 00077 virtual ~ICall4() { } 00078 00079 inline virtual void operator()() { (*this->del)(p1, p2, p3, p4); } 00080 }; 00081 00082 template<typename P1, typename P2, typename P3, typename P4, typename P5> class ICall5 : public ICall 00083 { 00084 private: 00085 IDelegate5<void, P1, P2, P3, P4, P5>* del; 00086 P1 p1; 00087 P2 p2; 00088 P3 p3; 00089 P4 p4; 00090 P5 p5; 00091 00092 public: 00093 ICall5(IDelegate5<void, P1, P2, P3, P4, P5>* del, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { this->del = del; this->p1 = p1; this->p2 = p2; this->p3 = p3; this->p4 = p4; this->p5 = p5; } 00094 virtual ~ICall5() { } 00095 00096 inline virtual void operator()() { (*this->del)(p1, p2, p3, p4, p5); } 00097 };
Last updated: February 8, 2011