Syntax
// // Strong typing definition // int64_t SaveModelS( OwlModel model, const void * callback, int64_t size ); // // Weak typing definition // int64_t __declspec(dllexport) __stdcall SaveModelS( int64_t model, const void * callback, int64_t size );
Property model
Size: 64 bit / 8 byte (value)Property callback
Size: 64 bit / 8 byte (reference)Property size
Size: 64 bit / 8 byte (value)
Example (based on pure API calls)
Here you can find code snippets that show how the API call SaveModelS can be used.
#include "./include/engine.h" #include <assert.h> const int_t BLOCK_LENGTH_WRITE = 20000; // no maximum limit FILE * myFileWrite = nullptr; void __stdcall WriteCallBackFunction(unsigned char * content, int64_t size) { fwrite(content, (size_t) size, 1, myFileWrite); } void SaveModelByStream(int64_t model, wchar_t * fileName) { assert(myFileWrite == nullptr); _wfopen_s(&myFileWrite, fileName, L"wb"); if (&myFileWrite) { SaveModelS(model, &WriteCallBackFunction, BLOCK_LENGTH_WRITE); fclose(myFileWrite); } else { assert(false); } }