Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
CObjectCon Class Reference

An object container. More...

#include <e32base.h>

Inheritance diagram for CObjectCon:
CBase

Public Member Functions

IMPORT_C ~CObjectCon ()
 Destructor.
 
IMPORT_C void Remove (CObject *anObj)
 Removes a reference counting object from this object container.
 
IMPORT_C void AddL (CObject *anObj)
 Adds a reference counting object to this object container.
 
IMPORT_C CObject * operator[] (TInt anIndex)
 Gets a pointer to the reference counting object located at the specified offset within the object container.
 
IMPORT_C CObject * At (TInt aFindHandle) const
 Gets a pointer to the reference counting object with the specified find-handle number.
 
IMPORT_C CObject * AtL (TInt aFindHandle) const
 Gets a pointer to the reference counting object with the specified find-handle number, and leaves on error.
 
IMPORT_C TInt CheckUniqueFullName (const CObject *anOwner, const TDesC &aName) const
 Checks that a name will be unique.
 
IMPORT_C TInt CheckUniqueFullName (const CObject *anObject) const
 Checks that the specified reference counting object does not already exist in this object container.
 
IMPORT_C TInt FindByName (TInt &aFindHandle, const TDesC &aMatch, TName &aName) const
 Searches for the reference counting object whose name matches the specified match pattern.
 
IMPORT_C TInt FindByFullName (TInt &aFindHandle, const TDesC &aMatch, TFullName &aFullName) const
 Searches for the reference counting object whose full name matches the specified match pattern.
 
TInt UniqueID () const
 Gets this object container's unique ID.
 
TInt Count () const
 Gets the number of reference counting objects in this object container.
 
- Public Member Functions inherited from CBase
 CBase ()
 Default constructor.
 
virtual IMPORT_C ~CBase ()
 Virtual destructor.
 
TAny * operator new (TUint aSize, TAny *aBase) __NO_THROW
 Initialises the object to binary zeroes.
 
TAny * operator new (TUint aSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TUint aExtraSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave, TUint aExtraSize)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 

Static Public Member Functions

static IMPORT_C CObjectCon * NewL ()
 Creates an object container.
 
- Static Public Member Functions inherited from CBase
static IMPORT_C void Delete (CBase *aPtr)
 Deletes the specified object.
 

Public Attributes

TInt iUniqueID
 The object container's unique Id value.
 

Protected Member Functions

IMPORT_C CObjectCon (TInt aUniqueID)
 Constructor taking a unique Id.
 
TBool NamesMatch (const CObject *anObject, const CObject *aCurrentObject) const
 protected recursive function for use by CheckUniqueFullName
 
TBool NamesMatch (const CObject *anObject, const TName &anObjectName, const CObject *aCurrentObject) const
 protected recursive function for use by CheckUniqueFullName
 
- Protected Member Functions inherited from CBase
virtual IMPORT_C TInt Extension_ (TUint aExtensionId, TAny *&a0, TAny *a1)
 Extension function.
 

Friends

class CObjectConIx
 

Detailed Description

An object container.

An object container acts as a home for a set of related reference counting objects.

A reference counting object, a CObject type, must be added to an object container. Only one instance of a given reference counting object can be held by an object container, i.e. each object within an object container must be distinct.

Object containers are constructed by an object container index, a CObjectConIx type.

Note that this class is not intended for user derivation.

See also
CObject
CObjectConIx
API status
Published to all clients. Released API.

Definition at line 1239 of file e32base.h.

Constructor & Destructor Documentation

◆ ~CObjectCon()

IMPORT_C CObjectCon::~CObjectCon ( )

Destructor.

Frees all resources owned by the object container, prior to its destruction.

In particular, it destroys all contained reference counting objects.

CObject

(generated from Symbian Developer Library)

◆ CObjectCon()

IMPORT_C CObjectCon::CObjectCon ( TInt  aUniqueID)
protected

Constructor taking a unique Id.

Parameters
aUniqueIDThe unique Id value.

(generated from Symbian Developer Library)

