RRef Class Reference

#include <e32std.h>

class RRef : public RRefBase

Inherits from

Detailed Description

Contains, or packages, a copy of an instance of another class.

The template parameter defines the type of the contained object.

The contained object is held in allocated memory, and can be accessed through the member selection and dereference operators.

Constructor & Destructor Documentation

RRef ( )

RRef()[inline]

Default constructor.

RRef ( const RRef< T > & )

RRef(const RRef< T > &anObject)[inline]

Copy constructor.

The constructor frees any existing contained object, and takes ownership of the object owned by anObject.

Parameters
anObjectA reference to another 'reference' object. On return from this constructor, anObject may be safely orphaned if it lives on the program stack.

Member Function Documentation

Alloc ( const T & )

voidAlloc(const T &anObject)[inline]

Creates a copy of the specified object, which is to be contained by this reference object.

The amount of memory set aside to contain the object is defined by the size of the object

Parameters
anObjectThe object to be packaged up by this reference object.

Alloc ( const T &, TInt )

voidAlloc(const T &anObject,
TIntaSize
)[inline]

Creates a copy of the specified object, which is to be contained by this reference object.

The amount of memory set aside to contain the object is defined by aSize.

Parameters
anObjectThe object to be packaged up by this reference object.
aSizeThe amount of memory to be set aside to contain the object. You must make sure that this is big enough.

AllocL ( const T & )

voidAllocL(const T &anObject)[inline]

Creates a copy of the specified object, which is to be contained by this reference object, and leaves on failure.

The amount of memory set aside to contain the object is defined by the size of the object

Parameters
anObjectThe object to be packaged up by this reference object.

AllocL ( const T &, TInt )

voidAllocL(const T &anObject,
TIntaSize
)[inline]

Creates a copy of the specified object, which is to be contained by this reference object, and leaves on failure.

The amount of memory set aside to contain the object is defined by aSize.

Parameters
anObjectThe object to be packaged up by this reference object.
aSizeThe amount of memory to be set aside to contain the object. You must make sure that this is big enough.

operator T * ( )

operator T *()[inline]

Gets a pointer to the contained object.

Return Value
A pointer to the contained object

operator-> ( )

T *operator->()[inline]

Gets a pointer to the contained object.

Return Value
A pointer to the contained object

operator= ( const RRef< T > & )

voidoperator=(const RRef< T > &anObject)[inline]

Assignment operator.

The constructor frees any existing contained object, and takes ownership of the object owned by anObject.

Parameters
anObjectA reference to another 'reference' object. On return from this constructor, anObject may be safely orphaned if it lives on the program stack.