Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: e32std.h

Class RRef

class RRef : public RRefBase;

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.

Derivation

Members

Defined in RRef:
Alloc(), Alloc(), AllocL(), AllocL(), RRef(), RRef(), operator T *(), operator->(), operator=()

Inherited from RRefBase:
Copy(), DoAlloc(), DoAllocL(), Free(), iPtr


Construction and destruction


RRef()

inline RRef();

Description

Default constructor.


RRef()

inline RRef(const RRef< T > &anObject);

Description

Copy constructor.

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

Parameters

const RRef< T > &anObject

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

[Top]


Member functions


operator=()

inline void operator=(const RRef< T > &anObject);

Description

Assignment operator.

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

Parameters

const RRef< T > &anObject

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


operator->()

inline T *operator->();

Description

Gets a pointer to the contained object.

Return value

T *

A pointer to the contained object


operator T *()

inline operator T *();

Description

Gets a pointer to the contained object.

Return value

A pointer to the contained object


Alloc()

inline void Alloc(const T &anObject);

Description

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

const T &anObject

The object to be packaged up by this reference object.


Alloc()

inline void Alloc(const T &anObject, TInt aSize);

Description

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

const T &anObject

The object to be packaged up by this reference object.

TInt aSize

The amount of memory to be set aside to contain the object. You must make sure that this is big enough.


AllocL()

inline void AllocL(const T &anObject);

Description

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

const T &anObject

The object to be packaged up by this reference object.


AllocL()

inline void AllocL(const T &anObject, TInt aSize);

Description

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

const T &anObject

The object to be packaged up by this reference object.

TInt aSize

The amount of memory to be set aside to contain the object. You must make sure that this is big enough.