MrSID Decode SDK for LiDAR Reference Manual
1.1.3.4427
|
Object is the base class for implementing reference counting. More...
#include <Object.h>
Public Member Functions | |
void | retain (void) const |
Increment the reference count by one. | |
void | release (void) const |
Decrement the reference count by one. | |
Protected Member Functions | |
Object (void) | |
virtual | ~Object (void) |
Static Protected Member Functions | |
static void * | operator new (size_t size) |
Overide new so all Objects use ALLOC() | |
static void | operator delete (void *ptr) |
Overide delete so all Objects use DEALLOC() |
The Object class is a base for implementing reference counting. When an object is created, it has a reference count of 1. When an object is retained, the reference count is incremented. When it is released the reference count is decremented, and when the reference count goes to zero the object gets deleted.
Derived classes should supply a static create() function to allocate new objects.
Constructors and destructors should be protected so users must go through the create/retain/release functions.
Object::Object | ( | void | ) | [protected] |
virtual Object::~Object | ( | void | ) | [protected, virtual] |
static void Object::operator delete | ( | void * | ptr | ) | [static, protected] |
static void* Object::operator new | ( | size_t | size | ) | [static, protected] |
void Object::release | ( | void | ) | const |
When the reference count goes to zero the object gets deleted.
void Object::retain | ( | void | ) | const |