From d41654b469fa51870b5952c836c04d9da17f32d3 Mon Sep 17 00:00:00 2001 From: Anton Novoselov Date: Tue, 8 Aug 2017 20:14:22 +0300 Subject: Updated to CL 22627414: * docs updates * authoring fixes * stress solver crash fixes --- docs/api_docs/files/pageextserialization.html | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'docs/api_docs/files/pageextserialization.html') diff --git a/docs/api_docs/files/pageextserialization.html b/docs/api_docs/files/pageextserialization.html index 4a72cd9..3f263d0 100644 --- a/docs/api_docs/files/pageextserialization.html +++ b/docs/api_docs/files/pageextserialization.html @@ -44,10 +44,15 @@ Each serialization module defines the object types it can serialize. ExtSerializ
  • LlObjectTypeID::Asset - An NvBlastAsset
  • LlObjectTypeID::Family - An NvBlastFamily
  • To serialize an object, for example an NvBlastAsset, use ExtSerialization::serializeIntoBuffer as follows:

    -/code const NvBlastAsset* asset = ... // Given pointer to an NvBlastAsset

    -void* buffer; uint64_t size = ser->serializeIntoBuffer(buffer, asset, LlObjectTypeID::Asset); /endcode

    -If successful, the data is written into a buffer allocated using the NvBlastGlobals allocator, written to the "buffer" parameter, and the size of the buffer written is the return value of the function. If the function returns 0, then serialization was unsuccessful. Notice that the second function parameter is actually a void*, so it requires the last parameter to tell it what object it's serializing. A utility wrapper function is given in NvBlastExtLlSerialization.h which performs the same operation with an NvBlastAsset, so one could equivalently use

    -/code void* buffer; uint64_t size = NvBlastExtSerializationSerializeAssetIntoBuffer(buffer, *ser, asset); /endcode

    +

    const NvBlastAsset* asset = ... // Given pointer to an NvBlastAsset
    +
    +void* buffer;
    +uint64_t size = ser->serializeIntoBuffer(buffer, asset, LlObjectTypeID::Asset);
    +

    +If successful, the data is written into a buffer allocated using the NvBlastGlobals allocator, written to the "buffer" parameter, and the size of the buffer written is the return value of the function. If the function returns 0, then serialization was unsuccessful. Notice that the second function parameter is actually a void*, so it requires the last parameter to tell it what object it is serializing. A utility wrapper function is given in NvBlastExtLlSerialization.h which performs the same operation with an NvBlastAsset, so one could equivalently use

    +

    void* buffer;
    +uint64_t size = NvBlastExtSerializationSerializeAssetIntoBuffer(buffer, *ser, asset);
    +

    A corresponding function also exists for NvBlastFamily, as well as other data types supported by other serialization extensions.

    This buffer may be written to disk, memory, networked, etc. Since the memory for the buffer is allocated using the allocator in NvBlastGlobals, it may be freed using the same allocator:

    NVBLAST_FREE(buffer)
    @@ -117,7 +122,7 @@ If you don't know the object type in the buffer, you may use the last (optional)
     

    Peeking at and Skipping Buffer Data

    -If a buffer contains multiple objects, you may peek at the buffer to get object information including object type, encoding, and data size, and skip to the next object in the buffer (whether or not you've chosen to read the current object). For example:

    +If a buffer contains multiple objects, you may peek at the buffer to get object information including object type, encoding, and data size, and skip to the next object in the buffer (whether or not you have chosen to read the current object). For example:

    const void* buffer = ... // The input buffer
     uint64_t size = ... // The input buffer size
     
    -- 
    cgit v1.2.3