gwnavgeneration/input/clientinputdescriptor.h Source File

clientinputdescriptor.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 
15 
16 
17 namespace Kaim
18 {
19 
20 
21 class ClientInputDescriptorBlob
22 {
23  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
24  KY_CLASS_WITHOUT_COPY(ClientInputDescriptorBlob)
25  KY_ROOT_BLOB_CLASS(Generator, ClientInputDescriptorBlob, 0)
26 
27 public:
28  ClientInputDescriptorBlob() {}
29 
30  BlobArray<char> m_clientInputFilename;
31 };
32 inline void SwapEndianness(Endianness::Target e, ClientInputDescriptorBlob& self)
33 {
34  SwapEndianness(e, self.m_clientInputFilename);
35 }
36 
37 
38 struct ClientInputDescriptor
39 {
40 public:
41  ClientInputDescriptor() {} // To make KyArray happy
42 
43  ClientInputDescriptor(const char* filename)
44  : m_clientInputFilename(filename) {}
45 
46  void Init(const ClientInputDescriptorBlob& blob)
47  {
48  m_clientInputFilename = blob.m_clientInputFilename.GetValues();
49  }
50 
51 public:
52  String m_clientInputFilename;
53 };
54 
55 
56 class ClientInputDescriptorBlobBuilder : public BaseBlobBuilder<ClientInputDescriptorBlob>
57 {
58 public:
59  ClientInputDescriptorBlobBuilder(const ClientInputDescriptor& information) : m_info(&information) {}
60 
61 private:
62  virtual void DoBuild()
63  {
64  BLOB_STRING(m_blob->m_clientInputFilename, m_info->m_clientInputFilename.ToCStr());
65  }
66 
67  const ClientInputDescriptor* m_info;
68 };
69 
70 
71 } // namespace Kaim
72 
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:27
ClientInputDescriptorBlob * 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