All Classes Functions Variables Typedefs Friends Pages
Static Public Member Functions | List of all members
Glympse::Object Class Reference

The Object class provides some helpers for dealing with O<T> objects. More...

#include <Object.h>

Static Public Member Functions

template<typename T >
static O< T > fromThis (T *t)
 fromThis() allows an object t to safely generate additional O<T> instances that all manipulate the lifetime of t (through its internal reference counter). More...
 

Detailed Description

The Object class provides some helpers for dealing with O<T> objects.

Member Function Documentation

template<typename T >
static O<T> Glympse::Object::fromThis ( T *  t)
inlinestatic

fromThis() allows an object t to safely generate additional O<T> instances that all manipulate the lifetime of t (through its internal reference counter).

void someMethod()
{
    Glympse::GSomeEventSink sink = ...;
    sink->addListener(Glympse::Object::fromThis(this));
}
Note
fromThis() method should NOT be used when object is instantiated. Newly created objects have internal reference counter already initialized with 1.
Glympse::GLong number = new Glympse::Long(10LL);
Parameters
Pointerto the object of class that implements ICommon.
Returns
Instance of O<T> that wraps raw pointer and participates in its lifetime management.

The documentation for this class was generated from the following file: