29 #ifndef NVBLASTGLOBALS_H 30 #define NVBLASTGLOBALS_H 67 virtual void*
allocate(
size_t size,
const char* typeName,
const char* filename,
int line) = 0;
101 eINVALID_PARAMETER = 4,
104 eINVALID_OPERATION = 8,
112 eINTERNAL_ERROR = 32,
145 virtual void reportError(
ErrorCode::Enum code,
const char* message,
const char* file,
int line) = 0;
195 NV_INLINE
void logLL(
int type,
const char* msg,
const char* file,
int line)
220 #define NVBLAST_ALLOC(_size) NvBlastGlobalGetAllocatorCallback()->allocate(_size, nullptr, __FILE__, __LINE__) 221 #define NVBLAST_ALLOC_NAMED(_size, _name) NvBlastGlobalGetAllocatorCallback()->allocate(_size, _name, __FILE__, __LINE__) 222 #define NVBLAST_FREE(_mem) NvBlastGlobalGetAllocatorCallback()->deallocate(_mem) 228 #define NVBLAST_NEW(T) new (NvBlastGlobalGetAllocatorCallback()->allocate(sizeof(T), #T, __FILE__, __LINE__)) T 234 #define NVBLAST_DELETE(obj, T) \ 236 NvBlastGlobalGetAllocatorCallback()->deallocate(obj) 245 #define NVBLAST_LOG(_code, _msg) NvBlastGlobalGetErrorCallback()->reportError(_code, _msg, __FILE__, __LINE__) 246 #define NVBLAST_LOG_ERROR(_msg) NVBLAST_LOG(Nv::Blast::ErrorCode::eINVALID_OPERATION, _msg) 247 #define NVBLAST_LOG_WARNING(_msg) NVBLAST_LOG(Nv::Blast::ErrorCode::eDEBUG_WARNING, _msg) 248 #define NVBLAST_LOG_INFO(_msg) NVBLAST_LOG(Nv::Blast::ErrorCode::eDEBUG_INFO, _msg) 249 #define NVBLAST_LOG_DEBUG(_msg) NVBLAST_LOG(Nv::Blast::ErrorCode::eNO_ERROR, _msg) 255 #define NVBLAST_CHECK(_code, _expr, _msg, _onFail) \ 259 NVBLAST_LOG(_code, _msg); \ 264 #define NVBLAST_CHECK_ERROR(_expr, _msg, _onFail) NVBLAST_CHECK(Nv::Blast::ErrorCode::eINVALID_OPERATION, _expr, _msg, _onFail) 265 #define NVBLAST_CHECK_WARNING(_expr, _msg, _onFail) NVBLAST_CHECK(Nv::Blast::ErrorCode::eDEBUG_WARNING, _expr, _msg, _onFail) 266 #define NVBLAST_CHECK_INFO(_expr, _msg, _onFail) NVBLAST_CHECK(Nv::Blast::ErrorCode::eDEBUG_INFO, _expr, _msg, _onFail) 267 #define NVBLAST_CHECK_DEBUG(_expr, _msg, _onFail) NVBLAST_CHECK(Nv::Blast::ErrorCode::eNO_ERROR, _expr, _msg, _onFail) 274 #define NVBLAST_FOURCC(_a, _b, _c, _d) ( (uint32_t)(_a) | (uint32_t)(_b)<<8 | (uint32_t)(_c)<<16 | (uint32_t)(_d)<<24 ) 277 #endif // ifndef NVBLASTGLOBALS_H Error messages.
Definition: NvBlastTypes.h:49
virtual void deallocate(void *ptr)=0
Frees memory previously allocated by allocate().
virtual void * allocate(size_t size, const char *typeName, const char *filename, int line)=0
Allocates size bytes of memory, which must be 16-byte aligned.
An informational message.
Definition: NvBlastGlobals.h:95
virtual void reportError(ErrorCode::Enum code, const char *message, const char *file, int line)=0
Reports an error code.
NV_INLINE void logLL(int type, const char *msg, const char *file, int line)
Definition: NvBlastGlobals.h:195
Warning messages.
Definition: NvBlastTypes.h:50
User defined interface class. Used by the library to emit debug information.
Definition: NvBlastGlobals.h:131
Information messages.
Definition: NvBlastTypes.h:51
void NvBlastGlobalSetAllocatorCallback(Nv::Blast::AllocatorCallback *allocatorCallback)
Error codes.
Definition: NvBlastGlobals.h:88
Nv::Blast::AllocatorCallback * NvBlastGlobalGetAllocatorCallback()
method was called at a time when an operation is not possible
Definition: NvBlastGlobals.h:104
#define NVBLAST_API
Definition: NvBlastPreprocessor.h:37
virtual ~AllocatorCallback()
destructor
Definition: NvBlastGlobals.h:51
Definition: NvBlastGlobals.h:92
a warning message for the user to help with debugging
Definition: NvBlastGlobals.h:98
Abstract base class for an application defined memory allocator that can be used by toolkit (Tk) or a...
Definition: NvBlastGlobals.h:45
void NvBlastGlobalSetErrorCallback(Nv::Blast::ErrorCallback *errorCallback)
virtual ~ErrorCallback()
Definition: NvBlastGlobals.h:134
Nv::Blast::ErrorCallback * NvBlastGlobalGetErrorCallback()
Used only in debug version of dll.
Definition: NvBlastTypes.h:52
Enum
Definition: NvBlastGlobals.h:90
Definition: NvBlastExtAuthoring.h:34