IO::EAIOZoneObject class

A class derived from EAIOZoneObject is able to be allocated from different heaps without the owner of the object needing to know or care which heap the object came from or even what kind of allocator the object is using.

The owner of the object can use 'delete' or the object can call 'delete' on itself (useful for reference counting systems) and the object will be freed via the correct allocator.

Zone object uses the ICoreAllocator interface to allocate and free.

Zone objects have a virtual destructor and thus a vtable. However, the user doesn't need to use any virtual functions in derived classes.

EAIOZoneObject-deriving classes can be created via EA_NEW, but don't have to be created by it. They can be created by regular new as well.

Example usage: class Widget : public EAIOZoneObject { uint32_t mRefCount;

Widget() : mRefCount(0) { }

void AddRef() { ++mRefCount; }

void Release() { if(mRefCount > 1) –mRefCount; else delete this; // Will use ICoreAllocator to free self. } };

Widget* pWidget = new(pCoreAllocator) Widget; pWidget->AddRef(); pWidget->Release();

Derived classes

class SharedPointer
Implements a basic ref-counted pointer.
class Resource::Database
class Resource::PFIndexModifiable
This class stores the metadata of all the files contained in a DBPF file.
class Resource::ThreadedObject

Public static functions

static auto operator delete(void* p) -> void
static auto operator delete(void* p, ICoreAllocator* pAllocator, const char* pName) -> void
static auto operator new(size_t n, ICoreAllocator* pAllocator, const char* pName) -> void*
Example usage: Widget* pWidget = new(pCoreAllocator, "Widget") Widget;.
static auto operator new(size_t n) -> void*

Constructors, destructors, conversion operators

~EAIOZoneObject() virtual