gwnavruntime/blob/baseblobbuilder.h File Reference

baseblobbuilder.h File Reference
#include "gwnavruntime/blob/blobbuffer.h"
#include "gwnavruntime/kernel/SF_Std.h"
#include <assert.h>

Classes

class  Kaim::BaseBlobBuilder< T >
 BaseBlobBuilder is an abstract base class that builds a blob within a contiguous block of memory. More...
 

Namespaces

 Kaim
 The Autodesk Navigation namespace.
 

Macros

#define BLOB_SET(blob, value)   if (this->IsWriteMode()) (blob) = (value)
 Use this macro only in implementations of BaseBlobBuilder::DoBuild(). More...
 
#define BLOB_ARRAY(blobArray, count)   this->GetBlobBufferToBuildThis()->AllocArray(this->IsWriteMode() ? &(blobArray) : nullptr, count)
 Use this macro only in implementations of BaseBlobBuilder::DoBuild(). More...
 
#define BLOB_ARRAY_COPY(blobArray, src, count)   this->GetBlobBufferToBuildThis()->AllocAndCopyArray(this->IsWriteMode() ? &(blobArray) : nullptr, (count) != 0 ? (src) : nullptr, (KyUInt32)(count))
 Use this macro only in implementations of BaseBlobBuilder::DoBuild(). More...
 
#define BLOB_ARRAY_COPY_2(blobArray, ky_array)   BLOB_ARRAY_COPY(blobArray, ky_array.GetDataPtr(), ky_array.GetSize())
 same as BLOB_ARRAY_COPY but uses Kaim::Array as input More...
 
#define BLOB_STRING(str, src)   this->GetBlobBufferToBuildThis()->AllocAndCopyArray(this->IsWriteMode() ? &(str) : nullptr, src, (KyUInt32)Kaim::SFstrlen(src) + 1)
 Use this macro only in implementations of BaseBlobBuilder::DoBuild(). More...
 
#define BLOB_BUILD(blob, builder)   builder.DoBuildAllocatedBlob(this->GetBlobBufferToBuildThis(), this->IsWriteMode() ? &(blob) : nullptr)
 Use this macro only in implementations of BaseBlobBuilder::DoBuild(). More...
 
#define BUILD_REFERENCED_BLOB(blobRef, builder)   builder.DoAllocAndBuildReferencedBlob(this->GetBlobBufferToBuildReference(), this->IsWriteMode() ? &(blobRef) : nullptr)
 Use this macro only in implementations of BaseBlobBuilder::DoBuild(). More...
 
#define COPY_REFERENCED_BLOB(blobRef, srcBlob, srcBlobDeepSize, srcBlobShallowSize)
 Use this macro only in implementations of BaseBlobBuilder::DoBuild(). More...
 

Macro Definition Documentation

#define BLOB_ARRAY (   blobArray,
  count 
)    this->GetBlobBufferToBuildThis()->AllocArray(this->IsWriteMode() ? &(blobArray) : nullptr, count)

Use this macro only in implementations of BaseBlobBuilder::DoBuild().

Call this macro to reserve a BlobArray member of the blob being built.

Parameters
blobArrayThe BlobArray class member of the blob.
countThe number of elements to reserve in blobArray. In COUNT mode, only the size of the array is counted. In WRITE mode, the array is built and the default constructor of each element is called.
#define BLOB_ARRAY_COPY (   blobArray,
  src,
  count 
)    this->GetBlobBufferToBuildThis()->AllocAndCopyArray(this->IsWriteMode() ? &(blobArray) : nullptr, (count) != 0 ? (src) : nullptr, (KyUInt32)(count))

Use this macro only in implementations of BaseBlobBuilder::DoBuild().

Call this macro to reserve a BlobArray member of the blob being built, and to copy its values from another specified BlobArray.

Parameters
blobArrayThe BlobArray class member of the blob.
srcThe source of the values to write to blobArray.
countThe number of elements to reserve in blobArray. In COUNT mode, only the size of the array is counted. In WRITE mode, the array is built and the memory contents of src are copied to blobArray. No constructors are called for the elements in the built array.
#define BLOB_ARRAY_COPY_2 (   blobArray,
  ky_array 
)    BLOB_ARRAY_COPY(blobArray, ky_array.GetDataPtr(), ky_array.GetSize())

same as BLOB_ARRAY_COPY but uses Kaim::Array as input

#define BLOB_BUILD (   blob,
  builder 
)    builder.DoBuildAllocatedBlob(this->GetBlobBufferToBuildThis(), this->IsWriteMode() ? &(blob) : nullptr)

Use this macro only in implementations of BaseBlobBuilder::DoBuild().

Call this macro to build a class member of the blob being built if that class member is itself a blob that needs to be built through its own class of BaseBlobBuilder. This automatically invokes the BaseBlobBuilder::Build() method of builder in order to set up the blob class member.

Parameters
blobThe class member that needs to be built.
builderAn object that derives from BaseBlobBuilder that will be invoked to build blob.
#define BLOB_SET (   blob,
  value 
)    if (this->IsWriteMode()) (blob) = (value)

Use this macro only in implementations of BaseBlobBuilder::DoBuild().

Call this macro to set a class member of the blob being built to a specified value.

Parameters
blobThe class member of the blob whose value will be set.
valueThe value to set. In COUNT mode, this macro does nothing. In WRITE mode, it sets the value provided.
#define BLOB_STRING (   str,
  src 
)    this->GetBlobBufferToBuildThis()->AllocAndCopyArray(this->IsWriteMode() ? &(str) : nullptr, src, (KyUInt32)Kaim::SFstrlen(src) + 1)

Use this macro only in implementations of BaseBlobBuilder::DoBuild().

Call this macro to copy a string value to a member of the blob being built.

Parameters
strThe class member of the blob in which to copy the string.
srcThe string to copy to str. In COUNT mode, only the length of the string is counted. In WRITE mode, the memory contents ofsrc are copied to str. This macro is effectively the same as BLOB_ARRAY_COPY, but automatically calculates the length of the array as strlen(src) + 1.
#define BUILD_REFERENCED_BLOB (   blobRef,
  builder 
)    builder.DoAllocAndBuildReferencedBlob(this->GetBlobBufferToBuildReference(), this->IsWriteMode() ? &(blobRef) : nullptr)

Use this macro only in implementations of BaseBlobBuilder::DoBuild().

BUILD_REFERENCED_BLOB must be called after all calls to BLOB_ARRAY, BLOB_ARRAY_COPY, BLOB_STRING, BLOB_BUILD

#define COPY_REFERENCED_BLOB (   blobRef,
  srcBlob,
  srcBlobDeepSize,
  srcBlobShallowSize 
)
Value:
this->GetBlobBufferToBuildReference()->AllocAndCopyReferencedBlob( \
this->IsWriteMode() ? &(blobRef) : nullptr, srcBlob, srcBlobDeepSize, srcBlobShallowSize)

Use this macro only in implementations of BaseBlobBuilder::DoBuild().

COPY_REFERENCED_BLOB must be called after all calls to BLOB_ARRAY, BLOB_ARRAY_COPY, BLOB_STRING, BLOB_BUILD

Go to the source code of this file.