Location:
e32base.h
Link against: euser.lib
class CObjectCon : public CBase;
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.
CBase
- Base class for all classes to be instantiated on the heap
CObjectCon
- An object container
Defined in CObjectCon
:
AddL()
, At()
, AtL()
, CObjectCon()
, CheckUniqueFullName()
, CheckUniqueFullName()
, Count()
, FindByFullName()
, FindByName()
, NewL()
, Remove()
, UniqueID()
, iUniqueID
, operator[]()
, ~CObjectCon()
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
static IMPORT_C CObjectCon *NewL();
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.
|
IMPORT_C ~CObjectCon();
Destructor.
Frees all resources owned by the object container, prior to its destruction.
In particular, it destroys all contained reference counting objects.
protected: IMPORT_C CObjectCon(TInt aUniqueID);
Constructor taking a unique Id.
|
IMPORT_C void Remove(CObject *anObj);
Removes a reference counting object from this object container.
The specified reference counting object is destroyed on removal.
|
|
IMPORT_C void 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.
|
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.
A find-handle number is an integer which uniquely identifies a reference counting object with respect to its object container.
|
|
|
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..
A find-handle number is an integer which uniquely identifies a reference counting object with respect to its object container.
|
|
|
IMPORT_C TInt 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.
|
|
IMPORT_C TInt 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.
|
|
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.
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.
|
|
|
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.
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.
|
|
|
inline TInt UniqueID() const;
Gets this object container's unique ID.
|
inline TInt Count() const;
Gets the number of reference counting objects in this object container.
|
TInt iUniqueID;
The object container's unique Id value.