Source/Gorgon/TMP.h

Tue, 06 Jul 2021 10:22:49 +0300

author
cemkalyoncu
date
Tue, 06 Jul 2021 10:22:49 +0300
branch
4.x-dev
changeset 1701
b168349a931d
parent 1516
dc526bcc1ad3
permissions
-rw-r--r--

* Image/Bitmap rotate

902
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
1 /// @file TMP.h This file contains template metaprogramming methods and
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
2 /// classes used throughout Gorgon Library.
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
3
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
4 #pragma once
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
5
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
6 #include <tuple>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
7 #include <typeinfo>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
8 #include "Utils/Compiler.h"
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
9 #include <functional>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
10
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
11 namespace Gorgon {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
12 namespace TMP {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
13
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
14 /// A sequence element, can be used to represent a sequence of integer numbers
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
15 template<int ...> struct Sequence {};
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
16
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
17 /// Generates a sequence from 0 to the given value.
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
18 template<int N, int ...S> struct Generate : Generate<N-1, N-1, S...> {};
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
19
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
20 ///@cond
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
21 template<int ...S> struct Generate<0, S...>{ typedef Sequence<S...> Type; };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
22
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
23 template<class F_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
24 struct FunctionTraits;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
25
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
26 template<class R_, class... Args_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
27 struct FunctionTraits<R_(*)(Args_...)> : public FunctionTraits<R_(Args_...)>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
28 {};
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
29
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
30 ///@endcond
1100
cc72d98bf947 * A static string compare function
cemkalyoncu
parents: 902
diff changeset
31
cc72d98bf947 * A static string compare function
cemkalyoncu
parents: 902
diff changeset
32
cc72d98bf947 * A static string compare function
cemkalyoncu
parents: 902
diff changeset
33 constexpr bool static_strequal_helper(const char * a, const char * b, unsigned len) {
cc72d98bf947 * A static string compare function
cemkalyoncu
parents: 902
diff changeset
34 return (len == 0) ? true : ((*a == *b) ? static_strequal_helper(a + 1, b + 1, len - 1) : false);
cc72d98bf947 * A static string compare function
cemkalyoncu
parents: 902
diff changeset
35 }
cc72d98bf947 * A static string compare function
cemkalyoncu
parents: 902
diff changeset
36
cc72d98bf947 * A static string compare function
cemkalyoncu
parents: 902
diff changeset
37 template <unsigned N1_, unsigned N2_>
cc72d98bf947 * A static string compare function
cemkalyoncu
parents: 902
diff changeset
38 constexpr bool StaticStrEqual(const char (&str1)[N1_], const char (&str2)[N2_]) {
cc72d98bf947 * A static string compare function
cemkalyoncu
parents: 902
diff changeset
39 return (N1_ == N2_) ? static_strequal_helper(&(str1[0]), &(str2[0]), N1_) : false;
cc72d98bf947 * A static string compare function
cemkalyoncu
parents: 902
diff changeset
40 }
902
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
41
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
42 /**
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
43 * Determines traits of a function. Works with regular, member and std::function.
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
44 * First argument of the member function is mapped as a pointer to the class. If the
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
45 * function is a const member function class pointer is set to be const
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
46 *
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
47 * Some examples:
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
48 * @code
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
49 * typename FunctionTraits<decltype(myfn)>::ReturnType ret = myfn();
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
50 *
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
51 * typename FunctionTraits<decltype(myfn)>::template Arguments<1> secondarg;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
52 *
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
53 * template<class F_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
54 * typename std::enable_if<FunctionTraits<F_>::IsMember>::type MembersOnly(F_ fn) { ... }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
55 *
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
56 * int params = FunctionTraits<decltype(&A::myfn)>::Arity;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
57 * @endcode
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
58 */
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
59 template<class R_, class ...Args_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
60 struct FunctionTraits<R_(Args_...)> {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
61 /// Return type of the function
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
62 using ReturnType = R_;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
63
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
64 /// Number of arguments of the function
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
65 static const unsigned Arity = sizeof...(Args_);
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
66
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
67 /// Whether this function is a member function
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
68 static const bool IsMember = false;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
69
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
70 /// This struct allow access to types of individual arguments. Do not forget to use template
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
71 /// keyword before arguments.
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
72 template<unsigned N>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
73 struct Arguments {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
74 static_assert(N<sizeof...(Args_), "Argument index out of bounds");
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
75
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
76 /// Type of the argument.
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
77 using Type = typename std::tuple_element<N, std::tuple<Args_...>>::type;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
78 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
79 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
80
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
81 /// @cond
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
82 template<class C_, class R_, class ...Args_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
83 struct FunctionTraits<R_(C_::*)(Args_...)> :
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
84 public FunctionTraits<R_(typename std::decay<C_>::type&, Args_...)>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
85 {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
86 static const bool IsMember = true;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
87 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
88
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
89 template<class C_, class R_, class ...Args_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
90 struct FunctionTraits<R_(C_::*)(Args_...) const> :
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
91 public FunctionTraits<R_(const typename std::decay<C_>::type&, Args_...)>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
92 {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
93 static const bool IsMember = true;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
94 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
95
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
96 template<class F_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
97 struct FunctionTraits
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
98 {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
99 private:
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
100 using innertype = FunctionTraits<decltype(&F_::operator())>;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
101 public:
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
102 using ReturnType = typename innertype::ReturnType;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
103
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
104 static const unsigned Arity = innertype::Arity - 1;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
105
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
106 static const bool IsMember = false;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
107
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
108 template <unsigned N>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
109 struct Arguments
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
110 {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
111 static_assert(N<Arity, "Argument index out of bounds");
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
112 using Type = typename innertype::template Arguments<N+1>::Type;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
113 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
114 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
115
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
116 template<class F_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
117 struct FunctionTraits<F_&> : public FunctionTraits<F_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
118 {};
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
119
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
120 template<class F_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
121 struct FunctionTraits<F_&&> : public FunctionTraits<F_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
122 {};
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
123
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
124 ///@endcond
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
125
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
126 /// This acts like ? operator between two types
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
127 template<bool Cond_, class T1_, class T2_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
128 struct Choose;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
129
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
130 /// @cond
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
131 template<class T1_, class T2_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
132 struct Choose<false, T1_, T2_> {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
133 using Type = T2_;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
134 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
135
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
136 template<class T1_, class T2_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
137 struct Choose<true, T1_, T2_> {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
138 using Type = T1_;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
139 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
140 ///@endcond
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
141
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
142 ///This class contains information about a runtime type
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
143 class RTTI {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
144 public:
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
145 ///Returns if this type is pointer
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
146 virtual bool IsPointer() const = 0;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
147
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
148 ///Returns if this type is a reference
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
149 virtual bool IsReference() const = 0;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
150
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
151 ///Returns if this type is a constant
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
152 virtual bool IsConstant() const = 0;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
153
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
154 ///Compares the type stored with this service to the given type info
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
155 virtual bool IsSameType(const std::type_info &) const = 0;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
156
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
157 ///Compares the type stored with this service to the given type
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
158 template<class T_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
159 bool IsSameType() const {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
160 return IsSameType(typeid(T_));
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
161 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
162
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
163 bool operator ==(const std::type_info &info) const {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
164 return IsSameType(info);
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
165 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
166
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
167 bool operator !=(const std::type_info &info) const {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
168 return IsSameType(info);
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
169 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
170
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
171 operator const std::type_info &() const {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
172 return TypeInfo();
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
173 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
174
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
175 ///Returns the size of the object
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
176 virtual long GetSize() const = 0;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
177
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
178 ///@name TypeInfo
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
179 ///@{
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
180 virtual const std::type_info &TypeInfo() const = 0;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
181 ///@}
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
182
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
183 ///Returns human readable name of the type
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
184 std::string Name() const { return Utils::GetTypeName(TypeInfo()); }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
185 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
186
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
187 /// This class contains runtime type services that allows dealing with unknown type.
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
188 /// RTTS should be constructed for RTT class. This class is not designed to work with
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
189 /// array types.
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
190 class RTTS : public RTTI {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
191 public:
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
192 ///Duplicates this service
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
193 virtual RTTS *Duplicate() const = 0;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
194
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
195 ///Clones the given object
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
196 virtual void *Clone(const void* const obj) const = 0;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
197
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
198 ///Clones the given object
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
199 virtual void Clone(void* const dest, const void* const obj) const = 0;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
200
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
201 ///Deletes the given object
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
202 virtual void Delete(void* obj) const = 0;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
203
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
204 ///Destructor
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
205 virtual ~RTTS() { }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
206 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
207
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
208 ///Runtime Type. This class implements both RTTS and RTTI
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
209 template<class T_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
210 class RTT : public RTTS {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
211 using StorageType = typename Choose<std::is_reference<T_>::value, typename std::remove_reference<T_>::type*, T_>::Type*;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
212 using NewType = typename std::remove_const<typename Choose<std::is_reference<T_>::value, typename std::remove_reference<T_>::type*, T_>::Type>::type;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
213 using CloneType = const typename Choose<std::is_reference<T_>::value, typename std::remove_reference<T_>::type*, T_>::Type* const;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
214
1362
6ff4adabed06 #21: Layer related crash has been solved
cemkalyoncu
parents: 1100
diff changeset
215 virtual RTTS *Duplicate() const override {
902
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
216 return new RTT<T_>();
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
217 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
218
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
219
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
220 virtual void *Clone(const void* const obj) const override {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
221 auto n = new NewType(*reinterpret_cast<CloneType>(obj));
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
222
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
223 return n;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
224 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
225
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
226 virtual void Clone(void* const dest, const void* const obj) const override {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
227 *reinterpret_cast<StorageType>(dest) = *reinterpret_cast<CloneType>(obj);
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
228 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
229
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
230
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
231 virtual void Delete(void *obj) const override {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
232 delete static_cast<StorageType>(obj);
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
233 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
234
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
235 virtual bool IsSameType(const std::type_info &info) const override {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
236 return info==typeid(T_);
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
237 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
238
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
239 virtual const std::type_info &TypeInfo() const override {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
240 return typeid(T_);
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
241 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
242
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
243 virtual long GetSize() const override { return sizeof(T_); }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
244
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
245 virtual bool IsPointer() const override { return std::is_pointer<T_>::value; }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
246
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
247 virtual bool IsReference() const override { return std::is_reference<T_>::value; }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
248
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
249 virtual bool IsConstant() const override { return std::is_const<T_>::value; }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
250 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
251
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
252 template<class T_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
253 typename std::enable_if<std::is_copy_constructible<T_>::value && !std::is_abstract<T_>::value, void*>::type
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
254 clonetype_wnull(const void* const obj) {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
255 using NewType = typename std::remove_const<typename Choose<std::is_reference<T_>::value, typename std::remove_reference<T_>::type*, T_>::Type>::type;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
256 using CloneType = const typename Choose<std::is_reference<T_>::value, typename std::remove_reference<T_>::type*, T_>::Type* const;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
257
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
258 auto n = new NewType(*reinterpret_cast<CloneType>(obj));
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
259
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
260 return n;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
261 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
262 template<class T_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
263 typename std::enable_if<!std::is_copy_constructible<T_>::value || std::is_abstract<T_>::value, void*>::type clonetype_wnull(const void* const obj) {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
264 return nullptr;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
265 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
266
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
267 template<class T_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
268 typename std::enable_if<std::is_copy_assignable<T_>::value && !std::is_const<T_>::value, void>::type
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
269 copytype_wnull(void* const dest, const void* const obj) {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
270 using NewType = typename std::remove_const<typename Choose<std::is_reference<T_>::value, typename std::remove_reference<T_>::type*, T_>::Type>::type;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
271 using CloneType = const typename Choose<std::is_reference<T_>::value, typename std::remove_reference<T_>::type*, T_>::Type* const;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
272 using StorageType = typename Choose<std::is_reference<T_>::value, typename std::remove_reference<T_>::type*, T_>::Type*;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
273
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
274 *reinterpret_cast<StorageType>(dest) = *reinterpret_cast<CloneType>(obj);
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
275 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
276 template<class T_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
277 typename std::enable_if<!std::is_copy_assignable<T_>::value || std::is_const<T_>::value, void>::type copytype_wnull(void* const dest, const void* const obj) {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
278
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
279 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
280
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
281 ///Runtime Type. This class implements both RTTS and RTTI
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
282 template<class T_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
283 class AbstractRTT : public RTTS {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
284 using StorageType = typename Choose<std::is_reference<T_>::value, typename std::remove_reference<T_>::type*, T_>::Type*;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
285 using NewType = typename std::remove_const<typename Choose<std::is_reference<T_>::value, typename std::remove_reference<T_>::type*, T_>::Type>::type;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
286 using CloneType = const typename Choose<std::is_reference<T_>::value, typename std::remove_reference<T_>::type*, T_>::Type* const;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
287
1516
dc526bcc1ad3 * Reference counter is upgraded
cemkalyoncu
parents: 1362
diff changeset
288 virtual RTTS *Duplicate() const override {
902
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
289 return new AbstractRTT<T_>();
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
290 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
291
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
292 virtual void* Clone(const void* const obj) const override {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
293 return clonetype_wnull<T_>(obj);
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
294 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
295
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
296 virtual void Clone(void* const dest, const void* const obj) const override {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
297 copytype_wnull<T_>(dest, obj);
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
298 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
299
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
300 virtual void Delete(void *obj) const override {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
301 delete static_cast<StorageType>(obj);
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
302 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
303
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
304 virtual bool IsSameType(const std::type_info &info) const override {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
305 return info==typeid(T_);
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
306 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
307
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
308 virtual const std::type_info &TypeInfo() const override {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
309 return typeid(T_);
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
310 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
311
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
312 virtual long GetSize() const override { return sizeof(T_); }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
313
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
314 virtual bool IsPointer() const override { return std::is_pointer<T_>::value; }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
315
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
316 virtual bool IsReference() const override { return std::is_reference<T_>::value; }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
317
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
318 virtual bool IsConstant() const override { return std::is_const<T_>::value; }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
319 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
320
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
321 ///Runtime Type. This class implements both RTTS and RTTI
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
322 template<>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
323 class AbstractRTT<void> : public RTTS {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
324
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
325 virtual RTTS *Duplicate() const {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
326 return new AbstractRTT<void>();
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
327 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
328
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
329 virtual void *Create() const {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
330 return nullptr;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
331 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
332
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
333 virtual void *Clone(const void* const obj) const override {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
334 return nullptr;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
335 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
336
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
337 virtual void Clone(void* const dest, const void* const obj) const override {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
338
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
339 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
340
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
341 virtual void Delete(void *obj) const override {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
342 throw std::runtime_error("type is void");
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
343 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
344
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
345 virtual bool IsSameType(const std::type_info &info) const override {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
346 return info==typeid(void);
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
347 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
348
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
349 virtual const std::type_info &TypeInfo() const override {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
350 return typeid(void);
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
351 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
352
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
353 virtual long GetSize() const override { return 0; }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
354
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
355 virtual bool IsPointer() const override { return std::is_pointer<void>::value; }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
356
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
357 virtual bool IsReference() const override { return std::is_reference<void>::value; }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
358
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
359 virtual bool IsConstant() const override { return std::is_const<void>::value; }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
360 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
361
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
362
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
363 ///Runtime Type Hierarchy
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
364 class RTTH {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
365 public:
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
366 virtual ~RTTH() {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
367 delete &NormalType;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
368 delete &ConstType;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
369 delete &RefType;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
370 delete &ConstRefType;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
371 delete &PtrType;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
372 delete &ConstPtrType;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
373 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
374
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
375 RTTS &NormalType, &ConstType, &RefType, &ConstRefType, &PtrType, &ConstPtrType;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
376
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
377 protected:
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
378 RTTH(RTTS &normaltype, RTTS &consttype, RTTS &reftype, RTTS &constreftype, RTTS &ptrtype, RTTS &constptrtype) :
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
379 NormalType(normaltype), ConstType(consttype), RefType(reftype), ConstRefType(constreftype),
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
380 PtrType(ptrtype), ConstPtrType(constptrtype)
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
381 { }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
382 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
383
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
384 /// Runtime type class, implements RTTH
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
385 template<class T_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
386 class RTTC : public RTTH {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
387 public:
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
388 using BaseType = typename std::remove_const<typename std::remove_reference<T_>::type>::type;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
389
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
390 RTTC() :
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
391 RTTH(
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
392 *new RTT<BaseType >(), *new RTT<const BaseType >(),
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
393 *new RTT<BaseType&>(), *new RTT<const BaseType&>(),
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
394 *new RTT<BaseType*>(), *new RTT<const BaseType*>()
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
395 )
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
396 { }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
397 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
398
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
399 /// Runtime type class, implements RTTH
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
400 template<class T_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
401 class AbstractRTTC : public RTTH {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
402 public:
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
403 using BaseType = typename std::remove_const<typename std::remove_reference<T_>::type>::type;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
404
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
405 AbstractRTTC() :
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
406 RTTH(
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
407 *new AbstractRTT<BaseType >(), *new AbstractRTT<const BaseType >(),
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
408 *new AbstractRTT<BaseType&>(), *new AbstractRTT<const BaseType&>(),
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
409 *new RTT<BaseType*>(), *new RTT<const BaseType*>()
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
410 )
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
411 { }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
412 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
413
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
414 template<class T_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
415 struct RemoveRValueReference {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
416 using Type = T_;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
417 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
418
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
419 template<class T_>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
420 struct RemoveRValueReference<T_&&> {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
421 using Type = T_;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
422 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
423
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
424 template<typename T>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
425 class IsStreamable
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
426 {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
427 using one = char;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
428 struct two {
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
429 char dummy[2];
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
430 };
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
431
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
432 template<class TT>
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
433 static one test(decltype(((std::ostream*)nullptr)->operator<<((TT*)nullptr))) { return one(); }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
434
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
435 static two test(...) { return two(); }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
436
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
437 public:
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
438 static const bool Value = sizeof( test(*(std::ostream*)nullptr) )==1;
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
439 };
900
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
440
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
441 /// Solution by Peter Dimov-5: http://std.2283326.n4.nabble.com/bind-Possible-to-use-variadic-templates-with-bind-td2557818.html
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
442
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
443 template<int n> struct Placeholder {};
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
444 template<> struct Placeholder<1> { static decltype(std::placeholders::_1) value() { return std::placeholders::_1; } };
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
445 template<> struct Placeholder<2> { static decltype(std::placeholders::_2) value() { return std::placeholders::_2; } };
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
446 template<> struct Placeholder<3> { static decltype(std::placeholders::_3) value() { return std::placeholders::_3; } };
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
447 template<> struct Placeholder<4> { static decltype(std::placeholders::_4) value() { return std::placeholders::_4; } };
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
448 template<> struct Placeholder<5> { static decltype(std::placeholders::_5) value() { return std::placeholders::_5; } };
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
449 template<> struct Placeholder<6> { static decltype(std::placeholders::_6) value() { return std::placeholders::_6; } };
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
450 template<> struct Placeholder<7> { static decltype(std::placeholders::_7) value() { return std::placeholders::_7; } };
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
451 template<> struct Placeholder<8> { static decltype(std::placeholders::_8) value() { return std::placeholders::_8; } };
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
452 template<> struct Placeholder<9> { static decltype(std::placeholders::_9) value() { return std::placeholders::_9; } };
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
453
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
454 template<int...> struct IntTuple {};
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
455
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
456 // make indexes impl is a helper for make indexes
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
457 template<int I, typename IntTuple, typename... Types>
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
458 struct MakeIndices_impl;
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
459
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
460 template<int I, int... Indices, typename T, typename... Types>
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
461 struct MakeIndices_impl<I, IntTuple<Indices...>, T, Types...> {
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
462 typedef typename MakeIndices_impl<I+1,
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
463 IntTuple<Indices..., I>,
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
464 Types...>::type type;
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
465 };
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
466
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
467 template<int I, int... Indices>
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
468 struct MakeIndices_impl<I, IntTuple<Indices...> > {
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
469 typedef IntTuple<Indices...> type;
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
470 };
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
471
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
472 template<typename... Types>
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
473 struct MakeIndices : MakeIndices_impl<0, IntTuple<>, Types...> {};
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
474
902
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
475 template< class T, class Ret_, class... Args, int... Indices >
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
476 std::function< Ret_(Args...) > MakeFunctionFromMember_helper(Ret_ (T::* pm) (Args...),
900
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
477 T * that, IntTuple< Indices... >) {
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
478 return std::bind(pm, that, Placeholder<Indices+1>::value()...);
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
479 }
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
480
902
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
481 template< class T_, class Ret_, class... Args >
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
482 std::function< Ret_(Args...) > MakeFunctionFromMember(Ret_ (T_::* pm) (Args...), T_ *that) {
900
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
483 return MakeFunctionFromMember_helper(pm, that, typename MakeIndices<Args...>::type());
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
484 }
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
485
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
486 template <typename U>
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
487 struct HasParanthesisOperator {
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
488 typedef char yes;
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
489 struct no { char _[2]; };
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
490 template<typename T, typename L=decltype(&T::operator())>
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
491 static yes impl(T*) { return yes(); }
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
492 static no impl(...) { return no(); }
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
493
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
494 enum { value = sizeof(impl(static_cast<U*>(0))) == sizeof(yes) };
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
495 };
06d24272c6dd * Event does not hold TMP functions hostage any more
cemkalyoncu
parents: 846
diff changeset
496
902
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
497
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
498 }
508c5250770b * Enable/disable semantics for ConsumableEvent
cemkalyoncu
parents: 900
diff changeset
499 };

mercurial