gwnavruntime/visualdebug/messages/logblob.h Source File

logblob.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: BRGR - secondary contact: NOBODY
9 #ifndef Navigation_LogBlob_H
10 #define Navigation_LogBlob_H
11 
14 
17 
18 namespace Kaim
19 {
20 
21 class LogBlob
22 {
23  KY_ROOT_BLOB_CLASS(VisualDebugMessage, LogBlob, 0)
24 public:
25  LogBlob()
26  : m_text()
27  , m_logMsgId(0)
28  {}
29 
30  BlobArray<char> m_text;
31  KyUInt32 m_logMsgId;
32 };
33 
34 inline void SwapEndianness(Endianness::Target e, LogBlob& self)
35 {
36  SwapEndianness(e, self.m_text);
37  SwapEndianness(e, self.m_logMsgId);
38 }
39 
40 class LogBlobBuilder : public BaseBlobBuilder< LogBlob >
41 {
42  KY_CLASS_WITHOUT_COPY(LogBlobBuilder)
43 public:
44  LogBlobBuilder(const char* text, KyUInt32 textSize, LogMessageId logMsgId)
45  : m_text(text)
46  , m_textSize(textSize)
47  , m_logMsgId(logMsgId)
48  {}
49 
50 private:
51  virtual void DoBuild()
52  {
53  BLOB_STRING(m_blob->m_text, m_text);
54  BLOB_SET(m_blob->m_logMsgId, (KyUInt32)m_logMsgId);
55  }
56 
57  const char* m_text;
58  KyUInt32 m_textSize;
59  LogMessageId m_logMsgId;
60 };
61 
62 } // namespace Kaim
63 
64 #endif // Navigation_LogBlob_H
#define BLOB_SET(blob, value)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:136
#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
LogBlob * m_blob
The blob maintained by this builder. Only modify using the macros listed under DoBuild().
Definition: baseblobbuilder.h:117
Definition: gamekitcrowddispersion.h:20
#define BLOB_STRING(str, src)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:179
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36