gwnavruntime/base/guidcompound.h Source File

guidcompound.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 
8 // primary contact: GUAL - secondary contact: JODA
9 #ifndef Navigation_GuidCompound_H
10 #define Navigation_GuidCompound_H
11 
14 
15 namespace Kaim
16 {
17 
18 class GuidCompound
19 {
20  KY_CLASS_WITHOUT_COPY(GuidCompound)
21  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
22 
23 public:
24  GuidCompound() {}
25 
26  KY_INLINE const KyGuid& GetMainGuid() const { return m_guids.GetCount() == 0 ? KyGuid::GetDefaultGuid() : m_guids.GetValues()[0]; }
27 
28  bool operator<(const GuidCompound& other) const;
29 
30  bool AreGuidsEqual(const GuidCompound& other) const;
31 
32  bool operator==(const GuidCompound& other) const { return AreGuidsEqual(other) && m_timeStamp == other.m_timeStamp; }
33 
34  bool operator!=(const GuidCompound& other) const { return !operator==(other); }
35 
36  void Sort();
37 
38  KY_INLINE KyUInt32 GetKyGuidCount() const { return m_guids.GetCount(); }
39 
40  KY_INLINE const KyGuid& GetKyGuid(KyUInt32 index) const { return m_guids.GetValues()[index]; }
41 
42  bool DoesContainAllGuidsOfGuidCompound(const Kaim::GuidCompound& other) const;
43 
44 public:
45  BlobArray<KyGuid> m_guids;
46  KyUInt32 m_timeStamp;
47 };
48 
49 inline void SwapEndianness(Endianness::Target e, GuidCompound& self)
50 {
51  SwapEndianness(e, self.m_guids);
52  SwapEndianness(e, self.m_timeStamp);
53 }
54 
55 } // namespace Kaim
56 
57 #endif
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
static const KyGuid & GetDefaultGuid()
Returns the default KyGuid value.