gwnavgeneration/generator/generatorguidcompound.h Source File

generatorguidcompound.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: NOBODY
9 #ifndef GwNavGen_GeneratorGuidCompound_H
10 #define GwNavGen_GeneratorGuidCompound_H
11 
12 
16 
17 
18 namespace Kaim
19 {
20 
23 {
24  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
25 
26 public:
29 
31  GeneratorGuidCompound(const GuidCompound& guidCompound) : m_timeStamp(0) { InitFromBlob(guidCompound); }
32 
34  void InitFromBlob(const GuidCompound& guidCompound);
35 
37  KyGuid GetMainGuid() const { return m_guids.GetCount() == 0 ? KyGuid::GetDefaultGuid() : m_guids[0]; }
38 
43  bool operator<(const GeneratorGuidCompound& other) const;
44 
46  bool AreGuidsEqual(const GeneratorGuidCompound& other) const;
47 
50  bool operator==(const GeneratorGuidCompound& other) const { return AreGuidsEqual(other) && m_timeStamp == other.m_timeStamp; }
51  bool operator!=(const GeneratorGuidCompound& other) const { return !operator==(other); }
52 
54  void AddGuid(const KyGuid& guid);
55 
57  bool DoesContain(const KyGuid& guid) const;
58 
60  void SetTimeStamp(KyUInt32 timeStamp) { m_timeStamp = timeStamp; }
61 
63  void Sort();
64 
65 public:
68 };
69 
70 
71 }
72 
73 
74 #endif
75 
bool AreGuidsEqual(const GeneratorGuidCompound &other) const
bool operator<(const GeneratorGuidCompound &other) const
void Sort()
Sorts the KyGuid objects in the array. For internal use.
bool operator==(const GeneratorGuidCompound &other) const
Note that this operator compare also the timeStamps so that we do the same as in GuidCompound but...
Definition: generatorguidcompound.h:52
General purpose array for movable objects that require explicit construction/destruction.
Definition: kyarray.h:118
KyUInt32 m_timeStamp
The last modification date of this object. Do not modify directly.
Definition: generatorguidcompound.h:70
bool DoesContain(const KyGuid &guid) const
void AddGuid(const KyGuid &guid)
Adds the specified KyGuid to the array maintained by this object.
Definition: gamekitcrowddispersion.h:20
The KyGuid class represents a globally unique ID.
Definition: kyguid.h:22
KyArray< KyGuid > m_guids
The array of KyGuid objects. Do not modify directly.
Definition: generatorguidcompound.h:69
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
GeneratorGuidCompound()
Constructs a new GeneratorGuidCompound with an empty KyGuid array.
Definition: generatorguidcompound.h:29
This class is a wrapper around an array of KyGuid objects.
Definition: generatorguidcompound.h:22
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.
KyGuid GetMainGuid() const
Definition: generatorguidcompound.h:38
void InitFromBlob(const GuidCompound &guidCompound)
Initialize from guidCompound (blob)
void SetTimeStamp(KyUInt32 timeStamp)
Sets the last modified timestamp for this object to the specified value. For internal use...
Definition: generatorguidcompound.h:62