19 #define BLIM(input, min, max) (input = (input > max) ? max : ((input < min) ? min : input))
20 #define LLIM(input, min) (input = (input < min) ? min : input)
21 #define ULIM(input, max) (input = (input > max) ? max : input)
22 #define LIMIT(A, B, C) (((A) < (B)) ? (B) : (((A) > (C)) ? (C) : (A)))
24 template <
class _InIt>
27 size_t _Val = 2166136261U;
29 while (_Begin != _End)
30 _Val = 16777619U * _Val ^ (size_t)*_Begin++;
34 #define DEFINE_STATIC_STRING(name) static constexpr char const* name = #name;
35 #define DEFINE_STATIC_STRING_EX(name, value) static constexpr char const* name = #value;
37 #define SAFE_DELETE(obj) \
43 #define SAFE_DELETE_ARRAY(ary) \
49 #define INVALIDATE_PROPERTY(name) \
50 if (name != nullptr) \
53 #define COPY_PROPERTY(name) \
54 if (from.Has##name()) \
55 Get##name().Set(*from.m_##name);
57 #define MERGE_CHILD(name) \
58 if (from.Has##name()) \
59 Get##name().Merge(*from.m_##name);
61 #define CDM_COPY(from, to) \
63 auto* bind = from->Unload(); \
69 inline void Copy(
const std::vector<T*>& from, std::vector<T*>& to)
72 to.resize(from.size());
73 std::copy(from.begin(), from.end(), to.begin());
77 inline void Copy(
const std::vector<T>& from, std::vector<T>& to)
80 to.resize(from.size());
81 std::copy(from.begin(), from.end(), to.begin());
85 inline bool Contains(
const std::vector<T*>& v, T& item)
87 return std::find(v.begin(), v.end(), &item) != v.end();
91 inline void Remove(std::vector<T*>& v, T* item)
93 v.erase(std::remove(v.begin(), v.end(), item), v.end());
97 inline void Copy(
const std::vector<T*>& from, std::vector<const T*>& to)
107 for (
unsigned int i = 0; i < vec.size(); i++) {
113 template <
class T,
class K>
116 for (
typename std::map<T, K>::iterator it = map.begin(); it != map.end(); ++it) {
122 template <
typename valueType>
125 return (x >= 0) ^ (y < 0);
void Copy(const std::vector< T * > &from, std::vector< T * > &to)
Definition: Macros.h:69
void DELETE_VECTOR(std::vector< T > &vec)
Definition: Macros.h:105
bool SameSign(valueType x, valueType y)
Definition: Macros.h:123
void Remove(std::vector< T * > &v, T *item)
Definition: Macros.h:91
size_t _Hash_value(_InIt _Begin, _InIt _End)
Definition: Macros.h:25
void DELETE_MAP_SECOND(std::map< T, K > &map)
Definition: Macros.h:114
bool Contains(const std::vector< T * > &v, T &item)
Definition: Macros.h:85
Definition: SEElectricalCircuit.h:18