symport/e32/include/e32base.inl
author jjkang
Fri, 11 Jun 2010 15:22:09 +0800
changeset 2 806186ab5e14
parent 1 0a7b44b10206
permissions -rw-r--r--
Change SFL to EPL
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
     1
// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
     2
// All rights reserved.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
2
806186ab5e14 Change SFL to EPL
jjkang
parents: 1
diff changeset
     4
// under the terms of the License "Eclipse Public License v1.0"
1
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
2
806186ab5e14 Change SFL to EPL
jjkang
parents: 1
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
     7
//
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
     8
// Initial Contributors:
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    10
//
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    11
// Contributors:
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    12
//
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    13
// Description:
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    14
// e32\include\e32base.inl
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    15
// 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    16
//
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    17
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    18
// Class CBase
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    19
inline TAny* CBase::operator new(TUint aSize, TAny* aBase) __NO_THROW
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    20
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    21
Initialises the object to binary zeroes.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    22
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    23
@param aSize The size of the derived class. This parameter is specified
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    24
             implicitly by C++ in all circumstances in which a derived
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    25
			 class is allocated.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    26
@param aBase Indicates a base address which is returned as the object's
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    27
             address. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    28
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    29
@return A pointer to the base address.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    30
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    31
	{ Mem::FillZ(aBase, aSize); return aBase; }
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    32
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    33
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    34
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    35
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    36
inline TAny* CBase::operator new(TUint aSize) __NO_THROW
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    37
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    38
Allocates the object from the heap and then initialises its contents
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    39
to binary zeroes.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    40
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    41
@param aSize The size of the derived class. This parameter is specified
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    42
             implicitly by C++ in all circumstances in which a derived class
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    43
			 is allocated.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    44
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    45
@return      A pointer to the allocated object; NULL if memory could not
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    46
             be allocated.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    47
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    48
	{ return User::AllocZ(aSize); }
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    49
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    50
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    51
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    52
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    53
inline TAny* CBase::operator new(TUint aSize, TLeave)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    54
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    55
Allocates the object from the heap and then initialises its contents
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    56
to binary zeroes.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    57
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    58
@param aSize  The size of the derived class. This parameter is specified
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    59
              implicitly by C++ in all circumstances in which a derived class
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    60
			  is allocated.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    61
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    62
@return       A pointer to the allocated object; the TLeave parameter indicates
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    63
              that the operation leaves if allocation fails with out-of-memory.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    64
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    65
	{ return User::AllocZL(aSize); }
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    66
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    67
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    68
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    69
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    70
inline TAny* CBase::operator new(TUint aSize, TUint aExtraSize) __NO_THROW
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    71
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    72
Allocates the object from the heap and then initialises its contents
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    73
to binary zeroes.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    74
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    75
Use of this overload is rare.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    76
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    77
@param aSize  The size of the derived class. This parameter is specified
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    78
              implicitly by C++ in all circumstances in which a derived class
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    79
			  is allocated.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    80
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    81
@param aExtraSize Indicates additional size beyond the end of the base class.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    82
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    83
@return      A pointer to the allocated object; NULL if memory could not
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    84
             be allocated.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    85
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    86
	{ return User::AllocZ(aSize + aExtraSize); }
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    87
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    88
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    89
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    90
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    91
inline TAny* CBase::operator new(TUint aSize, TLeave, TUint aExtraSize)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    92
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    93
Allocates the object from the heap and then initialises its contents
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    94
to binary zeroes.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    95
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    96
Use of this overload is rare.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    97
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    98
@param aSize  The size of the derived class. This parameter is specified
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
    99
              implicitly by C++ in all circumstances in which a derived class
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   100
			  is allocated.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   101
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   102
@param aExtraSize Indicates additional size beyond the end of the base class.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   103
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   104
@return      A pointer to the allocated object; the TLeave parameter indicates
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   105
              that the operation leaves if allocation fails with out-of-memory.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   106
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   107
	{ return User::AllocZL(aSize + aExtraSize); }
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   108
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   109
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   110
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   111
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   112
// Class CBufBase
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   113
inline TInt CBufBase::Size() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   114
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   115
Gets the number of data bytes in the buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   116
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   117
Note that the number of heap bytes used by the buffer may be greater than its
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   118
size, because there is typically extra room to allow for expansion. Use the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   119
Compress() function to reduce the extra allocation as much as possible.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   120
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   121
@return The number of data bytes in the buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   122
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   123
	{return(iSize);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   124
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   125
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   126
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   127
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   128
// Class CBufFlat
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   129
inline TInt CBufFlat::Capacity() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   130
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   131
Gets the size to which the buffer may expand without re-allocation.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   132
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   133
@return The size of the allocated cell associated with the buffer. This is 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   134
        the maximum size the buffer may be expanded to without re-allocation.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   135
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   136
	{return(iMaxSize);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   137
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   138
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   139
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   140
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   141
// Class CArrayFixBase
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   142
inline TInt CArrayFixBase::Count() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   143
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   144
Gets the number of elements held in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   145
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   146
@return The number of array elements
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   147
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   148
	{return(iCount);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   149
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   150
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   151
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   152
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   153
inline TInt CArrayFixBase::Length() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   154
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   155
Gets the length of an element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   156
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   157
@return The length of an element of type class T.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   158
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   159
	{return(iLength);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   160
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   161
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   162
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   163
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   164
// Template class CArrayFix
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   165
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   166
inline CArrayFix<T>::CArrayFix(TBufRep aRep,TInt aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   167
	: CArrayFixBase(aRep,sizeof(T),aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   168
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   169
@internalComponent
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   170
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   171
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   172
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   173
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   174
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   175
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   176
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   177
inline const T &CArrayFix<T>::operator[](TInt anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   178
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   179
Gets a const reference to the element located at the specified position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   180
within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   181
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   182
Note that if a pointer to the returned referenced class T object is taken,
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   183
be aware that the pointer value becomes invalid once elements have been added
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   184
to, or removed from the array. Always refresh the pointer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   185
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   186
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   187
               is relative to zero; i.e. zero implies the first element in
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   188
			   the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   189
			   
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   190
@return A const reference to the required element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   191
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   192
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   193
                         number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   194
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   195
	{return(*((const T *)CArrayFixBase::At(anIndex)));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   196
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   197
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   198
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   199
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   200
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   201
inline T &CArrayFix<T>::operator[](TInt anIndex)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   202
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   203
Gets a non-const reference to the element located at the specified position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   204
within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   205
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   206
Note that if a pointer to the returned referenced class T object is taken,
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   207
be aware that the pointer value becomes invalid once elements have been added
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   208
to, or removed from the array. Always refresh the pointer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   209
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   210
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   211
               is relative to zero; i.e. zero implies the first element in
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   212
			   the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   213
			   
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   214
@return A non-const reference to the required element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   215
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   216
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   217
                         number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   218
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   219
	{return(*((T *)CArrayFixBase::At(anIndex)));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   220
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   221
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   222
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   223
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   224
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   225
inline const T &CArrayFix<T>::At(TInt anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   226
/** 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   227
Gets a const reference to the element located at the specified position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   228
within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   229
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   230
Note that if a pointer to the returned referenced class T object is taken,
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   231
be aware that the pointer value becomes invalid once elements have been added
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   232
to, or removed from the array. Always refresh the pointer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   233
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   234
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   235
               is relative to zero; i.e. zero implies the first element in
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   236
			   the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   237
			   
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   238
@return A const reference to the required element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   239
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   240
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   241
                         number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   242
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   243
	{return(*((const T *)CArrayFixBase::At(anIndex)));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   244
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   245
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   246
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   247
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   248
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   249
inline const T *CArrayFix<T>::End(TInt anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   250
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   251
Gets a pointer to the (const) first byte following the end of the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   252
contiguous region containing the element at the specified position within
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   253
the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   254
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   255
For arrays implemented using flat buffers, the pointer always points to the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   256
first byte following the end of the buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   257
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   258
For arrays implemented using segmented buffers, the pointer always points 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   259
to the first byte following the end of the segment which contains the element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   260
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   261
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   262
               is relative to zero; i.e. zero implies the first element
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   263
			   in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   264
			   
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   265
@return A pointer to the constant byte following the end of the contiguous 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   266
        region. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   267
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   268
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   269
                         number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   270
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   271
	{return((const T *)CArrayFixBase::End(anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   272
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   273
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   274
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   275
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   276
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   277
inline const T *CArrayFix<T>::Back(TInt anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   278
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   279
Gets a pointer to the (const) beginning of a contiguous region.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   280
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   281
For arrays implemented using flat buffers, the function always returns a
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   282
pointer to the beginning of the buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   283
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   284
For arrays implemented using segmented buffers, the function returns a pointer 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   285
to the beginning of the segment for all elements in that segment except the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   286
first. If the element at position anIndex is the first in a segment, then 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   287
the function returns a pointer the beginning of the previous segment.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   288
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   289
For the first element in the array, the function returns a NULL pointer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   290
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   291
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   292
               is relative to zero; i.e. zero implies the first element
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   293
			   in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   294
			   
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   295
@return A pointer to the (const) beginning of the contiguous region.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   296
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   297
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   298
                         number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   299
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   300
	{return((const T *)CArrayFixBase::Back(anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   301
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   302
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   303
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   304
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   305
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   306
inline T &CArrayFix<T>::At(TInt anIndex)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   307
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   308
Gets a non-const reference to the element located at the specified position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   309
within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   310
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   311
Note that if a pointer to the returned referenced class T object is taken,
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   312
be aware that the pointer value becomes invalid once elements have been added
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   313
to, or removed from the array. Always refresh the pointer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   314
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   315
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   316
               is relative to zero; i.e. zero implies the first element in
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   317
			   the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   318
			   
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   319
@return A non-const reference to the required element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   320
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   321
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   322
                         number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   323
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   324
	{return(*((T *)CArrayFixBase::At(anIndex)));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   325
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   326
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   327
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   328
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   329
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   330
inline T *CArrayFix<T>::End(TInt anIndex)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   331
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   332
Gets a pointer to the first byte following the end of the contiguous region 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   333
containing the element at the specified position within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   334
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   335
For arrays implemented using flat buffers, the pointer always points to the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   336
first byte following the end of the buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   337
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   338
For arrays implemented using segmented buffers, the pointer always points 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   339
to the first byte following the end of the segment which contains the element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   340
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   341
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   342
               is relative to zero; i.e. zero implies the first element
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   343
			   in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   344
			   
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   345
@return A pointer to the byte following the end of the contiguous region.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   346
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   347
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   348
                         number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   349
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   350
	{return(((T *)CArrayFixBase::End(anIndex)));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   351
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   352
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   353
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   354
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   355
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   356
inline T *CArrayFix<T>::Back(TInt anIndex)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   357
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   358
Gets a pointer to the beginning of a contiguous region.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   359
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   360
For arrays implemented using flat buffers, the function always returns a pointer 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   361
to the beginning of the buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   362
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   363
For arrays implemented using segmented buffers, the function returns a pointer 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   364
to the beginning of the segment for all elements in that segment except the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   365
first. If the element at position anIndex is the first in a segment, then 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   366
the function returns a pointer the beginning of the previous segment.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   367
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   368
For the first element in the array, the function returns a NULL pointer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   369
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   370
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   371
               is relative to zero; i.e. zero implies the first element
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   372
			   in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   373
			   
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   374
@return A pointer to the beginning of the contiguous region.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   375
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   376
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   377
                         number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   378
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   379
	{return(((T *)CArrayFixBase::Back(anIndex)));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   380
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   381
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   382
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   383
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   384
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   385
inline void CArrayFix<T>::AppendL(const T &aRef)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   386
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   387
Appends a single element onto the end of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   388
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   389
@param aRef A reference to the class T element to be appended.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   390
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   391
@leave KErrNoMemory The function may attempt to expand the array buffer. If 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   392
       there is insufficient memory available, the function leaves, in which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   393
	   case the array is left in the state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   394
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   395
	{CArrayFixBase::InsertL(Count(),&aRef);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   396
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   397
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   398
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   399
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   400
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   401
inline void CArrayFix<T>::AppendL(const T *aPtr,TInt aCount)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   402
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   403
Appends one or more elements onto the end of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   404
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   405
@param aPtr   A pointer to a contiguous set of type <class T> objects to be
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   406
              appended.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   407
@param aCount The number of contiguous objects of type <class T> located at 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   408
              aPtr to be appended.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   409
			  
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   410
@leave KErrNoMemory The function may attempt to expand the array buffer. If 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   411
       there is insufficient memory available, the function leaves, in which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   412
	   case the array is left in the state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   413
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   414
@panic E32USER-CBase 23, if aCount is negative.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   415
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   416
	{CArrayFixBase::InsertL(Count(),aPtr,aCount);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   417
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   418
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   419
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   420
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   421
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   422
inline void CArrayFix<T>::AppendL(const T &aRef,TInt aReplicas)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   423
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   424
Appends replicated copies of an element onto the end of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   425
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   426
@param aRef      A reference to the <class T> object to be replicated and appended.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   427
@param aReplicas The number of copies of the aRef element to be appended. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   428
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   429
@leave KErrNoMemory The function may attempt to expand the array buffer. If 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   430
       there is insufficient memory available, the function leaves, in which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   431
	   case the array is left in the state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   432
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   433
@panic E32USER-CBase 28 if aReplicas is negative.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   434
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   435
	{CArrayFixBase::InsertRepL(Count(),&aRef,aReplicas);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   436
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   437
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   438
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   439
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   440
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   441
inline T &CArrayFix<T>::ExpandL(TInt anIndex)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   442
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   443
Expands the array by one element at the specified position.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   444
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   445
It:
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   446
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   447
1. expands the array by one element at the specified position
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   448
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   449
2. constructs a new element at that position
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   450
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   451
3. returns a reference to the new element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   452
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   453
All existing elements from position anIndex to the end of the array are moved 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   454
up, so that the element originally at position anIndex is now at position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   455
anIndex + 1 etc.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   456
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   457
The new element of type class T is constructed at position anIndex, using 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   458
the default constructor of that class.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   459
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   460
@param anIndex The position within the array where the array is to be expanded 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   461
               and the new class T object is to be constructed. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   462
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   463
@leave KErrNoMemory The function may attempt to expand the array buffer. If 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   464
       there is insufficient memory available, the function leaves, in which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   465
	   case the array is left in the state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   466
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   467
@return A reference to the newly constructed class T object at position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   468
        anIndex within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   469
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   470
@panic E32USER-CBase 21 if anIndex is negative or greater than the number
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   471
                        of elements currently in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   472
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   473
	{return(*new(CArrayFixBase::ExpandL(anIndex)) T);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   474
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   475
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   476
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   477
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   478
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   479
inline T &CArrayFix<T>::ExtendL()
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   480
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   481
Expands the array by one element at the end of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   482
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   483
It:
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   484
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   485
1. expands the array by one element at the end of the array, i.e. at position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   486
   CArrayFixBase::Count()
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   487
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   488
2. constructs a new element at that position
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   489
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   490
3. returns a reference to the new element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   491
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   492
The new element of type class T is constructed at the end of the array, 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   493
using the default constructor of that class.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   494
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   495
@leave KErrNoMemory The function may attempt to expand the array buffer. If 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   496
       there is insufficient memory available, the function leaves, in which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   497
	   case the array is left in the state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   498
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   499
@return A reference to the newly constructed class T object at the end of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   500
        the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   501
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   502
@see CArrayFixBase::Count
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   503
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   504
	{return(*new(CArrayFixBase::ExpandL(Count())) T);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   505
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   506
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   507
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   508
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   509
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   510
inline TInt CArrayFix<T>::Find(const T &aRef,TKeyArrayFix &aKey,TInt &anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   511
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   512
Finds the position of an element within the array, based on the matching of
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   513
keys, using a sequential search.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   514
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   515
The array is searched sequentially for an element whose key matches the key of the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   516
supplied class T object. The search starts with the first element in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   517
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   518
Note that where an array has elements with duplicate keys, the function only
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   519
supplies the position of the first element in the array with that key.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   520
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   521
@param aRef    A reference to an object of type class T whose key is used
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   522
               for comparison.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   523
@param aKey    A reference to a key object defining the properties of the key.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   524
@param anIndex A reference to a TInt supplied by the caller. On return, if the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   525
               element is found, the reference is set to the position of that
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   526
			   element within the array. The position is relative to zero, 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   527
			   (i.e. the first element in the array is at position 0).
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   528
			   If the element is not found and the array is not empty, then
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   529
			   the value of the reference is set to the number of elements in
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   530
			   the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   531
			   If the element is not found and the array is empty, then the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   532
			   reference is set to zero.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   533
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   534
@return Zero, if the element with the specified key is found. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   535
        Non-zero, if the element with the specified key is not found.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   536
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   537
	{return(CArrayFixBase::Find(&aRef,aKey,anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   538
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   539
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   540
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   541
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   542
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   543
inline TInt CArrayFix<T>::FindIsq(const T &aRef,TKeyArrayFix &aKey,TInt &anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   544
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   545
Finds the position of an element within the array, based on the matching of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   546
keys, using a binary search technique.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   547
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   548
The array is searched, using a binary search technique, for an element whose 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   549
key matches the key of the supplied class T object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   550
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   551
The array must be in key order.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   552
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   553
Note that where an array has elements with duplicate keys, the function cannot
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   554
guarantee which element, with the given key value, it will return, except that
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   555
it will find one of them.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   556
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   557
@param aRef    A reference to an object of type class T whose key is used 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   558
               for comparison. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   559
@param aKey    A reference to a key object defining the properties of the key.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   560
@param anIndex A reference to a TInt supplied by the caller. On return, if the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   561
               element is found, the reference is set to the position of that
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   562
			   element within the array. The position is relative to zero,
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   563
			   (i.e. the first element in the array is at position 0).
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   564
			   If the element is not found and the array is not empty, then the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   565
			   reference is set to the position of the first element in the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   566
			   array with a key which is greater than the key of the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   567
               object aRef.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   568
			   If the element is not found and the array is empty, then the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   569
               reference is set to zero.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   570
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   571
@return Zero, if the element with the specified key is found.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   572
        Non-zero, if the element with the specified key is not found.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   573
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   574
	{return(CArrayFixBase::FindIsq(&aRef,aKey,anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   575
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   576
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   577
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   578
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   579
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   580
inline void CArrayFix<T>::InsertL(TInt anIndex,const T &aRef)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   581
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   582
Inserts an element into the array at the specified position.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   583
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   584
Note that passing a value of anIndex which is the same as the current number
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   585
of elements in the array, has the effect of appending the element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   586
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   587
@param anIndex The position within the array where the element is to be
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   588
               inserted. The position is relative to zero, i.e. zero implies
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   589
			   that elements are inserted at the beginning of the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   590
			   
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   591
@param aRef    A reference to the class T object to be inserted into the array 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   592
               at position anIndex.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   593
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   594
@leave KErrNoMemory The function may attempt to expand the array buffer. If 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   595
       there is insufficient memory available, the function leaves, in which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   596
	   case the array is left in the state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   597
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   598
@panic E32USER-CBase 21 if anIndex is negative, or is greater than the number
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   599
       of elements currently in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   600
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   601
	{CArrayFixBase::InsertL(anIndex,&aRef);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   602
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   603
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   604
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   605
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   606
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   607
inline void CArrayFix<T>::InsertL(TInt anIndex,const T *aPtr,TInt aCount)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   608
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   609
Inserts one or more elements into the array at the specified position.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   610
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   611
The objects to be added must all be contiguous.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   612
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   613
Note that passing a value of anIndex which is the same as the current number
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   614
of elements in the array, has the effect of appending the element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   615
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   616
@param anIndex The position within the array where the elements are to be 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   617
               inserted. The position is relative to zero, i.e. zero implies
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   618
			   that elements are inserted at the beginning of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   619
			   
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   620
@param aPtr    A pointer to the first of the contiguous elements of type 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   621
               class T to be inserted into the array at position anIndex.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   622
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   623
@param aCount  The number of contiguous elements of type class T located at 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   624
               aPtr to be inserted into the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   625
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   626
@leave KErrNoMemory The function may attempt to expand the array buffer. If 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   627
       there is insufficient memory available, the function leaves, in which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   628
	   case the array is left in the state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   629
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   630
@panic E32USER-CBase 21  if anIndex is negative or is greater than the number
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   631
                         of elements currently in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   632
@panic E32USER-CBase 23  if aCount is negative.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   633
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   634
	{CArrayFixBase::InsertL(anIndex,aPtr,aCount);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   635
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   636
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   637
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   638
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   639
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   640
inline void CArrayFix<T>::InsertL(TInt anIndex,const T &aRef,TInt aReplicas)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   641
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   642
Inserts replicated copies of an element into the array at the specified
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   643
position.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   644
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   645
Note that passing a value of anIndex which is the same as the current number
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   646
of elements in the array, has the effect of appending the element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   647
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   648
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   649
@param anIndex   The position within the array where elements are to be
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   650
                 inserted. The position is relative to zero, i.e. zero implies
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   651
				 that elements are inserted at the beginning of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   652
				 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   653
@param aRef      A reference to the class T object to be replicated and
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   654
                 inserted into the array at position anIndex. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   655
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   656
@param aReplicas The number of copies of the aRef element to be inserted into 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   657
                 the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   658
				 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   659
@leave KErrNoMemory The function may attempt to expand the array buffer. If 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   660
       there is insufficient memory available, the function leaves, in which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   661
	   case the array is left in the state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   662
	   
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   663
@panic E32USER-CBase 21, if anIndex is negative or is greater than the number
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   664
                         of elements currently in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   665
@panic E32USER-CBase 28, if aReplicas is negative.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   666
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   667
	{CArrayFixBase::InsertRepL(anIndex,&aRef,aReplicas);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   668
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   669
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   670
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   671
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   672
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   673
inline TInt CArrayFix<T>::InsertIsqL(const T &aRef,TKeyArrayFix &aKey)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   674
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   675
Inserts a single element into the array at a position determined by a key.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   676
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   677
The array MUST already be in key sequence (as defined by the key), otherwise 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   678
the position of the new element is unpredictable, or duplicates may occur.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   679
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   680
Elements with duplicate keys are not permitted.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   681
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   682
@param aRef A reference to the element of type <class T> to be inserted into 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   683
            the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   684
@param aKey A reference to a key object defining the properties of the key. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   685
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   686
@return The position within the array of the newly inserted element. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   687
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   688
@leave KErrAlreadyExists An element with the same key already exists within 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   689
       the array. NB the array MUST already be in key sequence, otherwise
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   690
	   the function may insert a duplicate and fail to leave with
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   691
	   this value.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   692
@leave KErrNoMemory The function may attempt to expand the array buffer. If 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   693
       there is insufficient memory available, the function leaves, in which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   694
	   case the array is left in the state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   695
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   696
	{return(CArrayFixBase::InsertIsqL(&aRef,aKey));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   697
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   698
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   699
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   700
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   701
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   702
inline TInt CArrayFix<T>::InsertIsqAllowDuplicatesL(const T &aRef,TKeyArrayFix &aKey)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   703
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   704
Inserts a single element into the array at a position determined by a key, 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   705
allowing duplicates.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   706
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   707
The array MUST already be in key sequence (as defined by the key), otherwise 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   708
the position of the new element is unpredictable.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   709
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   710
If the new element's key is a duplicate of an existing element's key, then 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   711
the new element is positioned after the existing element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   712
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   713
@param aRef A reference to the element of type <class T> to be inserted into 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   714
            the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   715
@param aKey A reference to a key object defining the properties of the key. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   716
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   717
@return The position within the array of the newly inserted element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   718
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   719
@leave KErrNoMemory The function may attempt to expand the array buffer. If 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   720
       there is insufficient memory available, the function leaves, in which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   721
	   case the array is left in the state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   722
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   723
	{return(CArrayFixBase::InsertIsqAllowDuplicatesL(&aRef,aKey));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   724
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   725
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   726
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   727
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   728
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   729
inline void CArrayFix<T>::ResizeL(TInt aCount)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   730
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   731
Changes the size of the array so that it contains the specified number
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   732
of elements.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   733
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   734
The following describes the effects of calling this function:
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   735
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   736
1. If aCount is less than the current number of elements in the array, then the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   737
   array is shrunk. The elements at positions aCount and above are discarded. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   738
   The array buffer is not compressed.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   739
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   740
2. If aCount is greater than the current number of elements in the array, then 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   741
   the array is extended.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   742
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   743
3. New elements are replicated copies of an object of type <class T>,
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   744
   constructed using the default constructor of that class.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   745
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   746
The new elements are positioned after the existing elements in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   747
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   748
The function may attempt to expand the array buffer. If there is insufficient 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   749
memory available, the function leaves. The leave code is one of the system 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   750
wide error codes. If the function leaves, the array is left in the state it 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   751
was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   752
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   753
@param aCount The number of elements the array is to contain after the resizing 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   754
              operation. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   755
			  
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   756
@panic E32USER-CBase 24, if aCount is negative.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   757
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   758
	{TUint8 b[sizeof(T)]; new(&b[0]) T; CArrayFixBase::ResizeL(aCount,&b[0]);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   759
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   760
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   761
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   762
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   763
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   764
inline void CArrayFix<T>::ResizeL(TInt aCount,const T &aRef)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   765
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   766
Changes the size of the array so that it contains the specified number
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   767
of elements.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   768
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   769
The following describes the effects of calling this function:
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   770
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   771
1. If aCount is less than the current number of elements in the array, then the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   772
   array is shrunk. The elements at positions aCount and above are discarded. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   773
   The array buffer is not compressed.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   774
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   775
2. If aCount is greater than the current number of elements in the array, then 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   776
   the array is extended.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   777
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   778
3. New elements are replicated copies of aRef.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   779
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   780
The new elements are positioned after the existing elements in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   781
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   782
The function may attempt to expand the array buffer. If there is insufficient 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   783
memory available, the function leaves. The leave code is one of the system 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   784
wide error codes. If the function leaves, the array is left in the state it 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   785
was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   786
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   787
@param aCount The number of elements the array is to contain after the resizing 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   788
              operation.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   789
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   790
@param aRef   A reference to an object of type <class T>, copies of which are
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   791
              used as the new elements of the array, if the array is extended.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   792
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   793
@panic E32USER-CBase 24, if aCount is negative.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   794
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   795
	{CArrayFixBase::ResizeL(aCount,&aRef);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   796
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   797
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   798
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   799
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   800
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   801
inline const TArray<T> CArrayFix<T>::Array() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   802
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   803
Constructs and returns a TArray<T> object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   804
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   805
@return A TArray<T> object representing this array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   806
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   807
	{return(TArray<T>(CountR,AtR,this));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   808
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   809
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   810
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   811
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   812
inline CArrayFix<TAny>::CArrayFix(TBufRep aRep,TInt aRecordLength,TInt aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   813
	: CArrayFixBase(aRep,aRecordLength,aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   814
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   815
@internalComponent
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   816
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   817
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   818
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   819
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   820
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   821
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   822
inline const TAny *CArrayFix<TAny>::At(TInt anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   823
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   824
Gets a pointer to the untyped element located at the specified position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   825
within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   826
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   827
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   828
	           is relative to zero; i.e. zero implies the first element in the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   829
			   array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   830
			   
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   831
@return A pointer to the untyped element located at position anIndex within 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   832
	    the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   833
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   834
@panic E32User-CBase 21, if anIndex is negative or is greater than or equal
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   835
       to the number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   836
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   837
	{return(CArrayFixBase::At(anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   838
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   839
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   840
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   841
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   842
inline const TAny *CArrayFix<TAny>::End(TInt anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   843
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   844
Gets a pointer to the first byte following the end of the contiguous region 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   845
containing the element at the specfied position within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   846
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   847
For flat buffers, the pointer always points to the first byte following the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   848
end of the buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   849
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   850
For segmented buffers, the pointer always points to the first byte following 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   851
the end of the segment which contains the element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   852
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   853
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   854
	           is relative to zero; i.e. zero implies the first element in
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   855
			   the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   856
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   857
@return A pointer to the byte following the end of the contiguous region.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   858
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   859
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   860
       the number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   861
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   862
	{return(CArrayFixBase::End(anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   863
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   864
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   865
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   866
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   867
inline const TAny *CArrayFix<TAny>::Back(TInt anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   868
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   869
Gets a pointer to the beginning of a contiguous region.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   870
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   871
For flat buffers, the function always returns a pointer to the beginning of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   872
the buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   873
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   874
For segmented buffers, the function returns a pointer to the beginning of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   875
the segment for all elements in that segment except the first. If the element 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   876
at the specified position is the first in a segment, then the function returns 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   877
a pointer the beginning of the previous segment.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   878
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   879
For the first element in the array, the function returns a NULL pointer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   880
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   881
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   882
               is relative to zero; i.e. zero implies the first element in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   883
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   884
@return A pointer to the beginning of the contiguous region.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   885
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   886
@panic E32User-CBase 21, if anIndex is negative or is greater than or equal to
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   887
       the number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   888
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   889
	{return(CArrayFixBase::Back(anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   890
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   891
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   892
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   893
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   894
inline TAny *CArrayFix<TAny>::At(TInt anIndex)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   895
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   896
Gets a pointer to the untyped element located at the specified position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   897
within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   898
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   899
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   900
	           is relative to zero; i.e. zero implies the first element in the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   901
			   array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   902
			   
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   903
@return A pointer to the untyped element located at position anIndex within 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   904
	    the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   905
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   906
@panic E32User-CBase 21, if anIndex is negative or is greater than or equal
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   907
       to the number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   908
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   909
	{return(CArrayFixBase::At(anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   910
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   911
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   912
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   913
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   914
inline TAny *CArrayFix<TAny>::End(TInt anIndex)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   915
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   916
Gets a pointer to the first byte following the end of the contiguous region 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   917
containing the element at the specfied position within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   918
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   919
For flat buffers, the pointer always points to the first byte following the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   920
end of the buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   921
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   922
For segmented buffers, the pointer always points to the first byte following 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   923
the end of the segment which contains the element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   924
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   925
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   926
	           is relative to zero; i.e. zero implies the first element in
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   927
			   the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   928
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   929
@return A pointer to the byte following the end of the contiguous region.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   930
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   931
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   932
       the number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   933
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   934
	{return(CArrayFixBase::End(anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   935
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   936
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   937
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   938
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   939
inline TAny *CArrayFix<TAny>::Back(TInt anIndex)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   940
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   941
Gets a pointer to the beginning of a contiguous region.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   942
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   943
For flat buffers, the function always returns a pointer to the beginning of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   944
the buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   945
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   946
For segmented buffers, the function returns a pointer to the beginning of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   947
the segment for all elements in that segment except the first. If the element 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   948
at the specified position is the first in a segment, then the function returns 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   949
a pointer the beginning of the previous segment.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   950
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   951
For the first element in the array, the function returns a NULL pointer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   952
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   953
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   954
               is relative to zero; i.e. zero implies the first element in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   955
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   956
@return A pointer to the beginning of the contiguous region.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   957
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   958
@panic E32User-CBase 21, if anIndex is negative or is greater than or equal to
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   959
       the number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   960
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   961
	{return(CArrayFixBase::Back(anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   962
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   963
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   964
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   965
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   966
inline void CArrayFix<TAny>::AppendL(const TAny *aPtr)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   967
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   968
Appends the specified untyped element onto the end of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   969
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   970
@param aPtr A pointer to an untyped element to be appended. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   971
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   972
@leave KErrNoMemory The function may attempt to expand the array buffer. If 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   973
	   there is insufficient memory available, the function leaves, in which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   974
	   case the array is left in the state it was in before the call. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   975
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   976
	{CArrayFixBase::InsertL(Count(),aPtr);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   977
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   978
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   979
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   980
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   981
inline void CArrayFix<TAny>::AppendL(const TAny *aPtr,TInt aCount)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   982
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   983
Appends one or more untyped elements onto the end of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   984
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   985
@param aPtr   A pointer to the first of the contiguous untyped elements to be 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   986
	          appended. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   987
@param aCount The number of contiguous elements located at aPtr to be appended. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   988
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   989
@leave KErrNoMemory The function may attempt to expand the array buffer. If 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   990
       there is insufficient memory available, the function leaves, in which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   991
	   case the array is left in the state it was in before the call. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   992
@panic E32USER-CBase 23, if aCount is negative.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   993
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   994
	{CArrayFixBase::InsertL(Count(),aPtr,aCount);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   995
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   996
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   997
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   998
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
   999
inline TAny *CArrayFix<TAny>::ExtendL()
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1000
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1001
Expands the array by the length of one element at the end of the array and 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1002
returns a pointer to this new location.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1003
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1004
As elements are untyped, no construction is possible and the content of the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1005
new location remains undefined.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1006
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1007
@return A pointer to the new element location at the end of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1008
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1009
@leave KErrNoMemory The function may attempt to expand the array buffer. If 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1010
	   there is insufficient memory available, the function leaves, in which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1011
	   case the array is left in the state it was in before the call. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1012
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1013
	{return(CArrayFixBase::ExpandL(Count()));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1014
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1015
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1016
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1017
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1018
// Template class CArrayFixFlat
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1019
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1020
inline CArrayFixFlat<T>::CArrayFixFlat(TInt aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1021
	: CArrayFix<T>((TBufRep)CBufFlat::NewL,aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1022
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1023
Constructs a flat array of fixed length objects with the specified granularity.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1024
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1025
The length of all array elements is the length of the class passed as the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1026
template parameter. The length must be non-zero.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1027
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1028
Note that no memory is allocated to the array buffer by this constructor.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1029
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1030
@param aGranularity The granularity of the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1031
  
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1032
@panic E32USER-CBase 17, if the length of the class implied by the template parameter is zero.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1033
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1034
@panic E32USER-CBase 18, if aGranularity is not positive.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1035
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1036
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1037
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1038
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1039
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1040
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1041
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1042
inline void CArrayFixFlat<T>::SetReserveL(TInt aCount)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1043
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1044
Reserves space in the array buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1045
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1046
If necessary, the array buffer is allocated or re-allocated so that it can
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1047
accommodate the specified number of elements.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1048
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1049
After a successful call to this function, elements can be added to the array 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1050
and the process is guaranteed not to fail for lack of memory - provided the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1051
total number of elements does not exceed the number specified in this function.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1052
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1053
This function does not increase the number of elements in the array; i.e. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1054
the member function CArrayFixBase::Count() returns the same value both before 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1055
and after a call to CArrayFixFlat::SetReserveL().
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1056
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1057
@param aCount The total number of elements for which space is to be reserved. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1058
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1059
@panic E32USER-CBase 27, if aCount is less than the current number of elements
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1060
                         in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1061
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1062
	{this->SetReserveFlatL(aCount);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1063
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1064
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1065
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1066
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1067
inline CArrayFixFlat<TAny>::CArrayFixFlat(TInt aRecordLength,TInt aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1068
	: CArrayFix<TAny>((TBufRep)CBufFlat::NewL,aRecordLength,aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1069
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1070
Constructs a flat array of fixed length objects with the specified granularity 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1071
to contain elements of the specified length.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1072
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1073
Note that no memory is allocated to the array buffer by this constructor.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1074
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1075
@param aRecordLength The length of the elements of this fixed length array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1076
@param aGranularity  The granularity of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1077
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1078
@panic E32USER-CBase 17, if aRecordLength is not positive.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1079
@panic E32USER-CBase 18, if aGranularity is  not positive.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1080
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1081
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1082
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1083
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1084
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1085
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1086
inline void CArrayFixFlat<TAny>::SetReserveL(TInt aCount)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1087
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1088
Reserves space in the array buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1089
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1090
If necessary, the array buffer is allocated or re-allocated so that it can
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1091
accommodate the specified number of elements.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1092
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1093
After a successful call to this function, elements can be added to the array 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1094
and the process is guaranteed not to fail for lack of memory - provided the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1095
total number of elements does not exceed the specified number.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1096
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1097
This function does not increase the number of elements in the array; i.e. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1098
the member function CArrayFixBase::Count() returns the same value both before 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1099
and after a call to this function.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1100
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1101
@param aCount The total number of elements for which space is to be reserved. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1102
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1103
@panic E32USER-CBase 27, if aCount is less than the current number of elements
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1104
                         in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1105
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1106
	{SetReserveFlatL(aCount);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1107
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1108
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1109
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1110
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1111
inline void CArrayFixFlat<TInt>::SetReserveL(TInt aCount)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1112
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1113
Reserves space in the array buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1114
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1115
If necessary, the array buffer is allocated or re-allocated so that it can 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1116
accommodate the specified number of TInt elements.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1117
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1118
After a successful call to this function, elements can be added to the array 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1119
and the process is guaranteed not to fail for lack of memory - provided the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1120
total number of elements does not exceed the specified number.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1121
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1122
This function does not increase the number of elements in the array; i.e. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1123
the member function CArrayFixBase::Count() returns the same value both before 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1124
and after a call to this function.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1125
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1126
@param aCount The total number of elements for which space is to be reserved. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1127
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1128
@panic E32USER-CBase 27, if aCount is less than the current number of elements
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1129
                         in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1130
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1131
	{SetReserveFlatL(aCount);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1132
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1133
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1134
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1135
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1136
inline void CArrayFixFlat<TUid>::SetReserveL(TInt aCount)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1137
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1138
Reserves space in the array buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1139
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1140
If necessary, the array buffer is allocated or re-allocated so that it can 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1141
accommodate the specified number of TUid elements.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1142
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1143
After a successful call to this function, elements can be added to the array 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1144
and the process is guaranteed not to fail for lack of memory - provided the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1145
total number of elements does not exceed the specified number.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1146
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1147
This function does not increase the number of elements in the array; i.e. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1148
the member function CArrayFixBase::Count() returns the same value both before 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1149
and after a call to this function.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1150
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1151
@param aCount The total number of elements for which space is to be reserved. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1152
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1153
@panic E32USER-CBase 27, if aCount is less than the current number of elements
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1154
                         in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1155
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1156
	{SetReserveFlatL(aCount);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1157
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1158
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1159
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1160
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1161
// Template class CArrayFixSeg
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1162
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1163
inline CArrayFixSeg<T>::CArrayFixSeg(TInt aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1164
	: CArrayFix<T>((TBufRep)CBufSeg::NewL,aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1165
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1166
Constructs a segmented array of fixed length objects with the specified
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1167
granularity.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1168
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1169
The length of all array elements is the length of the class passed as the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1170
template parameter. The length must be non-zero.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1171
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1172
Note that no memory is allocated to the array buffer by this constructor.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1173
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1174
@param aGranularity The granularity of the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1175
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1176
@panic E32USER-CBase 17, if the length of the class implied by the template
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1177
                         parameter is zero.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1178
@panic E32USER-CBase 18, if aGranularity is not positive.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1179
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1180
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1181
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1182
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1183
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1184
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1185
inline CArrayFixSeg<TAny>::CArrayFixSeg(TInt aRecordLength,TInt aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1186
	: CArrayFix<TAny>((TBufRep)CBufSeg::NewL,aRecordLength,aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1187
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1188
Constructs a segmented array of fixed length objects with the specified
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1189
granularity to contain elements of the specified length.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1190
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1191
Note that no memory is allocated to the array buffer by this constructor.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1192
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1193
@param aRecordLength The length of the elements of this array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1194
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1195
@param aGranularity The granularity of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1196
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1197
@panic E32USER-CBase 17, if aRecordLength is not positive.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1198
@panic E32USER-CBase 18, if aGranularity is not positive.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1199
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1200
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1201
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1202
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1203
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1204
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1205
// Template class CArrayPtr
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1206
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1207
inline CArrayPtr<T>::CArrayPtr(TBufRep aRep,TInt aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1208
	: CArrayFix<T*>(aRep,aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1209
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1210
@internalComponent
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1211
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1212
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1213
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1214
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1215
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1216
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1217
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1218
void CArrayPtr<T>::ResetAndDestroy()
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1219
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1220
Destroys all objects whose pointers form the elements of the array, before 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1221
resetting the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1222
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1223
The destructor of each class T object is called before the objects themselves 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1224
are destroyed.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1225
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1226
If the array is not empty, this member function must be called before the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1227
array is deleted to prevent the CBase derived objects from being orphaned 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1228
on the heap.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1229
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1230
Note that each call to this function results in a small, but non-trivial,
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1231
amount of code being generated.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1232
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1233
	{
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1234
	for (TInt i=0;i<this->Count();++i)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1235
		delete this->At(i);
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1236
	this->Reset();
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1237
	}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1238
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1239
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1240
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1241
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1242
// Template class CArrayPtrFlat
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1243
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1244
inline CArrayPtrFlat<T>::CArrayPtrFlat(TInt aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1245
	: CArrayPtr<T>((TBufRep)CBufFlat::NewL,aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1246
/** 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1247
Constructs a flat array of pointers with specified granularity.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1248
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1249
Note that no memory is allocated to the array buffer by this constructor.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1250
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1251
@param aGranularity The granularity of the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1252
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1253
@panic E32USER-CBase 18, if aGranularity is not positive.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1254
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1255
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1256
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1257
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1258
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1259
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1260
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1261
inline void CArrayPtrFlat<T>::SetReserveL(TInt aCount)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1262
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1263
Reserves space in the array buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1264
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1265
If necessary, the array buffer is allocated or re-allocated so that it can
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1266
accommodate the specified number of elements.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1267
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1268
After a successful call to this function, elements can be added to the array 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1269
and the process is guaranteed not to fail for lack of memory - provided the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1270
total number of elements does not exceed the specified number.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1271
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1272
This function does not increase the number of elements in the array; i.e. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1273
the member function CArrayFixBase::Count() returns the same value both before 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1274
and after a call to this function.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1275
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1276
@param aCount The total number of elements for which space is to be reserved. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1277
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1278
@panic E32USER-CBase 27, if aCount is less than the current number of elements
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1279
       in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1280
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1281
	{this->SetReserveFlatL(aCount);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1282
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1283
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1284
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1285
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1286
// Template class CArrayPtrSeg
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1287
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1288
inline CArrayPtrSeg<T>::CArrayPtrSeg(TInt aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1289
	: CArrayPtr<T>((TBufRep)CBufSeg::NewL,aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1290
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1291
Constructs a segmented array of pointers with specified granularity.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1292
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1293
Note that no memory is allocated to the array buffer by this constructor.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1294
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1295
@param aGranularity The granularity of the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1296
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1297
@panic E32USER-CBase 18, if aGranularity is not positive.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1298
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1299
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1300
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1301
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1302
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1303
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1304
// Class CArrayVarBase
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1305
inline TInt CArrayVarBase::Count() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1306
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1307
Gets the number of elements held in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1308
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1309
@return The number of array elements.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1310
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1311
	{return(iCount);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1312
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1313
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1314
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1315
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1316
// Template class CArrayVar
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1317
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1318
inline CArrayVar<T>::CArrayVar(TBufRep aRep,TInt aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1319
	: CArrayVarBase(aRep,aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1320
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1321
@internalComponent
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1322
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1323
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1324
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1325
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1326
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1327
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1328
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1329
inline const T &CArrayVar<T>::operator[](TInt anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1330
/** 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1331
Gets a reference to the const element located at the specified position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1332
within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1333
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1334
The compiler uses this variant of the function if the returned reference is 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1335
used in an expression where it cannot be modified.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1336
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1337
@param anIndex The position of the element within the array, relative to zero; 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1338
               i.e. zero implies the first element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1339
			   
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1340
@return A const reference to the element located at position anIndex within 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1341
        the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1342
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1343
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1344
       number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1345
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1346
	{return(*((const T *)CArrayVarBase::At(anIndex)));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1347
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1348
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1349
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1350
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1351
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1352
inline T &CArrayVar<T>::operator[](TInt anIndex)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1353
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1354
Gets a reference to the element located at the specified position within 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1355
the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1356
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1357
The compiler uses this variant of the function if the returned reference is 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1358
used in an expression where it can be modified.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1359
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1360
@param anIndex The position of the element within the array, relative to zero; 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1361
               i.e. zero implies the first element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1362
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1363
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1364
@return A reference to the non-const element located at position anIndex within 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1365
        the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1366
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1367
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1368
       number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1369
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1370
	{return(*((T *)CArrayVarBase::At(anIndex)));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1371
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1372
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1373
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1374
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1375
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1376
inline const T &CArrayVar<T>::At(TInt anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1377
/** 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1378
Gets a reference to the const element located at the specified position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1379
within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1380
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1381
The compiler uses this variant of the function if the returned reference is 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1382
used in an expression where it cannot be modified.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1383
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1384
@param anIndex The position of the element within the array, relative to zero; 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1385
               i.e. zero implies the first element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1386
			   
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1387
@return A const reference to the element located at position anIndex within 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1388
        the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1389
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1390
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1391
       number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1392
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1393
	{return(*((const T *)CArrayVarBase::At(anIndex)));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1394
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1395
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1396
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1397
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1398
inline T &CArrayVar<T>::At(TInt anIndex)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1399
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1400
Gets a reference to the element located at the specified position within 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1401
the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1402
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1403
The compiler uses this variant of the function if the returned reference is 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1404
used in an expression where it can be modified.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1405
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1406
@param anIndex The position of the element within the array, relative to zero; 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1407
               i.e. zero implies the first element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1408
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1409
@return A reference to the non-const element located at position anIndex within 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1410
        the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1411
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1412
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1413
       number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1414
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1415
	{return(*((T *)CArrayVarBase::At(anIndex)));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1416
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1417
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1418
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1419
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1420
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1421
inline void CArrayVar<T>::AppendL(const T &aRef,TInt aLength)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1422
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1423
Appends an element of a specified length onto the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1424
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1425
@param aRef    A reference to the <class T> element to be appended.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1426
@param aLength The length of the element to be appended.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1427
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1428
@leave KErrNoMemory The function always attempts to allocate a cell to
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1429
       contain the new element and may also attempt to expand the array buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1430
	   If there is insufficient memory available, the function leaves, in which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1431
	   case, the array is left in the state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1432
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1433
@panic E32USER-CBase 30, if aLength is negative.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1434
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1435
	{CArrayVarBase::InsertL(Count(),&aRef,aLength);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1436
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1437
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1438
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1439
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1440
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1441
inline T &CArrayVar<T>::ExpandL(TInt anIndex,TInt aLength)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1442
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1443
Expands the array by one element of specified length at the specified position. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1444
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1445
It:
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1446
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1447
1. expands the array by one element position anIndex
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1448
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1449
2. constructs a new element of specified length at that position
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1450
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1451
3. returns a reference to the new element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1452
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1453
All existing elements from position anIndex to the end of the array are moved 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1454
up, so that the element originally at position anIndex is now at position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1455
anIndex + 1 etc.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1456
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1457
The new element of type <class T> and length aLength is constructed at position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1458
anIndex, using the default constructor of that class.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1459
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1460
@param anIndex The position within the array where the array is to be expanded 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1461
               and the new <class T> object is to be constructed.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1462
			   
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1463
@param aLength The length of the new element. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1464
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1465
@return A reference to the newly constructed <class T> object at position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1466
        anIndex within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1467
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1468
@leave KErrNoMemory The function always attempts to allocate a cell to contain 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1469
       the new element and may also attempt to expand the array buffer. If there 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1470
       is insufficient memory available, the function leaves, in which case, the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1471
       array is left in the state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1472
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1473
@panic E32USER-CBase 21, if anIndex is negative or is greater than the number
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1474
       of elements currently in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1475
@panic E32USER-CBase 30, if aLength is negative.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1476
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1477
	{return(*new(CArrayVarBase::ExpandL(anIndex,aLength)) T);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1478
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1479
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1480
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1481
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1482
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1483
inline T &CArrayVar<T>::ExtendL(TInt aLength)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1484
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1485
Expands the array by one element of specified length at the end of the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1486
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1487
It:
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1488
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1489
1. expands the array by one element at the end of the array, i.e. at position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1490
   CArrayVarBase::Count()
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1491
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1492
2. constructs a new element of specified length at that position.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1493
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1494
3. returns a reference to the new element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1495
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1496
The new element of type <class T> is constructed at the end of the array, 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1497
using the default constructor of that class.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1498
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1499
@param aLength The length of the new element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1500
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1501
@return A reference to the newly constructed <class T> object at the end of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1502
        the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1503
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1504
@leave KErrNoMemory The function always attempts to allocate a cell to contain 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1505
       the new element and may also attempt to expand the array buffer. If there 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1506
       is insufficient memory available, the function leaves, in which case, the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1507
       array is left in the state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1508
  
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1509
@panic E32USER-CBase 30, if aLength is negative.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1510
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1511
	{return(*new(CArrayVarBase::ExpandL(Count(),aLength)) T);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1512
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1513
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1514
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1515
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1516
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1517
inline TInt CArrayVar<T>::Find(const T &aRef,TKeyArrayVar &aKey,TInt &anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1518
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1519
Finds the position of an element within the array, based on the matching of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1520
keys, using a sequential search.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1521
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1522
The array is searched sequentially for an element whose key matches the key 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1523
of the supplied object. The search starts with the first element in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1524
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1525
Note that where an array has elements with duplicate keys, the function only
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1526
supplies the position of the first element in the array with that key.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1527
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1528
@param aRef    A reference to an object of type <class T> whose key is used 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1529
               for comparison.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1530
@param aKey    A reference to a key object defining the properties of the key.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1531
@param anIndex A TInt supplied by the caller. On return, if the element is
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1532
               found, this is set to the position of that element
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1533
			   within the array. The position is relative to zero, (i.e. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1534
               the first element in the array is at position 0).
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1535
			   If the element is not found or the array is empty, then
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1536
			   this is undefined.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1537
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1538
@return Zero, if the element with the specified key is found. Non-zero, if 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1539
        the element with the specified key is not found.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1540
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1541
	{return(CArrayVarBase::Find(&aRef,aKey,anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1542
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1543
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1544
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1545
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1546
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1547
inline TInt CArrayVar<T>::FindIsq(const T &aRef,TKeyArrayVar &aKey,TInt &anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1548
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1549
Finds the position of an element within the array, based on the matching of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1550
keys, using a binary search technique.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1551
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1552
The array is searched, using a binary search technique, for an element whose 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1553
key matches the key of the supplied <class T> object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1554
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1555
The array must be in key order.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1556
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1557
Note that where an array has elements with duplicate keys, the function cannot
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1558
guarantee which element, with the given key value, it will return, except that
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1559
it will find one of them.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1560
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1561
@param aRef    A reference to an object of type <class T> whose key is used 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1562
               for comparison.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1563
@param aKey    A reference to a key object defining the properties of the key.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1564
@param anIndex A TInt supplied by the caller. On return, if the element is
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1565
               found, this is set to the position  of that element within
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1566
			   the array. The position is relative to zero, (i.e. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1567
               the first element in the array is at position zero).
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1568
			   If the element is not found and the array is not empty, then
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1569
			   this is set to the position of the first element in the array
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1570
			   with a key which is greater than the key of the object aRef.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1571
			   If the element is not found and the array is empty, then 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1572
               this is undefined.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1573
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1574
@return Zero, if the element with the specified key is found or the array is 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1575
        empty. Non-zero, if the element with the specified key is not found.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1576
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1577
	{return(CArrayVarBase::FindIsq(&aRef,aKey,anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1578
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1579
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1580
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1581
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1582
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1583
inline void CArrayVar<T>::InsertL(TInt anIndex,const T &aRef,TInt aLength)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1584
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1585
Inserts an element of a specified length into the array at the specified
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1586
position.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1587
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1588
Note that passing a value of anIndex which is the same as the current number
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1589
of elements in the array, has the effect of appending that element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1590
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1591
@param anIndex The position within the array where the element is to be
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1592
               inserted. The position is relative to zero, i.e. zero implies
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1593
			   that elements are inserted at the beginning of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1594
@param aRef    A reference to the <class T> object to be inserted into
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1595
               the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1596
@param aLength The length of the element to be inserted into the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1597
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1598
@leave KErrNoMemory The function always attempts to allocate a cell to contain 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1599
       the new element and may also attempt to expand the array buffer. If
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1600
	   there is insufficient memory available, the function leaves, in which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1601
	   case, the array is left in the state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1602
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1603
@panic E32USER-CBase 21, if anIndex is negative or is greater than the number
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1604
       of objects currently in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1605
@panic E32USER-CBase 30, if aLength is is negative.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1606
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1607
	{CArrayVarBase::InsertL(anIndex,&aRef,aLength);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1608
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1609
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1610
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1611
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1612
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1613
inline TInt CArrayVar<T>::InsertIsqL(const T &aRef,TInt aLength,TKeyArrayVar &aKey)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1614
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1615
Inserts a single element of a specified length into the array at a position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1616
determined by a key.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1617
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1618
The array MUST already be in key sequence (as defined by the key), otherwise 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1619
the position of the new element is unpredictable, or duplicates may occur.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1620
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1621
Elements with duplicate keys are not permitted.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1622
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1623
@param aRef    A reference to the element of type <class T> to be inserted into 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1624
               the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1625
@param aLength The length of the new element of type <class T> to be inserted 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1626
               into the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1627
@param aKey    A reference to a key object defining the properties of the key.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1628
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1629
@return The position within the array of the newly inserted element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1630
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1631
@leave KErrAlreadyExists An element with the same key already exists within 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1632
       the array. NB the array MUST already be in key sequence, otherwise
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1633
	   the function may insert a duplicate and fail to leave with
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1634
	   this value.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1635
@leave KErrNoMemory The function always attempts to allocate a cell to contain 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1636
       the new element and may also attempt to expand the array buffer. If
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1637
	   there is insufficient memory available, the function leaves, in which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1638
	   case, the array is left in the state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1639
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1640
	{return(CArrayVarBase::InsertIsqL(&aRef,aLength,aKey));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1641
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1642
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1643
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1644
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1645
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1646
inline TInt CArrayVar<T>::InsertIsqAllowDuplicatesL(const T &aRef,TInt aLength,TKeyArrayVar &aKey)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1647
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1648
Inserts a single element of a specified length into the array at a position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1649
determined by a key, allowing duplicates.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1650
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1651
The array MUST already be in key sequence, otherwise the position of the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1652
new element is unpredictable.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1653
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1654
Elements with duplicate keys are permitted. If the new element's key is a 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1655
duplicate of an existing element's key, then the new element is positioned 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1656
after the existing element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1657
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1658
@param aRef    A reference to the element of type <class T> to be inserted
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1659
               into the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1660
@param aLength The length of the new element to be inserted into the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1661
@param aKey    A reference to a key object defining the properties of the key. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1662
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1663
@return The position within the array of the newly inserted element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1664
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1665
@leave KErrNoMemory The function always attempts to allocate a cell to contain 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1666
       the new element and may also attempt to expand the array buffer. If
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1667
	   there is insufficient memory available, the function leaves, in which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1668
	   case, the array is left in the state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1669
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1670
	{return(CArrayVarBase::InsertIsqAllowDuplicatesL(&aRef,aLength,aKey));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1671
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1672
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1673
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1674
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1675
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1676
inline const TArray<T> CArrayVar<T>::Array() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1677
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1678
Constructs and returns a TArray<T> object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1679
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1680
@return A TArray<T> object for this array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1681
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1682
	{return(TArray<T>(CountR,AtR,this));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1683
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1684
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1685
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1686
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1687
inline const TAny *CArrayVar<TAny>::At(TInt anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1688
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1689
Returns a pointer to the untyped element located at the specified position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1690
within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1691
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1692
The compiler uses this variant of the function if the returned pointer is 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1693
used in an expression where it cannot be modified.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1694
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1695
@param anIndex The position of the element within the array, relative to zero; 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1696
	           i.e. zero implies the first element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1697
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1698
@return A pointer to the const element located at position anIndex within the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1699
        array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1700
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1701
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1702
       number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1703
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1704
	{return(CArrayVarBase::At(anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1705
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1706
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1707
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1708
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1709
inline CArrayVar<TAny>::CArrayVar(TBufRep aRep,TInt aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1710
	: CArrayVarBase(aRep,aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1711
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1712
Constructs a variable array with the specified granularity and buffer
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1713
organization.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1714
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1715
Note that no memory is allocated to the array buffer by this constructor.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1716
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1717
@param aRep         A pointer to a function used to expand the array buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1718
                    The organisation of the array buffer is implied by the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1719
					choice of this function.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1720
			        For a flat array buffer, pass (TBufRep)CBufFlat::NewL.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1721
			        For a segmented array buffer, pass (TBufRep)CBufSeg::NewL. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1722
@param aGranularity The granularity of the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1723
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1724
@panic E32USER-CBase 19, if aGranularity is not positive.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1725
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1726
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1727
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1728
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1729
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1730
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1731
inline TAny *CArrayVar<TAny>::At(TInt anIndex)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1732
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1733
Returns a pointer to the untyped element located at the specified position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1734
within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1735
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1736
The compiler uses this variant of the function if the returned pointer is 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1737
used in an expression where it can be modified.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1738
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1739
@param anIndex The position of the element within the array, relative to zero; 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1740
	           i.e. zero implies the first element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1741
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1742
@return A pointer to the non-const element located at position anIndex within the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1743
        array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1744
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1745
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1746
       number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1747
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1748
	{return(CArrayVarBase::At(anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1749
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1750
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1751
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1752
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1753
inline void CArrayVar<TAny>::AppendL(const TAny *aPtr,TInt aLength)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1754
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1755
Appends an untyped element of specified length onto the end of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1756
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1757
@param aPtr    A pointer to an untyped element to be appended. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1758
@param aLength The length of the untyped element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1759
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1760
	{CArrayVarBase::InsertL(Count(),aPtr,aLength);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1761
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1762
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1763
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1764
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1765
inline TAny *CArrayVar<TAny>::ExtendL(TInt aLength)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1766
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1767
Extends the array by one element of specified length at the end of the array,
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1768
i.e. at position CArrayVarBase::Count(), and returns a pointer to the new
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1769
element location.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1770
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1771
As elements are untyped, no construction is possible and the content of the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1772
new location remains undefined.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1773
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1774
Note that the function always attempts to allocate a cell to contain the new
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1775
element and may also attempt to expand the array buffer. If there is
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1776
insufficient memory available, the function leaves.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1777
The leave code is one of the system wide error codes.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1778
If the function leaves, the array is left in the state it was in before
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1779
the call. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1780
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1781
@param aLength The length of the new element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1782
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1783
@return A pointer to the new element location at the end of the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1784
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1785
	{return(CArrayVarBase::ExpandL(Count(),aLength));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1786
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1787
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1788
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1789
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1790
// Template class CArrayVarFlat
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1791
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1792
inline CArrayVarFlat<T>::CArrayVarFlat(TInt aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1793
	: CArrayVar<T>((TBufRep)CBufFlat::NewL,aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1794
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1795
Constructs a variable flat array with specified granularity.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1796
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1797
Note that no memory is allocated to the array buffer by this constructor.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1798
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1799
@param aGranularity The granularity of the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1800
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1801
@panic E32USER-CBase 19, if aGranularity is not positive.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1802
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1803
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1804
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1805
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1806
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1807
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1808
// Template class CArrayVarSeg
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1809
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1810
inline CArrayVarSeg<T>::CArrayVarSeg(TInt aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1811
	: CArrayVar<T>((TBufRep)CBufSeg::NewL,aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1812
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1813
Constructs a variable segmented array with specified granularity.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1814
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1815
Note that no memory is allocated to the array buffer by this constructor.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1816
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1817
@param aGranularity The granularity of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1818
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1819
@panic E32USER-CBase 19, if aGranularity is not positive.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1820
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1821
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1822
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1823
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1824
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1825
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1826
// Class CArrayPakBase
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1827
inline TInt CArrayPakBase::Count() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1828
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1829
Gets the number of elements held in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1830
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1831
@return The number of array elements.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1832
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1833
	{return(iCount);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1834
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1835
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1836
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1837
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1838
// Template class CArrayPak
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1839
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1840
inline CArrayPak<T>::CArrayPak(TBufRep aRep,TInt aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1841
	: CArrayPakBase(aRep,aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1842
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1843
@internalComponent
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1844
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1845
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1846
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1847
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1848
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1849
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1850
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1851
inline const T &CArrayPak<T>::operator[](TInt anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1852
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1853
Gets a reference to the element located at the specified position within the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1854
array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1855
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1856
The compiler uses this variant of the function when the returned reference 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1857
is used in an expression where it cannot be modified.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1858
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1859
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1860
               is relative to zero; i.e. zero implies the first element in
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1861
			   the array.  
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1862
		
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1863
@return A const reference to the element located at position anIndex within 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1864
        the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1865
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1866
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1867
       number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1868
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1869
	{return(*((const T *)CArrayPakBase::At(anIndex)));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1870
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1871
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1872
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1873
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1874
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1875
inline T &CArrayPak<T>::operator[](TInt anIndex)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1876
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1877
Gets a reference to the element located at the specified position within the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1878
array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1879
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1880
The compiler uses this variant of the function when the returned reference 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1881
is used in an expression where it can be modified.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1882
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1883
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1884
               is relative to zero; i.e. zero implies the first element in
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1885
			   the array.  
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1886
		
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1887
@return A non-const reference to the element located at position anIndex within 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1888
        the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1889
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1890
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1891
       number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1892
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1893
	{return(*((T *)CArrayPakBase::At(anIndex)));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1894
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1895
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1896
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1897
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1898
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1899
inline const T &CArrayPak<T>::At(TInt anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1900
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1901
Gets a reference to the element located at the specified position within the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1902
array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1903
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1904
The compiler uses this variant of the function when the returned reference 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1905
is used in an expression where it cannot be modified.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1906
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1907
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1908
               is relative to zero; i.e. zero implies the first element in
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1909
			   the array.  
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1910
		
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1911
@return A const reference to the element located at position anIndex within 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1912
        the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1913
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1914
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1915
       number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1916
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1917
	{return(*((const T *)CArrayPakBase::At(anIndex)));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1918
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1919
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1920
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1921
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1922
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1923
inline T &CArrayPak<T>::At(TInt anIndex)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1924
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1925
Gets a reference to the element located at the specified position within the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1926
array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1927
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1928
The compiler uses this variant of the function when the returned reference 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1929
is used in an expression where it can be modified.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1930
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1931
@param anIndex The position of the element within the array. The position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1932
               is relative to zero; i.e. zero implies the first element in
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1933
			   the array.  
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1934
		
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1935
@return A non-const reference to the element located at position anIndex within 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1936
        the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1937
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1938
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1939
       number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1940
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1941
	{return(*((T *)CArrayPakBase::At(anIndex)));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1942
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1943
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1944
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1945
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1946
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1947
inline void CArrayPak<T>::AppendL(const T &aRef,TInt aLength)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1948
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1949
Appends an element of a specified length onto the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1950
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1951
@param aRef    A reference to the class T element to be appended.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1952
@param aLength The length of the element to be appended.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1953
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1954
@leave KErrNoMemory The function attempted to allocate from the heap and there 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1955
       is insufficient memory available. In this case, the array is left in
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1956
	   the state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1957
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1958
@panic E32USER-CBase 30, if aLength is negative.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1959
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1960
	{CArrayPakBase::InsertL(Count(),&aRef,aLength);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1961
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1962
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1963
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1964
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1965
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1966
inline T &CArrayPak<T>::ExpandL(TInt anIndex,TInt aLength)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1967
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1968
Expands the array by one element of specified length at the specified position. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1969
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1970
It:
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1971
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1972
1. expands the array by one element at the specified position.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1973
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1974
2. constructs a new element of specified length at that position.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1975
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1976
3. returns a reference to the new element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1977
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1978
All existing elements from position anIndex to the end of the array are moved 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1979
up, so that the element originally at position anIndex is now at position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1980
anIndex + 1 etc.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1981
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1982
The new element of type <class T> and length aLength is constructed at position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1983
anIndex, using the default constructor of that class.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1984
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1985
@param anIndex The position within the array where the array is to be expanded 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1986
               and the new <class T> object is to be constructed. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1987
@param aLength The length of the new element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1988
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1989
@return A reference to the newly constructed <class T> object at position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1990
        anIndex within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1991
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1992
@leave KErrNoMemory The function attempted to allocate from the heap and there 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1993
       is insufficient memory available. In this case, the array is left in the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1994
	   state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1995
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1996
@panic E32USER-CBase 21, if anIndex is negative or greater than the number of
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1997
       elements currently in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1998
@panic E32USER-CBase 30, if aLength is negative.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  1999
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2000
	{return(*new(CArrayPakBase::ExpandL(anIndex,aLength)) T);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2001
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2002
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2003
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2004
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2005
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2006
inline T &CArrayPak<T>::ExtendL(TInt aLength)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2007
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2008
Expands the array by one element of specified length at the end of the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2009
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2010
It:
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2011
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2012
1. expands the array by one element at the end of the array, i.e. at position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2013
   CArrayPakbase::Count().
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2014
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2015
2. constructs a new element of length aLength at that position.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2016
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2017
3. returns a reference to the new element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2018
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2019
The new element of type <class T> is constructed at the end of the array, 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2020
using the default constructor of that class.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2021
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2022
@param aLength The length of the new element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2023
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2024
@return A reference to the newly constructed <class T> object at the end of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2025
        the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2026
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2027
@leave KErrNoMemory The function attempted to allocate from the heap and there 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2028
       is insufficient memory available. In this case, the array is left in the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2029
	   state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2030
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2031
@panic E32USER-CBase 30, if aLength is negative.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2032
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2033
	{return(*new(CArrayPakBase::ExpandL(Count(),aLength)) T);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2034
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2035
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2036
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2037
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2038
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2039
inline TInt CArrayPak<T>::Find(const T &aRef,TKeyArrayPak &aKey,TInt &anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2040
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2041
Finds the position of an element within the array, based on the matching of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2042
keys, using a sequential search.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2043
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2044
The array is searched sequentially for an element whose key matches the key 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2045
of the supplied <class T> object. The search starts with the first element 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2046
in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2047
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2048
Note that where an array has elements with duplicate keys, the function only
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2049
supplies the position of the first element in the array with that key.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2050
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2051
@param aRef    A reference to an object of type <class T> whose key is used 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2052
               for comparison.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2053
@param aKey    A reference to a key object defining the properties of the key.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2054
@param anIndex A reference to a TInt supplied by the caller. On return, if the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2055
               element is found, this is set to the position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2056
               of that element within the array. The position is relative to zero, (i.e. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2057
               the first element in the array is at position 0).
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2058
			   If the element is not found or the array is empty, then this is undefined.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2059
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2060
@return Zero, if the element with the specified key is found. Non-zero, if 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2061
        the element with the specified key is not found.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2062
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2063
	{return(CArrayPakBase::Find(&aRef,aKey,anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2064
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2065
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2066
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2067
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2068
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2069
inline TInt CArrayPak<T>::FindIsq(const T &aRef,TKeyArrayPak &aKey,TInt &anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2070
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2071
Finds the position of an element within the array, based on the matching of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2072
keys, using a binary search technique.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2073
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2074
The array is searched, using a binary search technique, for an element whose 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2075
key matches the key of the supplied <class T> object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2076
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2077
The array must be in key order.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2078
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2079
Note that where an array has elements with duplicate keys, the function cannot
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2080
guarantee which element, with the given key value, it will return, except that it
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2081
will find one of them.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2082
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2083
@param aRef    A reference to an object of type <class T> whose key is used 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2084
               for comparison.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2085
@param aKey    A reference to a key object defining the properties of the key.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2086
@param anIndex A reference to a TInt supplied by the caller. On return, if the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2087
               element is found, this is set to the position of that element
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2088
			   within the array. The position is relative to zero, (i.e. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2089
               the first element in the array is at position 0).
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2090
			   If the element is not found and the array is not empty, then
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2091
			   this is set to the position of the first element in the array
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2092
			   with a key which is greater than the key of the object aRef.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2093
			   If the element is not found and the array is empty, then this 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2094
               is undefined.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2095
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2096
@return Zero, if the element with the specified key is found or the array is 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2097
        empty.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2098
		Non-zero, if the element with the specified key is not found.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2099
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2100
	{return(CArrayPakBase::FindIsq(&aRef,aKey,anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2101
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2102
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2103
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2104
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2105
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2106
inline void CArrayPak<T>::InsertL(TInt anIndex,const T &aRef,TInt aLength)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2107
/** 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2108
Inserts an element of a specified length into the array at the specified
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2109
position.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2110
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2111
@param anIndex The position within the array where the element is to be
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2112
               inserted. The position is relative to zero, i.e. zero implies
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2113
			   that elements are inserted at the beginning of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2114
@param aRef    A reference to the class T object to be inserted into
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2115
               the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2116
@param aLength The length of the element to be inserted into the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2117
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2118
@leave KErrNoMemory The function attempted to expand the array buffer and there
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2119
       is insufficient memory available. In this case, the array is left in the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2120
	   state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2121
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2122
@panic E32USER-CBase 21, if anIndex is negative or greater than the number of
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2123
       objects currently in the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2124
@panic E32USER-CBase 30, if aLength is negative.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2125
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2126
	{CArrayPakBase::InsertL(anIndex,&aRef,aLength);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2127
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2128
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2129
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2130
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2131
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2132
inline TInt CArrayPak<T>::InsertIsqL(const T &aRef,TInt aLength,TKeyArrayPak &aKey)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2133
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2134
Inserts a single element of a specified length into the array at a position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2135
determined by a key.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2136
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2137
The array MUST already be in key sequence (as defined by the key), otherwise 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2138
the position of the new element is unpredictable, or duplicates may occur.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2139
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2140
Elements with duplicate keys are not permitted.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2141
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2142
@param aRef    A reference to the element of type <class T> to be inserted into 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2143
               the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2144
@param aLength The length of the new element of type <class T> to be inserted 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2145
               into the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2146
@param aKey    A reference to a key object defining the properties of the key.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2147
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2148
@return The position within the array of the newly inserted element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2149
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2150
@leave KErrAlreadyExists An element with the same key already exists within 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2151
       the array. NB the array MUST already be in key sequence, otherwise
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2152
	   the function may insert a duplicate and fail to leave with
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2153
	   this value.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2154
@leave KErrNoMemory The function attempted to expand the array buffer and there 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2155
       is insufficient memory available. In this case, the array is left in the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2156
	   state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2157
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2158
	{return(CArrayPakBase::InsertIsqL(&aRef,aLength,aKey));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2159
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2160
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2161
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2162
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2163
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2164
inline TInt CArrayPak<T>::InsertIsqAllowDuplicatesL(const T &aRef,TInt aLength,TKeyArrayPak &aKey)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2165
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2166
Inserts a single element of a specified length into the array at a position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2167
determined by a key, allowing duplicates.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2168
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2169
The array MUST already be in key sequence, otherwise the position of the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2170
new element is unpredictable.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2171
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2172
Elements with duplicate keys are permitted. If the new element's key is a 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2173
duplicate of an existing element's key, then the new element is positioned 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2174
after the existing element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2175
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2176
@param aRef    A reference to the element of type <class T> to be inserted into
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2177
               the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2178
@param aLength The length of the new element to be inserted into the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2179
@param aKey    A reference to a key object defining the properties of the key.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2180
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2181
@return The position within the array of the newly inserted element. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2182
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2183
@leave KErrNoMemory The function attempted to expand the array buffer and there 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2184
       is insufficient memory available. In this case, the array is left in the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2185
	   state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2186
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2187
	{return(CArrayPakBase::InsertIsqAllowDuplicatesL(&aRef,aLength,aKey));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2188
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2189
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2190
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2191
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2192
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2193
inline const TArray<T> CArrayPak<T>::Array() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2194
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2195
Constructs and returns a TArray<T> object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2196
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2197
@return A Tarray<T> object for this array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2198
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2199
	{return(TArray<T>(CountR,AtR,this));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2200
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2201
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2202
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2203
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2204
inline CArrayPak<TAny>::CArrayPak(TBufRep aRep,TInt aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2205
	: CArrayPakBase(aRep,aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2206
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2207
Constructs a variable array with the specified granularity and
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2208
buffer organisation.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2209
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2210
Note that no memory is allocated to the array buffer by this constructor.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2211
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2212
@param aRep         A pointer to a function used to expand the array buffer. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2213
                    The organisation of the array buffer is implied by the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2214
					choice of this function.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2215
	                For a flat array buffer, pass (TBufRep)CBufFlat::NewL.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2216
			        For a segmented array buffer, pass (TBufRep)CBufSeg::NewL. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2217
@param aGranularity The granularity of the array. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2218
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2219
@panic E32USER-CBase 19, if aGranularity is not positive.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2220
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2221
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2222
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2223
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2224
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2225
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2226
inline const TAny *CArrayPak<TAny>::At(TInt anIndex) const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2227
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2228
Gets a pointer to the untyped element located at the specified position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2229
within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2230
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2231
The compiler uses this variant of the function if the returned reference is 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2232
used in an expression where that reference cannot be modified.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2233
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2234
@param anIndex The position of the element within the array, relative to zero; 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2235
               i.e. zero implies the first element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2236
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2237
@return A pointer to the const element located at position anIndex within 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2238
	    the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2239
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2240
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2241
       the number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2242
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2243
	{return(CArrayPakBase::At(anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2244
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2245
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2246
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2247
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2248
inline TAny *CArrayPak<TAny>::At(TInt anIndex)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2249
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2250
Gets a pointer to the untyped element located at the specified position 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2251
within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2252
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2253
The compiler uses this variant of the function if the returned reference is 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2254
used in an expression where that reference can be modified.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2255
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2256
@param anIndex The position of the element within the array, relative to zero; 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2257
               i.e. zero implies the first element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2258
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2259
@return A pointer to the non-const element located at position anIndex within 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2260
	    the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2261
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2262
@panic E32USER-CBase 21, if anIndex is negative or greater than or equal to
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2263
       the number of objects currently within the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2264
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2265
	{return(CArrayPakBase::At(anIndex));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2266
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2267
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2268
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2269
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2270
inline void CArrayPak<TAny>::AppendL(const TAny *aPtr,TInt aLength)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2271
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2272
Appends the untyped element of the specified length onto the end of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2273
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2274
@param aPtr    A pointer to an untyped element to be appended. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2275
@param aLength The length of the untyped element. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2276
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2277
@leave KErrNoMemory The function attempted to expand the array buffer and there 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2278
       is insufficient memory available. In this case, the array is left in the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2279
	   state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2280
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2281
	{CArrayPakBase::InsertL(Count(),aPtr,aLength);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2282
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2283
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2284
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2285
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2286
inline TAny *CArrayPak<TAny>::ExtendL(TInt aLength)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2287
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2288
Expands the array by one element of the specified length at the end of
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2289
the array, and returns a pointer to this new location.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2290
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2291
As elements are untyped, no construction is possible and the content of
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2292
the new location remains undefined.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2293
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2294
@param aLength  The length of the new element.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2295
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2296
@return A pointer to the new element location at the end of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2297
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2298
@leave KErrNoMemory The function attempted to expand the array buffer and there
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2299
       is insufficient memory available. In this case, the array is left in the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2300
	   state it was in before the call.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2301
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2302
	{return(CArrayPakBase::ExpandL(Count(),aLength));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2303
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2304
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2305
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2306
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2307
// Template class CArrayPakFlat
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2308
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2309
inline CArrayPakFlat<T>::CArrayPakFlat(TInt aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2310
	: CArrayPak<T>((TBufRep)CBufFlat::NewL,aGranularity)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2311
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2312
Constructs a packed flat array with specified granularity.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2313
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2314
Note that no memory is allocated to the array buffer by this  constructor.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2315
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2316
@param aGranularity The granularity of the array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2317
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2318
@panic E32USER-CBase 20, if aGranularity is not positive.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2319
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2320
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2321
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2322
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2323
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2324
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2325
// Class CObject
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2326
inline TInt CObject::UniqueID() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2327
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2328
Gets this reference counting object's unique ID.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2329
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2330
The unique ID is an integer which is a property of the object container. It 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2331
forms part of the identity of all reference counting objects and is the same 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2332
value for all reference counting objects held within the same object container.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2333
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2334
@return This reference counting object's unique ID.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2335
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2336
@see CObjectCon
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2337
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2338
	{return(iContainer->UniqueID());}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2339
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2340
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2341
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2342
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2343
inline TInt CObject::AccessCount() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2344
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2345
Gets the number of open references to this reference counting object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2346
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2347
@return The number of open references.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2348
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2349
	{return(iAccessCount);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2350
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2351
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2352
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2353
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2354
inline void CObject::Inc()
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2355
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2356
Adds one to the reference count.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2357
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2358
This function is called by the default implementation of the Open() member 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2359
function of this class.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2360
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2361
@see CObject::Open
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2362
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2363
	{iAccessCount++;}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2364
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2365
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2366
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2367
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2368
inline void CObject::Dec()
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2369
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2370
Subtracts one from the reference count.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2371
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2372
This function is called by the default implementation of the Close() member 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2373
function of this class.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2374
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2375
@see CObject::Close
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2376
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2377
	{iAccessCount--;}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2378
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2379
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2380
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2381
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2382
inline CObject * CObject::Owner() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2383
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2384
Gets a pointer to the reference counting object which owns this
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2385
reference counting object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2386
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2387
@return A pointer to the owning reference counting object. This is NULL, if 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2388
        there is no owner.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2389
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2390
	{return(iOwner);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2391
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2392
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2393
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2394
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2395
inline void CObject::SetOwner(CObject *anOwner)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2396
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2397
Sets the owner of this reference counting object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2398
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2399
If this reference counting object already has an owner, then all knowledge 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2400
of that owner is lost.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2401
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2402
@param anOwner A pointer to the reference counting object which is to be the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2403
               new owner of this reference counting object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2404
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2405
	{iOwner=anOwner;}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2406
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2407
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2408
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2409
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2410
// class CObjectIx
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2411
inline TInt CObjectIx::Count() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2412
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2413
Gets the number greater then the last slot number used to hold valid CObject pointer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2414
The input argument of CObject* CObjectIx::operator[]() must be less then the number returned by this method.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2415
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2416
@return The number greater then the last used slot.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2417
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2418
@see CObjectIx::ActiveCount
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2419
@see CObjectIx::operator[]
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2420
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2421
	{return iHighWaterMark;}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2422
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2423
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2424
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2425
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2426
inline TInt CObjectIx::ActiveCount() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2427
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2428
Gets the current number of reference counting objects held by this
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2429
object index.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2430
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2431
@return The current number.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2432
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2433
	{return iNumEntries;}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2434
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2435
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2436
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2437
// class CObjectCon
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2438
inline TInt CObjectCon::UniqueID() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2439
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2440
Gets this object container's unique ID.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2441
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2442
@return The unique ID value.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2443
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2444
	{return iUniqueID;}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2445
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2446
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2447
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2448
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2449
inline TInt CObjectCon::Count() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2450
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2451
Gets the number of reference counting objects in this object container.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2452
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2453
@return The number of objects.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2454
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2455
	{return iCount;}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2456
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2457
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2458
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2459
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2460
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2461
// class CCirBufBase
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2462
inline TInt CCirBufBase::Count() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2463
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2464
Gets the current number of objects in this circular buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2465
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2466
@return The number of objects in this circular buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2467
        This value can never be greater than the maximum capacity.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2468
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2469
	{return(iCount);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2470
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2471
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2472
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2473
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2474
inline TInt CCirBufBase::Length() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2475
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2476
Gets the maximum capacity of this circular buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2477
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2478
The capacity is the maximum number of elements that the buffer can hold.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2479
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2480
Use SetLengthL() to change the capacity of the circular buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2481
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2482
@return The maximum capacity of this circular buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2483
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2484
@see CCirBufBase::SetLengthL
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2485
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2486
	{return(iLength);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2487
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2488
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2489
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2490
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2491
// Template class CCirBuf
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2492
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2493
inline CCirBuf<T>::CCirBuf()
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2494
	: CCirBufBase(sizeof(T))
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2495
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2496
Default C++ constructor.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2497
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2498
The size of each object in the buffer is fixed and is the length of the class 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2499
passed as the template parameter. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2500
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2501
@panic E32USER-CBase 72, if the length of the template class is zero.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2502
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2503
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2504
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2505
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2506
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2507
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2508
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2509
inline TInt CCirBuf<T>::Add(const T *aPtr)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2510
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2511
Adds a single object to the circular buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2512
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2513
The object is of type class T and is only added if there is space available.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2514
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2515
@param aPtr A pointer to the object of type class T to be added to the circular 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2516
            buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2517
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2518
@return 1 if the object is successfully added. 0 if the object cannot be added 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2519
        because the circular buffer is full.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2520
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2521
@panic E32USER-CBase 74, if a call to CCirBufBase::SetLengthL() has not been
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2522
                         made before calling this function.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2523
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2524
@see CCirBufBase::SetLengthL
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2525
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2526
	{return(DoAdd((const TUint8 *)aPtr));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2527
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2528
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2529
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2530
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2531
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2532
inline TInt CCirBuf<T>::Add(const T *aPtr,TInt aCount)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2533
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2534
Adds multiple objects to the circular buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2535
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2536
The function attempts to add aCount objects of type class T. The objects are
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2537
only added if there is space available.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2538
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2539
@param aPtr   A pointer to a set of contiguous objects of type class T to be 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2540
              added to the circular buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2541
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2542
@param aCount The number of objects to be added to the circular buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2543
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2544
@return The number of objects successfully added to the buffer. This value 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2545
        may be less than the number requested and can range from 0 to aCount. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2546
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2547
@panic E32USER-CBase 74, if a call to CCirBufBase::SetLengthL() has not been
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2548
                         made before calling this function.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2549
@panic E32USER-CBase 75, if aCount is not a positive value. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2550
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2551
@see CCirBufBase::SetLengthL
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2552
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2553
	{return(DoAdd((const TUint8 *)aPtr,aCount));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2554
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2555
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2556
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2557
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2558
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2559
inline TInt CCirBuf<T>::Remove(T *aPtr)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2560
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2561
Removes a single object from the circular buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2562
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2563
An object can only be removed if there are objects in the buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2564
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2565
A binary copy of the object is made to aPtr.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2566
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2567
@param aPtr A pointer to an object of type class T supplied by the caller.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2568
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2569
@return 1 if an object is successfully removed. 0 if an object cannot be removed 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2570
        because the circular buffer is empty.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2571
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2572
	{return(DoRemove((TUint8 *)aPtr));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2573
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2574
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2575
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2576
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2577
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2578
inline TInt CCirBuf<T>::Remove(T *aPtr,TInt aCount)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2579
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2580
Removes multiple objects from the circular buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2581
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2582
The function attempts to remove aCount objects of type class T.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2583
Objects can only be removed if there are objects in the buffer
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2584
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2585
A binary copy of the objects is made to aPtr.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2586
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2587
@param aPtr   A pointer to contiguous memory able to hold aCount class T objects, 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2588
              supplied by the caller. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2589
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2590
@param aCount The number of objects to be removed from the circular buffer.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2591
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2592
@return The number of objects successfully removed from the buffer. This value
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2593
        may be less than the number requested, and can range from 0 to aCount.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2594
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2595
@panic E32USER-CBase 76, if aCount is not a positive value.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2596
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2597
	{return(DoRemove((TUint8 *)aPtr,aCount));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2598
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2599
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2600
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2601
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2602
// Class CActive
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2603
inline TBool CActive::IsActive() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2604
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2605
Determines whether the active object has a request outstanding.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2606
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2607
A request is outstanding when:
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2608
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2609
1. it has been issued
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2610
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2611
2. it has not been cancelled
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2612
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2613
3. it servicing has not yet begun.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2614
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2615
@return True, if a request is outstanding; false, otherwise.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2616
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2617
	{return(iStatus.iFlags&TRequestStatus::EActive);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2618
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2619
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2620
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2621
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2622
inline TBool CActive::IsAdded() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2623
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2624
Determines whether the active object has been added to the active scheduler's 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2625
list of active objects.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2626
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2627
If the active object has not been added to a scheduler, it cannot handle the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2628
completion of any request. No request should be issued until the active object 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2629
has been added to a scheduler because completion of that request generates 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2630
what appears to be a stray signal.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2631
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2632
Use the active object function Deque() to remove the active object from the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2633
scheduler.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2634
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2635
@return True, if the active object has been added to an active scheduler; 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2636
        false, otherwise. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2637
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2638
@see CActive::Deque
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2639
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2640
	{return(iLink.iNext!=NULL);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2641
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2642
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2643
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2644
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2645
inline TInt CActive::Priority() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2646
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2647
Gets the priority of the active object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2648
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2649
@return The active object's priority value.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2650
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2651
	{return iLink.iPriority;}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2652
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2653
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2654
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2655
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2656
// class CDeltaTimer
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2657
inline TDeltaTimerEntry::TDeltaTimerEntry(TCallBack& aCallback)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2658
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2659
Constructor specifying a general callback.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2660
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2661
@param aCallback The callback to be called when this timed event entry expires.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2662
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2663
	{iCallBack=aCallback;}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2664
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2665
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2666
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2667
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2668
inline TDeltaTimerEntry::TDeltaTimerEntry()
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2669
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2670
Default constructor.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2671
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2672
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2673
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2674
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2675
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2676
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2677
inline void TDeltaTimerEntry::Set(TCallBack& aCallback)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2678
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2679
Sets the specified callback.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2680
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2681
@param aCallback The callback to be called when this timed event entry expires.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2682
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2683
	{iCallBack=aCallback;}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2684
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2685
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2686
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2687
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2688
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2689
Gets a reference to the server's current message.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2690
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2691
@return The current message that contains the client request details.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2692
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2693
inline const RMessage2 &CServer2::Message() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2694
	{return iMessage;}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2695
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2696
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2697
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2698
	
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2699
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2700
Gets the server active object that handles messages for this session.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2701
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2702
This is the instance of the CServer2 derived class that created
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2703
this session object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2704
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2705
@return The server active object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2706
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2707
inline const CServer2 *CSession2::Server() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2708
	{return iServer;}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2709
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2710
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2711
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2712
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2713
// Class CAsyncOneShot
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2714
inline RThread& CAsyncOneShot::Thread()
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2715
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2716
Gets a handle to the current thread.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2717
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2718
@return The handle to the current thread.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2719
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2720
	{ return iThread; }
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2721
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2722
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2723
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2724
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2725
// Class CActiveScheduler
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2726
inline TInt CActiveScheduler::Level() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2727
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2728
@deprecated Use the StackDepth() function instead.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2729
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2730
Gets the scheduler's level of nestedness.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2731
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2732
@return The level of nestedness.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2733
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2734
@see StackDepth()
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2735
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2736
	{return StackDepth();}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2737
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2738
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2739
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2740
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2741
// Class CActiveSchedulerWait
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2742
inline TBool CActiveSchedulerWait::IsStarted() const
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2743
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2744
Reports whether this CActiveSchedulerWait object is currently started.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2745
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2746
Note: a CActiveSchedulerWait object itself becomes "stopped" as
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2747
soon as AsyncStop() is called, and can be started again immediately if
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2748
required (but this would start a new nested level of the scheduler).
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2749
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2750
@return True if the scheduling loop is active; false, otherwise.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2751
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2752
@see CActiveSchedulerWait::Start
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2753
@see CActiveSchedulerWait::AsyncStop
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2754
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2755
	{return iLoop != NULL;}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2756
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2757
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2758
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2759
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2760
// Class CleanupStack
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2761
#ifdef _DEBUG
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2762
inline void CleanupStack::Pop(TAny* aExpectedItem)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2763
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2764
Pops an object from the top of the cleanup stack.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2765
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2766
The function has two modes of operation, depending on whether it is part of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2767
a debug build or a release build.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2768
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2769
1. In a debug build, the function checks that the specified item is at the top 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2770
   of the cleanup stack before attempting to pop it; an E32USER-CBase 90 panic 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2771
   is raised if the check fails.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2772
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2773
2  In a release build, the function just pops the object which is at the top 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2774
   of the cleanup stack; no checking is done.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2775
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2776
@param aExpectedItem A pointer to the item expected to be at the top of the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2777
                     cleanup stack. In a release build, this parameter
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2778
					 is not used.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2779
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2780
	{ CleanupStack::Check(aExpectedItem); CleanupStack::Pop(); }
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2781
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2782
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2783
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2784
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2785
inline void CleanupStack::Pop(TInt aCount, TAny* aLastExpectedItem)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2786
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2787
Pops the specified number of objects from the top of the cleanup stack.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2788
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2789
The function has two modes of operation, depending on whether it is part of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2790
a debug build or a release build.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2791
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2792
1. In a debug build, the function pops (aCount-1) items from the cleanup stack, 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2793
   and then checks that the specified item is the next one on the cleanup stack 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2794
   before attempting to pop it; an E32USER-CBase 90 panic is raised if the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2795
   check fails.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2796
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2797
2. In a release build, the function just pops aCount items from the cleanup stack; 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2798
   no checking is done.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2799
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2800
@param aCount            The number of items top be popped from
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2801
                         the cleanup stack.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2802
@param aLastExpectedItem A pointer to the item expected to be at the top of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2803
                         the cleanup stack, after (aCount-1) items have been
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2804
						 popped. In a release build, this parameter is
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2805
						 not used.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2806
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2807
	{
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2808
	if (--aCount)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2809
		CleanupStack::Pop(aCount);
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2810
	CleanupStack::Check(aLastExpectedItem);
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2811
	CleanupStack::Pop();
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2812
	}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2813
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2814
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2815
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2816
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2817
inline void CleanupStack::PopAndDestroy(TAny* aExpectedItem)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2818
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2819
Pops an object from the top of the cleanup stack, and cleans it up.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2820
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2821
The function has two modes of operation, depending on whether it is part of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2822
a debug build or a release build.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2823
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2824
1. In a debug build, the function checks that the specified item is at the top 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2825
   of the cleanup stack before attempting to pop and clean it up;
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2826
   an E32USER-CBase 90 panic is raised if the check fails.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2827
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2828
2. In a release build, the function just pops and cleans up the object at 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2829
   the top of the cleanup stack; no checking is done.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2830
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2831
@param aExpectedItem A pointer to the item expected to be at the top of the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2832
                     cleanup stack. In a release build, this parameter is
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2833
					 not used.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2834
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2835
	{ CleanupStack::Check(aExpectedItem); CleanupStack::PopAndDestroy(); }
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2836
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2837
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2838
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2839
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2840
inline void CleanupStack::PopAndDestroy(TInt aCount, TAny* aLastExpectedItem)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2841
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2842
Pops the specified number of objects from the top of the cleanup stack, and 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2843
cleans them up.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2844
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2845
The function has two modes of operation, depending on whether it is part of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2846
a debug build or a release build.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2847
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2848
1. In a debug build, the function pops and cleans up (aCount-1) items from the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2849
   cleanup stack, and then checks that the specified item is the next one on 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2850
   the cleanup stack before attempting to pop it and clean it up;
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2851
   an E32USER-CBase  90 panic is raised if the check fails.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2852
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2853
2. In a release build, the function just pops and cleans up aCount items from 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2854
   the cleanup stack; no checking is done.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2855
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2856
@param aCount            The number of items top be popped from the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2857
                         cleanup stack, and cleaned up.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2858
@param aLastExpectedItem A pointer to the item expected to be at the top of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2859
                         the cleanup stack, after (aCount-1) items have been
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2860
						 popped and cleaned up. In a release build, this 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2861
						 parameter is not used.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2862
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2863
	{
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2864
	if (--aCount)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2865
		CleanupStack::PopAndDestroy(aCount);
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2866
	CleanupStack::Check(aLastExpectedItem);
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2867
	CleanupStack::PopAndDestroy();
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2868
	}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2869
#else
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2870
inline void CleanupStack::Pop(TAny*)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2871
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2872
Pops an object from the top of the cleanup stack.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2873
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2874
The function has two modes of operation, depending on whether it is part of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2875
a debug build or a release build.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2876
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2877
1. In a debug build, the function checks that the specified item is at the top 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2878
   of the cleanup stack before attempting to pop it; an E32USER-CBase 90 panic 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2879
   is raised if the check fails.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2880
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2881
2  In a release build, the function just pops the object which is at the top 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2882
   of the cleanup stack; no checking is done.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2883
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2884
@param aExpectedItem A pointer to the item expected to be at the top of the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2885
                     cleanup stack. In a release build, this parameter
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2886
					 is not used.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2887
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2888
	{ CleanupStack::Pop(); }
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2889
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2890
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2891
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2892
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2893
inline void CleanupStack::Pop(TInt aCount, TAny*)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2894
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2895
Pops the specified number of objects from the top of the cleanup stack.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2896
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2897
The function has two modes of operation, depending on whether it is part of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2898
a debug build or a release build.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2899
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2900
1. In a debug build, the function pops (aCount-1) items from the cleanup stack, 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2901
   and then checks that the specified item is the next one on the cleanup stack 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2902
   before attempting to pop it; an E32USER-CBase 90 panic is raised if the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2903
   check fails.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2904
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2905
2. In a release build, the function just pops aCount items from the cleanup stack; 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2906
   no checking is done.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2907
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2908
@param aCount            The number of items top be popped from
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2909
                         the cleanup stack.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2910
@param aLastExpectedItem A pointer to the item expected to be at the top of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2911
                         the cleanup stack, after (aCount-1) items have been
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2912
						 popped. In a release build, this parameter is
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2913
						 not used.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2914
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2915
	{ CleanupStack::Pop(aCount); }
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2916
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2917
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2918
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2919
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2920
inline void CleanupStack::PopAndDestroy(TAny*)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2921
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2922
Pops an object from the top of the cleanup stack, and cleans it up.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2923
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2924
The function has two modes of operation, depending on whether it is part of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2925
a debug build or a release build.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2926
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2927
1. In a debug build, the function checks that the specified item is at the top 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2928
   of the cleanup stack before attempting to pop and clean it up;
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2929
   an E32USER-CBase 90 panic is raised if the check fails.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2930
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2931
2. In a release build, the function just pops and cleans up the object at 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2932
   the top of the cleanup stack; no checking is done.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2933
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2934
@param aExpectedItem A pointer to the item expected to be at the top of the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2935
                     cleanup stack. In a release build, this parameter is
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2936
					 not used.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2937
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2938
	{ CleanupStack::PopAndDestroy(); }
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2939
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2940
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2941
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2942
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2943
inline void CleanupStack::PopAndDestroy(TInt aCount, TAny*)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2944
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2945
Pops the specified number of objects from the top of the cleanup stack, and 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2946
cleans them up.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2947
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2948
The function has two modes of operation, depending on whether it is part of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2949
a debug build or a release build.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2950
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2951
1. In a debug build, the function pops and cleans up (aCount-1) items from the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2952
   cleanup stack, and then checks that the specified item is the next one on 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2953
   the cleanup stack before attempting to pop it and clean it up;
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2954
   an E32USER-CBase  90 panic is raised if the check fails.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2955
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2956
2. In a release build, the function just pops and cleans up aCount items from 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2957
   the cleanup stack; no checking is done.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2958
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2959
@param aCount            The number of items top be popped from the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2960
                         cleanup stack, and cleaned up.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2961
@param aLastExpectedItem A pointer to the item expected to be at the top of 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2962
                         the cleanup stack, after (aCount-1) items have been
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2963
						 popped and cleaned up. In a release build, this 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2964
						 parameter is not used.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2965
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2966
	{ CleanupStack::PopAndDestroy(aCount); }
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2967
#endif
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2968
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2969
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2970
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2971
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2972
// Class TCleanupItem
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2973
inline TCleanupItem::TCleanupItem(TCleanupOperation anOperation)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2974
	: iOperation(anOperation)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2975
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2976
Constructs the object with a cleanup operation.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2977
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2978
@param anOperation  A cleanup operation which will be invoked by the pop and
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2979
                    destroy action resulting from a subsequent call to
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2980
					CleanupStack::PopAndDestroy().
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2981
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2982
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2983
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2984
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2985
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2986
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2987
inline TCleanupItem::TCleanupItem(TCleanupOperation anOperation,TAny *aPtr)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2988
	: iOperation(anOperation), iPtr(aPtr)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2989
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2990
Constructs the object with a cleanup operation and a pointer to the object
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2991
to be cleaned up.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2992
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2993
@param anOperation A cleanup operation which will be invoked by the pop
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2994
                   and destroy action resulting from a subsequent call to
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2995
				   CleanupStack::PopAndDestroy().
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2996
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2997
@param aPtr        A pointer to an object which is the target of the
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2998
                   cleanup operation.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  2999
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3000
	{}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3001
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3002
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3003
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3004
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3005
// Class TCleanupTrapHandler
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3006
inline CCleanup &TCleanupTrapHandler::Cleanup()
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3007
	{return(*iCleanup);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3008
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3009
// Class TAutoClose
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3010
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3011
inline TAutoClose<T>::~TAutoClose()
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3012
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3013
Destructor.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3014
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3015
The implementation calls Close() on iObj, the instance of the template class.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3016
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3017
#ifdef __LEAVE_EQUALS_THROW__
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3018
	{if (!std::uncaught_exception()) iObj.Close();}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3019
#else
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3020
	{iObj.Close();}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3021
#endif
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3022
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3023
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3024
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3025
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3026
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3027
inline void TAutoClose<T>::PushL()
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3028
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3029
Pushes a cleanup item onto the cleanup stack, so that Close() is called on the 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3030
templated class object, iObj, if a leave occurs.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3031
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3032
	{CleanupStack::PushL(TCleanupItem(Close, (TAny *)&iObj));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3033
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3034
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3035
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3036
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3037
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3038
inline void TAutoClose<T>::Pop()
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3039
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3040
Pops a single cleanup item from the cleanup stack.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3041
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3042
	{CleanupStack::Pop();}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3043
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3044
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3045
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3046
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3047
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3048
void TAutoClose<T>::Close(TAny *aObj)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3049
	{((T *)aObj)->Close();}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3050
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3051
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3052
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3053
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3054
// Template class CleanupDelete
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3055
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3056
inline void CleanupDelete<T>::PushL(T* aPtr)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3057
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3058
Creates a TCleanupItem for the specified object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3059
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3060
The cleanup operation is the private static function Delete() of this class, which
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3061
deletes the specified object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3062
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3063
@param aPtr The object for which a TCleanupItem is to be constructed.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3064
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3065
	{CleanupStack::PushL(TCleanupItem(&Delete,aPtr));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3066
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3067
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3068
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3069
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3070
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3071
void CleanupDelete<T>::Delete(TAny *aPtr)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3072
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3073
The cleanup operation to be performed.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3074
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3075
@param aPtr A pointer to the object for which clean up is to be performed. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3076
            The implementation deletes this object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3077
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3078
	{delete STATIC_CAST(T*,aPtr);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3079
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3080
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3081
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3082
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3083
// See header file e32base.h for in-source comment.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3084
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3085
inline void CleanupDeletePushL(T* aPtr)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3086
	{CleanupDelete<T>::PushL(aPtr);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3087
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3088
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3089
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3090
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3091
// Template class CleanupArrayDelete
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3092
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3093
inline void CleanupArrayDelete<T>::PushL(T* aPtr)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3094
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3095
Creates a TCleanupItem for the specified array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3096
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3097
The cleanup operation is the private static function ArrayDelete() of
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3098
this class, which deletes the specified array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3099
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3100
@param aPtr The array of class T type objects for which a TCleanupItem is
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3101
            to be constructed.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3102
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3103
	{CleanupStack::PushL(TCleanupItem(&ArrayDelete,aPtr));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3104
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3105
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3106
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3107
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3108
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3109
void CleanupArrayDelete<T>::ArrayDelete(TAny *aPtr)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3110
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3111
The cleanup operation to be performed.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3112
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3113
@param aPtr A pointer to the array for which clean up is to be performed. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3114
            The implementation deletes this array.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3115
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3116
	{delete [] STATIC_CAST(T*,aPtr);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3117
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3118
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3119
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3120
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3121
// See header file e32base.h for in-source comment.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3122
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3123
inline void CleanupArrayDeletePushL(T* aPtr)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3124
	{CleanupArrayDelete<T>::PushL(aPtr);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3125
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3126
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3127
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3128
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3129
// Template class CleanupClose
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3130
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3131
inline void CleanupClose<T>::PushL(T& aRef)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3132
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3133
Creates a TCleanupItem for the specified object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3134
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3135
The cleanup operation is the private static function Close() of this class.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3136
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3137
@param aRef The object for which a TCleanupItem is to be constructed.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3138
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3139
	{CleanupStack::PushL(TCleanupItem(&Close,&aRef));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3140
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3141
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3142
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3143
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3144
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3145
void CleanupClose<T>::Close(TAny *aPtr)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3146
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3147
The cleanup operation to be performed.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3148
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3149
@param aPtr A pointer to the object for which clean up is to be performed. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3150
            The implementation calls Close() on this object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3151
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3152
	{(STATIC_CAST(T*,aPtr))->Close();}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3153
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3154
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3155
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3156
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3157
// See header file e32base.h for in-source comment.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3158
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3159
inline void CleanupClosePushL(T& aRef)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3160
	{CleanupClose<T>::PushL(aRef);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3161
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3162
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3163
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3164
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3165
// Template class CleanupRelease
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3166
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3167
inline void CleanupRelease<T>::PushL(T& aRef)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3168
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3169
Creates a TCleanupItem for the specified object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3170
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3171
The cleanup operation is the private static function Release() of this class.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3172
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3173
@param aRef The object for which a TCleanupItem is to be constructed.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3174
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3175
	{CleanupStack::PushL(TCleanupItem(&Release,&aRef));}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3176
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3177
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3178
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3179
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3180
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3181
void CleanupRelease<T>::Release(TAny *aPtr)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3182
/**
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3183
The cleanup operation to be performed.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3184
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3185
@param aPtr A pointer to the object for which clean up is to be performed. 
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3186
            The implementation calls Release() on this object.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3187
*/
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3188
	{(STATIC_CAST(T*,aPtr))->Release();}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3189
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3190
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3191
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3192
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3193
// See header file e32base.h for in-source comment.
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3194
template <class T>
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3195
inline void CleanupReleasePushL(T& aRef)
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3196
	{CleanupRelease<T>::PushL(aRef);}
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3197
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3198
0a7b44b10206 Catch up of Symbian tools for @1627812
Pat Downey <patrick.downey@nokia.com>
parents:
diff changeset
  3199