gwnavgeneration/input/clientinputdescriptor.h Source File

clientinputdescriptor.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: LASI - secondary contact: NOBODY
9 #ifndef GwNavGen_ClientInputDescriptorBlob_H
10 #define GwNavGen_ClientInputDescriptorBlob_H
11 
17 
18 
19 namespace Kaim
20 {
21 
22 
23 class ClientInputDescriptorBlob
24 {
25  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
26  KY_CLASS_WITHOUT_COPY(ClientInputDescriptorBlob)
27  KY_ROOT_BLOB_CLASS(Generator, ClientInputDescriptorBlob, 0)
28 
29 public:
30  ClientInputDescriptorBlob() {}
31 
32  BlobArray<char> m_clientInputFilename;
33 };
34 inline void SwapEndianness(Endianness::Target e, ClientInputDescriptorBlob& self)
35 {
36  SwapEndianness(e, self.m_clientInputFilename);
37 }
38 
39 
40 struct ClientInputDescriptor
41 {
42 public:
43  ClientInputDescriptor() {} // To make KyArray happy
44 
45  ClientInputDescriptor(const char* filename)
46  : m_clientInputFilename(filename) {}
47 
48  void Init(const ClientInputDescriptorBlob& blob)
49  {
50  m_clientInputFilename = blob.m_clientInputFilename.GetValues();
51  }
52 
53 public:
54  String m_clientInputFilename;
55 };
56 
57 
58 class ClientInputDescriptorBlobBuilder : public BaseBlobBuilder<ClientInputDescriptorBlob>
59 {
60 public:
61  ClientInputDescriptorBlobBuilder(const ClientInputDescriptor& information) : m_info(&information) {}
62 
63 private:
64  virtual void DoBuild()
65  {
66  BLOB_STRING(m_blob->m_clientInputFilename, m_info->m_clientInputFilename.ToCStr());
67  }
68 
69  const ClientInputDescriptor* m_info;
70 };
71 
72 
73 } // namespace Kaim
74 
75 #endif
#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
ClientInputDescriptorBlob * 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 KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
#define BLOB_STRING(str, src)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:179