A TypedBlob holds raw binary data and a type tag (see BlobType). It is often used to hold the result of an export or query operation. For example, Operation::ExportToTriangleSoup cannot directly write the result because the operation is deferred and because the size of the result is unknown. Instead, it populates a TypedBlob that holds the triangle data after Context::Execute finishes.
Note:
a TypeBlob is, like Meshes and Surfaces, immutable. It can only be initialized once.
Signature
// Immutable container for exported or queried binary data tagged with a BlobType
class TypedBlob:
fun getType()
fun hasData(slot: DataSlot) -> bool
fun getData(slot: DataSlot) -> [byte]
// constructors
class Context:
fun createTypedBlob() -> TypedBlob
fun createTypedBlobWithFixedBuffer(buffer: mut [byte]) -> TypedBlob
Constructors
| Name | Description |
|---|---|
createTypedBlob | Creates an uninitialized TypedBlob with auto-managed memory |
createTypedBlobWithFixedBuffer | Creates a TypedBlob backed by fixed-size user-provided memory |
Properties
| Name | Type | Description |
|---|---|---|
getType | BlobType | BlobType tag describing the data stored in this blob |
Methods
| Name | Type | Description |
|---|---|---|
hasData | bool | Checks if the blob contains data for a given slot |
getData | [byte] | Retrieves raw data bytes from a given slot in the blob |