36 #include <AK/Tools/Common/AkKeyArray.h>
50 struct AkSetGetKey{
static AkForceInline T&
Get(T& in_item){
return in_item; } };
56 template<
typename T,
class U_POOL, AkUInt32 uGrowBy = 1 >
66 template<
typename T,
class U_POOL, AkUInt32 uGrowBy >
71 while (itA != in_A.
End() && itB != in_B.
End())
86 template<
typename T,
class U_POOL, AkUInt32 uGrowBy >
89 return !AkDisjoint(in_A, in_B);
95 template<
typename T,
class U_POOL, AkUInt32 uGrowBy >
100 while (itA != in_A.
End() && itB != in_B.
End())
106 else if (*itA < *itB)
113 return (itA == in_A.
End());
119 template<
typename T,
class U_POOL, AkUInt32 uGrowBy >
125 while (itA != in_A.
End() && itB != in_B.
End())
129 ++uSize; ++itA; ++itB;
131 else if (*itA < *itB)
146 template<
typename T,
class U_POOL, AkUInt32 uGrowBy >
150 itAr = itAw = in_A.
Begin();
152 while (itAr != in_A.
End())
154 if (itB == in_B.
End() || *itAr < *itB)
162 else if (*itAr == *itB)
172 in_A.
Resize((AkUInt32)(itAw.pItem - in_A.
Begin().pItem));
179 template<
typename T,
class U_POOL, AkUInt32 uGrowBy >
183 itAr = itAw = in_A.
Begin();
185 while (itAr != in_A.
End() && itB != in_B.
End())
196 else if (*itAr < *itB)
205 in_A.
Resize((AkUInt32)(itAw.pItem - in_A.
Begin().pItem));
212 template<
typename T,
class U_POOL, AkUInt32 uGrowBy >
219 while (itA != in_A.
End() && itB != in_B.
End())
228 else if (*itA < *itB)
244 template<
typename T,
class U_POOL, AkUInt32 uGrowBy >
247 AkInt32 uSizeNeeded = io_A.
Length() + in_B.
Length() - AkCountIntersection(io_A, in_B);
250 if (result.
Resize(uSizeNeeded))
256 while (itB != in_B.
End() || itA != io_A.
End())
258 if ( itB != in_B.
End() && (itA == io_A.
End() || *itB < *itA))
263 else if (itB == in_B.
End() || *itA < *itB)
290 template<
typename T,
class U_POOL, AkUInt32 uGrowBy >
293 if (in_typeA == SetType_Inclusion)
295 if (in_typeB == SetType_Inclusion)
296 return !AkDisjoint(in_A, in_B);
298 return !AkIsSubset(in_A, in_B);
302 if (in_typeB == SetType_Inclusion)
303 return !AkIsSubset(in_B, in_A);
312 template<
typename T,
class U_POOL, AkUInt32 uGrowBy >
315 return (in_type == SetType_Inclusion && in_Set.
Contains(in_item)) ||
316 (in_type == SetType_Exclusion && !in_Set.
Contains(in_item));
323 template<
typename T,
class U_POOL, AkUInt32 uGrowBy >
326 if (in_typeA == SetType_Inclusion)
328 if (in_typeB == SetType_Inclusion)
329 return AkSubtraction(in_A, in_B);
331 return AkIntersection(in_A, in_B);
335 if (in_typeB == SetType_Inclusion)
336 return AkUnion(in_A, in_B);
338 return AkIntersection(in_A, in_B);
346 template<
typename T,
class U_POOL, AkUInt32 uGrowBy >
349 if (io_typeA == SetType_Inclusion)
351 if (in_typeB == SetType_Inclusion)
352 return AkUnion(io_A, in_B);
357 if (io_A.
Copy(in_B) == AK_Success)
359 io_typeA = SetType_Exclusion;
360 AkSubtraction(io_A, temp);
373 if (in_typeB == SetType_Inclusion)
374 return AkSubtraction(io_A, in_B);
376 return AkIntersection(io_A, in_B);