Member Function Documentation

◆ AddL()

IMPORT_C void CObjectCon::AddL ( CObject *  anObj)

Adds a reference counting object to this object container.

If the specified reference counting object has a name, it must be valid, otherwise the function leaves with KErrBadName; in addition, the reference counting object's full name must be unique to this object container, otherwise the function leaves with KErrAlreadyExists.

If the specified reference counting object has no name, then the object itself must be unique to the object container, i.e. the object container should not already contain the same reference counting object, otherwise the function leaves with KErrAlreadyExists.

Parameters
anObjA pointer to the reference counting object to be added.

(generated from Symbian Developer Library)

◆ At()

IMPORT_C CObject * CObjectCon::At ( TInt  aFindHandle) const

Gets a pointer to the reference counting object with the specified find-handle number.

A find-handle number is an integer which uniquely identifies a reference counting object with respect to its object container.

Parameters
aFindHandleThe find-handle number of the reference counting object. The unique Id part of this number must be the same as the unique Id of this container. The index part of the find-handle number must be a valid index.

Panic condition: E32User-CBase 38 if the unique Id part of aFindHandle is not the same as the unique Id of this container.

Panic condition: E32User-CBase 39 if the index part of aFindHandle is negative or greater than or equal to the total number of reference counting objects held by this object container.

(generated from Symbian Developer Library)

◆ AtL()

IMPORT_C CObject * CObjectCon::AtL ( TInt  aFindHandle) const

Gets a pointer to the reference counting object with the specified find-handle number, and leaves on error.

A find-handle number is an integer which uniquely identifies a reference counting object with respect to its object container.

Parameters
aFindHandleThe find-handle number of the reference counting object. The unique Id part of this number must be the same as the unique Id of this container. The index part of the find-handle number must be a valid index.

Leave condition: KErrBadHandle if the unique Id part of aFindHandle is not the same as the unique Id of this container.

Leave condition: KErrArgument if the index part of aFindHandle is negative or greater than or equal to the total number of reference counting objects held by this object container.

(generated from Symbian Developer Library)

◆ CheckUniqueFullName() [1/2]

IMPORT_C TInt CObjectCon::CheckUniqueFullName ( const CObject *  anObject) const

Checks that the specified reference counting object does not already exist in this object container.

Uniqueness is decided by name, if the object has a name, otherwise by pointer.

If the reference counting object has a name, then it is unique only if there is no other reference counting object in the container with the same full name.

If the reference counting object has no name, then it is unique only if there is no other reference counting object in the container with the same pointer.

Parameters
anObjectA pointer to the reference counting object to be checked.

(generated from Symbian Developer Library)

◆ CheckUniqueFullName() [2/2]

IMPORT_C TInt CObjectCon::CheckUniqueFullName ( const CObject *  anOwner,
const TDesC &  aName 
) const

Checks that a name will be unique.

The function checks that no reference counting object exists in this object container with the same full name as that generated from the specified name and the specified owning reference counting object.

This is a useful test to ensure that the name for a potential new reference counting object will result in a unique full name.

Parameters
anOwnerA pointer to a potential owning reference counting object.
aNameThe name for a potential new reference counting object.

(generated from Symbian Developer Library)

◆ Count()

TInt CObjectCon::Count ( ) const
inline

Gets the number of reference counting objects in this object container.

(generated from Symbian Developer Library)

◆ FindByFullName()

IMPORT_C TInt CObjectCon::FindByFullName ( TInt &  aFindHandle,
const TDesC &  aMatch,
TFullName &  aFullName 
) const

Searches for the reference counting object whose full name matches the specified match pattern.

The search starts at the reference counting object following the one associated with the specified find-handle number. If the specified find-handle number is zero, then searching starts at the beginning of the object container.

Notes:

  1. names are folded for the purpose of pattern matching
  2. if the specified find-handle number is non-zero, then the unique Id part of the number must be the same as the unique Id of this container.
