34 #include "../System/exception.h"
38 template <
typename RetVal,
typename Param1,
typename Param2>
class CL_Super_2;
42 template <
typename RetVal,
class Param1,
class Param2>
51 template <
typename RetVal,
class Param1,
class Param2>
55 RetVal
invoke(Param1 param1, Param2 param2)
57 std::vector< CL_SharedPtr<CL_SlotCallback> >::reverse_iterator it =
it_super;
65 if (it->get()->valid && it->get()->enabled)
72 throw CL_Exception(
"Called non-invokable super function");
77 std::vector< CL_SharedPtr<CL_SlotCallback> >::reverse_iterator it =
it_super;
80 if (it->get()->valid && it->get()->enabled)
92 std::vector< CL_SharedPtr<CL_SlotCallback> >::reverse_iterator
it_super;
94 std::vector< CL_SharedPtr<CL_SlotCallback> >::reverse_iterator
it_end;
99 template <
typename RetVal,
class Param1,
class Param2>
111 template <
typename RetVal,
class Param1,
class Param2,
class UserData>
124 template <
typename RetVal,
class Param1,
class Param2,
class InstanceClass>
129 : instance(instance), member_func(member_func) {
return; }
137 template <
typename RetVal,
class Param1,
class Param2,
class InstanceClass,
class UserData>
142 : instance(instance), member_func(member_func), user_data(user_data) {
return; }
151 template <
typename RetVal,
class Param1,
class Param2,
class Functor>
156 : functor(functor) {
return; }
164 template <
typename RetVal,
class Param1,
class Param2>
175 : impl(copy.impl) {
return; }
186 CL_SharedPtr<CL_SlotCallback> callback(
188 impl->connected_slots.push_back(callback);
192 template<
class UserData>
196 CL_SharedPtr<CL_SlotCallback> callback(
198 impl->connected_slots.push_back(callback);
202 template<
class InstanceClass>
206 CL_SharedPtr<CL_SlotCallback> callback(
208 impl->connected_slots.push_back(callback);
212 template<
class InstanceClass,
class UserData>
216 CL_SharedPtr<CL_SlotCallback> callback(
218 impl->connected_slots.push_back(callback);
222 template<
class Functor>
226 CL_SharedPtr<CL_SlotCallback> callback(
228 impl->connected_slots.push_back(callback);
232 RetVal
invoke(Param1 param1, Param2 param2)
const
234 std::vector< CL_SharedPtr<CL_SlotCallback> > callbacks = impl->connected_slots;
237 s.
it_end = callbacks.rend();
238 return s.
invoke(param1, param2);
249 std::vector< CL_SharedPtr<CL_SlotCallback> >::size_type i, size;
250 size = impl->connected_slots.size();
251 for (i = 0; i < size; i++)
253 if (!impl->connected_slots[i]->valid)
255 impl->connected_slots.erase(impl->connected_slots.begin()+i);
262 CL_SharedPtr<CL_Signal_Impl> impl;