SaveModelA

This function saves the current model in an array.

Syntax

//
//   Strong typing definition
//
int64_t         SaveModelA(
                        OwlModel                model,
                        unsigned char           * content,
                        int64_t                 * size
                    );


//
//   Weak typing definition
//
int64_t __declspec(dllexport) __stdcall SaveModelA(
                                                int64_t                 model,
                                                unsigned char           * content,
                                                int64_t                 * size
                                            );
    

Property model

Size: 64 bit / 8 byte (value)
The handle to the model. The model handle is static during its existance. Several models can be opened simultaniously within one session. Different models are always independent, threads are allowed to be running on different models simultaniously.

Property content

Size: 32 bit / 4 byte (reference)
The content of this IO call, the size of the content is defined by attribute size.

Property size

Size: 32 bit / 4 byte (reference)
The size of the content as defined in number of bytes.

Example (based on pure API calls)

Here you can find code snippits that show how the API call SaveModelA can be used.

#include    "./include/engine.h"
#include    <assert.h>

void    SaveModelByArray(int64_t model, wchar_t * fileName)
{
    FILE    * myFileWrite = nullptr;

    _wfopen_s(&myFileWrite, fileName, L"wb");
    if (&myFileWrite) {
        int64_t size = 0;

        SaveModelA(model, 0, &size);

        unsigned char   * content = new unsigned char[(int_t) size];
        SaveModelA(model, content, &size);

        fwrite(content, 1, (size_t) size, myFileWrite);
        delete[] content;

        fclose(myFileWrite);
    }
    else {
        assert(false);
    }
}