Parameters
aFindHandleOn entry, contains the find-handle number of a reference counting object from where searching is to start or zero. On return, if an object is found, then this is set to the find-handle number of that object; if no object is found, then this is set to a generated number, the index part of which has the value 0x7fff. If the object container is empty, then this reference is not changed.
aMatchThe match pattern.
aFullNameA modifiable buffer descriptor with a defined maximum length. On return, if an object is found, then this contains the full name of that object; if no object is found, then the length of this descriptor is set to zero. If the object container is empty, then this reference is not changed.

Panic condition: E32User-CBase 38 if aFindHandle is non-zero and the unique Id part of it is not the same as the unique Id of this container.

(generated from Symbian Developer Library)

◆ FindByName()

IMPORT_C TInt CObjectCon::FindByName ( TInt &  aFindHandle,
const TDesC &  aMatch,
TName &  aName 
) const

Searches for the reference counting object whose name matches the specified match pattern.

The search starts at the reference counting object following the one associated with the specified find-handle number. If the specified find-handle number is zero, then searching starts at the beginning of the object container.

Notes:

  1. names are folded for the purpose of pattern matching
  2. if the specified find-handle number is non-zero, then the unique Id part of the number must be the same as the unique Id of this container.
Parameters
aFindHandleOn entry, contains the find-handle number of a reference counting object from where searching is to start, or zero. On return, if an object is found, then this is set to the find-handle number of that object; if no object is found, then this is set to a generated number, the index part of which has the value 0x7fff. If the object container is empty, then this reference is not changed.
aMatchThe match pattern.
aNameA modifiable buffer descriptor with a defined maximum length. On return, if an object is found, then this contains the name of that object; if no object is found, then the length of this descriptor is set to zero. If the object container is empty, then this reference is not changed.

Panic condition: E32User-CBase 38 if aFindHandle is non-zero and the unique Id part of it is not the same as the unique Id of this container.

(generated from Symbian Developer Library)

◆ NamesMatch() [1/2]

TBool CObjectCon::NamesMatch ( const CObject *  anObject,
const CObject *  aCurrentObject 
) const
protected

protected recursive function for use by CheckUniqueFullName

(generated from Symbian Developer Library)

◆ NamesMatch() [2/2]

TBool CObjectCon::NamesMatch ( const CObject *  anObject,
const TName &  anObjectName,
const CObject *  aCurrentObject 
) const
protected

protected recursive function for use by CheckUniqueFullName

(generated from Symbian Developer Library)

◆ NewL()

static IMPORT_C CObjectCon * CObjectCon::NewL ( )
static

Creates an object container.

Open code rarely, if ever, explicitly calls this function. Instead, call the CreateL() member function of the container index, CObjectConIx, which uses this function in its implementation.

CObjectConIx::CreateL

(generated from Symbian Developer Library)

◆ operator[]()

IMPORT_C CObject * CObjectCon::operator[] ( TInt  anIndex)

Gets a pointer to the reference counting object located at the specified offset within the object container.

Parameters
anIndexThe offset of the reference counting object within the object container. Offset is relative to zero.

Panic condition: E32USER-CBase 21 if anIndex is negative or is greater than or equal to the total number of objects held by the container.

(generated from Symbian Developer Library)

◆ Remove()

IMPORT_C void CObjectCon::Remove ( CObject *  anObj)

Removes a reference counting object from this object container.

The specified reference counting object is destroyed on removal.

Parameters
anObjA pointer to the reference counting object to be removed.

Panic condition: E32USER-CBase 35 if the reference counting object is not held by this object container.

(generated from Symbian Developer Library)

◆ UniqueID()

TInt CObjectCon::UniqueID ( ) const
inline

Gets this object container's unique ID.

(generated from Symbian Developer Library)

Friends And Related Symbol Documentation

◆ CObjectConIx

friend class CObjectConIx
friend

Definition at line 1294 of file e32base.h.

Member Data Documentation

◆ iUniqueID

TInt CObjectCon::iUniqueID

The object container's unique Id value.

Definition at line 1287 of file e32base.h.


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