Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
This class is a smart pointer with the additional property of dealing with the ownership of the object. More...
#include <ilviews/util/refcount.h>
Public Member Functions | |
~IlvOwnership () | |
The destructor just cleans the resource used by this instance. | |
OBJECT * | get () const |
This function returns a pointer to the object pointed to by this instance. More... | |
IlBoolean | isOwner () const |
This functions returns the ownership property. More... | |
OBJECT & | operator* () const |
The dereference operator. More... | |
OBJECT * | operator-> () const |
The structure pointer dereference operator. More... | |
void | setOwner (IlBoolean owner=IlTrue) |
This function modifies the ownership property. More... | |
Static Public Member Functions | |
static CntPtr | Factory (OBJECT *object, IlBoolean owner=IlTrue) |
This function is a factory for the IlvOwnership class. More... | |
Protected Member Functions | |
IlvOwnership (OBJECT *object, IlBoolean owner) | |
Constructor. More... | |
This class is a smart pointer with the additional property of dealing with the ownership of the object.
Library: display
This class behaves as a pointer except that if it has the ownership property set to IlTrue
, when it is deleted it also deletes the object pointed to. If the ownership property is not set the object pointed to is not deleted.
The type of the object is given as parameter of the class.
|
protected |
Constructor.
The constructor builds a new object that points to the object given as first parameter and the ownership property given as second parameter. This constructor is protected and should be called only through the Factory function.
object | A pointer to an OBJECT (type given as parameter of the template) that will be pointed to by the current instance. |
owner | A Boolean value that gives the initial ownership of the object pointed to by this instance. |
|
static |
This function is a factory for the IlvOwnership
class.
This function returns an IlvRefCountPtr
to an instance of IlvOwnership
that was either created if none already existed that pointed to the object given as parameter, or either a previous one. In the latter case, the ownership property is the result Boolean or between the ownership given as parameter and the previous ownership of the instance.
object | A pointer to an OBJECT that will be the object to be pointed to. |
owner | A Boolean value that is the ownership property. |
IlvRefCountPtr
that points to an IlvOwnership
that points to the object. The ownership depends on the value given as parameter and the previous value of the ownership property of the IlvOwnership
instance if it already existed. OBJECT* IlvOwnership< OBJECT, HASHSIZE >::get | ( | ) | const |
This function returns a pointer to the object pointed to by this instance.
IlBoolean IlvOwnership< OBJECT, HASHSIZE >::isOwner | ( | ) | const |
This functions returns the ownership property.
OBJECT& IlvOwnership< OBJECT, HASHSIZE >::operator* | ( | ) | const |
The dereference operator.
This operator returns a reference to the object pointed to by this instance. This lets this class behave as if it were a pointer.
OBJECT* IlvOwnership< OBJECT, HASHSIZE >::operator-> | ( | ) | const |
The structure pointer dereference operator.
This operator returns a pointer to the object pointed to by this instance. It lets this class behave as if it was a pointer.
void IlvOwnership< OBJECT, HASHSIZE >::setOwner | ( | IlBoolean | owner = IlTrue | ) |
This function modifies the ownership property.
owner | A Boolean value that is the new ownership property. |
© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.