18 #ifndef __SERVICES_INTERNAL_ERROR_HANDLING_HELPERS_H__
19 #define __SERVICES_INTERNAL_ERROR_HANDLING_HELPERS_H__
21 #include "services/error_handling.h"
22 #include "services/daal_shared_ptr.h"
31 inline void tryAssignStatus(Status *status,
const Status &statusToAssign)
33 if (status) { *status |= statusToAssign; }
36 inline void tryAssignStatusAndThrow(Status *status,
const Status &statusToAssign)
40 *status |= statusToAssign;
41 services::throwIfPossible(*status);
45 services::throwIfPossible(statusToAssign);
50 inline SharedPtr<T> wrapShared(T *
object, Status *status = NULL)
54 tryAssignStatus(status, ErrorMemoryAllocationFailed);
56 return SharedPtr<T>(object);
60 inline SharedPtr<T> wrapSharedAndTryThrow(T *
object, Status *status = NULL)
64 tryAssignStatusAndThrow(status, ErrorMemoryAllocationFailed);
66 return SharedPtr<T>(object);
daal::services::ErrorMemoryAllocationFailed
Definition: error_indexes.h:150