00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef CNTM_SIGNATUREARGSCOLLECTOR_H
00015 #define CNTM_SIGNATUREARGSCOLLECTOR_H
00016
00017
00018
00019 #include <Cntm/SystemUtils/AtomicUtils.h>
00020 #include <Cntm/Utils/IntTypes.h>
00021 #include <Cntm/Utils/SignatureInfo.h>
00022 #include <Cntm/SystemUtils/ObjectAllocateBuffer.h>
00023
00024 namespace Cntm
00025 {
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 template < typename DeriveClassT, typename ResT, typename SignatureInfoT, int ArgsCountI >
00059 class SignatureArgsCollector
00060 {
00061 };
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 #define CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR class Signature##ArgsCollector
00090
00091 template < typename DeriveClassT, typename ResT, typename SignatureInfoT > CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR < DeriveClassT, ResT, SignatureInfoT, 0 > { public: typedef SignatureInfoT SignInfoType; ResT operator() () { if (static_cast<DeriveClassT*>(this)->NoNeedCreateCollectObject()) return static_cast<DeriveClassT*>(this)->NoneProcessCollectObject(); typename DeriveClassT::SignatureArgsCollectObject* obj = static_cast<DeriveClassT*>(this)->CreateCollectObject(); try { new (obj->ArgsBuffer()) typename SignatureInfoT::Args(); obj->ConstructArgs(); } catch (...) { delete obj; throw; } return static_cast<DeriveClassT*>(this)->ProcessCollectObject(obj); } };
00092 template < typename DeriveClassT, typename ResT, typename SignatureInfoT > CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR < DeriveClassT, ResT, SignatureInfoT, 1 > { public: typedef SignatureInfoT SignInfoType; ResT operator() ( const typename SignatureInfoT::StoreType0 & Arg0) { if (static_cast<DeriveClassT*>(this)->NoNeedCreateCollectObject()) return static_cast<DeriveClassT*>(this)->NoneProcessCollectObject(); typename DeriveClassT::SignatureArgsCollectObject* obj = static_cast<DeriveClassT*>(this)->CreateCollectObject(); try { new (obj->ArgsBuffer()) typename SignatureInfoT::Args( Arg0); obj->ConstructArgs(); } catch (...) { delete obj; throw; } return static_cast<DeriveClassT*>(this)->ProcessCollectObject(obj); } };
00093 template < typename DeriveClassT, typename ResT, typename SignatureInfoT > CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR < DeriveClassT, ResT, SignatureInfoT, 2 > { public: typedef SignatureInfoT SignInfoType; ResT operator() ( const typename SignatureInfoT::StoreType0 & Arg0 , const typename SignatureInfoT::StoreType1 & Arg1) { if (static_cast<DeriveClassT*>(this)->NoNeedCreateCollectObject()) return static_cast<DeriveClassT*>(this)->NoneProcessCollectObject(); typename DeriveClassT::SignatureArgsCollectObject* obj = static_cast<DeriveClassT*>(this)->CreateCollectObject(); try { new (obj->ArgsBuffer()) typename SignatureInfoT::Args( Arg0 , Arg1); obj->ConstructArgs(); } catch (...) { delete obj; throw; } return static_cast<DeriveClassT*>(this)->ProcessCollectObject(obj); } };
00094 template < typename DeriveClassT, typename ResT, typename SignatureInfoT > CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR < DeriveClassT, ResT, SignatureInfoT, 3 > { public: typedef SignatureInfoT SignInfoType; ResT operator() ( const typename SignatureInfoT::StoreType0 & Arg0 , const typename SignatureInfoT::StoreType1 & Arg1 , const typename SignatureInfoT::StoreType2 & Arg2) { if (static_cast<DeriveClassT*>(this)->NoNeedCreateCollectObject()) return static_cast<DeriveClassT*>(this)->NoneProcessCollectObject(); typename DeriveClassT::SignatureArgsCollectObject* obj = static_cast<DeriveClassT*>(this)->CreateCollectObject(); try { new (obj->ArgsBuffer()) typename SignatureInfoT::Args( Arg0 , Arg1 , Arg2); obj->ConstructArgs(); } catch (...) { delete obj; throw; } return static_cast<DeriveClassT*>(this)->ProcessCollectObject(obj); } };
00095 template < typename DeriveClassT, typename ResT, typename SignatureInfoT > CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR < DeriveClassT, ResT, SignatureInfoT, 4 > { public: typedef SignatureInfoT SignInfoType; ResT operator() ( const typename SignatureInfoT::StoreType0 & Arg0 , const typename SignatureInfoT::StoreType1 & Arg1 , const typename SignatureInfoT::StoreType2 & Arg2 , const typename SignatureInfoT::StoreType3 & Arg3) { if (static_cast<DeriveClassT*>(this)->NoNeedCreateCollectObject()) return static_cast<DeriveClassT*>(this)->NoneProcessCollectObject(); typename DeriveClassT::SignatureArgsCollectObject* obj = static_cast<DeriveClassT*>(this)->CreateCollectObject(); try { new (obj->ArgsBuffer()) typename SignatureInfoT::Args( Arg0 , Arg1 , Arg2 , Arg3); obj->ConstructArgs(); } catch (...) { delete obj; throw; } return static_cast<DeriveClassT*>(this)->ProcessCollectObject(obj); } };
00096 template < typename DeriveClassT, typename ResT, typename SignatureInfoT > CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR < DeriveClassT, ResT, SignatureInfoT, 5 > { public: typedef SignatureInfoT SignInfoType; ResT operator() ( const typename SignatureInfoT::StoreType0 & Arg0 , const typename SignatureInfoT::StoreType1 & Arg1 , const typename SignatureInfoT::StoreType2 & Arg2 , const typename SignatureInfoT::StoreType3 & Arg3 , const typename SignatureInfoT::StoreType4 & Arg4) { if (static_cast<DeriveClassT*>(this)->NoNeedCreateCollectObject()) return static_cast<DeriveClassT*>(this)->NoneProcessCollectObject(); typename DeriveClassT::SignatureArgsCollectObject* obj = static_cast<DeriveClassT*>(this)->CreateCollectObject(); try { new (obj->ArgsBuffer()) typename SignatureInfoT::Args( Arg0 , Arg1 , Arg2 , Arg3 , Arg4); obj->ConstructArgs(); } catch (...) { delete obj; throw; } return static_cast<DeriveClassT*>(this)->ProcessCollectObject(obj); } };
00097 template < typename DeriveClassT, typename ResT, typename SignatureInfoT > CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR < DeriveClassT, ResT, SignatureInfoT, 6 > { public: typedef SignatureInfoT SignInfoType; ResT operator() ( const typename SignatureInfoT::StoreType0 & Arg0 , const typename SignatureInfoT::StoreType1 & Arg1 , const typename SignatureInfoT::StoreType2 & Arg2 , const typename SignatureInfoT::StoreType3 & Arg3 , const typename SignatureInfoT::StoreType4 & Arg4 , const typename SignatureInfoT::StoreType5 & Arg5) { if (static_cast<DeriveClassT*>(this)->NoNeedCreateCollectObject()) return static_cast<DeriveClassT*>(this)->NoneProcessCollectObject(); typename DeriveClassT::SignatureArgsCollectObject* obj = static_cast<DeriveClassT*>(this)->CreateCollectObject(); try { new (obj->ArgsBuffer()) typename SignatureInfoT::Args( Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5); obj->ConstructArgs(); } catch (...) { delete obj; throw; } return static_cast<DeriveClassT*>(this)->ProcessCollectObject(obj); } };
00098 template < typename DeriveClassT, typename ResT, typename SignatureInfoT > CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR < DeriveClassT, ResT, SignatureInfoT, 7 > { public: typedef SignatureInfoT SignInfoType; ResT operator() ( const typename SignatureInfoT::StoreType0 & Arg0 , const typename SignatureInfoT::StoreType1 & Arg1 , const typename SignatureInfoT::StoreType2 & Arg2 , const typename SignatureInfoT::StoreType3 & Arg3 , const typename SignatureInfoT::StoreType4 & Arg4 , const typename SignatureInfoT::StoreType5 & Arg5 , const typename SignatureInfoT::StoreType6 & Arg6) { if (static_cast<DeriveClassT*>(this)->NoNeedCreateCollectObject()) return static_cast<DeriveClassT*>(this)->NoneProcessCollectObject(); typename DeriveClassT::SignatureArgsCollectObject* obj = static_cast<DeriveClassT*>(this)->CreateCollectObject(); try { new (obj->ArgsBuffer()) typename SignatureInfoT::Args( Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6); obj->ConstructArgs(); } catch (...) { delete obj; throw; } return static_cast<DeriveClassT*>(this)->ProcessCollectObject(obj); } };
00099 template < typename DeriveClassT, typename ResT, typename SignatureInfoT > CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR < DeriveClassT, ResT, SignatureInfoT, 8 > { public: typedef SignatureInfoT SignInfoType; ResT operator() ( const typename SignatureInfoT::StoreType0 & Arg0 , const typename SignatureInfoT::StoreType1 & Arg1 , const typename SignatureInfoT::StoreType2 & Arg2 , const typename SignatureInfoT::StoreType3 & Arg3 , const typename SignatureInfoT::StoreType4 & Arg4 , const typename SignatureInfoT::StoreType5 & Arg5 , const typename SignatureInfoT::StoreType6 & Arg6 , const typename SignatureInfoT::StoreType7 & Arg7) { if (static_cast<DeriveClassT*>(this)->NoNeedCreateCollectObject()) return static_cast<DeriveClassT*>(this)->NoneProcessCollectObject(); typename DeriveClassT::SignatureArgsCollectObject* obj = static_cast<DeriveClassT*>(this)->CreateCollectObject(); try { new (obj->ArgsBuffer()) typename SignatureInfoT::Args( Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7); obj->ConstructArgs(); } catch (...) { delete obj; throw; } return static_cast<DeriveClassT*>(this)->ProcessCollectObject(obj); } };
00100 template < typename DeriveClassT, typename ResT, typename SignatureInfoT > CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR < DeriveClassT, ResT, SignatureInfoT, 9 > { public: typedef SignatureInfoT SignInfoType; ResT operator() ( const typename SignatureInfoT::StoreType0 & Arg0 , const typename SignatureInfoT::StoreType1 & Arg1 , const typename SignatureInfoT::StoreType2 & Arg2 , const typename SignatureInfoT::StoreType3 & Arg3 , const typename SignatureInfoT::StoreType4 & Arg4 , const typename SignatureInfoT::StoreType5 & Arg5 , const typename SignatureInfoT::StoreType6 & Arg6 , const typename SignatureInfoT::StoreType7 & Arg7 , const typename SignatureInfoT::StoreType8 & Arg8) { if (static_cast<DeriveClassT*>(this)->NoNeedCreateCollectObject()) return static_cast<DeriveClassT*>(this)->NoneProcessCollectObject(); typename DeriveClassT::SignatureArgsCollectObject* obj = static_cast<DeriveClassT*>(this)->CreateCollectObject(); try { new (obj->ArgsBuffer()) typename SignatureInfoT::Args( Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8); obj->ConstructArgs(); } catch (...) { delete obj; throw; } return static_cast<DeriveClassT*>(this)->ProcessCollectObject(obj); } };
00101 template < typename DeriveClassT, typename ResT, typename SignatureInfoT > CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR < DeriveClassT, ResT, SignatureInfoT, 10 > { public: typedef SignatureInfoT SignInfoType; ResT operator() ( const typename SignatureInfoT::StoreType0 & Arg0 , const typename SignatureInfoT::StoreType1 & Arg1 , const typename SignatureInfoT::StoreType2 & Arg2 , const typename SignatureInfoT::StoreType3 & Arg3 , const typename SignatureInfoT::StoreType4 & Arg4 , const typename SignatureInfoT::StoreType5 & Arg5 , const typename SignatureInfoT::StoreType6 & Arg6 , const typename SignatureInfoT::StoreType7 & Arg7 , const typename SignatureInfoT::StoreType8 & Arg8 , const typename SignatureInfoT::StoreType9 & Arg9) { if (static_cast<DeriveClassT*>(this)->NoNeedCreateCollectObject()) return static_cast<DeriveClassT*>(this)->NoneProcessCollectObject(); typename DeriveClassT::SignatureArgsCollectObject* obj = static_cast<DeriveClassT*>(this)->CreateCollectObject(); try { new (obj->ArgsBuffer()) typename SignatureInfoT::Args( Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9); obj->ConstructArgs(); } catch (...) { delete obj; throw; } return static_cast<DeriveClassT*>(this)->ProcessCollectObject(obj); } };
00102 template < typename DeriveClassT, typename ResT, typename SignatureInfoT > CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR < DeriveClassT, ResT, SignatureInfoT, 11 > { public: typedef SignatureInfoT SignInfoType; ResT operator() ( const typename SignatureInfoT::StoreType0 & Arg0 , const typename SignatureInfoT::StoreType1 & Arg1 , const typename SignatureInfoT::StoreType2 & Arg2 , const typename SignatureInfoT::StoreType3 & Arg3 , const typename SignatureInfoT::StoreType4 & Arg4 , const typename SignatureInfoT::StoreType5 & Arg5 , const typename SignatureInfoT::StoreType6 & Arg6 , const typename SignatureInfoT::StoreType7 & Arg7 , const typename SignatureInfoT::StoreType8 & Arg8 , const typename SignatureInfoT::StoreType9 & Arg9 , const typename SignatureInfoT::StoreType10 & Arg10) { if (static_cast<DeriveClassT*>(this)->NoNeedCreateCollectObject()) return static_cast<DeriveClassT*>(this)->NoneProcessCollectObject(); typename DeriveClassT::SignatureArgsCollectObject* obj = static_cast<DeriveClassT*>(this)->CreateCollectObject(); try { new (obj->ArgsBuffer()) typename SignatureInfoT::Args( Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9 , Arg10); obj->ConstructArgs(); } catch (...) { delete obj; throw; } return static_cast<DeriveClassT*>(this)->ProcessCollectObject(obj); } };
00103 template < typename DeriveClassT, typename ResT, typename SignatureInfoT > CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR < DeriveClassT, ResT, SignatureInfoT, 12 > { public: typedef SignatureInfoT SignInfoType; ResT operator() ( const typename SignatureInfoT::StoreType0 & Arg0 , const typename SignatureInfoT::StoreType1 & Arg1 , const typename SignatureInfoT::StoreType2 & Arg2 , const typename SignatureInfoT::StoreType3 & Arg3 , const typename SignatureInfoT::StoreType4 & Arg4 , const typename SignatureInfoT::StoreType5 & Arg5 , const typename SignatureInfoT::StoreType6 & Arg6 , const typename SignatureInfoT::StoreType7 & Arg7 , const typename SignatureInfoT::StoreType8 & Arg8 , const typename SignatureInfoT::StoreType9 & Arg9 , const typename SignatureInfoT::StoreType10 & Arg10 , const typename SignatureInfoT::StoreType11 & Arg11) { if (static_cast<DeriveClassT*>(this)->NoNeedCreateCollectObject()) return static_cast<DeriveClassT*>(this)->NoneProcessCollectObject(); typename DeriveClassT::SignatureArgsCollectObject* obj = static_cast<DeriveClassT*>(this)->CreateCollectObject(); try { new (obj->ArgsBuffer()) typename SignatureInfoT::Args( Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9 , Arg10 , Arg11); obj->ConstructArgs(); } catch (...) { delete obj; throw; } return static_cast<DeriveClassT*>(this)->ProcessCollectObject(obj); } };
00104 template < typename DeriveClassT, typename ResT, typename SignatureInfoT > CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR < DeriveClassT, ResT, SignatureInfoT, 13 > { public: typedef SignatureInfoT SignInfoType; ResT operator() ( const typename SignatureInfoT::StoreType0 & Arg0 , const typename SignatureInfoT::StoreType1 & Arg1 , const typename SignatureInfoT::StoreType2 & Arg2 , const typename SignatureInfoT::StoreType3 & Arg3 , const typename SignatureInfoT::StoreType4 & Arg4 , const typename SignatureInfoT::StoreType5 & Arg5 , const typename SignatureInfoT::StoreType6 & Arg6 , const typename SignatureInfoT::StoreType7 & Arg7 , const typename SignatureInfoT::StoreType8 & Arg8 , const typename SignatureInfoT::StoreType9 & Arg9 , const typename SignatureInfoT::StoreType10 & Arg10 , const typename SignatureInfoT::StoreType11 & Arg11 , const typename SignatureInfoT::StoreType12 & Arg12) { if (static_cast<DeriveClassT*>(this)->NoNeedCreateCollectObject()) return static_cast<DeriveClassT*>(this)->NoneProcessCollectObject(); typename DeriveClassT::SignatureArgsCollectObject* obj = static_cast<DeriveClassT*>(this)->CreateCollectObject(); try { new (obj->ArgsBuffer()) typename SignatureInfoT::Args( Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9 , Arg10 , Arg11 , Arg12); obj->ConstructArgs(); } catch (...) { delete obj; throw; } return static_cast<DeriveClassT*>(this)->ProcessCollectObject(obj); } };
00105 template < typename DeriveClassT, typename ResT, typename SignatureInfoT > CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR < DeriveClassT, ResT, SignatureInfoT, 14 > { public: typedef SignatureInfoT SignInfoType; ResT operator() ( const typename SignatureInfoT::StoreType0 & Arg0 , const typename SignatureInfoT::StoreType1 & Arg1 , const typename SignatureInfoT::StoreType2 & Arg2 , const typename SignatureInfoT::StoreType3 & Arg3 , const typename SignatureInfoT::StoreType4 & Arg4 , const typename SignatureInfoT::StoreType5 & Arg5 , const typename SignatureInfoT::StoreType6 & Arg6 , const typename SignatureInfoT::StoreType7 & Arg7 , const typename SignatureInfoT::StoreType8 & Arg8 , const typename SignatureInfoT::StoreType9 & Arg9 , const typename SignatureInfoT::StoreType10 & Arg10 , const typename SignatureInfoT::StoreType11 & Arg11 , const typename SignatureInfoT::StoreType12 & Arg12 , const typename SignatureInfoT::StoreType13 & Arg13) { if (static_cast<DeriveClassT*>(this)->NoNeedCreateCollectObject()) return static_cast<DeriveClassT*>(this)->NoneProcessCollectObject(); typename DeriveClassT::SignatureArgsCollectObject* obj = static_cast<DeriveClassT*>(this)->CreateCollectObject(); try { new (obj->ArgsBuffer()) typename SignatureInfoT::Args( Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9 , Arg10 , Arg11 , Arg12 , Arg13); obj->ConstructArgs(); } catch (...) { delete obj; throw; } return static_cast<DeriveClassT*>(this)->ProcessCollectObject(obj); } };
00106 template < typename DeriveClassT, typename ResT, typename SignatureInfoT > CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR < DeriveClassT, ResT, SignatureInfoT, 15 > { public: typedef SignatureInfoT SignInfoType; ResT operator() ( const typename SignatureInfoT::StoreType0 & Arg0 , const typename SignatureInfoT::StoreType1 & Arg1 , const typename SignatureInfoT::StoreType2 & Arg2 , const typename SignatureInfoT::StoreType3 & Arg3 , const typename SignatureInfoT::StoreType4 & Arg4 , const typename SignatureInfoT::StoreType5 & Arg5 , const typename SignatureInfoT::StoreType6 & Arg6 , const typename SignatureInfoT::StoreType7 & Arg7 , const typename SignatureInfoT::StoreType8 & Arg8 , const typename SignatureInfoT::StoreType9 & Arg9 , const typename SignatureInfoT::StoreType10 & Arg10 , const typename SignatureInfoT::StoreType11 & Arg11 , const typename SignatureInfoT::StoreType12 & Arg12 , const typename SignatureInfoT::StoreType13 & Arg13 , const typename SignatureInfoT::StoreType14 & Arg14) { if (static_cast<DeriveClassT*>(this)->NoNeedCreateCollectObject()) return static_cast<DeriveClassT*>(this)->NoneProcessCollectObject(); typename DeriveClassT::SignatureArgsCollectObject* obj = static_cast<DeriveClassT*>(this)->CreateCollectObject(); try { new (obj->ArgsBuffer()) typename SignatureInfoT::Args( Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9 , Arg10 , Arg11 , Arg12 , Arg13 , Arg14); obj->ConstructArgs(); } catch (...) { delete obj; throw; } return static_cast<DeriveClassT*>(this)->ProcessCollectObject(obj); } };
00107 template < typename DeriveClassT, typename ResT, typename SignatureInfoT > CNTM_STRUCT_SIGNATURE_ARG_COLLECTOR < DeriveClassT, ResT, SignatureInfoT, 16 > { public: typedef SignatureInfoT SignInfoType; ResT operator() ( const typename SignatureInfoT::StoreType0 & Arg0 , const typename SignatureInfoT::StoreType1 & Arg1 , const typename SignatureInfoT::StoreType2 & Arg2 , const typename SignatureInfoT::StoreType3 & Arg3 , const typename SignatureInfoT::StoreType4 & Arg4 , const typename SignatureInfoT::StoreType5 & Arg5 , const typename SignatureInfoT::StoreType6 & Arg6 , const typename SignatureInfoT::StoreType7 & Arg7 , const typename SignatureInfoT::StoreType8 & Arg8 , const typename SignatureInfoT::StoreType9 & Arg9 , const typename SignatureInfoT::StoreType10 & Arg10 , const typename SignatureInfoT::StoreType11 & Arg11 , const typename SignatureInfoT::StoreType12 & Arg12 , const typename SignatureInfoT::StoreType13 & Arg13 , const typename SignatureInfoT::StoreType14 & Arg14 , const typename SignatureInfoT::StoreType15 & Arg15) { if (static_cast<DeriveClassT*>(this)->NoNeedCreateCollectObject()) return static_cast<DeriveClassT*>(this)->NoneProcessCollectObject(); typename DeriveClassT::SignatureArgsCollectObject* obj = static_cast<DeriveClassT*>(this)->CreateCollectObject(); try { new (obj->ArgsBuffer()) typename SignatureInfoT::Args( Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9 , Arg10 , Arg11 , Arg12 , Arg13 , Arg14 , Arg15); obj->ConstructArgs(); } catch (...) { delete obj; throw; } return static_cast<DeriveClassT*>(this)->ProcessCollectObject(obj); } };
00108
00109
00110
00111
00112 template < typename SignatureArgsT >
00113 class SignatureArgsCollectObjectBase
00114 {
00115 public:
00116
00117
00118
00119
00120 SignatureArgsCollectObjectBase() {}
00121
00122
00123
00124
00125 ~SignatureArgsCollectObjectBase() { DestroyArgs(); }
00126
00127
00128
00129
00130
00131
00132 void* ArgsBuffer() { return argsBuffer.Place(); }
00133
00134
00135
00136
00137 SignatureArgsT* Args() { return reinterpret_cast<SignatureArgsT*>(argsBuffer.Place()); }
00138
00139
00140
00141
00142 void ConstructArgs() { argsConstructed.SetValue(1); }
00143
00144
00145
00146
00147 void DestroyArgs() throw()
00148 {
00149 try
00150 {
00151 if (argsConstructed.DecAndTest())
00152 Args()->~SignatureArgsT();
00153 else
00154 argsConstructed.SetValue(0);
00155 }
00156 catch(...)
00157 {
00158 }
00159 }
00160
00161 private:
00162
00163 typedef unsigned char BufItem;
00164
00165
00166
00167
00168 SpecUtils::ObjectAllocateBuffer<SignatureArgsT> argsBuffer;
00169
00170
00171
00172
00173 SpecUtils::AtomicVariable argsConstructed;
00174 };
00175
00176 }
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209 #endif //CNTM_SIGNATUREARGSCOLLECTOR_H