gwnavruntime/path/positiononlivepathblob.h Source File

positiononlivepathblob.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 Navigation_PositionOnLivePathBlob_H
10 #define Navigation_PositionOnLivePathBlob_H
11 
14 
15 namespace Kaim
16 {
17 
18 class PositionOnLivePathBlob
19 {
20  KY_ROOT_BLOB_CLASS(Runtime, PositionOnLivePathBlob, 1)
21 
22 public:
23  PositionOnLivePathBlob() : m_onEventListIndex(KyUInt32MAXVAL), m_onEventListStatus((KyUInt32)OnEventListStatus_Undefined) {}
24 
25  PositionOnPathStatus GetPositionStatus() const { return m_positionOnPathBlob.GetPositionStatus(); }
26  OnEventListStatus GetOnEventListStatus() const { return (OnEventListStatus)m_onEventListStatus; }
27 public:
28  PositionOnPathBlob m_positionOnPathBlob;
29  KyUInt32 m_onEventListIndex;
30  KyUInt32 m_onEventListStatus;
31 };
32 inline void SwapEndianness(Endianness::Target e, PositionOnLivePathBlob& self)
33 {
34  SwapEndianness(e, self.m_positionOnPathBlob);
35  SwapEndianness(e, self.m_onEventListIndex);
36  SwapEndianness(e, self.m_onEventListStatus);
37 }
38 
39 
40 class PositionOnLivePathBlobBuilder: public BaseBlobBuilder<PositionOnLivePathBlob>
41 {
42  KY_CLASS_WITHOUT_COPY(PositionOnLivePathBlobBuilder)
43 
44 public:
45  PositionOnLivePathBlobBuilder(const PositionOnLivePath* positionOnLivePath)
46  : m_positionOnLivePath(positionOnLivePath)
47  {}
48  ~PositionOnLivePathBlobBuilder() {}
49 
50 private:
51  virtual void DoBuild()
52  {
53  if ((m_positionOnLivePath != NULL) && (m_positionOnLivePath->GetPositionOnPathStatus() != PositionOnPathStatus_Undefined))
54  {
55  PositionOnPathBlobBuilder builder(&m_positionOnLivePath->GetPositionOnPath());
56  BLOB_BUILD(m_blob->m_positionOnPathBlob, builder);
57  BLOB_SET(m_blob->m_onEventListIndex, m_positionOnLivePath->GetOnEventListIndex());
58  BLOB_SET(m_blob->m_onEventListStatus, (KyUInt32)m_positionOnLivePath->GetOnEventListStatus());
59  }
60  }
61 
62 private:
63  const PositionOnLivePath* m_positionOnLivePath;
64 };
65 
66 
67 }
68 
69 #endif
OnEventListStatus
Enumerates the admissible values for PositionOnLivePath status accordingly to its position relatively...
Definition: positiononlivepath.h:27
#define BLOB_SET(blob, value)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:136
PositionOnPathStatus
< enumerates="" the="" different="" status="" an="" objectpositiononpath="" can="" have="" on="" its="" path.="" />
Definition: positiononpath.h:20
#define BLOB_BUILD(blob, builder)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:189
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
The PositionOnLivePath relative position in PathEventList is not yet defined.
Definition: positiononlivepath.h:29
The PositionOnPath is not yet defined.
Definition: positiononpath.h:22
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
PositionOnLivePathBlob * m_blob
The blob maintained by this builder. Only modify using the macros listed under DoBuild().
Definition: baseblobbuilder.h:117
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
#define KyUInt32MAXVAL
The maximum value that can be stored in the KyUInt32 variable type.
Definition: types.h:226