Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
RRef< T > Class Template Reference

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

#include <e32std.h>

Inheritance diagram for RRef< T >:
RRefBase

Public Member Functions

 RRef ()
 Default constructor.
 
 RRef (const RRef< T > &anObject)
 Copy constructor.
 
void operator= (const RRef< T > &anObject)
 Assignment operator.
 
T * operator-> ()
 Gets a pointer to the contained object.
 
 operator T* ()
 Gets a pointer to the contained object.
 
void Alloc (const T &anObject)
 Creates a copy of the specified object, which is to be contained by this reference object.
 
void Alloc (const T &anObject, TInt aSize)
 Creates a copy of the specified object, which is to be contained by this reference object.
 
void AllocL (const T &anObject)
 Creates a copy of the specified object, which is to be contained by this reference object, and leaves on failure.
 
void AllocL (const T &anObject, TInt aSize)
 Creates a copy of the specified object, which is to be contained by this reference object, and leaves on failure.
 
- Public Member Functions inherited from RRefBase
IMPORT_C void Free ()
 Frees the memory holding the contained object.
 

Additional Inherited Members

- Protected Member Functions inherited from RRefBase
 RRefBase ()
 Default constructor.
 
 RRefBase (const RRefBase &aRef)
 Copy constructor.
 
IMPORT_C void DoAlloc (const TAny *aPtr, TInt aSize)
 Creates a copy of an object, which is to be contained by this reference object.
 
IMPORT_C void DoAllocL (const TAny *aPtr, TInt aSize)
 Creates a copy of an object, which is to be contained by this reference object, and leaves on error.
 
IMPORT_C void Copy (const RRefBase &aRef)
 Provides an implementation for the RRef class copy constructor and assignment operator.
 
- Protected Attributes inherited from RRefBase
TInt * iPtr
 

Detailed Description

template<class T>
class RRef< T >

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.

API status
Published to all clients. Released API.

Definition at line 4801 of file e32std.h.

Constructor & Destructor Documentation

◆ RRef() [1/2]

template<class T >
RRef< T >::RRef ( )
inline

Default constructor.

(generated from Symbian Developer Library)

◆ RRef() [2/2]

template<class T >
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.

(generated from Symbian Developer Library)

Member Function Documentation

◆ Alloc() [1/2]

template<class T >
void RRef< T >::Alloc ( 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.

(generated from Symbian Developer Library)

◆ Alloc() [2/2]

template<class T >
void RRef< T >::Alloc ( const T &  anObject,
TInt  aSize 
)
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.

(generated from Symbian Developer Library)

◆ AllocL() [1/2]

template<class T >
void RRef< T >::AllocL ( 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.

(generated from Symbian Developer Library)

◆ AllocL() [2/2]

template<class T >
void RRef< T >::AllocL ( const T &  anObject,
TInt  aSize 
)
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.

(generated from Symbian Developer Library)

◆ operator T*()

template<class T >
RRef< T >::operator T* ( )
inline

Gets a pointer to the contained object.

(generated from Symbian Developer Library)

◆ operator->()

template<class T >
T * RRef< T >::operator-> ( )
inline

Gets a pointer to the contained object.

(generated from Symbian Developer Library)

◆ operator=()

template<class T >
void RRef< T >::operator= ( 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.

(generated from Symbian Developer Library)


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