NAVTOR SDK  v.3.0
Software Development Kit for fast and efficient development of ECDIS, ECS and generic marine applications
allocator_interface.h
Go to the documentation of this file.
1 #ifndef SDK_BASE_MEMORY_ALLOCATOR_INTERFACE_H_
11 #define SDK_BASE_MEMORY_ALLOCATOR_INTERFACE_H_
12 
13 #include <base/inc/sdk_results.h>
14 #include <base/inc/base_types.h>
16 #include <base/inc/sdk_ref_ptr.h>
17 
18 namespace sdk {
19 namespace base {
20 
21 class IMemoryAllocator;
22 typedef SDKRefPtr<IMemoryAllocator> MemoryAllocatorSP;
23 
27 {
28  public:
30  virtual SDKResult SDK_CALLTYPE Alloc(SDKUInt64 size, void** ptr) throw() = 0;
32  virtual SDKResult SDK_CALLTYPE Realloc(SDKUInt64 new_size,
33  void** ptr) throw() = 0;
35  virtual SDKResult SDK_CALLTYPE Free(void** ptr) throw() = 0;
36 
37  SDK_IMPLEMENT_IID(IMemoryAllocator)
38  SDK_END_INTERFACE(IMemoryAllocator)
39 };
40 SDK_DECLARE_IID(IMemoryAllocator)
41 
42 } // namespace base
43 } // namespace sdk
44 
45 #endif // SDK_BASE_MEMORY_ALLOCATOR_INTERFACE_H_
sdk_results.h
A list of SDK error/return results.
base_types.h
SDK base types.
sdk_ref_ptr.h
Interfaces wrapper with reference count control.
SDKResult
SDKInt32 SDKResult
Type of all error or return codes which SDK functions can end with.
Definition: sdk_results.h:17
sdk::base::IMemoryAllocator
Memory allocator interface.
Definition: allocator_interface.h:26
SDKRefPtr
A smart pointer class for managing SDK components interface pointers.
Definition: sdk_ref_ptr.h:23
sdk_component_interface.h
Common base SDK interfaces.
sdk::base::IMemoryAllocator::Realloc
virtual SDKResult SDK_CALLTYPE Realloc(SDKUInt64 new_size, void **ptr)=0
Reallocates memory.
ISDKComponent
Base interface for all SDK interfaces.
Definition: sdk_component_interface.h:41
sdk::base::IMemoryAllocator::Alloc
virtual SDKResult SDK_CALLTYPE Alloc(SDKUInt64 size, void **ptr)=0
Allocates memory.
sdk::base::IMemoryAllocator::Free
virtual SDKResult SDK_CALLTYPE Free(void **ptr)=0
Frees memory.