gwnavruntime/visualdebug/messages/logblob.h Source File

logblob.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 
15 
16 namespace Kaim
17 {
18 
19 class LogBlob
20 {
21  KY_ROOT_BLOB_CLASS(VisualDebugMessage, LogBlob, 0)
22 public:
23  LogBlob()
24  : m_text()
25  , m_logMsgId(0)
26  {}
27 
28  BlobArray<char> m_text;
29  KyUInt32 m_logMsgId;
30 };
31 
32 inline void SwapEndianness(Endianness::Target e, LogBlob& self)
33 {
34  SwapEndianness(e, self.m_text);
35  SwapEndianness(e, self.m_logMsgId);
36 }
37 
38 class LogBlobBuilder : public BaseBlobBuilder< LogBlob >
39 {
40  KY_CLASS_WITHOUT_COPY(LogBlobBuilder)
41 public:
42  LogBlobBuilder(const char* text, KyUInt32 textSize, LogMessageId logMsgId)
43  : m_text(text)
44  , m_textSize(textSize)
45  , m_logMsgId(logMsgId)
46  {}
47 
48 private:
49  virtual void DoBuild()
50  {
51  BLOB_STRING(m_blob->m_text, m_text);
52  BLOB_SET(m_blob->m_logMsgId, (KyUInt32)m_logMsgId);
53  }
54 
55  const char* m_text;
56  KyUInt32 m_textSize;
57  LogMessageId m_logMsgId;
58 };
59 
60 } // namespace Kaim
61 
#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
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:27
LogBlob * 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 BLOB_STRING(str, src)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:166