gwnavruntime/path/positiononlivepathblob.h Source File

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