gwnavruntime/base/guidcompound.h Source File

guidcompound.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 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 #pragma once
9 
12 
13 namespace Kaim
14 {
15 
16 class GuidCompound
17 {
18  KY_CLASS_WITHOUT_COPY(GuidCompound)
19  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
20 
21 public:
22  GuidCompound() {}
23 
24  KY_INLINE const KyGuid& GetMainGuid() const { return m_guids.GetCount() == 0 ? KyGuid::GetDefaultGuid() : m_guids.GetValues()[0]; }
25 
26  bool operator<(const GuidCompound& other) const;
27 
28  bool AreGuidsEqual(const GuidCompound& other) const;
29 
30  bool operator==(const GuidCompound& other) const { return AreGuidsEqual(other) && m_timeStamp == other.m_timeStamp; }
31 
32  bool operator!=(const GuidCompound& other) const { return !operator==(other); }
33 
34  void Sort();
35 
36  KY_INLINE KyUInt32 GetKyGuidCount() const { return m_guids.GetCount(); }
37 
38  KY_INLINE const KyGuid& GetKyGuid(KyUInt32 index) const { return m_guids.GetValues()[index]; }
39 
40  bool DoesContainAllGuidsOfGuidCompound(const Kaim::GuidCompound& other) const;
41 
42 public:
43  BlobArray<KyGuid> m_guids;
44  KyUInt32 m_timeStamp;
45 };
46 
47 inline void SwapEndianness(Endianness::Target e, GuidCompound& self)
48 {
49  SwapEndianness(e, self.m_guids);
50  SwapEndianness(e, self.m_timeStamp);
51 }
52 
53 } // namespace Kaim
54 
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:27
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
static const KyGuid & GetDefaultGuid()
Returns the default KyGuid value.
Definition: kyguid.cpp:15