1 #ifndef __PBIO_API__PBIO__PROCESSING_UNIT_H_
2 #define __PBIO_API__PBIO__PROCESSING_UNIT_H_
6 #include "ComplexObject.h"
9 #include "ExceptionCheck.h"
17 class ProcessingUnit :
public ComplexObject
23 FACE_ATTRIBUTES_ESTIMATOR = 1,
26 typedef LightSmartPtr<ProcessingUnit>::tPtr Ptr;
28 char* processSparse(
char* serializedCtx)
const;
30 void freeStr(
char* str_ptr)
const;
32 void* getException()
const;
37 const DHPtr &dll_handle,
39 const char* serializedConfig);
46 friend class object_with_ref_counter<ProcessingUnit>;
62 ProcessingUnit::ProcessingUnit(
63 const DHPtr &dll_handle,
65 const char* serializedConfig)
66 : ComplexObject(dll_handle, nullptr)
68 if (block_type == FACE_ATTRIBUTES_ESTIMATOR)
70 _block_ptr = _dll_handle->TDVFaceAttributesEstimator_createByConfig(serializedConfig);
73 throw pbio::Error(0x10ba1f8e,
"Error in pbio::ProcessingUnit"
74 " unknown block_type for ProcessingUnit");
76 checkException(getException(), *_dll_handle);
81 ProcessingUnit::~ProcessingUnit()
85 _dll_handle->TDVProcessingBlock_destroy(_block_ptr);
92 char* ProcessingUnit::processSparse(
char* serializedCtx)
const
94 char* result = _dll_handle->TDVProcessingBlock_processSparse(_block_ptr, serializedCtx);
95 checkException(getException(), *_dll_handle);
101 void* ProcessingUnit::getException()
const
103 return _dll_handle->TDVProcessingBlock_getException(_block_ptr);
108 void ProcessingUnit::freeStr(
char* str_ptr)
const
110 _dll_handle->tdvFreeStr(str_ptr);
118 #endif // __PBIO_API__PBIO__PROCESSING_BLOCK_H_
Error - the class of exceptions thrown when errors occur.
The class of exceptions thrown when errors occur.
Definition: Error.h:26
Definition: FacerecService.mm:79