gwnavruntime/blob/baseblobhandler.h Source File

baseblobhandler.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: GUAL - secondary contact: NOBODY
9 #ifndef Navigation_IBlobHandler_H
10 #define Navigation_IBlobHandler_H
11 
12 
14 
15 
16 namespace Kaim
17 {
18 
19 
20 class BaseBlobHandler : public IBlobTypeDescriptor
21 {
22  KY_CLASS_WITHOUT_COPY(BaseBlobHandler)
23 
24 public:
25  BaseBlobHandler();
26  virtual ~BaseBlobHandler();
27 
28  void Clear();
29  void ClearAndRelease();
30 
31  void InitAsWeakReference(void* blob, KyUInt32 deepBlobSize, KyUInt32 shallowBlobSize = 0);
32  void* InitAsStrongReference(KyUInt32 deepBlobSize, KyUInt32 shallowBlobSize, MemoryHeap* heap, KyInt32 memStat);
33 
34  const void* VoidBlob() const { return m_blob; }
35  void* VoidBlob() { return m_blob; }
36  void* GetMutableBlob() const { return m_blob; }
37 
38  // Retrieves the deep size (including BlobRefs) of the blob maintained by this handler.
39  KyUInt32 BlobSize() const { return m_deepBlobSize; }
40 
41  // Retrieves the deep size (including BlobRefs) of the blob maintained by this handler.
42  KyUInt32 GetDeepBlobSize() const { return m_deepBlobSize; }
43  KyUInt32 GetShallowBlobSize() const { return m_shallowBlobSize; }
44 
45  void SwapEndianess(Endianness::Target e) { DoSwapEndianness(e, m_blob); }
46 
47 public:
48  void* m_blob; //< The blob handled by this object.
49  KyUInt32 m_deepBlobSize; //< The size of #m_blob in memory including BlobRefs.
50  KyUInt32 m_shallowBlobSize; //< The size of #m_blob in memory excluding BlobRefs.
51 
52  void* m_buffer;
53  KyUInt32 m_bufferSize;
54 };
55 
56 
57 }
58 
59 
60 #endif
61 
int KyInt32
Type used internally to represent a 32-bit integer.
Definition: types.h:35
#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
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36