|
MrSID Decode SDK for LiDAR Reference Manual
1.1.4.4709
|
Scoped is a wrapper class around Object that gives it block scoping. More...
#include <Object.h>
Public Member Functions | |
| ~Scoped (void) | |
| Releases the object when Scoped<> goes out of scope. | |
| Scoped (void) | |
| Create an object on the heap. | |
| Scoped (TYPE *object) | |
| Manage an existing object. | |
| Scoped & | operator= (TYPE *object) |
| Assignment operator. | |
| Scoped & | operator= (const TYPE *object) |
| Scoped (const Scoped &object) | |
| Copy constructor. | |
| Scoped & | operator= (const Scoped &object) |
| Assignment operator. | |
| TYPE * | operator-> (void) |
| Make Scoped behave like a pointer to TYPE. | |
| const TYPE * | operator-> (void) const |
| TYPE & | operator* (void) |
| Make Scoped behave like a pointer to TYPE. | |
| const TYPE & | operator* (void) const |
| operator TYPE *& (void) | |
| Make Scoped behave like a pointer to TYPE. | |
| operator const TYPE *& (void) const | |
Scoped is convenience class that give block scoping to reference counted Objects. Scoped<TYPE> tries to act like a TYPE *.
As a convenience class you don't have to use it. Some people find it easier to manage the reference counting themselves.
Example: Without Scoped:
{
FileIO *file = FileIO::create();
try
{
file->init(path, mode);
// use the file object
if(return early)
{
file->release();
return;
}
// use the file object some more
file->release();
}
catch(...)
{
file->release();
throw;
}
}
With Scoped:
{
Scoped<FileIO> file;
file->init(path, mode);
// use the file object
if(return early)
return;
// use the file object some more
}
| Scoped< TYPE >::operator const TYPE *& | ( | void | ) | const [inline] |
| Scoped< TYPE >::operator TYPE *& | ( | void | ) | [inline] |
| TYPE& Scoped< TYPE >::operator* | ( | void | ) | [inline] |
| const TYPE& Scoped< TYPE >::operator* | ( | void | ) | const [inline] |
| TYPE* Scoped< TYPE >::operator-> | ( | void | ) | [inline] |
| const TYPE* Scoped< TYPE >::operator-> | ( | void | ) | const [inline] |