epoc32/include/e32cmn.inl
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 e32cmn.inl
     1 // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // e32\include\e32cmn.inl
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __PLACEMENT_NEW_INLINE
       
    19 #define __PLACEMENT_NEW_INLINE
       
    20 // Global placement operator new
       
    21 inline TAny* operator new(TUint /*aSize*/, TAny* aBase) __NO_THROW
       
    22 	{return aBase;}
       
    23 
       
    24 // Global placement operator delete
       
    25 inline void operator delete(TAny* /*aPtr*/, TAny* /*aBase*/) __NO_THROW
       
    26 	{}
       
    27 #endif //__PLACEMENT_NEW_INLINE
       
    28 
       
    29 #ifndef __PLACEMENT_VEC_NEW_INLINE
       
    30 #define __PLACEMENT_VEC_NEW_INLINE
       
    31 // Global placement operator new[]
       
    32 inline TAny* operator new[](TUint /*aSize*/, TAny* aBase) __NO_THROW
       
    33 	{return aBase;}
       
    34 
       
    35 // Global placement operator delete[]
       
    36 inline void operator delete[](TAny* /*aPtr*/, TAny* /*aBase*/) __NO_THROW
       
    37 	{}
       
    38 #endif //__PLACEMENT_VEC_NEW_INLINE
       
    39 
       
    40 
       
    41 // class RAllocator
       
    42 inline RAllocator::RAllocator()
       
    43 	{
       
    44 	iAccessCount=1;
       
    45 	iHandleCount=0;
       
    46 	iHandles=0;
       
    47 	iFlags=0;
       
    48 	iCellCount=0;
       
    49 	iTotalAllocSize=0;
       
    50 	}
       
    51 inline void RAllocator::__DbgMarkCheck(TBool aCountAll, TInt aCount, const TUint8* aFileName, TInt aLineNum)
       
    52 	{__DbgMarkCheck(aCountAll, aCount, TPtrC8(aFileName), aLineNum);}
       
    53 
       
    54 // Class RHeap
       
    55 inline RHeap::RHeap()
       
    56 	{}
       
    57 
       
    58 /**
       
    59 @return The maximum length to which the heap can grow.
       
    60 
       
    61 @publishedAll
       
    62 @released
       
    63 */
       
    64 inline TInt RHeap::MaxLength() const
       
    65 	{return iMaxLength;}
       
    66 
       
    67 inline void RHeap::operator delete(TAny*, TAny*) 
       
    68 /**
       
    69 Called if constructor issued by operator new(TUint aSize, TAny* aBase) throws exception.
       
    70 This is dummy as corresponding new operator does not allocate memory.
       
    71 */
       
    72 	{}
       
    73 
       
    74 
       
    75 inline TUint8* RHeap::Base() const
       
    76 /**
       
    77 Gets a pointer to the start of the heap.
       
    78 	
       
    79 Note that because of the small space overhead incurred by all allocated cells, 
       
    80 no cell will have the same address as that returned by this function.
       
    81 	
       
    82 @return A pointer to the base of the heap.
       
    83 */
       
    84 	{return iBase;}
       
    85 
       
    86 
       
    87 
       
    88 
       
    89 inline TInt RHeap::Size() const
       
    90 /**
       
    91 Gets the current size of the heap.
       
    92 
       
    93 This is the total number of bytes committed by the host chunk. 
       
    94 It is the requested size rounded up by page size minus the size of RHeap object(116 bytes)
       
    95 minus the cell alignment overhead as shown:
       
    96 
       
    97 Size = (Rounded committed size - Size of RHeap - Cell Alignment Overhead).
       
    98 
       
    99 The cell alignment overhead varies between release builds and debug builds.
       
   100 
       
   101 Note that this value is always greater than the total space available across all allocated cells.
       
   102 	
       
   103 @return The size of the heap.
       
   104 
       
   105 @see Rheap::Available( )
       
   106 */
       
   107 	{return iTop-iBase;}
       
   108 
       
   109 
       
   110 
       
   111 
       
   112 inline TInt RHeap::Align(TInt a) const
       
   113 /**
       
   114 @internalComponent
       
   115 */
       
   116 	{return _ALIGN_UP(a, iAlign);}
       
   117 
       
   118 
       
   119 
       
   120 
       
   121 inline const TAny* RHeap::Align(const TAny* a) const
       
   122 /**
       
   123 @internalComponent
       
   124 */
       
   125 	{return (const TAny*)_ALIGN_UP((TLinAddr)a, iAlign);}
       
   126 
       
   127 
       
   128 
       
   129 
       
   130 inline TBool RHeap::IsLastCell(const SCell* aCell) const
       
   131 /**
       
   132 @internalComponent
       
   133 */
       
   134 	{return (((TUint8*)aCell) + aCell->len) == iTop;}
       
   135 
       
   136 
       
   137 
       
   138 
       
   139 #ifndef __KERNEL_MODE__
       
   140 inline void RHeap::Lock() const
       
   141 /**
       
   142 @internalComponent
       
   143 */
       
   144 	{((RFastLock&)iLock).Wait();}
       
   145 
       
   146 
       
   147 
       
   148 
       
   149 inline void RHeap::Unlock() const
       
   150 /**
       
   151 @internalComponent
       
   152 */
       
   153 	{((RFastLock&)iLock).Signal();}
       
   154 
       
   155 
       
   156 inline TInt RHeap::ChunkHandle() const
       
   157 /**
       
   158 @internalComponent
       
   159 */
       
   160 	{
       
   161 	return iChunkHandle;
       
   162 	}
       
   163 #endif
       
   164 
       
   165 
       
   166 
       
   167 
       
   168 // Class TRefByValue
       
   169 template <class T>
       
   170 inline TRefByValue<T>::TRefByValue(T &aRef)
       
   171 	: iRef(aRef)
       
   172 /**
       
   173 Constructs this value reference for the specified referenced object.
       
   174 
       
   175 @param aRef The referenced object.
       
   176 */
       
   177 	{}
       
   178 
       
   179 
       
   180 
       
   181 
       
   182 template <class T>
       
   183 inline TRefByValue<T>::operator T &()
       
   184 /**
       
   185 Gets a reference to the object encapsulated inside this value reference.
       
   186 */
       
   187 	{return(iRef);}
       
   188 
       
   189 
       
   190 
       
   191 
       
   192 /**
       
   193 Creates the logical channel.
       
   194 
       
   195 @param aDevice    The name of the logical device for which the channel
       
   196                   is to be constructed. This is the name by which
       
   197 				  the LDD factory object, i.e. the instance of
       
   198 				  the DLogicalDevice derived class, is known.
       
   199 @param aVer       The required version of the logical device. The driver
       
   200                   normally checks this against the version of the logical
       
   201 				  channel, returning KErrNotSupported if the logical channel
       
   202 				  is not compatible.
       
   203 @param aUnit      A unit of the device. This argument only has meaning if
       
   204                   the flag KDeviceAllowUnit is set in the iParseMask data
       
   205 				  member of the LDD factory object.
       
   206 @param aDriver    A pointer to a descriptor containing the name of
       
   207                   a physical device. This is the name by which the PDD
       
   208 				  factory object, i.e. the instance of the DPhysicalDevice
       
   209 				  derived class, is known.
       
   210                   This is NULL, if no explicit name is to be supplied, or
       
   211 				  the logical device does not require an accompanying physical
       
   212 				  device.
       
   213 @param aInfo      A pointer to an explicit 8-bit descriptor containing extra
       
   214                   information for the physical device. This argument only has
       
   215 				  meaning if the KDeviceAllowInfo flag is set in the iParseMask
       
   216 				  data member of the LDD factory object.
       
   217 @param aType      An enumeration whose enumerators define the ownership of
       
   218                   this handle. If not explicitly specified, EOwnerProcess is
       
   219 				  taken as default.
       
   220 @param aTransferable If false, the channel is created as an object which is
       
   221                      local/private to the current process.
       
   222                      If true, the channel is an object which may be shared with
       
   223                      other processes using the IPC mechanisms for handle passing.
       
   224 	
       
   225 @return  KErrNone, if successful; otherwise one of the other system wide
       
   226          error codes.
       
   227 */
       
   228 inline TInt RBusLogicalChannel::DoCreate(const TDesC& aDevice, const TVersion& aVer, TInt aUnit, const TDesC* aDriver, const TDesC8* aInfo, TOwnerType aType, TBool aTransferable)
       
   229 	{ return DoCreate(aDevice, aVer, aUnit, aDriver, aInfo, (TInt)aType | (aTransferable?KCreateProtectedObject:0) ); }
       
   230 
       
   231 
       
   232 
       
   233 
       
   234 // Class TChar
       
   235 inline TChar::TChar()
       
   236 /**
       
   237 Default constructor.
       
   238 
       
   239 Constructs this character object with an undefined value.
       
   240 */
       
   241 	{}
       
   242 
       
   243 
       
   244 
       
   245 
       
   246 inline TChar::TChar(TUint aChar)
       
   247 	: iChar(aChar)
       
   248 /**
       
   249 Constructs this character object and initialises it with the specified value.
       
   250 
       
   251 @param aChar The initialisation value.
       
   252 */
       
   253 	{}
       
   254 
       
   255 
       
   256 
       
   257 
       
   258 inline TChar& TChar::operator-=(TUint aChar)
       
   259 /**
       
   260 Subtracts an unsigned integer value from this character object.
       
   261 
       
   262 This character object is changed by the operation.
       
   263 
       
   264 @param aChar The value to be subtracted.
       
   265 
       
   266 @return A reference to this character object.
       
   267 */
       
   268 	{iChar-=aChar;return(*this);}
       
   269 
       
   270 
       
   271 
       
   272 
       
   273 inline TChar& TChar::operator+=(TUint aChar)
       
   274 /**
       
   275 Adds an unsigned integer value to this character object.
       
   276 
       
   277 This character object is changed by the operation.
       
   278 
       
   279 @param aChar The value to be added.
       
   280 
       
   281 @return A reference to this character object.
       
   282 */
       
   283 	{iChar+=aChar;return(*this);}
       
   284 
       
   285 
       
   286 
       
   287 
       
   288 inline TChar TChar::operator-(TUint aChar)
       
   289 /**
       
   290 Gets the result of subtracting an unsigned integer value from this character 
       
   291 object.
       
   292 
       
   293 This character object is not changed.
       
   294 
       
   295 @param aChar The value to be subtracted.
       
   296 
       
   297 @return A character object whose value is the result of the subtraction
       
   298         operation.
       
   299 */
       
   300 	{return(iChar-aChar);}
       
   301 
       
   302 
       
   303 
       
   304 
       
   305 inline TChar TChar::operator+(TUint aChar)
       
   306 /** 
       
   307 Gets the result of adding an unsigned integer value to this character object. 
       
   308 
       
   309 This character object is not changed.
       
   310 
       
   311 @param aChar The value to be added.
       
   312 
       
   313 @return A character object whose value is the result of the addition operation.
       
   314 */
       
   315 	{return(iChar+aChar);}
       
   316 
       
   317 
       
   318 
       
   319 
       
   320 inline TChar::operator TUint() const
       
   321 /**
       
   322 Gets the value of the character as an unsigned integer. 
       
   323 
       
   324 The operator casts a TChar to a TUint, returning the TUint value wrapped by
       
   325 this character object.
       
   326 */
       
   327 	{return(iChar);}
       
   328 
       
   329 
       
   330 
       
   331 
       
   332 // Class TDesC8
       
   333 inline TBool TDesC8::operator<(const TDesC8 &aDes) const
       
   334 /**
       
   335 Determines whether this descriptor's data is less than the specified
       
   336 descriptor's data.
       
   337 
       
   338 The comparison is implemented using the Compare() member function.
       
   339 
       
   340 @param aDes The 8-bit non-modifable descriptor whose data is to be compared 
       
   341             with this descriptor's data.
       
   342             
       
   343 @return True if greater than or equal, false otherwise.
       
   344 
       
   345 @see TDesC8::Compare
       
   346 */
       
   347 	{return(Compare(aDes)<0);}
       
   348 
       
   349 
       
   350 
       
   351 
       
   352 inline TBool TDesC8::operator<=(const TDesC8 &aDes) const
       
   353 /**
       
   354 Determines whether this descriptor's data is less than or equal to the
       
   355 specified descriptor's data.
       
   356 
       
   357 The comparison is implemented using the Compare() member function.
       
   358 
       
   359 @param aDes The 8-bit non-modifable descriptor whose data is to be compared 
       
   360             with this descriptor's data. 
       
   361             
       
   362 @return True if less than or equal, false otherwise. 
       
   363 
       
   364 @see TDesC8::Compare
       
   365 */
       
   366 	{return(Compare(aDes)<=0);}
       
   367 
       
   368 
       
   369 
       
   370 
       
   371 inline TBool TDesC8::operator>(const TDesC8 &aDes) const
       
   372 /**
       
   373 Determines whether this descriptor's data is greater than the specified
       
   374 descriptor's data.
       
   375 
       
   376 The comparison is implemented using the Compare() member function.
       
   377 
       
   378 @param aDes The 8-bit non-modifable descriptor whose data is to be compared 
       
   379             with this descriptor's data. 
       
   380             
       
   381 @return True if greater than, false otherwise. 
       
   382 
       
   383 @see TDesC8::Compare
       
   384 */
       
   385 	{return(Compare(aDes)>0);}
       
   386 
       
   387 
       
   388 
       
   389 
       
   390 inline TBool TDesC8::operator>=(const TDesC8 &aDes) const
       
   391 /**
       
   392 Determines whether this descriptor's data is greater than or equal to the
       
   393 specified descriptor's data.
       
   394 
       
   395 The comparison is implemented using the Compare() member function.
       
   396 
       
   397 @param aDes The 8-bit non-modifable descriptor whose data is to be compared 
       
   398             with this descriptor's data. 
       
   399             
       
   400 @return True if greater than, false otherwise.
       
   401 
       
   402 @see TDesC8::Compare
       
   403 */
       
   404 	{return(Compare(aDes)>=0);}
       
   405 
       
   406 
       
   407 
       
   408 
       
   409 inline TBool TDesC8::operator==(const TDesC8 &aDes) const
       
   410 /**
       
   411 Determines whether this descriptor's data is equal to the specified
       
   412 descriptor's data.
       
   413 
       
   414 The comparison is implemented using the Compare() member function.
       
   415 
       
   416 @param aDes The 8-bit non-modifable descriptor whose data is to be compared 
       
   417             with this descriptor's data. 
       
   418             
       
   419 @return True if equal, false otherwise. 
       
   420 
       
   421 @see TDesC8::Compare
       
   422 */
       
   423 	{return(Compare(aDes)==0);}
       
   424 
       
   425 
       
   426 
       
   427 
       
   428 inline TBool TDesC8::operator!=(const TDesC8 &aDes) const
       
   429 /**
       
   430 Determines whether this descriptor's data is not equal to the specified
       
   431 descriptor's data.
       
   432 
       
   433 The comparison is implemented using the Compare() member function.
       
   434 
       
   435 @param aDes The 8-bit non-modifable descriptor whose data is to be compared 
       
   436             with this descriptor's data. 
       
   437             
       
   438 @return True if not equal, false otherwise. 
       
   439 
       
   440 @see TDesC8::Compare
       
   441 */
       
   442 	{return(Compare(aDes)!=0);}
       
   443 
       
   444 
       
   445 
       
   446 
       
   447 inline const TUint8 &TDesC8::operator[](TInt anIndex) const
       
   448 /**
       
   449 Gets a reference to a single data item within this descriptor's data.
       
   450 
       
   451 @param anIndex The position of the individual data item within the descriptor's 
       
   452                data. This is an offset value; a zero value refers to the
       
   453                leftmost data position. 
       
   454                
       
   455 @return A reference to the data item.
       
   456 
       
   457 @panic USER 21, if anIndex is negative or greater than or equal to the current
       
   458                 length of the descriptor.
       
   459 */
       
   460 	{return(AtC(anIndex));}
       
   461 
       
   462 
       
   463 
       
   464 
       
   465 inline TInt TDesC8::Length() const
       
   466 /**
       
   467 Gets the length of the data.
       
   468 
       
   469 This is the number of 8-bit values or data items represented by the descriptor.
       
   470 
       
   471 @return The length of the data represented by the descriptor.
       
   472 */
       
   473 	{return(iLength&KMaskDesLength8);}
       
   474 
       
   475 
       
   476 
       
   477 
       
   478 inline TInt TDesC8::Size() const
       
   479 /**
       
   480 Gets the size of the data.
       
   481 
       
   482 This is the number of bytes occupied by the data represented by the descriptor.
       
   483 
       
   484 @return The size of the data represented by the descriptor.
       
   485 */
       
   486 	{return(Length());}
       
   487 
       
   488 
       
   489 
       
   490 
       
   491 inline void TDesC8::DoSetLength(TInt aLength)
       
   492 	{iLength=(iLength&(~KMaskDesLength8))|aLength;}
       
   493 
       
   494 
       
   495 
       
   496 
       
   497 // Class TPtrC8
       
   498 inline void TPtrC8::Set(const TUint8 *aBuf,TInt aLength)
       
   499 /**
       
   500 Sets the 8-bit non-modifiable pointer descriptor to point to the specified 
       
   501 location in memory, whether in RAM or ROM.
       
   502 
       
   503 The length of the descriptor is set to the specified length.
       
   504 
       
   505 @param aBuf    A pointer to the location that the descriptor is to represent.
       
   506 @param aLength The length of the descriptor. This value must be non-negative.
       
   507 
       
   508 @panic USER 29, if aLength is negative.
       
   509 */
       
   510 	{new(this) TPtrC8(aBuf,aLength);}
       
   511 
       
   512 
       
   513 
       
   514 
       
   515 inline void TPtrC8::Set(const TDesC8 &aDes)
       
   516 /**
       
   517 Sets the 8-bit non-modifiable pointer descriptor from the specified descriptor.
       
   518 
       
   519 It is set to point to the same data and is given the same length.
       
   520 
       
   521 @param aDes A reference to an 8-bit non-modifiable descriptor.
       
   522 */
       
   523 	{new(this) TPtrC8(aDes);}
       
   524 
       
   525 
       
   526 
       
   527 
       
   528 inline void TPtrC8::Set(const TPtrC8& aPtr)
       
   529 /**
       
   530 Sets the 8-bit non-modifiable pointer descriptor from the specified
       
   531 non-modifiable pointer descriptor.
       
   532 
       
   533 It is set to point to the same data and is given the same length.
       
   534 
       
   535 @param aPtr A reference to an 8-bit non-modifiable pointer descriptor.
       
   536 */
       
   537 	{new(this) TPtrC8(aPtr);}
       
   538 
       
   539 
       
   540 
       
   541 
       
   542 
       
   543 // class TBufCBase8
       
   544 inline TPtr8 TBufCBase8::DoDes(TInt aMaxLength)
       
   545 	{return TPtr8(*this,aMaxLength);}
       
   546 
       
   547 
       
   548 
       
   549 
       
   550 // Template class TBufC8
       
   551 template <TInt S>
       
   552 inline TBufC8<S>::TBufC8()
       
   553 	: TBufCBase8()
       
   554 /** 
       
   555 Constructs an empty 8-bit non-modifiable buffer descriptor.
       
   556 
       
   557 It contains no data.
       
   558 
       
   559 The integer template parameter determines the size of the data area which 
       
   560 is created as part of the buffer descriptor object.
       
   561 
       
   562 Data can, subsequently, be assigned into this buffer descriptor using the 
       
   563 assignment operators.
       
   564 
       
   565 @see TBufC8::operator=
       
   566 */
       
   567 	{}
       
   568 
       
   569 
       
   570 
       
   571 
       
   572 template <TInt S>
       
   573 inline TBufC8<S>::TBufC8(const TUint8 *aString)
       
   574 	: TBufCBase8(aString,S)
       
   575 /**
       
   576 Constructs the 8-bit non-modifiable buffer descriptor from a zero terminated 
       
   577 string.
       
   578 
       
   579 The integer template parameter determines the size of the data area which 
       
   580 is created as part of this object.
       
   581 
       
   582 The string, excluding the zero terminator, is copied into this buffer descriptor's 
       
   583 data area. The length of this buffer descriptor is set to the length of the 
       
   584 string, excluding the zero terminator.
       
   585 
       
   586 @param aString A pointer to a zero terminated string.
       
   587 
       
   588 @panic USER 20, if the length of the string, excluding the zero terminator, is
       
   589                 greater than the value of the integer template parameter.
       
   590 */
       
   591 	{}
       
   592 
       
   593 
       
   594 
       
   595 
       
   596 template <TInt S>
       
   597 inline TBufC8<S>::TBufC8(const TDesC8 &aDes)
       
   598 	: TBufCBase8(aDes,S)
       
   599 /**
       
   600 Constructs the 8-bit non-modifiable buffer descriptor from any
       
   601 existing descriptor.
       
   602 
       
   603 The integer template parameter determines the size of the data area which 
       
   604 is created as part of this object.
       
   605 
       
   606 Data is copied from the source descriptor into this buffer descriptor and 
       
   607 the length of this buffer descriptor is set to the length of the
       
   608 source descriptor.
       
   609 
       
   610 @param aDes The source 8-bit non-modifiable descriptor.
       
   611 
       
   612 @panic USER 20, if the length of the source descriptor is
       
   613                 greater than the value of the integer template parameter.
       
   614 */
       
   615 	{}
       
   616 
       
   617 
       
   618 
       
   619 
       
   620 template <TInt S>
       
   621 inline TBufC8<S> &TBufC8<S>::operator=(const TUint8 *aString)
       
   622 /**
       
   623 Copies data into this descriptor, replacing any existing data.
       
   624 
       
   625 The length of this descriptor is set to reflect the new data.
       
   626 
       
   627 @param aString A pointer to a zero-terminated string. 
       
   628 
       
   629 @return A reference to this descriptor.
       
   630 
       
   631 @panic USER 23, if the length of the string, excluding the zero terminator, is
       
   632                 greater than the maximum length of this (target) descriptor.
       
   633 */
       
   634 	{Copy(aString,S);return(*this);}
       
   635 
       
   636 
       
   637 
       
   638 
       
   639 template <TInt S>
       
   640 inline TBufC8<S> &TBufC8<S>::operator=(const TDesC8 &aDes)
       
   641 /**
       
   642 Copies data into this descriptor, replacing any existing data.
       
   643 
       
   644 The length of this descriptor is set to reflect the new data.
       
   645 
       
   646 @param aDes An 8-bit non-modifiable descriptor. 
       
   647 
       
   648 @return A reference to this descriptor.
       
   649 
       
   650 @panic USER 23, if the length of the descriptor aDes is
       
   651                 greater than the maximum length of this (target) descriptor.
       
   652 */
       
   653 	{Copy(aDes,S);return(*this);}
       
   654 
       
   655 
       
   656 
       
   657 
       
   658 template <TInt S>
       
   659 inline TPtr8 TBufC8<S>::Des()
       
   660 /**
       
   661 Creates and returns an 8-bit modifiable pointer descriptor for the data
       
   662 represented by this 8-bit non-modifiable buffer descriptor.
       
   663 
       
   664 The content of a non-modifiable buffer descriptor normally cannot be altered, 
       
   665 other than by complete replacement of the data. Creating a modifiable pointer 
       
   666 descriptor provides a way of changing the data.
       
   667 
       
   668 The modifiable pointer descriptor is set to point to this non-modifiable buffer 
       
   669 descriptor's data.
       
   670 
       
   671 The length of the modifiable pointer descriptor is set to the length of this 
       
   672 non-modifiable buffer descriptor.
       
   673 
       
   674 The maximum length of the modifiable pointer descriptor is set to the value 
       
   675 of the integer template parameter.
       
   676 
       
   677 When data is modified through this new pointer descriptor, the lengths of 
       
   678 both it and this constant buffer descriptor are changed.
       
   679 
       
   680 @return An 8-bit modifiable pointer descriptor representing the data in this 
       
   681         8-bit non-modifiable buffer descriptor.
       
   682 */
       
   683 	{return DoDes(S);}
       
   684 
       
   685 
       
   686 
       
   687 
       
   688 #ifndef __KERNEL_MODE__
       
   689 // Class HBufC8
       
   690 inline HBufC8 &HBufC8::operator=(const HBufC8 &aLcb)
       
   691 /**
       
   692 Copies data into this 8-bit heap descriptor replacing any existing data.
       
   693 
       
   694 The length of this descriptor is set to reflect the new data.
       
   695 
       
   696 Note that the maximum length of this (target) descriptor is the length
       
   697 of the descriptor buffer in the allocated host heap cell; this may be greater
       
   698 than the maximum length specified when this descriptor was created or
       
   699 last re-allocated.
       
   700 
       
   701 @param aLcb The source 8-bit heap descriptor.
       
   702 
       
   703 @return A reference to this 8-bit heap descriptor.
       
   704 
       
   705 @panic USER 23, if the length of the descriptor aLcb is greater than the
       
   706                 maximum length of this (target) descriptor
       
   707 */
       
   708 	{return *this=static_cast<const TDesC8&>(aLcb);}
       
   709 
       
   710 
       
   711 
       
   712 
       
   713 // Class RBuf8
       
   714 inline RBuf8& RBuf8::operator=(const TUint8* aString)
       
   715 /**
       
   716 Copies data into this descriptor replacing any existing data.
       
   717 
       
   718 The length of this descriptor is set to reflect the new data.
       
   719 
       
   720 @param aString A pointer to a zero-terminated string.
       
   721 
       
   722 @return A reference to this, the target descriptor.
       
   723 
       
   724 @panic USER 11, if the length of the string, excluding the zero terminator, is
       
   725                 greater than the maximum length of this (target) descriptor.
       
   726 */
       
   727     {Copy(aString);return(*this);}
       
   728 
       
   729 
       
   730 
       
   731 
       
   732 inline RBuf8& RBuf8::operator=(const TDesC8& aDes)
       
   733 /**
       
   734 Copies data into this descriptor replacing any existing data.
       
   735 
       
   736 The length of this descriptor is set to reflect the new data.
       
   737 
       
   738 @param aDes An 8-bit non-modifiable descriptor.
       
   739 
       
   740 @return A reference to this, the target descriptor.
       
   741 
       
   742 @panic USER 11, if the length of the descriptor aDes is greater than the
       
   743                 maximum length of this (target) descriptor.
       
   744 */
       
   745     {Copy(aDes);return(*this);}
       
   746 
       
   747 
       
   748 
       
   749 
       
   750 inline RBuf8& RBuf8::operator=(const RBuf8& aDes)
       
   751 /**
       
   752 Copies data into this descriptor replacing any existing data.
       
   753 
       
   754 The length of this descriptor is set to reflect the new data.
       
   755 
       
   756 @param aDes A 8-bit buffer descriptor.
       
   757 
       
   758 @return A reference to this, the target descriptor.
       
   759 
       
   760 @panic USER 11, if the length of the descriptor aDes is greater than the
       
   761                 maximum length of this (target) descriptor.
       
   762 */
       
   763     {Copy(aDes);return(*this);}
       
   764 
       
   765 
       
   766 
       
   767 
       
   768 /**
       
   769 Creates an 8-bit resizable buffer descriptor that has been initialised with
       
   770 data from the specified read stream; leaves on failure.
       
   771 			 
       
   772 Data is assigned to the new descriptor from the specified stream.
       
   773 This variant assumes that the stream contains the length of the data followed
       
   774 by the data itself.
       
   775 
       
   776 The function is implemented by calling the HBufC8::NewL(RReadStream&amp;,TInt)
       
   777 variant and then assigning the resulting heap descriptor using
       
   778 the RBuf8::Assign(HBufC8*) variant. The comments that describe
       
   779 the HBufC8::NewL() variant	also apply to this RBuf8::CreateL() function.
       
   780 
       
   781 The function may leave with one of the system-wide error codes,	specifically 
       
   782 KErrOverflow, if the length of the data as read from the stream is greater than
       
   783 the upper limit as specified by the aMaxLength parameter.
       
   784 
       
   785 @param aStream    The stream from which the data length and the data to be
       
   786                   assigned to the new descriptor, are taken.
       
   787 @param aMaxLength The upper limit on the length of data that the descriptor is
       
   788                   to represent. The value of this parameter must be non-negative
       
   789                   otherwise the	underlying function will panic.
       
   790 */
       
   791 inline void RBuf8::CreateL(RReadStream &aStream,TInt aMaxLength)
       
   792 	{
       
   793 	Assign(HBufC8::NewL(aStream,aMaxLength));
       
   794 	}
       
   795 #endif
       
   796 
       
   797 
       
   798 
       
   799 
       
   800 // Class TDes8
       
   801 inline TDes8 &TDes8::operator=(const TUint8 *aString)
       
   802 /**
       
   803 Copies data into this descriptor replacing any existing data.
       
   804 
       
   805 The length of this descriptor is set to reflect the new data.
       
   806 
       
   807 @param aString A pointer to a zero-terminated string.
       
   808 
       
   809 @return A reference to this, the target descriptor.
       
   810 
       
   811 @panic USER 23, if the length of the string, excluding the zero terminator, is
       
   812                 greater than the maximum length of this (target) descriptor.
       
   813 */
       
   814     {Copy(aString);return(*this);}
       
   815 
       
   816 
       
   817 
       
   818 
       
   819 inline TDes8 &TDes8::operator=(const TDesC8 &aDes)
       
   820 /**
       
   821 Copies data into this descriptor replacing any existing data.
       
   822 
       
   823 The length of this descriptor is set to reflect the new data.
       
   824 
       
   825 @param aDes An 8-bit non-modifiable descriptor. 
       
   826  
       
   827 @return A reference to this, the target descriptor.
       
   828 
       
   829 @panic USER 23, if the length of the descriptor aDes is greater than the
       
   830                 maximum length of this (target) descriptor.
       
   831 */
       
   832     {Copy(aDes);return(*this);}
       
   833 
       
   834 
       
   835 
       
   836 
       
   837 inline TDes8 &TDes8::operator=(const TDes8 &aDes)
       
   838 /**
       
   839 Copies data into this descriptor replacing any existing data.
       
   840 
       
   841 The length of this descriptor is set to reflect the new data.
       
   842 
       
   843 @param aDes An 8-bit modifiable descriptor.
       
   844 
       
   845 @return A reference to this, the target descriptor.
       
   846 
       
   847 @panic USER 23, if the length of the descriptor aDes is greater than the
       
   848                 maximum length of this (target) descriptor.
       
   849 */
       
   850     {Copy(aDes);return(*this);}
       
   851 
       
   852 
       
   853 
       
   854 
       
   855 inline TDes8 &TDes8::operator+=(const TDesC8 &aDes)
       
   856 /**
       
   857 Appends data onto the end of this descriptor's data and returns a reference 
       
   858 to this descriptor.
       
   859 
       
   860 The length of this descriptor is incremented to reflect the new content.
       
   861 
       
   862 @param aDes An-8 bit non-modifiable descriptor whose data is to be appended.
       
   863 
       
   864 @return A reference to this descriptor.
       
   865 
       
   866 @panic USER 23, if the resulting length of this descriptor is greater than its
       
   867                 maximum length.  
       
   868 */
       
   869 	{Append(aDes);return(*this);}
       
   870 
       
   871 
       
   872 
       
   873 
       
   874 inline const TUint8 &TDes8::operator[](TInt anIndex) const
       
   875 /**
       
   876 Gets a const reference to a single data item within this descriptor's data.
       
   877 
       
   878 @param anIndex The position of the data item within this descriptor's data.
       
   879                This is an offset value; a zero value refers to the leftmost
       
   880 			   data position.
       
   881 
       
   882 @return A const reference to the data item at the specified position. 
       
   883 
       
   884 @panic USER 21, if anIndex is negative or is greater than or equal to the
       
   885                 current length of this descriptor.
       
   886 */
       
   887 	{return(AtC(anIndex));}
       
   888 
       
   889 
       
   890 
       
   891 
       
   892 inline TUint8 &TDes8::operator[](TInt anIndex)
       
   893 /**
       
   894 Gets a non-const reference to a single data item within this descriptor's 
       
   895 data.
       
   896 
       
   897 @param anIndex The position of the data item within this descriptor's data.
       
   898                This is an offset value; a zero value refers to the leftmost
       
   899 			   data position.
       
   900 
       
   901 @return A non-const reference to the data item at the specified position.
       
   902 
       
   903 @panic USER 21, if anIndex is negative or is greater than or equal to the
       
   904                 current length of this descriptor.
       
   905 */
       
   906 	{return((TUint8 &)AtC(anIndex));}
       
   907 
       
   908 
       
   909 
       
   910 
       
   911 inline TInt TDes8::MaxLength() const
       
   912 /**
       
   913 Gets the maximum length of the descriptor.
       
   914 
       
   915 This is the upper limit for the number of 8-bit values or data items that
       
   916 the descriptor can represent.
       
   917 
       
   918 @return The maximum length of data that the descriptor can represent.
       
   919 */
       
   920 	{return(iMaxLength);}
       
   921 
       
   922 
       
   923 
       
   924 
       
   925 inline TInt TDes8::MaxSize() const
       
   926 /**
       
   927 Gets the maximum size of the descriptor.
       
   928 
       
   929 This is the upper limit for the number of bytes which the data represented by
       
   930 the descriptor can occupy.
       
   931 
       
   932 @return The maximum size of the descriptor data.
       
   933 */
       
   934 	{return(iMaxLength);}
       
   935 
       
   936 
       
   937 
       
   938 
       
   939 inline TUint8 * TDes8::WPtr() const
       
   940 	{return((TUint8 *)Ptr());}
       
   941 
       
   942 
       
   943 
       
   944 
       
   945 // Class TPtr8
       
   946 inline TPtr8 &TPtr8::operator=(const TUint8 *aString)
       
   947 /**
       
   948 Copies data into this 8-bit modifiable pointer descriptor replacing any
       
   949 existing data.
       
   950 
       
   951 The length of this descriptor is set to reflect the new data.
       
   952 
       
   953 @param aString A pointer to a zero-terminated string.
       
   954 
       
   955 @return A reference to this 8-bit modifiable pointer descriptor.
       
   956 
       
   957 @panic USER 23, if the length of the string, excluding the zero terminator, is
       
   958                 greater than the maximum length of this descriptor.
       
   959 */
       
   960 	{Copy(aString);return(*this);}
       
   961 
       
   962 
       
   963 
       
   964 
       
   965 inline TPtr8 &TPtr8::operator=(const TDesC8 &aDes)
       
   966 /**
       
   967 Copies data into this 8-bit modifiable pointer descriptor replacing any
       
   968 existing data.
       
   969 
       
   970 The length of this descriptor is set to reflect the new data.
       
   971 
       
   972 @param aDes An 8-bit modifiable pointer descriptor whose data is to be copied 
       
   973             into this descriptor.
       
   974 
       
   975 @return A reference to this 8-bit modifiable pointer descriptor.
       
   976 
       
   977 @panic USER 23, if the length of aDes is greater than the maximum 
       
   978                 length of this descriptor.
       
   979 */
       
   980 	{Copy(aDes);return(*this);}
       
   981 
       
   982 
       
   983 
       
   984 
       
   985 inline TPtr8 &TPtr8::operator=(const TPtr8 &aDes)
       
   986 /**
       
   987 Copies data into this 8-bit modifiable pointer descriptor replacing any
       
   988 existing data.
       
   989 
       
   990 The length of this descriptor is set to reflect the new data.
       
   991 
       
   992 @param aDes An 8-bit modifiable pointer descriptor whose data is to be copied
       
   993             into this descriptor.
       
   994 
       
   995 @return A reference to this 8-bit modifiable pointer descriptor.
       
   996 
       
   997 @panic USER 23, if the length of aDes is greater than the maximum 
       
   998                 length of this descriptor.
       
   999 */
       
  1000 	{Copy(aDes);return(*this);}
       
  1001 
       
  1002 
       
  1003 
       
  1004 
       
  1005 inline void TPtr8::Set(TUint8 *aBuf,TInt aLength,TInt aMaxLength)
       
  1006 /**
       
  1007 Sets the 8-bit modifiable pointer descriptor to point to the specified location
       
  1008 in memory, whether in RAM or ROM.
       
  1009 
       
  1010 The length of the descriptor and its maximum length are set to the specified
       
  1011 values.
       
  1012 
       
  1013 @param aBuf       A pointer to the location that the descriptor is to represent.
       
  1014 @param aLength    The length of the descriptor.
       
  1015 @param aMaxLength The maximum length of the descriptor.
       
  1016 
       
  1017 @panic USER 20, if aLength is negative or is greater than the maximum length of
       
  1018                 this descriptor.
       
  1019 @panic USER 30, if aMaxLength is negative.
       
  1020 */
       
  1021 	{new(this) TPtr8(aBuf,aLength,aMaxLength);}
       
  1022 
       
  1023 
       
  1024 
       
  1025 
       
  1026 inline void TPtr8::Set(const TPtr8 &aPtr)
       
  1027 /**
       
  1028 Sets the 8-bit modifiable pointer descriptor from an existing 8-bit modifiable
       
  1029 pointer descriptor.
       
  1030   
       
  1031 It is set to point to the same data, is given the same length and the same
       
  1032 maximum length as the source pointer descriptor.
       
  1033 
       
  1034 @param aPtr The source 8-bit modifiable pointer descriptor.
       
  1035 */
       
  1036 	{new(this) TPtr8(aPtr);}
       
  1037 
       
  1038 
       
  1039 
       
  1040 
       
  1041 // Template class TBuf8
       
  1042 template <TInt S>
       
  1043 inline TBuf8<S>::TBuf8()
       
  1044 	: TBufBase8(S)
       
  1045 /**
       
  1046 Constructs an empty 8-bit modifiable buffer descriptor.
       
  1047 
       
  1048 It contains no data.
       
  1049 
       
  1050 The integer template parameter determines the size of the data area that is created 
       
  1051 as part of the object, and defines the descriptor's maximum length.
       
  1052 */
       
  1053 	{}
       
  1054 
       
  1055 
       
  1056 
       
  1057 
       
  1058 template <TInt S>
       
  1059 inline TBuf8<S>::TBuf8(TInt aLength)
       
  1060 	: TBufBase8(aLength,S)
       
  1061 /**
       
  1062 Constructs an empty 8-bit modifiable buffer descriptor and sets the its length 
       
  1063 to the specified value.
       
  1064 
       
  1065 No data is assigned to the descriptor.
       
  1066 
       
  1067 The integer template parameter determines the size of the data area that is created 
       
  1068 as part of the object, and defines the descriptor's maximum length.
       
  1069 
       
  1070 @param aLength The length of this modifiable buffer descriptor.
       
  1071 
       
  1072 @panic USER 20, if aLength is negative or is greater than the 
       
  1073                 value of the integer template parameter.
       
  1074 */
       
  1075 	{}
       
  1076 
       
  1077 
       
  1078 
       
  1079 
       
  1080 template <TInt S>
       
  1081 inline TBuf8<S>::TBuf8(const TUint8 *aString)
       
  1082 	: TBufBase8(aString,S)
       
  1083 /**
       
  1084 Constructs the 8-bit modifiable buffer descriptor from a
       
  1085 zero terminated string.
       
  1086 
       
  1087 The integer template parameter determines the size of the data area that
       
  1088 is created as part of the object, and defines the descriptor's maximum length.
       
  1089 
       
  1090 The string, excluding the zero terminator, is copied into this buffer
       
  1091 descriptor's data area. The length of this buffer descriptor is set to the
       
  1092 length of the string, excluding the zero terminator.
       
  1093 
       
  1094 @param aString A pointer to a zero terminated string.
       
  1095 
       
  1096 @panic USER 23, if the length of the string, excluding the zero terminator,
       
  1097                 is greater than the value of the integer template parameter.
       
  1098 */
       
  1099 	{}
       
  1100 
       
  1101 
       
  1102 
       
  1103 
       
  1104 template <TInt S>
       
  1105 inline TBuf8<S>::TBuf8(const TDesC8 &aDes)
       
  1106 	: TBufBase8(aDes,S)
       
  1107 /**
       
  1108 Constructs the 8-bit modifiable buffer descriptor from any existing
       
  1109 8-bit descriptor.
       
  1110 
       
  1111 The integer template parameter determines the size of the data area created 
       
  1112 as part of this object and defines the descriptor's maximum length.
       
  1113 
       
  1114 Data is copied from the source descriptor into this modifiable buffer
       
  1115 descriptor and the length of this modifiable buffer descriptor is set to
       
  1116 the length of the source descriptor.
       
  1117 
       
  1118 @param aDes The source 8-bit non-modifiable descriptor.
       
  1119 
       
  1120 @panic USER 23, if the length of the source descriptor is greater than the
       
  1121                 value of the integer template parameter.
       
  1122 */
       
  1123 	{}
       
  1124 
       
  1125 
       
  1126 
       
  1127 
       
  1128 template <TInt S>
       
  1129 inline TBuf8<S> &TBuf8<S>::operator=(const TUint8 *aString)
       
  1130 /**
       
  1131 Copies data into this 8-bit modifiable buffer descriptor, replacing any
       
  1132 existing data.
       
  1133 
       
  1134 The length of this descriptor is set to reflect the new data.
       
  1135 
       
  1136 @param aString A pointer to a zero-terminated string.
       
  1137 
       
  1138 @return A reference to this 8-bit modifiable buffer descriptor. 
       
  1139 
       
  1140 @panic USER 23, if the length of the string, excluding the zero terminator,
       
  1141                 is greater than the maximum length of this (target) descriptor.
       
  1142 */
       
  1143 	{Copy(aString);return(*this);}
       
  1144 
       
  1145 
       
  1146 
       
  1147 
       
  1148 template <TInt S>
       
  1149 inline TBuf8<S> &TBuf8<S>::operator=(const TDesC8 &aDes)
       
  1150 /**
       
  1151 Copies data into this 8-bit modifiable buffer descriptor, replacing any
       
  1152 existing data.
       
  1153 
       
  1154 The length of this descriptor is set to reflect the new data.
       
  1155 
       
  1156 @param aDes An 8 bit non-modifiable descriptor.
       
  1157 
       
  1158 @return A reference to this 8-bit modifiable buffer descriptor. 
       
  1159 
       
  1160 @panic USER 23, if the length of the descriptor aDes is greater than the
       
  1161                 maximum length of this (target) descriptor.
       
  1162 */
       
  1163 	{Copy(aDes);return(*this);}
       
  1164 
       
  1165 
       
  1166 
       
  1167 
       
  1168 template <TInt S>
       
  1169 inline TBuf8<S>& TBuf8<S>::operator=(const TBuf8<S>& aBuf)
       
  1170 /**
       
  1171 Copies data into this 8-bit modifiable buffer descriptor replacing any
       
  1172 existing data.
       
  1173 
       
  1174 The length of this descriptor is set to reflect the new data.
       
  1175 
       
  1176 @param aBuf The source 8-bit modifiable buffer descriptor with the same
       
  1177             template value.
       
  1178 
       
  1179 @return A reference to this 8-bit modifiable buffer descriptor. 
       
  1180 */
       
  1181 	{Copy(aBuf);return *this;}
       
  1182 
       
  1183 
       
  1184 
       
  1185 
       
  1186 // Template class TAlignedBuf8
       
  1187 template <TInt S>
       
  1188 inline TAlignedBuf8<S>::TAlignedBuf8()
       
  1189 	: TBufBase8(S)
       
  1190 /**
       
  1191 Constructs an empty 8-bit modifiable buffer descriptor.
       
  1192 
       
  1193 It contains no data.
       
  1194 
       
  1195 The integer template parameter determines the size of the data area that is created 
       
  1196 as part of the object, and defines the descriptor's maximum length.
       
  1197 */
       
  1198 	{}
       
  1199 
       
  1200 
       
  1201 
       
  1202 
       
  1203 template <TInt S>
       
  1204 inline TAlignedBuf8<S>::TAlignedBuf8(TInt aLength)
       
  1205 	: TBufBase8(aLength,S)
       
  1206 /**
       
  1207 Constructs an empty 8-bit modifiable buffer descriptor and sets the its length 
       
  1208 to the specified value.
       
  1209 
       
  1210 No data is assigned to the descriptor.
       
  1211 
       
  1212 The integer template parameter determines the size of the data area that is created 
       
  1213 as part of the object, and defines the descriptor's maximum length.
       
  1214 
       
  1215 @param aLength The length of this modifiable buffer descriptor.
       
  1216 
       
  1217 @panic USER 20, if aLength is negative or is greater than the 
       
  1218                 value of the integer template parameter.
       
  1219 */
       
  1220 	{}
       
  1221 
       
  1222 
       
  1223 
       
  1224 
       
  1225 template <TInt S>
       
  1226 inline TAlignedBuf8<S>::TAlignedBuf8(const TUint8 *aString)
       
  1227 	: TBufBase8(aString,S)
       
  1228 /**
       
  1229 Constructs the 8-bit modifiable buffer descriptor from a
       
  1230 zero terminated string.
       
  1231 
       
  1232 The integer template parameter determines the size of the data area that
       
  1233 is created as part of the object, and defines the descriptor's maximum length.
       
  1234 
       
  1235 The string, excluding the zero terminator, is copied into this buffer
       
  1236 descriptor's data area. The length of this buffer descriptor is set to the
       
  1237 length of the string, excluding the zero terminator.
       
  1238 
       
  1239 @param aString A pointer to a zero terminated string.
       
  1240 
       
  1241 @panic USER 23, if the length of the string, excluding the zero terminator,
       
  1242                 is greater than the value of the integer template parameter.
       
  1243 */
       
  1244 	{}
       
  1245 
       
  1246 
       
  1247 
       
  1248 
       
  1249 template <TInt S>
       
  1250 inline TAlignedBuf8<S>::TAlignedBuf8(const TDesC8 &aDes)
       
  1251 	: TBufBase8(aDes,S)
       
  1252 /**
       
  1253 Constructs the 8-bit modifiable buffer descriptor from any existing
       
  1254 8-bit descriptor.
       
  1255 
       
  1256 The integer template parameter determines the size of the data area created 
       
  1257 as part of this object and defines the descriptor's maximum length.
       
  1258 
       
  1259 Data is copied from the source descriptor into this modifiable buffer
       
  1260 descriptor and the length of this modifiable buffer descriptor is set to
       
  1261 the length of the source descriptor.
       
  1262 
       
  1263 @param aDes The source 8-bit non-modifiable descriptor.
       
  1264 
       
  1265 @panic USER 23, if the length of the source descriptor is greater than the
       
  1266                 value of the integer template parameter.
       
  1267 */
       
  1268 	{}
       
  1269 
       
  1270 
       
  1271 
       
  1272 
       
  1273 template <TInt S>
       
  1274 inline TAlignedBuf8<S> &TAlignedBuf8<S>::operator=(const TUint8 *aString)
       
  1275 /**
       
  1276 Copies data into this 8-bit modifiable buffer descriptor, replacing any
       
  1277 existing data.
       
  1278 
       
  1279 The length of this descriptor is set to reflect the new data.
       
  1280 
       
  1281 @param aString A pointer to a zero-terminated string.
       
  1282 
       
  1283 @return A reference to this 8-bit modifiable buffer descriptor. 
       
  1284 
       
  1285 @panic USER 23, if the length of the string, excluding the zero terminator,
       
  1286                 is greater than the maximum length of this (target) descriptor.
       
  1287 */
       
  1288 	{Copy(aString);return(*this);}
       
  1289 
       
  1290 
       
  1291 
       
  1292 
       
  1293 template <TInt S>
       
  1294 inline TAlignedBuf8<S> &TAlignedBuf8<S>::operator=(const TDesC8 &aDes)
       
  1295 /**
       
  1296 Copies data into this 8-bit modifiable buffer descriptor, replacing any
       
  1297 existing data.
       
  1298 
       
  1299 The length of this descriptor is set to reflect the new data.
       
  1300 
       
  1301 @param aDes An 8 bit non-modifiable descriptor.
       
  1302 
       
  1303 @return A reference to this 8-bit modifiable buffer descriptor. 
       
  1304 
       
  1305 @panic USER 23, if the length of the descriptor aDes is greater than the
       
  1306                 maximum length of this (target) descriptor.
       
  1307 */
       
  1308 	{Copy(aDes);return(*this);}
       
  1309 
       
  1310 
       
  1311 
       
  1312 
       
  1313 template <TInt S>
       
  1314 inline TAlignedBuf8<S>& TAlignedBuf8<S>::operator=(const TAlignedBuf8<S>& aBuf)
       
  1315 /**
       
  1316 Copies data into this 8-bit modifiable buffer descriptor replacing any
       
  1317 existing data.
       
  1318 
       
  1319 The length of this descriptor is set to reflect the new data.
       
  1320 
       
  1321 @param aBuf The source 8-bit modifiable buffer descriptor with the same
       
  1322             template value.
       
  1323 
       
  1324 @return A reference to this 8-bit modifiable buffer descriptor. 
       
  1325 */
       
  1326 	{Copy(aBuf);return *this;}
       
  1327 
       
  1328 
       
  1329 
       
  1330 
       
  1331 // Template class TLitC8
       
  1332 template <TInt S>
       
  1333 inline const TDesC8* TLitC8<S>::operator&() const
       
  1334 /**
       
  1335 Returns a const TDesC8 type pointer.
       
  1336 
       
  1337 @return A descriptor type pointer to this literal. 
       
  1338 */
       
  1339 	{return REINTERPRET_CAST(const TDesC8*,this);}
       
  1340 
       
  1341 
       
  1342 
       
  1343 
       
  1344 template <TInt S>
       
  1345 inline const TDesC8& TLitC8<S>::operator()() const
       
  1346 /**
       
  1347 Returns a const TDesC8 type reference.
       
  1348 
       
  1349 @return A descriptor type reference to this literal 
       
  1350 */
       
  1351 	{return *operator&();}
       
  1352 
       
  1353 
       
  1354 
       
  1355 
       
  1356 template <TInt S>
       
  1357 inline TLitC8<S>::operator const TDesC8&() const
       
  1358 /**
       
  1359 Invoked by the compiler when a TLitC8<TInt> type is passed to a function
       
  1360 which is prototyped to take a const TDesC8& type.
       
  1361 */
       
  1362 	{return *operator&();}
       
  1363 
       
  1364 
       
  1365 
       
  1366 template <TInt S>
       
  1367 inline TLitC8<S>::operator const __TRefDesC8() const
       
  1368 /**
       
  1369 Invoked by the compiler when a TLitC8<TInt> type is passed to a function
       
  1370 which is prototyped to take a const TRefByValue<const TDesC8> type.
       
  1371 
       
  1372 @see __TRefDesC8
       
  1373 */
       
  1374 	{return *operator&();}
       
  1375 
       
  1376 
       
  1377 
       
  1378 
       
  1379 #ifndef __KERNEL_MODE__
       
  1380 // Class TDesC16
       
  1381 inline TBool TDesC16::operator<(const TDesC16 &aDes) const
       
  1382 /**
       
  1383 Determines whether this descriptor's data is less than the specified descriptor's 
       
  1384 data.
       
  1385 
       
  1386 The comparison is implemented using the Compare() member function.
       
  1387 
       
  1388 @param aDes The 16-bit non-modifable descriptor whose data is to be compared 
       
  1389             with this descriptor's data. 
       
  1390 
       
  1391 @return True if less than, false otherwise. 
       
  1392 
       
  1393 @see TDesC16::Compare
       
  1394 */
       
  1395 	{return(Compare(aDes)<0);}
       
  1396 
       
  1397 
       
  1398 
       
  1399 
       
  1400 inline TBool TDesC16::operator<=(const TDesC16 &aDes) const
       
  1401 /**
       
  1402 Determines whether this descriptor's data is less than or equal
       
  1403 to the specified descriptor's data.
       
  1404 
       
  1405 The comparison is implemented using the Compare() member function.
       
  1406 
       
  1407 @param aDes The 16-bit non- modifiable descriptor whose data is to be compared 
       
  1408             with this descriptor's data. 
       
  1409 
       
  1410 @return True if less than or equal, false otherwise. 
       
  1411 
       
  1412 @see TDesC16::Compare
       
  1413 */
       
  1414 	{return(Compare(aDes)<=0);}
       
  1415 
       
  1416 
       
  1417 
       
  1418 
       
  1419 inline TBool TDesC16::operator>(const TDesC16 &aDes) const
       
  1420 /**
       
  1421 Determines whether this descriptor's data is greater than the specified
       
  1422 descriptor's data.
       
  1423 
       
  1424 The comparison is implemented using the Compare() member function.
       
  1425 
       
  1426 @param aDes The 16-bit non-modifiable descriptor whose data is to be compared 
       
  1427             with this descriptor's data. 
       
  1428 
       
  1429 @return True if greater than, false otherwise. 
       
  1430 
       
  1431 @see TDesC16::Compare
       
  1432 */
       
  1433 	{return(Compare(aDes)>0);}
       
  1434 
       
  1435 
       
  1436 
       
  1437 
       
  1438 inline TBool TDesC16::operator>=(const TDesC16 &aDes) const
       
  1439 /**
       
  1440 Determines whether this descriptor's data is greater than or equal to the
       
  1441 specified descriptor's data.
       
  1442 
       
  1443 The comparison is implemented using the Compare() member function.
       
  1444 
       
  1445 @param aDes The 16-bit non-modifiable descriptor whose data is to be compared 
       
  1446             with this descriptor's data. 
       
  1447 
       
  1448 @return True if greater than or equal, false otherwise. 
       
  1449 
       
  1450 @see TDesC16::Compare
       
  1451 */
       
  1452 	{return(Compare(aDes)>=0);}
       
  1453 
       
  1454 
       
  1455 
       
  1456 
       
  1457 inline TBool TDesC16::operator==(const TDesC16 &aDes) const
       
  1458 /**
       
  1459 Determines whether this descriptor's data is equal to the specified
       
  1460 descriptor's data.
       
  1461 
       
  1462 The comparison is implemented using the Compare() member function.
       
  1463 
       
  1464 @param aDes The 16-bit non-modifiable descriptor whose data is to be compared 
       
  1465             with this descriptor's data. 
       
  1466 
       
  1467 @return True if equal, false otherwise. 
       
  1468 
       
  1469 @see TDesC16::Compare
       
  1470 */
       
  1471 	{return(Compare(aDes)==0);}
       
  1472 
       
  1473 
       
  1474 
       
  1475 
       
  1476 inline TBool TDesC16::operator!=(const TDesC16 &aDes) const
       
  1477 /**
       
  1478 Determines whether this descriptor's data is not equal to the specified
       
  1479 descriptor's data.
       
  1480 
       
  1481 The comparison is implemented using the Compare() member function.
       
  1482 
       
  1483 @param aDes The 16-bit non-modifiable descriptor whose data is to be compared 
       
  1484             with this descriptor's data. 
       
  1485 
       
  1486 @return True if not equal, false otherwise. 
       
  1487 
       
  1488 @see TDesC16::Compare
       
  1489 */
       
  1490 	{return(Compare(aDes)!=0);}
       
  1491 
       
  1492 
       
  1493 
       
  1494 
       
  1495 inline const TUint16 &TDesC16::operator[](TInt anIndex) const
       
  1496 /**
       
  1497 Gets a reference to a single data item within this descriptor's data.
       
  1498 
       
  1499 @param anIndex The position of the individual data item within the descriptor's 
       
  1500                data. This is an offset value; a zero value refers to the
       
  1501 			   leftmost data position. 
       
  1502 
       
  1503 @return A reference to the data item.
       
  1504 
       
  1505 @panic USER 9, if anIndex is negative or greater than or equal to the current
       
  1506                length of the descriptor.
       
  1507 */
       
  1508 	{return(AtC(anIndex));}
       
  1509 
       
  1510 
       
  1511 
       
  1512 
       
  1513 inline TInt TDesC16::Length() const
       
  1514 /**
       
  1515 Gets the length of the data.
       
  1516 
       
  1517 This is the number of 16-bit values or data items represented by the descriptor.
       
  1518 
       
  1519 @return The length of the data represented by the descriptor.
       
  1520 */
       
  1521 	{return(iLength&KMaskDesLength16);}
       
  1522 
       
  1523 
       
  1524 
       
  1525 
       
  1526 inline TInt TDesC16::Size() const
       
  1527 /**
       
  1528 Gets the size of the data.
       
  1529 
       
  1530 This is the number of bytes occupied by the data represented by the descriptor.
       
  1531 
       
  1532 @return The size of the data represented by the descriptor. This is always 
       
  1533         twice the length.
       
  1534  */
       
  1535 	{return(Length()<<1);}
       
  1536 
       
  1537 
       
  1538 
       
  1539 
       
  1540 inline void TDesC16::DoSetLength(TInt aLength)
       
  1541 	{iLength=(iLength&(~KMaskDesLength16))|aLength;}
       
  1542 
       
  1543 
       
  1544 
       
  1545 
       
  1546 // Class TPtrC16
       
  1547 inline void TPtrC16::Set(const TUint16 *aBuf,TInt aLength)
       
  1548 /**
       
  1549 Sets the 16-bit non-modifiable pointer descriptor to point to the specified 
       
  1550 location in memory, whether in RAM or ROM.
       
  1551 
       
  1552 The length of the descriptor is set to the specified length.
       
  1553 
       
  1554 @param aBuf    A pointer to the location that the descriptor is to represent.
       
  1555 @param aLength The length of the descriptor. This value must be non-negative 
       
  1556 
       
  1557 @panic USER 17, if aLength is negative.
       
  1558 */
       
  1559 	{new(this) TPtrC16(aBuf,aLength);}
       
  1560 
       
  1561 
       
  1562 
       
  1563 
       
  1564 inline void TPtrC16::Set(const TDesC16 &aDes)
       
  1565 /**
       
  1566 Sets the 16-bit non-modifiable pointer descriptor from the specified descriptor.
       
  1567 
       
  1568 It is set to point to the same data and is given the same length.
       
  1569 
       
  1570 @param aDes A reference to a 16-bit non-modifiable descriptor
       
  1571 */
       
  1572 	{new(this) TPtrC16(aDes);}
       
  1573 
       
  1574 
       
  1575 
       
  1576 
       
  1577 inline void TPtrC16::Set(const TPtrC16& aPtr)
       
  1578 	{new(this) TPtrC16(aPtr);}
       
  1579 
       
  1580 
       
  1581 
       
  1582 
       
  1583 // class TBufCBase16
       
  1584 inline TPtr16 TBufCBase16::DoDes(TInt aMaxLength)
       
  1585 	{return TPtr16(*this,aMaxLength);}
       
  1586 
       
  1587 
       
  1588 
       
  1589 
       
  1590 // Template class TBufC16
       
  1591 template <TInt S>
       
  1592 inline TBufC16<S>::TBufC16()
       
  1593 	: TBufCBase16()
       
  1594 /**
       
  1595 Constructs an empty 16-bit non-modifiable buffer descriptor. 
       
  1596 
       
  1597 It contains no data.
       
  1598 
       
  1599 The integer template parameter determines the size of the data area which 
       
  1600 is created as part of the buffer descriptor object.
       
  1601 
       
  1602 Data can, subsequently, be assigned into this buffer descriptor using the 
       
  1603 assignment operators.
       
  1604 
       
  1605 @see TBufC16::operator=
       
  1606 */
       
  1607 	{}
       
  1608 
       
  1609 
       
  1610 
       
  1611 
       
  1612 template <TInt S>
       
  1613 inline TBufC16<S>::TBufC16(const TUint16 *aString)
       
  1614 	: TBufCBase16(aString,S)
       
  1615 /** 
       
  1616 Constructs the 16-bit non-modifiable buffer descriptor from a zero terminated
       
  1617 string.
       
  1618 
       
  1619 The integer template parameter determines the size of the data area which 
       
  1620 is created as part of this object.
       
  1621 
       
  1622 The string, excluding the zero terminator, is copied into this buffer descriptor's 
       
  1623 data area. The length of this buffer descriptor is set to the length of the 
       
  1624 string, excluding the zero terminator.
       
  1625 
       
  1626 @panic USER 8, if the length of the string, excluding the zero terminator, is
       
  1627                greater than the value of the integer template parameter.
       
  1628 
       
  1629 @param aString A pointer to a zero terminated string.
       
  1630 */
       
  1631 	{}
       
  1632 
       
  1633 
       
  1634 
       
  1635 
       
  1636 template <TInt S>
       
  1637 inline TBufC16<S>::TBufC16(const TDesC16 &aDes)
       
  1638 	: TBufCBase16(aDes,S)
       
  1639 /**
       
  1640 Constructs the 16-bit non-modifiable buffer descriptor from any
       
  1641 existing descriptor.
       
  1642 
       
  1643 The integer template parameter determines the size of the data area which 
       
  1644 is created as part of this object.
       
  1645 
       
  1646 Data is copied from the source descriptor into this buffer descriptor and 
       
  1647 the length of this buffer descriptor is set to the length of the
       
  1648 source descriptor.
       
  1649 
       
  1650 @param aDes The source 16-bit non-modifiable descriptor.
       
  1651 
       
  1652 @panic USER 8, if the length of the source descriptor is
       
  1653                greater than the value of the integer template parameter.
       
  1654 */
       
  1655 	{}
       
  1656 
       
  1657 
       
  1658 
       
  1659 
       
  1660 template <TInt S>
       
  1661 inline TBufC16<S> &TBufC16<S>::operator=(const TUint16 *aString)
       
  1662 /**
       
  1663 Copies data into this descriptor replacing any existing data.
       
  1664 
       
  1665 The length of this descriptor is set to reflect the new data.
       
  1666 
       
  1667 @param aString A pointer to a zero-terminated string.
       
  1668 
       
  1669 @return A reference to this descriptor.
       
  1670 
       
  1671 @panic USER 11, if the length of the string, excluding the zero terminator, is
       
  1672                 greater than the maximum length of this (target) descriptor.
       
  1673 */
       
  1674 	{Copy(aString,S);return(*this);}
       
  1675 
       
  1676 
       
  1677 
       
  1678 
       
  1679 template <TInt S>
       
  1680 inline TBufC16<S> &TBufC16<S>::operator=(const TDesC16 &aDes)
       
  1681 /**
       
  1682 Copies data into this descriptor, replacing any existing data.
       
  1683 
       
  1684 The length of this descriptor is set to reflect the new data.
       
  1685 
       
  1686 @param aDes A 16-bit non-modifiable descriptor.
       
  1687 
       
  1688 @panic USER 11, if the length of the descriptor aDes is
       
  1689                 greater than the maximum length of this (target) descriptor.
       
  1690 
       
  1691 @return A reference to this descriptor.
       
  1692 */
       
  1693 	{Copy(aDes,S);return(*this);}
       
  1694 
       
  1695 
       
  1696 
       
  1697 
       
  1698 template <TInt S>
       
  1699 inline TPtr16 TBufC16<S>::Des()
       
  1700 /**
       
  1701 Creates and returns a 16-bit modifiable pointer descriptor for the data
       
  1702 represented by this 16-bit non-modifiable buffer descriptor.
       
  1703 
       
  1704 The content of a non-modifiable buffer descriptor normally cannot be altered, 
       
  1705 other than by complete replacement of the data. Creating a modifiable pointer 
       
  1706 descriptor provides a way of changing the data.
       
  1707 
       
  1708 The modifiable pointer descriptor is set to point to this non-modifiable buffer 
       
  1709 descriptor's data.
       
  1710 
       
  1711 The length of the modifiable pointer descriptor is set to the length of this 
       
  1712 non-modifiable buffer descriptor.
       
  1713 
       
  1714 The maximum length of the modifiable pointer descriptor is set to the value 
       
  1715 of the integer template parameter.
       
  1716 
       
  1717 When data is modified through this new pointer descriptor, the lengths of 
       
  1718 both it and this constant buffer descriptor are changed.
       
  1719 
       
  1720 @return A 16-bit modifiable pointer descriptor representing the data in this 
       
  1721         16-bit non-modifiable buffer descriptor.
       
  1722 */
       
  1723 	{return(DoDes(S));}
       
  1724 
       
  1725 
       
  1726 
       
  1727 
       
  1728 #ifndef __KERNEL_MODE__
       
  1729 // Class HBufC16
       
  1730 inline HBufC16 &HBufC16::operator=(const HBufC16 &aLcb)
       
  1731 /**
       
  1732 Copies data into this 16-bit heap descriptor replacing any existing data.
       
  1733 
       
  1734 The length of this descriptor is set to reflect the new data.
       
  1735 
       
  1736 Note that the maximum length of this (target) descriptor is the length
       
  1737 of the descriptor buffer in the allocated host heap cell; this may be greater
       
  1738 than the maximum length specified when this descriptor was created or
       
  1739 last re-allocated.
       
  1740 
       
  1741 @param aLcb The source 16-bit heap descriptor.
       
  1742 
       
  1743 @return A reference to this 16-bit heap descriptor.
       
  1744 
       
  1745 @panic USER 11, if the length of the descriptor aLcb is greater than the
       
  1746                 maximum length of this (target) descriptor
       
  1747 */
       
  1748 	{return *this=static_cast<const TDesC16&>(aLcb);}
       
  1749 #endif
       
  1750 
       
  1751 
       
  1752 
       
  1753 
       
  1754 // Class TDes16
       
  1755 inline TDes16 &TDes16::operator=(const TUint16 *aString)
       
  1756 /**
       
  1757 Copies data into this descriptor replacing any existing data.
       
  1758 
       
  1759 The length of this descriptor is set to reflect the new data.
       
  1760 
       
  1761 @param aString A pointer to a zero-terminated string.
       
  1762 
       
  1763 @return A reference to this, the target descriptor.
       
  1764 
       
  1765 @panic USER 11, if the length of the string, excluding the zero terminator, is
       
  1766                 greater than the maximum length of this (target) descriptor.
       
  1767 */
       
  1768     {Copy(aString);return(*this);}
       
  1769 
       
  1770 
       
  1771 
       
  1772 
       
  1773 inline TDes16 &TDes16::operator=(const TDesC16 &aDes)
       
  1774 /**
       
  1775 Copies data into this descriptor replacing any existing data.
       
  1776 
       
  1777 The length of this descriptor is set to reflect the new data.
       
  1778 
       
  1779 @param aDes A 16-bit non-modifiable descriptor.
       
  1780 
       
  1781 @return A reference to this, the target descriptor.
       
  1782 
       
  1783 @panic USER 11, if the length of the descriptor aDes is greater than the
       
  1784                 maximum length of this (target) descriptor.
       
  1785 */
       
  1786     {Copy(aDes);return(*this);}
       
  1787 
       
  1788 
       
  1789 
       
  1790 
       
  1791 inline TDes16 &TDes16::operator=(const TDes16 &aDes)
       
  1792 /**
       
  1793 Copies data into this descriptor replacing any existing data.
       
  1794 
       
  1795 The length of this descriptor is set to reflect the new data.
       
  1796 
       
  1797 @param aDes A 16-bit modifiable descriptor.
       
  1798 
       
  1799 @return A reference to this, the target descriptor.
       
  1800 
       
  1801 @panic USER 11, if the length of the descriptor aDes is greater than the
       
  1802                 maximum length of this (target) descriptor.
       
  1803 */
       
  1804     {Copy(aDes);return(*this);}
       
  1805 
       
  1806 
       
  1807 
       
  1808 
       
  1809 inline TDes16 &TDes16::operator+=(const TDesC16 &aDes)
       
  1810 /** 
       
  1811 Appends data onto the end of this descriptor's data and returns a reference 
       
  1812 to this descriptor.
       
  1813 
       
  1814 The length of this descriptor is incremented to reflect the new content.
       
  1815 
       
  1816 @param aDes A 16-bit non-modifiable descriptor whose data is to be appended. 
       
  1817 
       
  1818 @return A reference to this descriptor.
       
  1819 
       
  1820 @panic USER 11, if the resulting length of this descriptor is greater than its
       
  1821                 maximum length.  
       
  1822 */
       
  1823 	{Append(aDes);return(*this);}
       
  1824 
       
  1825 
       
  1826 
       
  1827 
       
  1828 inline const TUint16 &TDes16::operator[](TInt anIndex) const
       
  1829 /**
       
  1830 Gets a const reference to a single data item within this descriptor's data.
       
  1831 
       
  1832 @param anIndex The position the data item within this descriptor's data. This 
       
  1833 is an offset value; a zero value refers to the leftmost data position.
       
  1834 
       
  1835 @return A const reference to the data item at the specified position.
       
  1836 
       
  1837 @panic USER 9, if anIndex is negative or is greater than or equal to the
       
  1838                 current length of this descriptor.
       
  1839 */
       
  1840 	{return(AtC(anIndex));}
       
  1841 
       
  1842 
       
  1843 
       
  1844 
       
  1845 inline TUint16 &TDes16::operator[](TInt anIndex)
       
  1846 /** 
       
  1847 Gets a non-const reference to a single data item within this descriptor's 
       
  1848 data.
       
  1849 
       
  1850 @param anIndex The position of the data item within this descriptor's data.
       
  1851                This is an offset value; a zero value refers to the leftmost
       
  1852 			   data position. 
       
  1853 			   
       
  1854 @return A non-const reference to the data item at the specified position.
       
  1855 
       
  1856 @panic USER 9, if anIndex is negative or is greater than or equal to the
       
  1857                 current length of this descriptor.
       
  1858 */
       
  1859 	{return((TUint16 &)AtC(anIndex));}
       
  1860 
       
  1861 
       
  1862 
       
  1863 
       
  1864 inline TInt TDes16::MaxLength() const
       
  1865 /**
       
  1866 Gets the maximum length of the descriptor.
       
  1867 
       
  1868 This is the upper limit for the number of 16-bit values or data items that
       
  1869 the descriptor can represent.
       
  1870 
       
  1871 @return The maximum length of data that the descriptor can represent.
       
  1872 */
       
  1873 	{return(iMaxLength);}
       
  1874 
       
  1875 
       
  1876 
       
  1877 
       
  1878 inline TInt TDes16::MaxSize() const
       
  1879 /**
       
  1880 Gets the maximum size of the descriptor.
       
  1881 
       
  1882 This is the upper limit for the number of bytes which the data represented by
       
  1883 the descriptor can occupy.
       
  1884 
       
  1885 @return The maximum size of the descriptor data.
       
  1886 */
       
  1887 	{return(iMaxLength<<1);}
       
  1888 
       
  1889 
       
  1890 
       
  1891 
       
  1892 inline TUint16 * TDes16::WPtr() const
       
  1893 	{return((TUint16 *)Ptr());}
       
  1894 
       
  1895 
       
  1896 
       
  1897 
       
  1898 // Class TPtr16
       
  1899 inline TPtr16 &TPtr16::operator=(const TUint16 *aString)
       
  1900 /**
       
  1901 Copies data into this 16-bit modifiable pointer descriptor replacing
       
  1902 any existing data.
       
  1903 
       
  1904 The length of this descriptor is set to reflect the new data.
       
  1905 
       
  1906 @param aString A pointer to a zero-terminated string.
       
  1907 
       
  1908 @return A reference to this 16-bit modifiable pointer descriptor.
       
  1909 
       
  1910 @panic USER 11, if the length of the string, excluding the zero terminator, is
       
  1911                 greater than the maximum length of this descriptor.
       
  1912 */
       
  1913 	{Copy(aString);return(*this);}
       
  1914 
       
  1915 
       
  1916 
       
  1917 
       
  1918 inline TPtr16 &TPtr16::operator=(const TDesC16 &aDes)
       
  1919 /**
       
  1920 Copies data into this 16-bit modifiable pointer descriptor replacing any
       
  1921 existing data.
       
  1922 
       
  1923 The length of this descriptor is set to reflect the new data.
       
  1924 
       
  1925 @param aDes A 16-bit non-modifiable descriptor whose data is to be copied 
       
  1926             into this descriptor.
       
  1927 
       
  1928 @return A reference to this 16-bit modifiable pointer descriptor.
       
  1929 
       
  1930 @panic USER 11, if the length of aDes is greater than the maximum 
       
  1931                 length of this descriptor.
       
  1932 */
       
  1933 	{Copy(aDes);return(*this);}
       
  1934 
       
  1935 
       
  1936 
       
  1937 
       
  1938 inline TPtr16 &TPtr16::operator=(const TPtr16 &aDes)
       
  1939 /**
       
  1940 Copies data into this 16-bit modifiable pointer descriptor replacing any
       
  1941 existing data.
       
  1942 
       
  1943 The length of this descriptor is set to reflect the new data.
       
  1944 
       
  1945 @param aDes A 16-bit modifiable pointer descriptor whose data is to be copied 
       
  1946             into this descriptor.
       
  1947 
       
  1948 @return A reference to this 16-bit modifiable pointer descriptor.
       
  1949 
       
  1950 @panic USER 11, if the length of aDes is greater than the maximum 
       
  1951                 length of this descriptor.
       
  1952 */
       
  1953 	{Copy(aDes);return(*this);}
       
  1954 
       
  1955 
       
  1956 
       
  1957 
       
  1958 inline void TPtr16::Set(TUint16 *aBuf,TInt aLength,TInt aMaxLength)
       
  1959 /**
       
  1960 Sets the 16-bit modifiable pointer descriptor to point to the specified location 
       
  1961 in memory, whether in RAM or ROM.
       
  1962 
       
  1963 The length of the descriptor and its maximum length are set to the specified
       
  1964 values.
       
  1965 
       
  1966 @param aBuf       A pointer to the location that the descriptor is to represent.
       
  1967 @param aLength    The length of the descriptor.
       
  1968 @param aMaxLength The maximum length of the descriptor.
       
  1969 
       
  1970 @panic USER 8,  if aLength is negative or is greater than the maximum length of
       
  1971                 this descriptor.
       
  1972 @panic USER 18, if aMaxLength is negative.
       
  1973 */
       
  1974 	{new(this) TPtr16(aBuf,aLength,aMaxLength);}
       
  1975 
       
  1976 
       
  1977 
       
  1978 
       
  1979 inline void TPtr16::Set(const TPtr16 &aPtr)
       
  1980 /**
       
  1981 Sets the 16-bit modifiable pointer descriptor from an existing
       
  1982 16-bit modifiable pointer descriptor.
       
  1983   
       
  1984 It is set to point to the same data, is given the same length and the same
       
  1985 maximum length as the source pointer descriptor.
       
  1986 
       
  1987 @param aPtr The source 16-bit modifiable pointer descriptor.
       
  1988 */
       
  1989 	{new(this) TPtr16(aPtr);}
       
  1990 
       
  1991 
       
  1992 
       
  1993 
       
  1994 // Template class TBuf16
       
  1995 template <TInt S>
       
  1996 inline TBuf16<S>::TBuf16()
       
  1997 	: TBufBase16(S)
       
  1998 /**
       
  1999 Constructs an empty 16-bit modifiable buffer descriptor.
       
  2000 
       
  2001 It contains no data.
       
  2002 
       
  2003 The integer template parameter determines the size of the data area created 
       
  2004 as part of the object and defines the descriptor's maximum length.
       
  2005 */
       
  2006 	{}
       
  2007 
       
  2008 
       
  2009 
       
  2010 
       
  2011 template <TInt S>
       
  2012 inline TBuf16<S>::TBuf16(TInt aLength)
       
  2013 	: TBufBase16(aLength,S)
       
  2014 /**
       
  2015 Constructs an empty 16-bit modifiable buffer descriptor and sets the its length 
       
  2016 to the specified value.
       
  2017 
       
  2018 No data is assigned to the descriptor.
       
  2019 
       
  2020 The integer template parameter defines the size of the data area created as 
       
  2021 part of the object and defines the descriptor's maximum length.
       
  2022 
       
  2023 @param aLength The length of this modifiable buffer descriptor.
       
  2024 
       
  2025 @panic USER 8, if aLength is negative or is greater than the 
       
  2026                 value of the integer template parameter.
       
  2027 */
       
  2028 	{}
       
  2029 
       
  2030 
       
  2031 
       
  2032 
       
  2033 template <TInt S>
       
  2034 inline TBuf16<S>::TBuf16(const TUint16 *aString)
       
  2035 	: TBufBase16(aString,S)
       
  2036 /**
       
  2037 Constructs the 16-bit modifiable buffer descriptor from
       
  2038 a zero terminated string.
       
  2039 
       
  2040 The integer template parameter determines the size of the data area that is
       
  2041 created as part of this object, and defines the descriptor's maximum length.
       
  2042 
       
  2043 The string, excluding the zero terminator, is copied into this buffer
       
  2044 descriptor's data area. The length of this buffer descriptor is set to the
       
  2045 length of the string, excluding the zero terminator.
       
  2046 
       
  2047 @param aString A pointer to a zero terminated string.
       
  2048 
       
  2049 @panic USER 11, if the length of the string, excluding the zero terminator,
       
  2050                 is greater than the value of the integer template parameter.
       
  2051 */
       
  2052 	{}
       
  2053 
       
  2054 
       
  2055 
       
  2056 
       
  2057 template <TInt S>
       
  2058 inline TBuf16<S>::TBuf16(const TDesC16 &aDes)
       
  2059 	: TBufBase16(aDes,S)
       
  2060 /**
       
  2061 Constructs the 16-bit modifiable buffer descriptor from any existing
       
  2062 16-bit descriptor.
       
  2063 
       
  2064 The integer template parameter determines the size of the data area created 
       
  2065 as part of this object and defines the descriptor's maximum length.
       
  2066 
       
  2067 Data is copied from the source descriptor into this modifiable buffer descriptor 
       
  2068 and the length of this modifiable buffer descriptor is set to the length of 
       
  2069 the source descriptor.
       
  2070 
       
  2071 @param aDes The source 16-bit non-modifiable descriptor.
       
  2072 
       
  2073 @panic USER 11, if the length of the source descriptor is greater than the
       
  2074                 value of the integer template parameter.
       
  2075 */
       
  2076 	{}
       
  2077 
       
  2078 
       
  2079 
       
  2080 
       
  2081 template <TInt S>
       
  2082 inline TBuf16<S> &TBuf16<S>::operator=(const TUint16 *aString)
       
  2083 /**
       
  2084 Copies data into this 16-bit modifiable buffer descriptor, replacing any
       
  2085 existing data. 
       
  2086 
       
  2087 The length of this descriptor is set to reflect the new data.
       
  2088 
       
  2089 @param aString A pointer to a zero-terminated string.
       
  2090 
       
  2091 @return A reference to this descriptor.
       
  2092 
       
  2093 @panic USER 11, if the length of the string, excluding the zero terminator,
       
  2094                 is greater than the maximum length of this (target) descriptor.
       
  2095 */
       
  2096 	{Copy(aString);return(*this);}
       
  2097 
       
  2098 
       
  2099 
       
  2100 
       
  2101 template <TInt S>
       
  2102 inline TBuf16<S> &TBuf16<S>::operator=(const TDesC16 &aDes)
       
  2103 /**
       
  2104 Copies data into this 16-bit modifiable descriptor, replacing any
       
  2105 existing data.
       
  2106 
       
  2107 The length of this descriptor is set to reflect the new data.
       
  2108 
       
  2109 @param aDes A 16-bit non-modifiable descriptor.
       
  2110 
       
  2111 @return A reference to this descriptor.
       
  2112 
       
  2113 @panic USER 11, if the length of the descriptor aDes is greater than the
       
  2114                 maximum length of this (target) descriptor.
       
  2115 */
       
  2116 	{Copy(aDes);return(*this);}
       
  2117 
       
  2118 
       
  2119 
       
  2120 
       
  2121 template <TInt S>
       
  2122 inline TBuf16<S>& TBuf16<S>::operator=(const TBuf16<S>& aBuf)
       
  2123 /**
       
  2124 Copies data into this 16-bit modifiable buffer descriptor replacing any
       
  2125 existing data.
       
  2126 
       
  2127 The length of this descriptor is set to reflect the new data.
       
  2128 
       
  2129 @param aBuf The source 16-bit modifiable buffer descriptor with the same
       
  2130             template value.
       
  2131 
       
  2132 @return A reference to this 16-bit modifiable buffer descriptor. 
       
  2133 
       
  2134 @panic USER 11, if the length of the descriptor aDes is greater than the
       
  2135                 maximum length of this (target) descriptor.
       
  2136 */
       
  2137 	{Copy(aBuf);return *this;}
       
  2138 
       
  2139 
       
  2140 // Class RBuf16
       
  2141 inline RBuf16& RBuf16::operator=(const TUint16* aString)
       
  2142 /**
       
  2143 Copies data into this descriptor replacing any existing data.
       
  2144 
       
  2145 The length of this descriptor is set to reflect the new data.
       
  2146 
       
  2147 @param aString A pointer to a zero-terminated string.
       
  2148 
       
  2149 @return A reference to this, the target descriptor.
       
  2150 
       
  2151 @panic USER 11, if the length of the string, excluding the zero terminator, is
       
  2152                 greater than the maximum length of this (target) descriptor.
       
  2153 */
       
  2154     {Copy(aString);return(*this);}
       
  2155 
       
  2156 
       
  2157 
       
  2158 
       
  2159 inline RBuf16& RBuf16::operator=(const TDesC16& aDes)
       
  2160 /**
       
  2161 Copies data into this descriptor replacing any existing data.
       
  2162 
       
  2163 The length of this descriptor is set to reflect the new data.
       
  2164 
       
  2165 @param aDes A 16-bit non-modifiable descriptor.
       
  2166 
       
  2167 @return A reference to this, the target descriptor.
       
  2168 
       
  2169 @panic USER 11, if the length of the descriptor aDes is greater than the
       
  2170                 maximum length of this (target) descriptor.
       
  2171 */
       
  2172     {Copy(aDes);return(*this);}
       
  2173 
       
  2174 
       
  2175 
       
  2176 
       
  2177 inline RBuf16& RBuf16::operator=(const RBuf16& aDes)
       
  2178 /**
       
  2179 Copies data into this descriptor replacing any existing data.
       
  2180 
       
  2181 The length of this descriptor is set to reflect the new data.
       
  2182 
       
  2183 @param aDes A 16-bit buffer descriptor.
       
  2184 
       
  2185 @return A reference to this, the target descriptor.
       
  2186 
       
  2187 @panic USER 11, if the length of the descriptor aDes is greater than the
       
  2188                 maximum length of this (target) descriptor.
       
  2189 */
       
  2190     {Copy(aDes);return(*this);}
       
  2191 
       
  2192 
       
  2193 
       
  2194 
       
  2195 /**
       
  2196 Creates a 16-bit resizable buffer descriptor that has been initialised with
       
  2197 data from the specified read stream; leaves on failure.
       
  2198 			 
       
  2199 Data is assigned to the new descriptor from the specified stream.
       
  2200 This variant assumes that the stream contains the length of the data followed
       
  2201 by the data itself.
       
  2202 
       
  2203 The function is implemented by calling the HBufC16::NewL(RReadStream&amp;,TInt)
       
  2204 variant and then assigning the resulting heap descriptor using
       
  2205 the RBuf16::Assign(HBufC16*) variant. The comments that describe
       
  2206 the HBufC16::NewL() variant	also apply to this RBuf16::CreateL() function.
       
  2207 
       
  2208 The function may leave with one of the system-wide error codes,	specifically 
       
  2209 KErrOverflow, if the length of the data as read from the stream is greater than
       
  2210 the upper limit as specified by the aMaxLength parameter.
       
  2211 
       
  2212 @param aStream    The stream from which the data length and the data to be
       
  2213                   assigned to the new descriptor, are taken.
       
  2214 @param aMaxLength The upper limit on the length of data that the descriptor is
       
  2215                   to represent. The value of this parameter must be non-negative
       
  2216                   otherwise the	underlying function will panic.
       
  2217 */
       
  2218 inline void RBuf16::CreateL(RReadStream &aStream,TInt aMaxLength)
       
  2219 	{
       
  2220 	Assign(HBufC16::NewL(aStream,aMaxLength));
       
  2221 	}
       
  2222 
       
  2223 
       
  2224 // Template class TLitC16
       
  2225 template <TInt S>
       
  2226 inline const TDesC16* TLitC16<S>::operator&() const
       
  2227 /**
       
  2228 Returns a const TDesC16 type pointer.
       
  2229 
       
  2230 @return A descriptor type pointer to this literal. 
       
  2231 */
       
  2232 	{return REINTERPRET_CAST(const TDesC16*,this);}
       
  2233 
       
  2234 
       
  2235 
       
  2236 
       
  2237 template <TInt S>
       
  2238 inline const TDesC16& TLitC16<S>::operator()() const
       
  2239 /**
       
  2240 Returns a const TDesC16 type reference.
       
  2241 
       
  2242 @return A descriptor type reference to this literal 
       
  2243 */
       
  2244 	{return *operator&();}
       
  2245 
       
  2246 
       
  2247 
       
  2248 
       
  2249 template <TInt S>
       
  2250 inline TLitC16<S>::operator const TDesC16&() const
       
  2251 /**
       
  2252 Invoked by the compiler when a TLitC16<TInt> type is passed to a function
       
  2253 which is prototyped to take a const TDesC16& type.
       
  2254 */
       
  2255 	{return *operator&();}
       
  2256 
       
  2257 
       
  2258 
       
  2259 
       
  2260 template <TInt S>
       
  2261 inline TLitC16<S>::operator const __TRefDesC16() const
       
  2262 /**
       
  2263 Invoked by the compiler when a TLitC16<TInt> type is passed to a function
       
  2264 which is prototyped to take a const TRefByValue<const TDesC16> type.
       
  2265 
       
  2266 @see __TRefDesC16
       
  2267 */
       
  2268 	{return *operator&();}
       
  2269 #endif //__KERNEL_MODE__
       
  2270 
       
  2271 
       
  2272 
       
  2273 
       
  2274 // Template class TBufC
       
  2275 #if defined(_UNICODE) && !defined(__KERNEL_MODE__)
       
  2276 template <TInt S>
       
  2277 inline TBufC<S>::TBufC()
       
  2278 	: TBufCBase16()
       
  2279 /**
       
  2280 Constructs an empty build independent non-modifiable buffer descriptor.
       
  2281 
       
  2282 It contains no data.
       
  2283 
       
  2284 The integer template parameter determines the size of the data area which 
       
  2285 is created as part of the buffer descriptor object.
       
  2286 
       
  2287 Data can, subsequently, be assigned into this buffer descriptor using the 
       
  2288 assignment operators.
       
  2289 
       
  2290 @see TBufC::operator=
       
  2291 */
       
  2292 	{}
       
  2293 
       
  2294 
       
  2295 
       
  2296 
       
  2297 template <TInt S>
       
  2298 inline TBufC<S>::TBufC(const TText *aString)
       
  2299 	: TBufCBase16(aString,S)
       
  2300 /** 
       
  2301 Constructs a build independent non-modifiable 
       
  2302 buffer descriptor from a zero terminated string.
       
  2303 
       
  2304 The integer template parameter determines the size of the data area which 
       
  2305 is created as part of this object.
       
  2306 
       
  2307 The string, excluding the zero terminator, is copied into this buffer descriptor's 
       
  2308 data area. The length of this buffer descriptor is set to the length of the 
       
  2309 string, excluding the zero terminator.
       
  2310 
       
  2311 @param aString A pointer to a zero terminated string.
       
  2312 
       
  2313 @panic USER 8,  if the length of the string, excluding the zero terminator, is
       
  2314                 greater than the value of the integer template parameter for
       
  2315 				the 16-bit build variant.
       
  2316 
       
  2317 @panic USER 20, if the length of the string, excluding the zero terminator, is
       
  2318                 greater than the value of the integer template parameter for
       
  2319 				the 8-bit build variant.
       
  2320 */
       
  2321 	{}
       
  2322 
       
  2323 
       
  2324 
       
  2325 
       
  2326 template <TInt S>
       
  2327 inline TBufC<S>::TBufC(const TDesC &aDes)
       
  2328 	: TBufCBase16(aDes,S)
       
  2329 /**
       
  2330 Constructs a build-independent non-modifiable buffer descriptor from any 
       
  2331 existing build independent descriptor.
       
  2332 
       
  2333 The integer template parameter determines the size of the data area which 
       
  2334 is created as part of this object.
       
  2335 
       
  2336 Data is copied from the source descriptor into this buffer descriptor and 
       
  2337 the length of this buffer descriptor is set to the length of the source descriptor.
       
  2338 
       
  2339 The length of the source descriptor must not be greater than the value of 
       
  2340 the integer template parameter, otherwise the constructor raises a USER 20 
       
  2341 panic for an 8 bit build variant or a USER 8 panic for a 16 bit (Unicode) 
       
  2342 build variant.
       
  2343 
       
  2344 @param aDes The source build independent non-modifiable descriptor.
       
  2345 
       
  2346 @panic USER 8,  if the length of the source descriptor is
       
  2347                 greater than the value of the integer template parameter for
       
  2348 				the 16-bit build variant.
       
  2349 
       
  2350 @panic USER 20, if the length of the source descriptor is
       
  2351                 greater than the value of the integer template parameter for
       
  2352 				the 8-bit build variant.
       
  2353 */
       
  2354 	{}
       
  2355 #else
       
  2356 template <TInt S>
       
  2357 inline TBufC<S>::TBufC()
       
  2358 	: TBufCBase8()
       
  2359 	{}
       
  2360 template <TInt S>
       
  2361 inline TBufC<S>::TBufC(const TText *aString)
       
  2362 	: TBufCBase8(aString,S)
       
  2363 	{}
       
  2364 template <TInt S>
       
  2365 inline TBufC<S>::TBufC(const TDesC &aDes)
       
  2366 	: TBufCBase8(aDes,S)
       
  2367 	{}
       
  2368 #endif
       
  2369 template <TInt S>
       
  2370 inline TBufC<S> &TBufC<S>::operator=(const TText *aString)
       
  2371 /** 
       
  2372 Copies data into this descriptor, replacing any existing data.
       
  2373 
       
  2374 The length of this descriptor is set to reflect the new data.
       
  2375 
       
  2376 @param aString A pointer to a zero-terminated string.
       
  2377 
       
  2378 @return A reference to this descriptor.
       
  2379 
       
  2380 @panic USER 11, if the length of the string, excluding the zero terminator,
       
  2381                 is greater than the maximum length of this (target) descriptor
       
  2382 				for the 16-bit build variant.
       
  2383 
       
  2384 @panic USER 23, if the length of the string, excluding the zero terminator,
       
  2385                 is greater than the maximum length of this (target) descriptor
       
  2386 				for the 8-bit build variant.
       
  2387 */
       
  2388 	{Copy(aString,S);return(*this);}
       
  2389 
       
  2390 
       
  2391 
       
  2392 
       
  2393 template <TInt S>
       
  2394 inline TBufC<S> &TBufC<S>::operator=(const TDesC &aDes)
       
  2395 /**
       
  2396 Copies data into this descriptor, replacing any existing data.
       
  2397 
       
  2398 The length of this descriptor is set to reflect the new data.
       
  2399 
       
  2400 @param aDes A build independent non-modifiable descriptor. 
       
  2401 
       
  2402 @return A reference to this descriptor.
       
  2403 
       
  2404 @panic USER 11, if the length of the descriptor aDes is greater than the
       
  2405                 maximum length of this (target) descriptor for the 16-bit
       
  2406 				build variant.
       
  2407 
       
  2408 @panic USER 23, if the length of the descriptor aDes is greater than the
       
  2409                 maximum length of this (target) descriptor for the 8-bit
       
  2410 				build variant.
       
  2411 */
       
  2412 	{Copy(aDes,S);return(*this);}
       
  2413 
       
  2414 
       
  2415 
       
  2416 
       
  2417 template <TInt S>
       
  2418 inline TPtr TBufC<S>::Des()
       
  2419 /**
       
  2420 Creates and returns a build-independent modifiable pointer descriptor for
       
  2421 the data represented by this build-independent non-modifiable buffer
       
  2422 descriptor.
       
  2423 
       
  2424 The content of a non-modifiable buffer descriptor normally cannot be altered, 
       
  2425 other than by complete replacement of the data. Creating a modifiable pointer 
       
  2426 descriptor provides a way of changing the data.
       
  2427 
       
  2428 The modifiable pointer descriptor is set to point to this non-modifiable buffer 
       
  2429 descriptor's data.
       
  2430 
       
  2431 The length of the modifiable pointer descriptor is set to the length of this 
       
  2432 non-modifiable buffer descriptor.
       
  2433 
       
  2434 The maximum length of the modifiable pointer descriptor is set to the value 
       
  2435 of the integer template parameter.
       
  2436 
       
  2437 When data is modified through this new pointer descriptor, the lengths of 
       
  2438 both it and this constant buffer descriptor are changed.
       
  2439 
       
  2440 @return A build independent modifiable pointer descriptor representing the 
       
  2441         data in this build independent non-modifiable buffer descriptor.
       
  2442 */
       
  2443 	{return(DoDes(S));}
       
  2444 
       
  2445 
       
  2446 
       
  2447 
       
  2448 // Template class TBuf
       
  2449 #if defined(_UNICODE) && !defined(__KERNEL_MODE__)
       
  2450 template <TInt S>
       
  2451 inline TBuf<S>::TBuf()
       
  2452 	: TBufBase16(S)
       
  2453 /**
       
  2454 Creates a build-independent modifiable buffer descriptor which 
       
  2455 contains no data.
       
  2456 
       
  2457 The integer template parameter determines the size of the data area that is created 
       
  2458 as part of the object, and defines the descriptor's maximum length.
       
  2459 */
       
  2460 	{}
       
  2461 
       
  2462 
       
  2463 
       
  2464 
       
  2465 template <TInt S>
       
  2466 inline TBuf<S>::TBuf(TInt aLength)
       
  2467 	: TBufBase16(aLength,S)
       
  2468 /**
       
  2469 Constructs an empty build independent modifiable buffer descriptor and
       
  2470 sets its length to the specified value.
       
  2471 
       
  2472 No data is assigned to the descriptor.
       
  2473 
       
  2474 The integer template parameter determines the size of the data area created 
       
  2475 as part of the object and defines the descriptor's maximum length.
       
  2476 
       
  2477 @param aLength The length of this modifiable buffer descriptor.
       
  2478 
       
  2479 @panic USER 8,  if aLength is negative and is greater than the value of the
       
  2480                 integer template parameter for a 16-bit build variant.
       
  2481 
       
  2482 @panic USER 20, if aLength is negative and is greater than the value of the
       
  2483                 integer template parameter for a 8-bit build variant.
       
  2484 */
       
  2485 	{}
       
  2486 
       
  2487 
       
  2488 
       
  2489 
       
  2490 template <TInt S>
       
  2491 inline TBuf<S>::TBuf(const TText *aString)
       
  2492 	: TBufBase16(aString,S)
       
  2493 /**
       
  2494 Constructs the build-independent modifiable buffer descriptor from
       
  2495 a zero terminated string.
       
  2496 
       
  2497 The integer template parameter determines the size of the data area which 
       
  2498 is created as part of this object.
       
  2499 
       
  2500 The string, excluding the zero terminator, is copied into this buffer
       
  2501 descriptor's data area. The length of this buffer descriptor is set to
       
  2502 the length of the string, excluding the zero terminator.
       
  2503 
       
  2504 @param aString A pointer to a zero terminated string.
       
  2505 
       
  2506 @panic USER 11, if the length of the string, excluding the zero terminator,
       
  2507                 is greater than the value of the integer template parameter
       
  2508 				for a 16-bit build variant.
       
  2509 @panic USER 23, if the length of the string, excluding the zero terminator,
       
  2510                 is greater than the value of the integer template parameter
       
  2511 				for a 8-bit build variant.
       
  2512 */
       
  2513 	{}
       
  2514 
       
  2515 
       
  2516 
       
  2517 
       
  2518 template <TInt S>
       
  2519 inline TBuf<S>::TBuf(const TDesC &aDes)
       
  2520 	: TBufBase16(aDes,S)
       
  2521 /**
       
  2522 Constructs the build-independent modifiable buffer descriptor from any
       
  2523 existing build-independent descriptor.
       
  2524 
       
  2525 The integer template parameter determines the size of the data area created 
       
  2526 as part of this object, and defines the descriptor's maximum length.
       
  2527 
       
  2528 Data is copied from the source descriptor into this modifiable buffer descriptor 
       
  2529 and the length of this modifiable buffer descriptor is set to the length of 
       
  2530 the source descriptor.
       
  2531 
       
  2532 @param aDes The source build independent non-modifiable descriptor.
       
  2533 
       
  2534 @panic USER 11, if the length of the source descriptor is greater than the
       
  2535                 value of the integer template parameter for a 16-bit
       
  2536 				build variant.
       
  2537 @panic USER 23, if the length of the source descriptor is greater than the
       
  2538                 value of the integer template parameter for an 8-bit
       
  2539 				build variant.
       
  2540 	
       
  2541 */
       
  2542 	{}
       
  2543 #else
       
  2544 template <TInt S>
       
  2545 inline TBuf<S>::TBuf()
       
  2546 	: TBufBase8(S)
       
  2547 	{}
       
  2548 template <TInt S>
       
  2549 inline TBuf<S>::TBuf(TInt aLength)
       
  2550 	: TBufBase8(aLength,S)
       
  2551 	{}
       
  2552 template <TInt S>
       
  2553 inline TBuf<S>::TBuf(const TText *aString)
       
  2554 	: TBufBase8(aString,S)
       
  2555 	{}
       
  2556 template <TInt S>
       
  2557 inline TBuf<S>::TBuf(const TDesC &aDes)
       
  2558 	: TBufBase8(aDes,S)
       
  2559 	{}
       
  2560 #endif
       
  2561 template <TInt S>
       
  2562 inline TBuf<S> &TBuf<S>::operator=(const TText *aString)
       
  2563 	{Copy(aString);return(*this);}
       
  2564 template <TInt S>
       
  2565 inline TBuf<S> &TBuf<S>::operator=(const TDesC &aDes)
       
  2566 	{Copy(aDes);return(*this);}
       
  2567 template <TInt S>
       
  2568 inline TBuf<S> &TBuf<S>::operator=(const TBuf<S> &aBuf)
       
  2569 	{Copy(aBuf);return(*this);}
       
  2570 
       
  2571 
       
  2572 
       
  2573 
       
  2574 // Template class TLitC
       
  2575 template <TInt S>
       
  2576 inline const TDesC* TLitC<S>::operator&() const
       
  2577 /**
       
  2578 Returns a const TDesC type pointer.
       
  2579 
       
  2580 @return A descriptor type pointer to this literal. 
       
  2581 */
       
  2582 	{return REINTERPRET_CAST(const TDesC*,this);}
       
  2583 
       
  2584 
       
  2585 
       
  2586 
       
  2587 template <TInt S>
       
  2588 inline const TDesC& TLitC<S>::operator()() const
       
  2589 /**
       
  2590 Returns a const TDesC type reference.
       
  2591 
       
  2592 @return A descriptor type reference to this literal 
       
  2593 */
       
  2594 	{return *operator&();}
       
  2595 
       
  2596 
       
  2597 
       
  2598 
       
  2599 template <TInt S>
       
  2600 inline TLitC<S>::operator const TDesC&() const
       
  2601 /**
       
  2602 Invoked by the compiler when a TLitC<TInt> type is passed to a function
       
  2603 which is prototyped to take a const TDesC& type.
       
  2604 */
       
  2605 	{return *operator&();}
       
  2606 
       
  2607 
       
  2608 
       
  2609 
       
  2610 template <TInt S>
       
  2611 inline TLitC<S>::operator const __TRefDesC() const
       
  2612 /**
       
  2613 Invoked by the compiler when a TLitC<TInt> type is passed to a function
       
  2614 which is prototyped to take a const TRefByValue<const TDesC> type.
       
  2615 
       
  2616 @see __TRefDesC.
       
  2617 */
       
  2618 	{return *operator&();}
       
  2619 
       
  2620 
       
  2621 
       
  2622 
       
  2623 // Template class TPckgC
       
  2624 template <class T>
       
  2625 inline TPckgC<T>::TPckgC(const T &aRef)
       
  2626 	: TPtrC8((const TUint8 *)&aRef,sizeof(T))
       
  2627 /**
       
  2628 Constructs a packaged non-modifiable pointer descriptor to represent
       
  2629 the specified object whose type is defined by the template parameter.
       
  2630 
       
  2631 @param aRef The object to be represented by this packaged non-modifiable 
       
  2632             pointer descriptor.
       
  2633 */
       
  2634 	{}
       
  2635 
       
  2636 
       
  2637 
       
  2638 
       
  2639 template <class T>
       
  2640 inline const T &TPckgC<T>::operator()() const
       
  2641 /**
       
  2642 Gets a reference to the object represented by this packaged non-modifiable
       
  2643 pointer descriptor.
       
  2644 
       
  2645 @return The packaged object 
       
  2646 */
       
  2647 	{return(*((const T *)iPtr));}
       
  2648 
       
  2649 
       
  2650 
       
  2651 
       
  2652 // Template class TPckg
       
  2653 template <class T>
       
  2654 inline TPckg<T>::TPckg(const T &aRef)
       
  2655 	: TPtr8((TUint8 *)&aRef,sizeof(T),sizeof(T))
       
  2656 /**
       
  2657 Constructs a packaged modifiable pointer descriptor to represent the specified 
       
  2658 object whose type is defined by the template parameter.
       
  2659 
       
  2660 @param aRef The object to be represented by this packaged modifiable pointer 
       
  2661             descriptor.
       
  2662 */
       
  2663 	{}
       
  2664 
       
  2665 
       
  2666 
       
  2667 
       
  2668 template <class T>
       
  2669 inline T &TPckg<T>::operator()()
       
  2670 /**
       
  2671 Gets a reference to the object represented by this packaged
       
  2672 modifiable pointer descriptor.
       
  2673 
       
  2674 @return The packaged object.
       
  2675 */
       
  2676 	{return(*((T *)iPtr));}
       
  2677 
       
  2678 
       
  2679 
       
  2680 
       
  2681 // Template class TPckgBuf
       
  2682 template <class T>
       
  2683 inline TPckgBuf<T>::TPckgBuf()
       
  2684 	: TAlignedBuf8<sizeof(T)>(sizeof(T))
       
  2685 /**
       
  2686 Constructs a packaged modifiable buffer descriptor for an object whose type 
       
  2687 is defined by the template parameter.
       
  2688 
       
  2689 The length of the packaged descriptor is set to the length of the templated 
       
  2690 class but no data is assigned into the descriptor.
       
  2691 */
       
  2692 	{new(&this->iBuf[0]) T;}
       
  2693 
       
  2694 
       
  2695 
       
  2696 
       
  2697 template <class T>
       
  2698 inline TPckgBuf<T>::TPckgBuf(const T &aRef)
       
  2699 	: TAlignedBuf8<sizeof(T)>(sizeof(T))
       
  2700 /**
       
  2701 Constructs a packaged modifiable buffer descriptor for an object whose type 
       
  2702 is defined by the template parameter and copies the supplied object into the 
       
  2703 descriptor.
       
  2704 
       
  2705 The length of the packaged descriptor is set to the length of the templated 
       
  2706 class.
       
  2707 
       
  2708 @param aRef The source object to be copied into the packaged modifiable buffer 
       
  2709             descriptor.
       
  2710 */
       
  2711 	{new(&this->iBuf[0]) T(aRef);}
       
  2712 
       
  2713 
       
  2714 
       
  2715 
       
  2716 template <class T>
       
  2717 inline TPckgBuf<T> &TPckgBuf<T>::operator=(const TPckgBuf<T> &aRef)
       
  2718 /**
       
  2719 Copies data from the specified packaged modifiable buffer descriptor into this 
       
  2720 packaged modifiable buffer descriptor, replacing any existing data.
       
  2721 
       
  2722 @param aRef The source packaged modifiable buffer descriptor. 
       
  2723 @return A reference to this packaged modifiable descriptor.
       
  2724 */
       
  2725 	{this->Copy(aRef);return(*this);}
       
  2726 
       
  2727 
       
  2728 
       
  2729 
       
  2730 template <class T>
       
  2731 inline T &TPckgBuf<T>::operator=(const T &aRef)
       
  2732 /**
       
  2733 Copies data from the specified object into this packaged modifiable buffer 
       
  2734 descriptor, replacing any existing data.
       
  2735 
       
  2736 @param aRef The source object. 
       
  2737 @return A reference to the copy of the source object in the packaged modifiable 
       
  2738         buffer descriptor.
       
  2739 */
       
  2740 	{this->Copy((TUint8 *)&aRef,sizeof(T));return(*((T *)&this->iBuf[0]));}
       
  2741 
       
  2742 
       
  2743 
       
  2744 
       
  2745 template <class T>
       
  2746 inline T &TPckgBuf<T>::operator()()
       
  2747 /**
       
  2748 Gets a reference to the object contained by this packaged modifiable
       
  2749 buffer descriptor.
       
  2750 
       
  2751 @return The packaged object.
       
  2752 */
       
  2753 	{return(*((T *)&this->iBuf[0]));}
       
  2754 
       
  2755 
       
  2756 
       
  2757 
       
  2758 template <class T>
       
  2759 inline const T &TPckgBuf<T>::operator()() const
       
  2760 /**
       
  2761 Gets a const reference to the object contained by this packaged modifiable
       
  2762 buffer descriptor.
       
  2763 
       
  2764 @return The (const) packaged object.
       
  2765 */
       
  2766 	{return(*((T *)&this->iBuf[0]));}
       
  2767 
       
  2768 
       
  2769 
       
  2770 
       
  2771 // Class TRequestStatus
       
  2772 inline TRequestStatus::TRequestStatus()
       
  2773 /**
       
  2774 Default constructor.
       
  2775 */
       
  2776 : iFlags(0)
       
  2777 	{}
       
  2778 
       
  2779 
       
  2780 
       
  2781 
       
  2782 inline TRequestStatus::TRequestStatus(TInt aVal)
       
  2783 /**
       
  2784 Constructs an asynchronous request status object and assigns a completion value 
       
  2785 to it.
       
  2786 
       
  2787 @param aVal The completion value to be assigned to the constructed request 
       
  2788             status object.
       
  2789 */
       
  2790 	: iStatus(aVal),
       
  2791 	iFlags(aVal==KRequestPending ? TRequestStatus::ERequestPending : 0)
       
  2792 
       
  2793 	{}
       
  2794 
       
  2795 
       
  2796 
       
  2797 
       
  2798 inline TInt TRequestStatus::operator=(TInt aVal)
       
  2799 /**
       
  2800 Assigns the specified completion code to the request status object.
       
  2801 
       
  2802 @param aVal The value to be assigned.
       
  2803 
       
  2804 @return The value assigned.
       
  2805 */
       
  2806 	{
       
  2807 	if(aVal==KRequestPending)
       
  2808 		iFlags|=TRequestStatus::ERequestPending;
       
  2809 	else
       
  2810 		iFlags&=~TRequestStatus::ERequestPending;
       
  2811 	return (iStatus=aVal);
       
  2812 	}
       
  2813 
       
  2814 
       
  2815 
       
  2816 
       
  2817 inline TBool TRequestStatus::operator==(TInt aVal) const
       
  2818 /**
       
  2819 Tests whether the request status object's completion code is the same as
       
  2820 the specified value.
       
  2821 
       
  2822 @param aVal The value to be compared.
       
  2823 
       
  2824 @return True, if the values are equal; false otherwise.
       
  2825 */
       
  2826 	{return(iStatus==aVal);}
       
  2827 
       
  2828 
       
  2829 
       
  2830 
       
  2831 inline TBool TRequestStatus::operator!=(TInt aVal) const
       
  2832 /**
       
  2833 Tests whether the request status object's completion code is not equal to
       
  2834 the specified value.
       
  2835 
       
  2836 @param aVal The value to be compared.
       
  2837 
       
  2838 @return True, if the values are unequal; false otherwise.
       
  2839 */
       
  2840 	{return(iStatus!=aVal);}
       
  2841 
       
  2842 
       
  2843 
       
  2844 
       
  2845 inline TBool TRequestStatus::operator>=(TInt aVal) const
       
  2846 /**
       
  2847 Tests whether the request status object's completion code is greater than 
       
  2848 or equal to the specified value.
       
  2849 
       
  2850 @param aVal The value to be compared.
       
  2851 
       
  2852 @return True, if the request status object's value is greater than or equal 
       
  2853         to the specified value; false, otherwise.
       
  2854 */
       
  2855 	{return(iStatus>=aVal);}
       
  2856 
       
  2857 
       
  2858 
       
  2859 
       
  2860 inline TBool TRequestStatus::operator<=(TInt aVal) const
       
  2861 /**
       
  2862 Tests whether the request status object's completion code is less than or 
       
  2863 equal to the specified value.
       
  2864 
       
  2865 @param aVal The value to be compared.
       
  2866 
       
  2867 @return True, if the request status object's value is less than or equal 
       
  2868         to the specified value; false, otherwise.
       
  2869 */
       
  2870 	{return(iStatus<=aVal);}
       
  2871 
       
  2872 
       
  2873 
       
  2874 
       
  2875 inline TBool TRequestStatus::operator>(TInt aVal) const
       
  2876 /**
       
  2877 Tests whether the request status object's completion code is greater than 
       
  2878 the specified value.
       
  2879 
       
  2880 @param aVal The value to be compared.
       
  2881 
       
  2882 @return True, if the request status object's value is greater than
       
  2883         the specified value; false, otherwise.
       
  2884 */
       
  2885 	{return(iStatus>aVal);}
       
  2886 
       
  2887 
       
  2888 
       
  2889 
       
  2890 inline TBool TRequestStatus::operator<(TInt aVal) const
       
  2891 /**
       
  2892 Tests whether the request status object's completion code is less than the 
       
  2893 specified value.
       
  2894 
       
  2895 @param aVal The value to be compared.
       
  2896 
       
  2897 @return True, if the request status object's value is less than the specified 
       
  2898         value; false, otherwise.
       
  2899 */
       
  2900 	{return(iStatus<aVal);}
       
  2901 
       
  2902 
       
  2903 
       
  2904 
       
  2905 inline TInt TRequestStatus::Int() const
       
  2906 /**
       
  2907 Gets this request status object's completion code value.
       
  2908 
       
  2909 @return The completion code.
       
  2910 */
       
  2911 	{return(iStatus);}
       
  2912 
       
  2913 
       
  2914 
       
  2915 
       
  2916 // Class TPoint
       
  2917 #ifndef __KERNEL_MODE__
       
  2918 inline TPoint::TPoint()
       
  2919 	: iX(0),iY(0)
       
  2920 /**
       
  2921 Constructs default point, initialising its iX and iY members to zero.
       
  2922 */
       
  2923 	{}
       
  2924 
       
  2925 
       
  2926 
       
  2927 
       
  2928 inline TPoint::TPoint(TInt aX,TInt aY)
       
  2929 	: iX(aX),iY(aY)
       
  2930 /**
       
  2931 Constructs a point with the specified x and y co-ordinates.
       
  2932 
       
  2933 @param aX The x co-ordinate value.
       
  2934 @param aY The y co-ordinate value.
       
  2935 */
       
  2936 	{}
       
  2937 
       
  2938 
       
  2939 
       
  2940 
       
  2941 // Class TSize
       
  2942 inline TSize::TSize()
       
  2943 	: iWidth(0),iHeight(0)
       
  2944 /**
       
  2945 Constructs the size object with its iWidth and iHeight members set to zero.
       
  2946 */
       
  2947 	{}
       
  2948 
       
  2949 
       
  2950 
       
  2951 
       
  2952 inline TSize::TSize(TInt aWidth,TInt aHeight)
       
  2953 	: iWidth(aWidth),iHeight(aHeight)
       
  2954 /**
       
  2955 Constructs the size object with the specified width and height values.
       
  2956 
       
  2957 @param aWidth The width value.
       
  2958 @param aHeight The height value .
       
  2959 */
       
  2960 	{}
       
  2961 #endif
       
  2962 
       
  2963 
       
  2964 
       
  2965 
       
  2966 // Class TFindHandle
       
  2967 inline TFindHandle::TFindHandle()
       
  2968 	: iHandle(0), iSpare1(0), iObjectIdLow(0), iObjectIdHigh(0)
       
  2969 	{}
       
  2970 
       
  2971 
       
  2972 
       
  2973 
       
  2974 inline TInt TFindHandle::Handle() const
       
  2975 /**
       
  2976 @publishedAll
       
  2977 @released
       
  2978 
       
  2979 Gets the find-handle number associated with the Kernel object. 
       
  2980 
       
  2981 The find-handle number identifies the kernel object with respect to
       
  2982 its container.
       
  2983 	
       
  2984 Note that setting the find-handle number into a TFindHandle object is not
       
  2985 implemented by this class; it is implemented by derived classes, typically by
       
  2986 their Next() member functions. The class TFindSemaphore is a good example.
       
  2987 	
       
  2988 @return The find-handle number.
       
  2989 */
       
  2990 	{return iHandle;}
       
  2991 
       
  2992 
       
  2993 
       
  2994 
       
  2995 #ifdef __KERNEL_MODE__
       
  2996 const TInt KFindHandleUniqueIdShift=16;    ///< @internalComponent
       
  2997 const TInt KFindHandleUniqueIdMask=0x7fff; ///< @internalComponent
       
  2998 const TInt KFindHandleIndexMask=0x7fff;    ///< @internalComponent
       
  2999 
       
  3000 
       
  3001 
       
  3002 
       
  3003 /**
       
  3004 Gets the index into its container at which the kernel object was last seen.
       
  3005 
       
  3006 @return The object's index in its container.
       
  3007 */
       
  3008 inline TInt TFindHandle::Index() const
       
  3009 	{return(iHandle&KFindHandleIndexMask);}
       
  3010 
       
  3011 
       
  3012 
       
  3013 
       
  3014 /**
       
  3015 Gets the unique ID of the kernel container this object resides in.
       
  3016 
       
  3017 @return The ID of this object's container.
       
  3018 */
       
  3019 inline TInt TFindHandle::UniqueID() const
       
  3020 	{return((iHandle>>KFindHandleUniqueIdShift)&KFindHandleUniqueIdMask);}
       
  3021 
       
  3022 
       
  3023 
       
  3024 
       
  3025 /**
       
  3026 Gets the unique ID of the kernel object itself.
       
  3027 
       
  3028 @return The ID of the object.
       
  3029 */
       
  3030 inline TUint64 TFindHandle::ObjectID() const
       
  3031 	{return MAKE_TUINT64(iObjectIdHigh, iObjectIdLow);}
       
  3032 
       
  3033 
       
  3034 
       
  3035 
       
  3036 /**
       
  3037 Sets the find handle to refer to a specific object.
       
  3038 
       
  3039 @oaram aIndex The current index of the object in its container.
       
  3040 @param aUniqueId The unique ID of the container object.
       
  3041 @param aObjectId The unique ID of the object iteself.
       
  3042 */
       
  3043 inline void TFindHandle::Set(TInt aIndex, TInt aUniqueId, TUint64 aObjectId)
       
  3044 	{
       
  3045 	iHandle=(TInt)((aUniqueId<<KFindHandleUniqueIdShift)|aIndex);
       
  3046 	iObjectIdLow=I64LOW(aObjectId);
       
  3047 	iObjectIdHigh=I64HIGH(aObjectId);
       
  3048 	}
       
  3049 
       
  3050 
       
  3051 #else
       
  3052 
       
  3053 
       
  3054 /**
       
  3055 Resets the find handle to its initial state.
       
  3056 */
       
  3057 inline void TFindHandle::Reset()
       
  3058 	{
       
  3059 	iHandle=iSpare1=iObjectIdLow=iObjectIdHigh=0;
       
  3060 	}
       
  3061 #endif
       
  3062 
       
  3063 
       
  3064 
       
  3065 
       
  3066 // Class RHandleBase
       
  3067 inline RHandleBase::RHandleBase()
       
  3068 	: iHandle(0)
       
  3069 /**
       
  3070 Default constructor.
       
  3071 */
       
  3072 	{}
       
  3073 
       
  3074 
       
  3075 
       
  3076 
       
  3077 #ifndef __KERNEL_MODE__
       
  3078 inline RHandleBase::RHandleBase(TInt aHandle)
       
  3079 	: iHandle(aHandle)
       
  3080 /**
       
  3081 Copy constructor.
       
  3082 
       
  3083 It constructs this handle from an existing one. Specifically, the handle-number 
       
  3084 encapsulated by the specified handle is copied to this handle.
       
  3085 
       
  3086 @param aHandle The existing handle to be copied.
       
  3087 */
       
  3088 	{}
       
  3089 #endif
       
  3090 
       
  3091 
       
  3092 
       
  3093 
       
  3094 inline void RHandleBase::SetHandle(TInt aHandle)
       
  3095 /**
       
  3096 Sets the handle-number of this handle to the specified 
       
  3097 value.
       
  3098 
       
  3099 @param aHandle The handle-number to be set.
       
  3100 */
       
  3101 	{ iHandle=aHandle; }
       
  3102 
       
  3103 
       
  3104 
       
  3105 
       
  3106 inline TInt RHandleBase::Handle() const
       
  3107 /**
       
  3108 Retrieves the handle-number of the object associated with this handle.
       
  3109 
       
  3110 @return The handle number
       
  3111 */
       
  3112 	{return(iHandle);}
       
  3113 
       
  3114 
       
  3115 
       
  3116 
       
  3117 inline TInt RHandleBase::SetReturnedHandle(TInt aHandleOrError)
       
  3118 /**
       
  3119 Sets the handle-number of this handle to the specified 
       
  3120 value.
       
  3121 
       
  3122 The function can take a (zero or positive) handle-number,
       
  3123 or a (negative) error number.
       
  3124 
       
  3125 If aHandleOrError represents a handle-number, then the handle-number of this handle
       
  3126 is set to that value.
       
  3127 If aHandleOrError represents an error number, then the handle-number of this handle is set to zero
       
  3128 and the negative value is returned.
       
  3129 
       
  3130 @param aHandleOrError A handle-number, if zero or positive; an error value, if negative.
       
  3131 
       
  3132 @return KErrNone, if aHandle is a handle-number; the value of aHandleOrError, otherwise.
       
  3133 */
       
  3134 	{
       
  3135 	if(aHandleOrError>=0)
       
  3136 		{
       
  3137 		iHandle = aHandleOrError;
       
  3138 		return KErrNone;
       
  3139 		}
       
  3140 	iHandle = 0;
       
  3141 	return aHandleOrError;
       
  3142 	}
       
  3143 
       
  3144 
       
  3145 
       
  3146 
       
  3147 // Class RSemaphore
       
  3148 #ifndef __KERNEL_MODE__
       
  3149 inline TInt RSemaphore::Open(const TFindSemaphore& aFind,TOwnerType aType)
       
  3150 /**
       
  3151 Opens a handle to the global semaphore found using a TFindSemaphore object.
       
  3152 
       
  3153 A TFindSemaphore object is used to find all global semaphores whose full names 
       
  3154 match a specified pattern.
       
  3155 
       
  3156 By default, any thread in the process can use this instance of RSemaphore 
       
  3157 to access the semaphore. However, specifying EOwnerThread as the second parameter 
       
  3158 to this function, means that only the opening thread can use this instance 
       
  3159 of RSemaphore to access the semaphore; any other thread in this process that 
       
  3160 wants to access the semaphore must either duplicate the handle or use OpenGlobal() 
       
  3161 again.
       
  3162 
       
  3163 @param aFind A reference to the TFindSemaphore object used to find the semaphore. 
       
  3164 @param aType An enumeration whose enumerators define the ownership of this 
       
  3165              semaphore handle. If not explicitly specified, EOwnerProcess is
       
  3166 			 taken as default. 
       
  3167 
       
  3168 @return KErrNone if successful otherwise another of the system wide error codes.
       
  3169 */
       
  3170 	{return(RHandleBase::Open((const TFindHandleBase&)aFind,aType));}
       
  3171 #endif
       
  3172 
       
  3173 
       
  3174 
       
  3175 
       
  3176 // Class RFastLock
       
  3177 
       
  3178 
       
  3179 /**
       
  3180 Default constructor.
       
  3181 */
       
  3182 inline RFastLock::RFastLock()
       
  3183 	:	iCount(0)
       
  3184 	{}
       
  3185 
       
  3186 
       
  3187 
       
  3188 
       
  3189 // Class RMessagePtr2
       
  3190 
       
  3191 
       
  3192 /**
       
  3193 Default constructor
       
  3194 */
       
  3195 inline RMessagePtr2::RMessagePtr2()
       
  3196 	: iHandle(0)
       
  3197 	{}
       
  3198 
       
  3199 
       
  3200 
       
  3201 
       
  3202 /**
       
  3203 Tests whether this message handle is empty.
       
  3204 
       
  3205 @return True, if this message handle is empty, false, otherwise.
       
  3206 */
       
  3207 inline TBool RMessagePtr2::IsNull() const
       
  3208 	{return iHandle==0;}
       
  3209 
       
  3210 
       
  3211 
       
  3212 
       
  3213 /**
       
  3214 Gets the message handle value.
       
  3215 
       
  3216 @return The message handle value.
       
  3217 */
       
  3218 inline TInt RMessagePtr2::Handle() const
       
  3219 	{return iHandle;}
       
  3220 inline TBool operator==(RMessagePtr2 aLeft,RMessagePtr2 aRight)
       
  3221 	{return aLeft.Handle()==aRight.Handle();}
       
  3222 inline TBool operator!=(RMessagePtr2 aLeft,RMessagePtr2 aRight)
       
  3223 	{return aLeft.Handle()!=aRight.Handle();}
       
  3224 
       
  3225 
       
  3226 
       
  3227 
       
  3228 
       
  3229 // Class RMessage
       
  3230 
       
  3231 
       
  3232 /**
       
  3233 Default constructor
       
  3234 */
       
  3235 inline RMessage2::RMessage2()
       
  3236 	{}
       
  3237 
       
  3238 
       
  3239 
       
  3240 
       
  3241 /**
       
  3242 Gets the the number of the function requested by the client.
       
  3243 
       
  3244 @return The function number. 
       
  3245 */
       
  3246 inline TInt RMessage2::Function() const
       
  3247 	{return(iFunction);}
       
  3248 
       
  3249 
       
  3250 
       
  3251 
       
  3252 /**
       
  3253 Gets the first message argument as an integer value.
       
  3254 
       
  3255 @return The first message argument.
       
  3256 */
       
  3257 inline TInt RMessage2::Int0() const
       
  3258 	{return(iArgs[0]);}
       
  3259 
       
  3260 
       
  3261 
       
  3262 
       
  3263 /**
       
  3264 Gets the second message argument as an integer value.
       
  3265 
       
  3266 @return The second message argument.
       
  3267 */
       
  3268 inline TInt RMessage2::Int1() const
       
  3269 	{return(iArgs[1]);}
       
  3270 
       
  3271 
       
  3272 
       
  3273 
       
  3274 /**
       
  3275 Gets the third message argument as an integer value.
       
  3276 
       
  3277 @return The third message argument.
       
  3278 */
       
  3279 inline TInt RMessage2::Int2() const
       
  3280 	{return(iArgs[2]);}
       
  3281 
       
  3282 
       
  3283 
       
  3284 /**
       
  3285 Gets the fourth message argument as an integer value.
       
  3286 
       
  3287 @return The fourth message argument.
       
  3288 */
       
  3289 inline TInt RMessage2::Int3() const
       
  3290 	{return(iArgs[3]);}
       
  3291 
       
  3292 
       
  3293 
       
  3294 /**
       
  3295 Gets the first message argument as a pointer type.
       
  3296 
       
  3297 @return The first message argument.
       
  3298 */
       
  3299 inline const TAny *RMessage2::Ptr0() const
       
  3300 	{return((const TAny *)iArgs[0]);}
       
  3301 
       
  3302 
       
  3303 
       
  3304 
       
  3305 /**
       
  3306 Gets the second message argument as a pointer type.
       
  3307 
       
  3308 @return The second message argument.
       
  3309 */
       
  3310 inline const TAny *RMessage2::Ptr1() const
       
  3311 	{return((const TAny *)iArgs[1]);}
       
  3312 
       
  3313 
       
  3314 
       
  3315 
       
  3316 /**
       
  3317 Gets the third message argument as a pointer type.
       
  3318 
       
  3319 @return The third message argument.
       
  3320 */
       
  3321 inline const TAny *RMessage2::Ptr2() const
       
  3322 	{return((const TAny *)iArgs[2]);}
       
  3323 
       
  3324 
       
  3325 
       
  3326 
       
  3327 /**
       
  3328 Gets the fourth message argument as a pointer type.
       
  3329 
       
  3330 @return The fourth message argument.
       
  3331 */
       
  3332 inline const TAny *RMessage2::Ptr3() const
       
  3333 	{return((const TAny *)iArgs[3]);}
       
  3334 
       
  3335 
       
  3336 
       
  3337 /**
       
  3338 Gets a pointer to the session.
       
  3339 
       
  3340 @return A pointer to the session object.
       
  3341 */
       
  3342 inline CSession2* RMessage2::Session() const
       
  3343 	{return (CSession2*)iSessionPtr; }
       
  3344 
       
  3345 
       
  3346 
       
  3347 
       
  3348 // Class TUid
       
  3349 inline TUid TUid::Uid(TInt aUid)
       
  3350 /**
       
  3351 Constructs the TUid object from a 32-bit integer.
       
  3352 
       
  3353 @param aUid The 32-bit integer value from which the TUid object is to be
       
  3354             constructed.
       
  3355 
       
  3356 @return The constructed TUid object.
       
  3357 */
       
  3358 	{TUid uid={aUid};return uid;}
       
  3359 
       
  3360 
       
  3361 
       
  3362 
       
  3363 inline TUid TUid::Null()
       
  3364 /**
       
  3365 Constructs a Null-valued TUid object.
       
  3366 
       
  3367 @return The constructed Null-valued TUid object.
       
  3368 */
       
  3369 	{TUid uid={KNullUidValue};return uid;}
       
  3370 
       
  3371 
       
  3372 
       
  3373 
       
  3374 #ifndef __KERNEL_MODE__
       
  3375 // Template class TArray
       
  3376 template <class T>
       
  3377 inline TArray<T>::TArray(TInt (*aCount)(const CBase *aPtr),const TAny *(*anAt)(const CBase *aPtr,TInt anIndex),const CBase *aPtr)
       
  3378 	: iPtr(aPtr),iCount(aCount),iAt(anAt)
       
  3379 /**
       
  3380 Constructor.
       
  3381 
       
  3382 A TArray object is not intended to be instantiated explicitly. An object of
       
  3383 this type is instantiated as a result of a call to to the Array() member
       
  3384 function of a concrete array class
       
  3385 
       
  3386 @param aCount A pointer to a function which takes a
       
  3387               @code
       
  3388 			  const CBase*
       
  3389               @endcode
       
  3390               argument and returns a
       
  3391               @code
       
  3392               TInt
       
  3393               @endcode
       
  3394               aCount must point to the member function which returns the
       
  3395               current number of elements of type class T contained in the
       
  3396 	          array at aPtr, for which this TArray is being constructed.
       
  3397               This argument is supplied by the Array() member function of the
       
  3398               array class. 
       
  3399 @param anAt   A pointer to a function which takes a
       
  3400               @code
       
  3401               const CBase*
       
  3402               @endcode
       
  3403               and a 
       
  3404               @code
       
  3405               TInt
       
  3406               @endcode
       
  3407               argument, and returns a pointer to
       
  3408               @code
       
  3409               TAny
       
  3410               @endcode
       
  3411               anAt must point to the member function which returns a reference
       
  3412               to the element located at position anIndex within the array at
       
  3413               aPtr, for which this TArray is being constructed.
       
  3414               This argument is supplied by the Array() member function of the
       
  3415               array class.
       
  3416 @param aPtr   A pointer to the array for which this TArray is being
       
  3417               constructed. This argument is supplied by the Array() member
       
  3418               function of the array class.
       
  3419 
       
  3420 @see CArrayFixFlat::Array
       
  3421 @see CArrayFixSeg::Array
       
  3422 @see CArrayVarFlat::Array
       
  3423 @see CArrayVarSeg::Array
       
  3424 @see CArrayPakFlat::Array
       
  3425 @see RArray::Array
       
  3426 @see RPointerArray::Array
       
  3427 @see RArray<TInt>::Array
       
  3428 @see RArray<TUint>::Array
       
  3429 */
       
  3430 	{}
       
  3431 
       
  3432 
       
  3433 
       
  3434 
       
  3435 template <class T>
       
  3436 inline TInt TArray<T>::Count() const
       
  3437 /**
       
  3438 Gets the number of elements currently held in the array for which this generic 
       
  3439 array has been constructed.
       
  3440 
       
  3441 @return The number of array elements.
       
  3442 */
       
  3443 	{return((*iCount)(iPtr));}
       
  3444 
       
  3445 
       
  3446 
       
  3447 
       
  3448 template <class T>
       
  3449 inline const T &TArray<T>::operator[](TInt anIndex) const
       
  3450 /**
       
  3451 Gets a reference to the element located at the specified position.
       
  3452 
       
  3453 The returned reference is const and cannot be used to change the element.
       
  3454 Any member function of the referenced template class T must be declared
       
  3455 as const if that function is to be accessed through this operator.
       
  3456 
       
  3457 @param anIndex The position of the element within the array for which this
       
  3458                TArray has been constructed. The position is relative to zero;
       
  3459 			   i.e. zero implies the first element in the array. 
       
  3460 
       
  3461 @return A const reference to the element located at position anIndex within
       
  3462         the array for which this TArray has been constructed.
       
  3463 
       
  3464 @panic E32USER-CBase 21, if anIndex is negative, or greater than or equal to
       
  3465        the number of objects currently within the array.
       
  3466 */
       
  3467 	{return(*((const T *)(*iAt)(iPtr,anIndex)));}
       
  3468 #endif
       
  3469 
       
  3470 
       
  3471 
       
  3472 
       
  3473 // Class TIdentityRelation<T>
       
  3474 template <class T>
       
  3475 inline TIdentityRelation<T>::TIdentityRelation( TBool (*anIdentity)(const T&, const T&) )
       
  3476 /**
       
  3477 Constructs the object taking the specified function as an argument.
       
  3478 
       
  3479 The specified function should implement an algorithm for determining whether
       
  3480 two class T type objects match. It should return:
       
  3481 
       
  3482 1. true, if the two objects match.
       
  3483 
       
  3484 2. false, if the two objects do not match.
       
  3485 
       
  3486 @param anIdentity A pointer to a function that takes constant references to two
       
  3487                   class T objects and returns a TInt value. 
       
  3488 */
       
  3489 	{ iIdentity=(TGeneralIdentityRelation)anIdentity; }
       
  3490 
       
  3491 
       
  3492 
       
  3493 
       
  3494 template <class T>
       
  3495 inline TIdentityRelation<T>::operator TGeneralIdentityRelation() const
       
  3496 /**
       
  3497 Operator that gets the function that determines whether two
       
  3498 objects of a given class type match.
       
  3499 */
       
  3500 	{ return iIdentity; }
       
  3501 
       
  3502 
       
  3503 
       
  3504 
       
  3505 // Class TLinearOrder<T>
       
  3506 template <class T>
       
  3507 inline TLinearOrder<T>::TLinearOrder( TInt(*anOrder)(const T&, const T&) )
       
  3508 /**
       
  3509 Constructs the object taking the specified function as an argument.
       
  3510 
       
  3511 The specified function should implement an algorithm that determines the
       
  3512 order of two class T type objects. It should return:
       
  3513 
       
  3514 1. zero, if the two objects are equal.
       
  3515 
       
  3516 2. a negative value, if the first object is less than the second.
       
  3517 
       
  3518 3. a positive value, if the first object is greater than the second.
       
  3519 
       
  3520 @param anOrder A pointer to a function that takes constant references to two
       
  3521                class T objects and returns a TInt value. 
       
  3522 */
       
  3523 	{ iOrder=(TGeneralLinearOrder)anOrder; }
       
  3524 
       
  3525 
       
  3526 
       
  3527 
       
  3528 template <class T>
       
  3529 inline TLinearOrder<T>::operator TGeneralLinearOrder() const
       
  3530 /**
       
  3531 Operator that gets the function that determines the order of two
       
  3532 objects of a given class type.
       
  3533 */
       
  3534 	{ return iOrder; }
       
  3535 
       
  3536 
       
  3537 
       
  3538 
       
  3539 // Class RPointerArray<T>
       
  3540 
       
  3541 /**
       
  3542 Default C++ constructor.
       
  3543 
       
  3544 This constructs an array object for an array of pointers with default
       
  3545 granularity, which is 8.
       
  3546 */
       
  3547 template <class T>
       
  3548 inline RPointerArray<T>::RPointerArray()
       
  3549 	: RPointerArrayBase()
       
  3550 	{}
       
  3551 
       
  3552 
       
  3553 
       
  3554 
       
  3555 /**
       
  3556 C++ constructor with granularity.
       
  3557 
       
  3558 This constructs an array object for an array of pointers with the specified 
       
  3559 granularity.
       
  3560 
       
  3561 @param aGranularity The granularity of the array.
       
  3562 
       
  3563 @panic USER 127, if aGranularity is not positive, or greater than or equal
       
  3564        to 0x10000000.
       
  3565 */
       
  3566 template <class T>
       
  3567 inline RPointerArray<T>::RPointerArray(TInt aGranularity)
       
  3568 	: RPointerArrayBase(aGranularity)
       
  3569 	{}
       
  3570 
       
  3571 
       
  3572 
       
  3573 
       
  3574 /**
       
  3575 C++ constructor with minimum growth step and exponential growth factor.
       
  3576 
       
  3577 This constructs an array object for an array of pointers with the specified 
       
  3578 minimum growth step and exponential growth factor.
       
  3579 
       
  3580 @param aMinGrowBy	The minimum growth step of the array. Must be between 1 and
       
  3581 					65535 inclusive.
       
  3582 @param aFactor		The factor by which the array grows, multiplied by 256.
       
  3583 					For example 512 specifies a factor of 2. Must be between 257
       
  3584 					and 32767 inclusive.
       
  3585 
       
  3586 @panic USER 192, if aMinGrowBy<=0 or aMinGrowBy>65535.
       
  3587 @panic USER 193, if aFactor<=257 or aFactor>32767.
       
  3588 */
       
  3589 template <class T>
       
  3590 inline RPointerArray<T>::RPointerArray(TInt aMinGrowBy, TInt aFactor)
       
  3591 	: RPointerArrayBase(aMinGrowBy, aFactor)
       
  3592 	{}
       
  3593 
       
  3594 
       
  3595 
       
  3596 
       
  3597 template <class T>
       
  3598 inline void RPointerArray<T>::Close()
       
  3599 /**
       
  3600 Closes the array and frees all memory allocated to it.
       
  3601 
       
  3602 The function must be called before this array object goes out of scope.
       
  3603 
       
  3604 Note that the function does not delete the objects whose pointers are contained
       
  3605 in the array.
       
  3606 */
       
  3607 	{RPointerArrayBase::Close();}
       
  3608 
       
  3609 
       
  3610 
       
  3611 
       
  3612 template <class T>
       
  3613 inline TInt RPointerArray<T>::Count() const
       
  3614 /**
       
  3615 Gets the number of object pointers in the array.
       
  3616 
       
  3617 @return The number of object pointers in the array.
       
  3618 */
       
  3619 	{ return RPointerArrayBase::Count(); }
       
  3620 
       
  3621 
       
  3622 
       
  3623 
       
  3624 template <class T>
       
  3625 inline T* const& RPointerArray<T>::operator[](TInt anIndex) const
       
  3626 /**
       
  3627 Gets a reference to the object pointer located at the specified 
       
  3628 position within the array.
       
  3629 
       
  3630 The compiler chooses this option if the returned reference is used in
       
  3631 an expression where the reference cannot be modified.
       
  3632 
       
  3633 @param anIndex The position of the object pointer within the array. The
       
  3634                position is relative to zero, i.e. zero implies the object
       
  3635 			   pointer at the beginning of the array.
       
  3636 
       
  3637 @return A const reference to the object pointer at position anIndex within 
       
  3638         the array.
       
  3639 
       
  3640 @panic USER 130, if anIndex is negative, or is greater than the number of
       
  3641        objects currently in the array.
       
  3642 */
       
  3643 	{return (T* const&)At(anIndex);}
       
  3644 
       
  3645 
       
  3646 
       
  3647 
       
  3648 template <class T>
       
  3649 inline T*& RPointerArray<T>::operator[](TInt anIndex)
       
  3650 /**
       
  3651 Gets a reference to the object pointer located at the specified 
       
  3652 position within the array.
       
  3653 
       
  3654 The compiler chooses this option if the returned reference is used in
       
  3655 an expression where the reference can be modified.
       
  3656 
       
  3657 @param anIndex The position of the object pointer within the array. The
       
  3658                position is relative to zero, i.e. zero implies the object
       
  3659 			   pointer at the beginning of the array.
       
  3660 
       
  3661 @return A non-const reference to the object pointer at position anIndex within 
       
  3662         the array.
       
  3663 
       
  3664 @panic USER 130, if anIndex is negative, or is greater than the number of
       
  3665        objects currently in the array.
       
  3666 */
       
  3667 	{return (T*&)At(anIndex);}
       
  3668 
       
  3669 
       
  3670 
       
  3671 
       
  3672 template <class T>
       
  3673 inline TInt RPointerArray<T>::Append(const T* anEntry)
       
  3674 /**
       
  3675 Appends an object pointer onto the array.
       
  3676 
       
  3677 @param anEntry The object pointer to be appended.
       
  3678 
       
  3679 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  3680         wide error codes.
       
  3681 */
       
  3682 	{ return RPointerArrayBase::Append(anEntry); }
       
  3683 
       
  3684 
       
  3685 
       
  3686 
       
  3687 template <class T>
       
  3688 inline TInt RPointerArray<T>::Insert(const T* anEntry, TInt aPos)
       
  3689 /**
       
  3690 Inserts an object pointer into the array at the specified position.
       
  3691 
       
  3692 @param anEntry The object pointer to be inserted.
       
  3693 @param aPos    The position within the array where the object pointer is to be 
       
  3694                inserted. The position is relative to zero, i.e. zero implies
       
  3695 			   that a pointer is inserted at the beginning of the array.
       
  3696 
       
  3697 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  3698         wide error codes.
       
  3699 
       
  3700 @panic USER 131, if aPos is negative, or is greater than the number of object
       
  3701        pointers currently in the array.
       
  3702 */
       
  3703 	{ return RPointerArrayBase::Insert(anEntry,aPos); }
       
  3704 
       
  3705 
       
  3706 
       
  3707 
       
  3708 template <class T>
       
  3709 inline void RPointerArray<T>::Remove(TInt anIndex)
       
  3710 /**
       
  3711 Removes the object pointer at the specified position from the array.
       
  3712 
       
  3713 Note that the function does not delete the object whose pointer is removed.
       
  3714 
       
  3715 @param anIndex The position within the array from where the object pointer 
       
  3716                is to be removed. The position is relative to zero, i.e. zero
       
  3717 			   implies that a pointer at the beginning of the array is to be
       
  3718 			   removed.
       
  3719 			   
       
  3720 @panic USER 130, if anIndex is negative, or is greater than the number of
       
  3721        objects currently in the array. 
       
  3722 */
       
  3723 	{RPointerArrayBase::Remove(anIndex);}
       
  3724 
       
  3725 
       
  3726 
       
  3727 
       
  3728 template <class T>
       
  3729 inline void RPointerArray<T>::Compress()
       
  3730 /**
       
  3731 Compresses the array down to a minimum.
       
  3732 
       
  3733 After a call to this function, the memory allocated to the array is just
       
  3734 sufficient for its contained object pointers.
       
  3735 Subsequently adding a new object pointer to the array 
       
  3736 always results in a re-allocation of memory.
       
  3737 */
       
  3738 	{RPointerArrayBase::Compress();}
       
  3739 
       
  3740 
       
  3741 
       
  3742 
       
  3743 template <class T>
       
  3744 inline void RPointerArray<T>::Reset()
       
  3745 /**
       
  3746 Empties the array.
       
  3747 
       
  3748 It frees all memory allocated to the array and resets the internal state so 
       
  3749 that it is ready to be reused.
       
  3750 
       
  3751 This array object can be allowed to go out of scope after a call to this
       
  3752 function.
       
  3753 
       
  3754 Note that the function does not delete the objects whose pointers are contained
       
  3755 in the array.
       
  3756 */
       
  3757 	{RPointerArrayBase::Reset();}
       
  3758 
       
  3759 
       
  3760 
       
  3761 
       
  3762 template <class T>
       
  3763 inline TInt RPointerArray<T>::Find(const T* anEntry) const
       
  3764 /**
       
  3765 Finds the first object pointer in the array which matches the specified object 
       
  3766 pointer, using a sequential search.
       
  3767 
       
  3768 Matching is based on the comparison of pointers.
       
  3769 
       
  3770 The find operation always starts at the low index end of the array. There 
       
  3771 is no assumption about the order of objects in the array.
       
  3772 
       
  3773 @param anEntry The object pointer to be found.
       
  3774 @return The index of the first matching object pointer within the array.
       
  3775         KErrNotFound, if no matching object pointer can be found.
       
  3776 */
       
  3777 	{ return RPointerArrayBase::Find(anEntry); }
       
  3778 
       
  3779 
       
  3780 
       
  3781 
       
  3782 template <class T>
       
  3783 inline TInt RPointerArray<T>::Find(const T* anEntry, TIdentityRelation<T> anIdentity) const
       
  3784 /**
       
  3785 Finds the first object pointer in the array whose object matches the specified 
       
  3786 object, using a sequential search and a matching algorithm.
       
  3787 
       
  3788 The algorithm for determining whether two class T objects match is provided 
       
  3789 by a function supplied by the caller.
       
  3790 
       
  3791 The find operation always starts at the low index end of the array. There 
       
  3792 is no assumption about the order of objects in the array.
       
  3793 
       
  3794 @param anEntry    The object pointer to be found.
       
  3795 @param anIdentity A package encapsulating the function which determines whether 
       
  3796                   two class T objects match.
       
  3797 
       
  3798 @return The index of the first matching object pointer within the array.
       
  3799         KErrNotFound, if no suitable object pointer can be found.
       
  3800 */
       
  3801 	{ return RPointerArrayBase::Find(anEntry,anIdentity); }
       
  3802 
       
  3803 
       
  3804 
       
  3805 
       
  3806 template <class T>
       
  3807 inline TInt RPointerArray<T>::FindReverse(const T* anEntry) const
       
  3808 /**
       
  3809 Finds the last object pointer in the array which matches the specified object 
       
  3810 pointer, using a sequential search.
       
  3811 
       
  3812 Matching is based on the comparison of pointers.
       
  3813 
       
  3814 The find operation always starts at the high index end of the array. There 
       
  3815 is no assumption about the order of objects in the array.
       
  3816 
       
  3817 @param anEntry The object pointer to be found.
       
  3818 @return The index of the last matching object pointer within the array.
       
  3819         KErrNotFound, if no matching object pointer can be found.
       
  3820 */
       
  3821 	{ return RPointerArrayBase::FindReverse(anEntry); }
       
  3822 
       
  3823 
       
  3824 
       
  3825 
       
  3826 template <class T>
       
  3827 inline TInt RPointerArray<T>::FindReverse(const T* anEntry, TIdentityRelation<T> anIdentity) const
       
  3828 /**
       
  3829 Finds the last object pointer in the array whose object matches the specified 
       
  3830 object, using a sequential search and a matching algorithm.
       
  3831 
       
  3832 The algorithm for determining whether two class T objects match is provided 
       
  3833 by a function supplied by the caller.
       
  3834 
       
  3835 The find operation always starts at the high index end of the array. There 
       
  3836 is no assumption about the order of objects in the array.
       
  3837 
       
  3838 @param anEntry    The object pointer to be found.
       
  3839 @param anIdentity A package encapsulating the function which determines whether 
       
  3840                   two class T objects match.
       
  3841 
       
  3842 @return The index of the last matching object pointer within the array.
       
  3843         KErrNotFound, if no suitable object pointer can be found.
       
  3844 */
       
  3845 	{ return RPointerArrayBase::FindReverse(anEntry,anIdentity); }
       
  3846 
       
  3847 
       
  3848 
       
  3849 
       
  3850 template <class T>
       
  3851 inline TInt RPointerArray<T>::FindInAddressOrder(const T* anEntry) const
       
  3852 /**
       
  3853 Finds the object pointer in the array that matches the specified object
       
  3854 pointer, using a binary search technique.
       
  3855 
       
  3856 The function assumes that object pointers in the array are in address order.
       
  3857 
       
  3858 @param anEntry The object pointer to be found.
       
  3859 
       
  3860 @return The index of the matching object pointer within the array or KErrNotFound 
       
  3861         if no suitable object pointer can be found.
       
  3862 */
       
  3863 	{ return RPointerArrayBase::FindIsqUnsigned((TUint)anEntry); }
       
  3864 
       
  3865 
       
  3866 
       
  3867 
       
  3868 template <class T>
       
  3869 inline TInt RPointerArray<T>::FindInOrder(const T* anEntry, TLinearOrder<T> anOrder) const
       
  3870 /**
       
  3871 Finds the object pointer in the array whose object matches the specified
       
  3872 object, using a binary search technique and an ordering algorithm.
       
  3873 
       
  3874 The function assumes that existing object pointers in the array are ordered 
       
  3875 so that the objects themselves are in object order as determined by an algorithm 
       
  3876 supplied by the caller and packaged as a TLinearOrder<T>.
       
  3877 
       
  3878 @param anEntry The object pointer to be found.
       
  3879 @param anOrder A package encapsulating the function which determines the order 
       
  3880                of two class T objects.
       
  3881 
       
  3882 @return The index of the matching object pointer within the array or KErrNotFound, 
       
  3883         if no suitable object pointer can be found.
       
  3884 */
       
  3885 	{ return RPointerArrayBase::FindIsq(anEntry,anOrder); }
       
  3886 
       
  3887 
       
  3888 
       
  3889 
       
  3890 template <class T>
       
  3891 inline TInt RPointerArray<T>::FindInAddressOrder(const T* anEntry, TInt& anIndex) const
       
  3892 /**
       
  3893 Finds the object pointer in the array that matches the specified object
       
  3894 pointer, using a binary search technique.
       
  3895 
       
  3896 The function assumes that object pointers in the array are in address order.
       
  3897 
       
  3898 @param anEntry The object pointer to be found.
       
  3899 @param anIndex A TInt supplied by the caller. On return, contains an index
       
  3900                value:
       
  3901                If the function returns KErrNone, this is the index of the
       
  3902                matching object pointer within the array. 
       
  3903                If the function returns KErrNotFound,  this is the
       
  3904                index of the first object pointer within the array which
       
  3905                logically follows after anEntry.
       
  3906 
       
  3907 @return KErrNone, if a matching object pointer is found.
       
  3908         KErrNotFound, if no suitable object pointer can be found.
       
  3909 */
       
  3910 	{ return RPointerArrayBase::BinarySearchUnsigned((TUint)anEntry,anIndex); }
       
  3911 
       
  3912 
       
  3913 
       
  3914 
       
  3915 template <class T>
       
  3916 inline TInt RPointerArray<T>::FindInOrder(const T* anEntry, TInt& anIndex, TLinearOrder<T> anOrder) const
       
  3917 /**
       
  3918 Finds the object pointer in the array whose object matches the specified
       
  3919 object, using a binary search technique and an ordering algorithm.
       
  3920 
       
  3921 The function assumes that existing object pointers in the array are ordered 
       
  3922 so that the objects themselves are in object order as determined by an
       
  3923 algorithm supplied by the caller and packaged as a TLinearOrder<T>.
       
  3924 
       
  3925 @param anEntry The object pointer to be found.
       
  3926 @param anIndex A TInt supplied by the caller. On return, contains an
       
  3927                index value:
       
  3928                If the function returns KErrNone, this is the index of the
       
  3929                matching object pointer within the array. 
       
  3930                If the function returns KErrNotFound, this is the index of
       
  3931                the first object pointer in the array whose object is larger
       
  3932                than the entry being searched for - if no objects pointed to in
       
  3933                the array are larger, then the index value is the same as the
       
  3934                total number of object pointers in the array.
       
  3935 
       
  3936 @param anOrder A package encapsulating the function which determines the order 
       
  3937                of two class T objects.
       
  3938 
       
  3939 @return KErrNone, if a matching object pointer is found.
       
  3940         KErrNotFound, if no suitable object pointer can be found.
       
  3941 */
       
  3942 	{ return RPointerArrayBase::BinarySearch(anEntry,anIndex,anOrder); }
       
  3943 
       
  3944 
       
  3945 
       
  3946 
       
  3947 template <class T>
       
  3948 inline TInt RPointerArray<T>::SpecificFindInAddressOrder(const T* anEntry, TInt aMode) const
       
  3949 /**
       
  3950 Finds the object pointer in the array that matches the specified object
       
  3951 pointer, using a binary search technique.
       
  3952 
       
  3953 Where there is more than one matching element, it finds the first, the last 
       
  3954 or any matching element as specified by the value of aMode.
       
  3955 
       
  3956 The function assumes that object pointers in the array are in address order.
       
  3957 
       
  3958 @param	anEntry The object pointer to be found.
       
  3959 @param	aMode   Specifies whether to find the first match, the last match or
       
  3960                 any match, as defined by one of the TArrayFindMode enum values.
       
  3961 
       
  3962 @return KErrNotFound, if there is no matching element, otherwise the array
       
  3963         index of a matching element - what the index refers to depends on the
       
  3964         value of aMode:
       
  3965         if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  3966         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  3967         if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  3968         the last matching element - if the last matching element is also the last element of
       
  3969         the array, then the index value is the same as the total number of elements in the array.
       
  3970         
       
  3971 @see TArrayFindMode
       
  3972 */
       
  3973 	{ return RPointerArrayBase::FindIsqUnsigned((TUint)anEntry, aMode); }
       
  3974 
       
  3975 
       
  3976 
       
  3977 
       
  3978 template <class T>
       
  3979 inline TInt RPointerArray<T>::SpecificFindInOrder(const T* anEntry, TLinearOrder<T> anOrder, TInt aMode) const
       
  3980 /**
       
  3981 Finds the object pointer in the array whose object matches the specified
       
  3982 object, using a binary search technique and an ordering algorithm.
       
  3983 
       
  3984 Where there is more than one matching element, it finds the first, the last
       
  3985 or any matching element as specified by the value of aMode.
       
  3986 
       
  3987 The function assumes that existing object pointers in the array are ordered 
       
  3988 so that the objects themselves are in object order as determined by an algorithm 
       
  3989 supplied by the caller and packaged as a TLinearOrder<T> type.
       
  3990 
       
  3991 @param anEntry The object pointer to be found.
       
  3992 @param anOrder A package encapsulating the function which determines the order 
       
  3993                of two class T objects.
       
  3994 @param	aMode  Specifies whether to find the first match, the last match or any match,
       
  3995                as defined by one of the TArrayFindMode enum values.
       
  3996 
       
  3997 @return KErrNotFound, if there is no matching element, otherwise the array
       
  3998         index of a matching element -  what the index refers to depends on
       
  3999         the value of aMode:
       
  4000         if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  4001         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  4002         if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  4003         the last matching element - if the last matching element is also the last element of the array,
       
  4004         then the index value is the same as the total number of elements in the array.
       
  4005         
       
  4006 @see TArrayFindMode   
       
  4007 */
       
  4008 	{ return RPointerArrayBase::FindIsq(anEntry,anOrder,aMode); }
       
  4009 
       
  4010 
       
  4011 
       
  4012 
       
  4013 template <class T>
       
  4014 inline TInt RPointerArray<T>::SpecificFindInAddressOrder(const T* anEntry, TInt& anIndex, TInt aMode) const
       
  4015 /**
       
  4016 Finds the object pointer in the array that matches the specified object
       
  4017 pointer, using a binary search technique.
       
  4018 
       
  4019 Where there is more than one matching element, it finds the first, the last
       
  4020 or any matching element as specified by the value of aMode.
       
  4021 
       
  4022 The function assumes that object pointers in the array are in address order.
       
  4023 
       
  4024 @param anEntry The object pointer to be found.
       
  4025 @param anIndex A TInt type supplied by the caller. On return, it contains an
       
  4026                index value depending on whether a match is found and on the
       
  4027                value of aMode.
       
  4028                If there is no matching element in the array, then this is
       
  4029                the index of the first element in the array that is bigger than
       
  4030                the element being searched for - if no elements in the array are
       
  4031                bigger, then the index value is the same as the total number of
       
  4032                elements in the array. If there is a matching element, then what
       
  4033                the index refers to depends on the value of aMode:
       
  4034                if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  4035                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  4036                if this is EArrayFindMode_Last, then the index refers to first element that follows the
       
  4037                last matching element - if the last matching element is also the last element of the array,
       
  4038                then the index value is the same as the total number of elements in the array.
       
  4039                
       
  4040 @param	aMode  Specifies whether to find the first match, the last match or any
       
  4041                match, as defined by one of the TArrayFindMode enum values.
       
  4042 
       
  4043 @return KErrNone, if a matching object pointer is found.
       
  4044         KErrNotFound, if no suitable object pointer can be found.
       
  4045         
       
  4046 @see TArrayFindMode
       
  4047 */
       
  4048 	{ return RPointerArrayBase::BinarySearchUnsigned((TUint)anEntry,anIndex,aMode); }
       
  4049 
       
  4050 
       
  4051 
       
  4052 
       
  4053 template <class T>
       
  4054 inline TInt RPointerArray<T>::SpecificFindInOrder(const T* anEntry, TInt& anIndex, TLinearOrder<T> anOrder, TInt aMode) const
       
  4055 /**
       
  4056 Finds the object pointer in the array whose object matches the specified
       
  4057 object, using a binary search technique and an ordering algorithm.
       
  4058 
       
  4059 Where there is more than one matching element, it finds the first, the last or any
       
  4060 matching element as specified by the value of aMode.
       
  4061 
       
  4062 The function assumes that existing object pointers in the array are ordered 
       
  4063 so that the objects themselves are in object order as determined by an
       
  4064 algorithm supplied by the caller and packaged as a TLinearOrder<T> type.
       
  4065 
       
  4066 @param anEntry The object pointer to be found.
       
  4067 @param anIndex A TInt type supplied by the caller. On return, it contains an
       
  4068                index value depending on whether a match is found and on the
       
  4069                value of aMode. If there is no matching element in the array,
       
  4070                then this is the index of the first element in the array
       
  4071                that is bigger than the element being searched for - if
       
  4072                no elements in the array are bigger, then the index value
       
  4073                is the same as the total number of elements in the array.
       
  4074                If there is a matching element, then what the index refers to
       
  4075                depends on the value of aMode:
       
  4076                if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  4077                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  4078                if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  4079                the last matching element - if the last matching element is also the last element
       
  4080                of the array, then the index value is the same as the total number of elements in the array.
       
  4081 
       
  4082 @param anOrder A package encapsulating the function which determines the order 
       
  4083                of two class T objects.
       
  4084 @param	aMode  Specifies whether to find the first match, the last match or
       
  4085                any match, as defined by one of the TArrayFindMode enum values.
       
  4086 
       
  4087 @return KErrNone, if a matching object pointer is found.
       
  4088         KErrNotFound, if no suitable object pointer can be found.
       
  4089         
       
  4090 @see TArrayFindMode
       
  4091 */
       
  4092 	{ return RPointerArrayBase::BinarySearch(anEntry,anIndex,anOrder,aMode); }
       
  4093 
       
  4094 
       
  4095 
       
  4096 
       
  4097 template <class T>
       
  4098 inline TInt RPointerArray<T>::InsertInAddressOrder(const T* anEntry)
       
  4099 /**
       
  4100 Inserts an object pointer into the array in address order.
       
  4101 
       
  4102 No duplicate entries are permitted. The array remains unchanged following
       
  4103 an attempt to insert a duplicate entry.
       
  4104 
       
  4105 The function assumes that existing object pointers within the array are in 
       
  4106 address order.
       
  4107 
       
  4108 @param anEntry The object pointer to be inserted.
       
  4109 
       
  4110 @return KErrNone, if the insertion is successful;
       
  4111         KErrAlreadyExists, if an attempt is being made
       
  4112         to insert a duplicate entry; otherwise one of the other system wide
       
  4113         error codes.
       
  4114 */
       
  4115 	{ return RPointerArrayBase::InsertIsqUnsigned((TUint)anEntry,EFalse); }
       
  4116 
       
  4117 
       
  4118 
       
  4119 
       
  4120 template <class T>
       
  4121 inline TInt RPointerArray<T>::InsertInOrder(const T* anEntry, TLinearOrder<T> anOrder)
       
  4122 /**
       
  4123 Inserts an object pointer into the array so that the object itself is in object 
       
  4124 order.
       
  4125 
       
  4126 The algorithm for determining the order of two class T objects is provided 
       
  4127 by a function supplied by the caller.
       
  4128 
       
  4129 No duplicate entries are permitted. The array remains unchanged following
       
  4130 an attempt to insert a duplicate entry.
       
  4131 
       
  4132 The function assumes that the array is ordered so that the referenced objects 
       
  4133 are in object order.
       
  4134 
       
  4135 @param anEntry The object pointer to be inserted.
       
  4136 @param anOrder A package encapsulating the function which determines the order 
       
  4137                of two class T objects.
       
  4138 
       
  4139 @return KErrNone, if the insertion is successful;
       
  4140         KErrAlreadyExists, if an attempt is being made
       
  4141         to insert a duplicate entry; otherwise one of the other system wide
       
  4142         error codes.
       
  4143 */
       
  4144 	{ return RPointerArrayBase::InsertIsq(anEntry,anOrder,EFalse); }
       
  4145 
       
  4146 
       
  4147 
       
  4148 
       
  4149 template <class T>
       
  4150 inline TInt RPointerArray<T>::InsertInAddressOrderAllowRepeats(const T* anEntry)
       
  4151 /**
       
  4152 Inserts an object pointer into the array in address order, allowing duplicates.
       
  4153 
       
  4154 If the new object pointer is a duplicate of an existing object pointer in 
       
  4155 the array, then the new pointer is inserted after the existing one. If more 
       
  4156 than one duplicate object pointer already exists in the array, then any new 
       
  4157 duplicate pointer is inserted after the last one.
       
  4158 
       
  4159 The function assumes that existing object pointers within the array are in 
       
  4160 address order.
       
  4161 
       
  4162 @param anEntry The object pointer to be inserted.
       
  4163 
       
  4164 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  4165         wide error codes.
       
  4166 */
       
  4167 	{ return RPointerArrayBase::InsertIsqUnsigned((TUint)anEntry,ETrue); }
       
  4168 
       
  4169 
       
  4170 
       
  4171 
       
  4172 template <class T>
       
  4173 inline TInt RPointerArray<T>::InsertInOrderAllowRepeats(const T* anEntry, TLinearOrder<T> anOrder)
       
  4174 /**
       
  4175 Inserts an object pointer into the array so that the object itself is in object 
       
  4176 order, allowing duplicates
       
  4177 
       
  4178 The algorithm for determining the order of two class T objects is provided 
       
  4179 by a function supplied by the caller.
       
  4180 
       
  4181 If the specified object is a duplicate of an existing object, then the new 
       
  4182 pointer is inserted after the pointer to the existing object. If more than 
       
  4183 one duplicate object already exists, then the new pointer is inserted after 
       
  4184 the pointer to the last one.
       
  4185 
       
  4186 @param anEntry The object pointer to be inserted. 
       
  4187 @param anOrder A package encapsulating the function which determines the order 
       
  4188                of two class T objects.
       
  4189 
       
  4190 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  4191         wide error codes.
       
  4192 */
       
  4193 	{ return RPointerArrayBase::InsertIsq(anEntry,anOrder,ETrue); }
       
  4194 
       
  4195 
       
  4196 
       
  4197 
       
  4198 #ifndef __KERNEL_MODE__
       
  4199 template <class T>
       
  4200 inline RPointerArray<T>::RPointerArray(T** aEntries, TInt aCount)
       
  4201 	: RPointerArrayBase((TAny **)aEntries, aCount)
       
  4202 /**
       
  4203 C++ constructor with a pointer to the first array entry in a pre-existing
       
  4204 array, and the number of entries in that array.
       
  4205 
       
  4206 This constructor takes a pointer to a pre-existing set of entries of type 
       
  4207 pointer to class T, which is owned by another RPointerArray object. Ownership 
       
  4208 of the set of entries still resides with the original RPointerArray object.
       
  4209 
       
  4210 @param aEntries A pointer to the first entry of type pointer to class T in 
       
  4211                 the set of entries belonging to the existing array.
       
  4212 @param aCount   The number of entries in the existing array. The granularity of
       
  4213                 this array is set to this value.
       
  4214 
       
  4215 @panic USER 156, if aCount is not positive.
       
  4216 */
       
  4217 	{}
       
  4218 
       
  4219 
       
  4220 
       
  4221 
       
  4222 template <class T>
       
  4223 inline void RPointerArray<T>::GranularCompress()
       
  4224 /**
       
  4225 Compresses the array down to a granular boundary.
       
  4226 
       
  4227 After a call to this function, the memory allocated to the array is sufficient 
       
  4228 for its contained object pointers. Adding new object pointers to the array 
       
  4229 does not result in a re-allocation of memory until the the total number of 
       
  4230 pointers reaches a multiple of the granularity.
       
  4231 */
       
  4232 	{RPointerArrayBase::GranularCompress();}
       
  4233 
       
  4234 
       
  4235 
       
  4236 
       
  4237 template <class T>
       
  4238 inline TInt RPointerArray<T>::Reserve(TInt aCount)
       
  4239 /**
       
  4240 Reserves space for the specified number of elements.
       
  4241 
       
  4242 After a call to this function, the memory allocated to the array is sufficient 
       
  4243 to hold the number of object pointers specified. Adding new object pointers to the array 
       
  4244 does not result in a re-allocation of memory until the the total number of 
       
  4245 pointers exceeds the specified count.
       
  4246 
       
  4247 @param	aCount	The number of object pointers for which space should be reserved
       
  4248 @return	KErrNone		If the operation completed successfully
       
  4249 @return KErrNoMemory	If the requested amount of memory could not be allocated
       
  4250 */
       
  4251 	{ return RPointerArrayBase::DoReserve(aCount); }
       
  4252 
       
  4253 
       
  4254 
       
  4255 
       
  4256 template <class T>
       
  4257 inline void RPointerArray<T>::SortIntoAddressOrder()
       
  4258 /**
       
  4259 Sorts the object pointers within the array into address order.
       
  4260 */
       
  4261 	{ HeapSortUnsigned(); }
       
  4262 
       
  4263 
       
  4264 
       
  4265 
       
  4266 template <class T>
       
  4267 inline void RPointerArray<T>::Sort(TLinearOrder<T> anOrder)
       
  4268 /**
       
  4269 Sorts the object pointers within the array. 
       
  4270 
       
  4271 The sort order of the pointers is based on the order of the referenced objects. 
       
  4272 The referenced object order is determined by an algorithm supplied by the 
       
  4273 caller and packaged as a TLinerOrder<T>.
       
  4274 
       
  4275 @param anOrder A package encapsulating the function which determines the order 
       
  4276                of two class T objects.
       
  4277 */
       
  4278 	{ HeapSort(anOrder); }
       
  4279 
       
  4280 
       
  4281 
       
  4282 
       
  4283 template <class T>
       
  4284 inline TArray<T*> RPointerArray<T>::Array() const
       
  4285 /**
       
  4286 Constructs and returns a generic array.
       
  4287 
       
  4288 @return A generic array representing this array.
       
  4289 
       
  4290 @see TArray
       
  4291 */
       
  4292 	{ return TArray<T*>(GetCount,GetElementPtr,(const CBase*)this); }
       
  4293 #endif
       
  4294 
       
  4295 
       
  4296 
       
  4297 template <class T>
       
  4298 void RPointerArray<T>::ResetAndDestroy()
       
  4299 /**
       
  4300 Empties the array and deletes the referenced objects.
       
  4301 
       
  4302 It frees all memory allocated to the array and resets the internal state so 
       
  4303 that it is ready to be reused. The function also deletes all of the objects 
       
  4304 whose pointers are contained by the array.
       
  4305 
       
  4306 This array object can be allowed to go out of scope after a call to this function.
       
  4307 */
       
  4308 	{
       
  4309 	TInt c=Count();
       
  4310 	T** pE=(T**)Entries();
       
  4311 	ZeroCount();
       
  4312 	TInt i;
       
  4313 	for (i=0; i<c; i++)
       
  4314 		{
       
  4315 		delete *pE;
       
  4316 		pE++;
       
  4317 		}
       
  4318 	Reset();
       
  4319 	}
       
  4320 
       
  4321 
       
  4322 
       
  4323 // Specialization for RPointerArray<TAny>
       
  4324 
       
  4325 /**
       
  4326 Default C++ constructor.
       
  4327 
       
  4328 This constructs an array object for an array of TAny pointers with default
       
  4329 granularity, which is 8.
       
  4330 */
       
  4331 inline RPointerArray<TAny>::RPointerArray()
       
  4332 	: RPointerArrayBase()
       
  4333 	{}
       
  4334 
       
  4335 
       
  4336 
       
  4337 
       
  4338 /**
       
  4339 C++ constructor with granularity.
       
  4340 
       
  4341 This constructs an array object for an array of TAny pointers with the specified 
       
  4342 granularity.
       
  4343 
       
  4344 @param aGranularity The granularity of the array.
       
  4345 
       
  4346 @panic USER 127, if aGranularity is not positive, or greater than or equal
       
  4347        to 0x10000000.
       
  4348 */
       
  4349 inline RPointerArray<TAny>::RPointerArray(TInt aGranularity)
       
  4350 	: RPointerArrayBase(aGranularity)
       
  4351 	{}
       
  4352 
       
  4353 
       
  4354 
       
  4355 
       
  4356 /**
       
  4357 C++ constructor with minimum growth step and exponential growth factor.
       
  4358 
       
  4359 This constructs an array object for an array of TAny pointers with the specified 
       
  4360 minimum growth step and exponential growth factor.
       
  4361 
       
  4362 @param aMinGrowBy	The minimum growth step of the array. Must be between 1 and
       
  4363 					65535 inclusive.
       
  4364 @param aFactor		The factor by which the array grows, multiplied by 256.
       
  4365 					For example 512 specifies a factor of 2. Must be between 257
       
  4366 					and 32767 inclusive.
       
  4367 
       
  4368 @panic USER 192, if aMinGrowBy<=0 or aMinGrowBy>65535.
       
  4369 @panic USER 193, if aFactor<=257 or aFactor>32767.
       
  4370 */
       
  4371 inline RPointerArray<TAny>::RPointerArray(TInt aMinGrowBy, TInt aFactor)
       
  4372 	: RPointerArrayBase(aMinGrowBy, aFactor)
       
  4373 	{}
       
  4374 
       
  4375 
       
  4376 
       
  4377 
       
  4378 inline void RPointerArray<TAny>::Close()
       
  4379 /**
       
  4380 Closes the array and frees all memory allocated to it.
       
  4381 
       
  4382 The function must be called before this array object goes out of scope.
       
  4383 
       
  4384 Note that the function does not delete the objects whose pointers are contained
       
  4385 in the array.
       
  4386 */
       
  4387 	{RPointerArrayBase::Close();}
       
  4388 
       
  4389 
       
  4390 
       
  4391 
       
  4392 inline TInt RPointerArray<TAny>::Count() const
       
  4393 /**
       
  4394 Gets the number of pointers in the array.
       
  4395 
       
  4396 @return The number of pointers in the array.
       
  4397 */
       
  4398 	{ return RPointerArrayBase::Count(); }
       
  4399 
       
  4400 
       
  4401 
       
  4402 
       
  4403 inline TAny* const& RPointerArray<TAny>::operator[](TInt anIndex) const
       
  4404 /**
       
  4405 Gets a reference to the pointer located at the specified 
       
  4406 position within the array.
       
  4407 
       
  4408 The compiler chooses this option if the returned reference is used in
       
  4409 an expression where the reference cannot be modified.
       
  4410 
       
  4411 @param anIndex The position of the pointer within the array. The
       
  4412                position is relative to zero, i.e. zero implies the object
       
  4413 			   pointer at the beginning of the array.
       
  4414 
       
  4415 @return A const reference to the pointer at position anIndex within 
       
  4416         the array.
       
  4417 
       
  4418 @panic USER 130, if anIndex is negative, or is greater than the number of
       
  4419        objects currently in the array.
       
  4420 */
       
  4421 	{return At(anIndex);}
       
  4422 
       
  4423 
       
  4424 
       
  4425 
       
  4426 inline TAny*& RPointerArray<TAny>::operator[](TInt anIndex)
       
  4427 /**
       
  4428 Gets a reference to the pointer located at the specified 
       
  4429 position within the array.
       
  4430 
       
  4431 The compiler chooses this option if the returned reference is used in
       
  4432 an expression where the reference can be modified.
       
  4433 
       
  4434 @param anIndex The position of the pointer within the array. The
       
  4435                position is relative to zero, i.e. zero implies the object
       
  4436 			   pointer at the beginning of the array.
       
  4437 
       
  4438 @return A non-const reference to the pointer at position anIndex within 
       
  4439         the array.
       
  4440 
       
  4441 @panic USER 130, if anIndex is negative, or is greater than the number of
       
  4442        objects currently in the array.
       
  4443 */
       
  4444 	{return At(anIndex);}
       
  4445 
       
  4446 
       
  4447 
       
  4448 
       
  4449 inline TInt RPointerArray<TAny>::Append(const TAny* anEntry)
       
  4450 /**
       
  4451 Appends an pointer onto the array.
       
  4452 
       
  4453 @param anEntry The pointer to be appended.
       
  4454 
       
  4455 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  4456         wide error codes.
       
  4457 */
       
  4458 	{ return RPointerArrayBase::Append(anEntry); }
       
  4459 
       
  4460 
       
  4461 
       
  4462 
       
  4463 inline TInt RPointerArray<TAny>::Insert(const TAny* anEntry, TInt aPos)
       
  4464 /**
       
  4465 Inserts an pointer into the array at the specified position.
       
  4466 
       
  4467 @param anEntry The pointer to be inserted.
       
  4468 @param aPos    The position within the array where the pointer is to be 
       
  4469                inserted. The position is relative to zero, i.e. zero implies
       
  4470 			   that a pointer is inserted at the beginning of the array.
       
  4471 
       
  4472 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  4473         wide error codes.
       
  4474 
       
  4475 @panic USER 131, if aPos is negative, or is greater than the number of object
       
  4476        pointers currently in the array.
       
  4477 */
       
  4478 	{ return RPointerArrayBase::Insert(anEntry,aPos); }
       
  4479 
       
  4480 
       
  4481 
       
  4482 
       
  4483 inline void RPointerArray<TAny>::Remove(TInt anIndex)
       
  4484 /**
       
  4485 Removes the pointer at the specified position from the array.
       
  4486 
       
  4487 Note that the function does not delete the object whose pointer is removed.
       
  4488 
       
  4489 @param anIndex The position within the array from where the pointer 
       
  4490                is to be removed. The position is relative to zero, i.e. zero
       
  4491 			   implies that a pointer at the beginning of the array is to be
       
  4492 			   removed.
       
  4493 			   
       
  4494 @panic USER 130, if anIndex is negative, or is greater than the number of
       
  4495        objects currently in the array. 
       
  4496 */
       
  4497 	{RPointerArrayBase::Remove(anIndex);}
       
  4498 
       
  4499 
       
  4500 
       
  4501 
       
  4502 inline void RPointerArray<TAny>::Compress()
       
  4503 /**
       
  4504 Compresses the array down to a minimum.
       
  4505 
       
  4506 After a call to this function, the memory allocated to the array is just
       
  4507 sufficient for its contained pointers.
       
  4508 Subsequently adding a new pointer to the array 
       
  4509 always results in a re-allocation of memory.
       
  4510 */
       
  4511 	{RPointerArrayBase::Compress();}
       
  4512 
       
  4513 
       
  4514 
       
  4515 
       
  4516 inline void RPointerArray<TAny>::Reset()
       
  4517 /**
       
  4518 Empties the array.
       
  4519 
       
  4520 It frees all memory allocated to the array and resets the internal state so 
       
  4521 that it is ready to be reused.
       
  4522 
       
  4523 This array object can be allowed to go out of scope after a call to this
       
  4524 function.
       
  4525 
       
  4526 Note that the function does not delete the objects whose pointers are contained
       
  4527 in the array.
       
  4528 */
       
  4529 	{RPointerArrayBase::Reset();}
       
  4530 
       
  4531 
       
  4532 
       
  4533 
       
  4534 inline TInt RPointerArray<TAny>::Find(const TAny* anEntry) const
       
  4535 /**
       
  4536 Finds the first pointer in the array which matches the specified pointer, using
       
  4537 a sequential search.
       
  4538 
       
  4539 Matching is based on the comparison of pointers.
       
  4540 
       
  4541 The find operation always starts at the low index end of the array. There 
       
  4542 is no assumption about the order of objects in the array.
       
  4543 
       
  4544 @param anEntry The pointer to be found.
       
  4545 @return The index of the first matching pointer within the array.
       
  4546         KErrNotFound, if no matching pointer can be found.
       
  4547 */
       
  4548 	{ return RPointerArrayBase::Find(anEntry); }
       
  4549 
       
  4550 
       
  4551 
       
  4552 
       
  4553 inline TInt RPointerArray<TAny>::FindReverse(const TAny* anEntry) const
       
  4554 /**
       
  4555 Finds the last pointer in the array which matches the specified pointer, using
       
  4556 a sequential search.
       
  4557 
       
  4558 Matching is based on the comparison of pointers.
       
  4559 
       
  4560 The find operation always starts at the high index end of the array. There 
       
  4561 is no assumption about the order of objects in the array.
       
  4562 
       
  4563 @param anEntry The pointer to be found.
       
  4564 @return The index of the last matching pointer within the array.
       
  4565         KErrNotFound, if no matching pointer can be found.
       
  4566 */
       
  4567 	{ return RPointerArrayBase::FindReverse(anEntry); }
       
  4568 
       
  4569 
       
  4570 
       
  4571 
       
  4572 inline TInt RPointerArray<TAny>::FindInAddressOrder(const TAny* anEntry) const
       
  4573 /**
       
  4574 Finds the pointer in the array that matches the specified object
       
  4575 pointer, using a binary search technique.
       
  4576 
       
  4577 The function assumes that pointers in the array are in address order.
       
  4578 
       
  4579 @param anEntry The pointer to be found.
       
  4580 
       
  4581 @return The index of the matching pointer within the array or KErrNotFound 
       
  4582         if no suitable pointer can be found.
       
  4583 */
       
  4584 	{ return RPointerArrayBase::FindIsqUnsigned((TUint)anEntry); }
       
  4585 
       
  4586 
       
  4587 
       
  4588 
       
  4589 inline TInt RPointerArray<TAny>::FindInAddressOrder(const TAny* anEntry, TInt& anIndex) const
       
  4590 /**
       
  4591 Finds the pointer in the array that matches the specified object
       
  4592 pointer, using a binary search technique.
       
  4593 
       
  4594 The function assumes that pointers in the array are in address order.
       
  4595 
       
  4596 @param anEntry The pointer to be found.
       
  4597 @param anIndex A TInt supplied by the caller. On return, contains an index
       
  4598                value:
       
  4599                If the function returns KErrNone, this is the index of the
       
  4600 			   matching pointer within the array. 
       
  4601                If the function returns KErrNotFound, this is the index of the
       
  4602 			   last pointer within the array which logically
       
  4603 			   precedes anEntry.
       
  4604 
       
  4605 @return KErrNone, if a matching pointer is found.
       
  4606         KErrNotFound, if no suitable pointer can be found.
       
  4607 */
       
  4608 	{ return RPointerArrayBase::BinarySearchUnsigned((TUint)anEntry,anIndex); }
       
  4609 
       
  4610 
       
  4611 
       
  4612 
       
  4613 inline TInt RPointerArray<TAny>::SpecificFindInAddressOrder(const TAny* anEntry, TInt aMode) const
       
  4614 /**
       
  4615 Finds the pointer in the array that matches the specified pointer, using a
       
  4616 binary search technique.
       
  4617 
       
  4618 Where there is more than one matching element, it finds the first, the last 
       
  4619 or any matching element as specified by the value of aMode.
       
  4620 
       
  4621 The function assumes that pointers in the array are in address order.
       
  4622 
       
  4623 @param	anEntry The pointer to be found.
       
  4624 @param	aMode   Specifies whether to find the first match, the last match or
       
  4625                 any match, as defined by one of the TArrayFindMode enum values.
       
  4626 
       
  4627 @return KErrNotFound, if there is no matching element, otherwise the array
       
  4628         index of a matching element - what the index refers to depends on the
       
  4629         value of aMode:
       
  4630         if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  4631         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  4632         if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  4633         the last matching element - if the last matching element is also the last element of
       
  4634         the array, then the index value is the same as the total number of elements in the array.
       
  4635         
       
  4636 @see TArrayFindMode
       
  4637 */
       
  4638 	{ return RPointerArrayBase::FindIsqUnsigned((TUint)anEntry, aMode); }
       
  4639 
       
  4640 
       
  4641 
       
  4642 
       
  4643 inline TInt RPointerArray<TAny>::SpecificFindInAddressOrder(const TAny* anEntry, TInt& anIndex, TInt aMode) const
       
  4644 /**
       
  4645 Finds the pointer in the array that matches the specified pointer, using a
       
  4646 binary search technique.
       
  4647 
       
  4648 Where there is more than one matching element, it finds the first, the last
       
  4649 or any matching element as specified by the value of aMode.
       
  4650 
       
  4651 The function assumes that pointers in the array are in address order.
       
  4652 
       
  4653 @param anEntry The pointer to be found.
       
  4654 @param anIndex A TInt type supplied by the caller. On return, it contains an
       
  4655                index value depending on whether a match is found and on the
       
  4656                value of aMode.
       
  4657                If there is no matching element in the array, then this is
       
  4658                the index of the first element in the array that is bigger than
       
  4659                the element being searched for - if no elements in the array are
       
  4660                bigger, then the index value is the same as the total number of
       
  4661                elements in the array. If there is a matching element, then what
       
  4662                the index refers to depends on the value of aMode:
       
  4663                if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  4664                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  4665                if this is EArrayFindMode_Last, then the index refers to first element that follows the
       
  4666                last matching element - if the last matching element is also the last element of the array,
       
  4667                then the index value is the same as the total number of elements in the array.
       
  4668                
       
  4669 @param	aMode  Specifies whether to find the first match, the last match or any
       
  4670                match, as defined by one of the TArrayFindMode enum values.
       
  4671 
       
  4672 @return KErrNone, if a matching pointer is found.
       
  4673         KErrNotFound, if no suitable pointer can be found.
       
  4674         
       
  4675 @see TArrayFindMode
       
  4676 */
       
  4677 	{ return RPointerArrayBase::BinarySearchUnsigned((TUint)anEntry,anIndex,aMode); }
       
  4678 
       
  4679 
       
  4680 
       
  4681 
       
  4682 inline TInt RPointerArray<TAny>::InsertInAddressOrder(const TAny* anEntry)
       
  4683 /**
       
  4684 Inserts an pointer into the array in address order.
       
  4685 
       
  4686 No duplicate entries are permitted. The array remains unchanged following
       
  4687 an attempt to insert a duplicate entry.
       
  4688 
       
  4689 The function assumes that existing pointers within the array are in 
       
  4690 address order.
       
  4691 
       
  4692 @param anEntry The pointer to be inserted.
       
  4693 
       
  4694 @return KErrNone, if the insertion is successful;
       
  4695         KErrAlreadyExists, if an attempt is being made
       
  4696         to insert a duplicate entry; otherwise one of the other system wide
       
  4697         error codes.
       
  4698 */
       
  4699 	{ return RPointerArrayBase::InsertIsqUnsigned((TUint)anEntry,EFalse); }
       
  4700 
       
  4701 
       
  4702 
       
  4703 
       
  4704 inline TInt RPointerArray<TAny>::InsertInAddressOrderAllowRepeats(const TAny* anEntry)
       
  4705 /**
       
  4706 Inserts an pointer into the array in address order, allowing duplicates.
       
  4707 
       
  4708 If the new pointer is a duplicate of an existing pointer in 
       
  4709 the array, then the new pointer is inserted after the existing one. If more 
       
  4710 than one duplicate pointer already exists in the array, then any new 
       
  4711 duplicate pointer is inserted after the last one.
       
  4712 
       
  4713 The function assumes that existing pointers within the array are in 
       
  4714 address order.
       
  4715 
       
  4716 @param anEntry The pointer to be inserted.
       
  4717 
       
  4718 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  4719         wide error codes.
       
  4720 */
       
  4721 	{ return RPointerArrayBase::InsertIsqUnsigned((TUint)anEntry,ETrue); }
       
  4722 
       
  4723 
       
  4724 
       
  4725 
       
  4726 #ifndef __KERNEL_MODE__
       
  4727 inline RPointerArray<TAny>::RPointerArray(TAny** aEntries, TInt aCount)
       
  4728 	: RPointerArrayBase((TAny **)aEntries, aCount)
       
  4729 /**
       
  4730 C++ constructor with a pointer to the first array entry in a pre-existing
       
  4731 array, and the number of entries in that array.
       
  4732 
       
  4733 This constructor takes a pointer to a pre-existing set of entries of type TAny*,
       
  4734 which is owned by another RPointerArray object. Ownership of the set of entries
       
  4735 still resides with the original RPointerArray object.
       
  4736 
       
  4737 @param aEntries A pointer to the first entry of type TAny* in the set of entries
       
  4738                 belonging to the existing array.                
       
  4739 @param aCount   The number of entries in the existing array. The granularity of
       
  4740                 this array is set to this value.
       
  4741 
       
  4742 @panic USER 156, if aCount is not positive.
       
  4743 */
       
  4744 	{}
       
  4745 
       
  4746 
       
  4747 
       
  4748 
       
  4749 inline void RPointerArray<TAny>::GranularCompress()
       
  4750 /**
       
  4751 Compresses the array down to a granular boundary.
       
  4752 
       
  4753 After a call to this function, the memory allocated to the array is sufficient 
       
  4754 for its contained pointers. Adding new pointers to the array 
       
  4755 does not result in a re-allocation of memory until the the total number of 
       
  4756 pointers reaches a multiple of the granularity.
       
  4757 */
       
  4758 	{RPointerArrayBase::GranularCompress();}
       
  4759 
       
  4760 
       
  4761 
       
  4762 
       
  4763 inline void RPointerArray<TAny>::SortIntoAddressOrder()
       
  4764 /**
       
  4765 Sorts the pointers within the array into address order.
       
  4766 */
       
  4767 	{ HeapSortUnsigned(); }
       
  4768 
       
  4769 
       
  4770 
       
  4771 
       
  4772 inline TArray<TAny*> RPointerArray<TAny>::Array() const
       
  4773 /**
       
  4774 Constructs and returns a generic array.
       
  4775 
       
  4776 @return A generic array representing this array.
       
  4777 
       
  4778 @see TArray
       
  4779 */
       
  4780 	{ return TArray<TAny*>(GetCount,GetElementPtr,(const CBase*)this); }
       
  4781 #endif
       
  4782 
       
  4783 
       
  4784 
       
  4785 template <class T>
       
  4786 inline RArray<T>::RArray()
       
  4787 	: RArrayBase(sizeof(T))
       
  4788 /** 
       
  4789 Default C++ constructor. 
       
  4790 
       
  4791 This constructs an array object for an array of type class T objects with 
       
  4792 default granularity and key offset value. The default granularity is 8 and 
       
  4793 the defaul key offset value is zero.
       
  4794 
       
  4795 @panic USER 129, if the size of class T is not positive or is not less
       
  4796        than 640.
       
  4797 */
       
  4798 	{}
       
  4799 
       
  4800 
       
  4801 
       
  4802 
       
  4803 template <class T>
       
  4804 inline RArray<T>::RArray(TInt aGranularity)
       
  4805 	: RArrayBase(sizeof(T),aGranularity)
       
  4806 /**
       
  4807 C++ constructor with granularity. 
       
  4808 
       
  4809 This constructs an array object for an array of type class T objects with 
       
  4810 a specified granularity and default key offset value. The default key offset 
       
  4811 value is zero.
       
  4812 
       
  4813 @param aGranularity The granularity of the array.
       
  4814 
       
  4815 @panic USER 129, if the size of class T is not positive or is not less
       
  4816        than 640.
       
  4817 @panic USER 127, if aGranularity is not positive or the product of this
       
  4818        value and the size of class T is not less than 0x10000000.
       
  4819 */
       
  4820 	{}
       
  4821 
       
  4822 
       
  4823 
       
  4824 
       
  4825 template <class T>
       
  4826 inline RArray<T>::RArray(TInt aGranularity, TInt aKeyOffset)
       
  4827 	: RArrayBase(sizeof(T),aGranularity,aKeyOffset)
       
  4828 /**
       
  4829 C++ constructor with granularity and key offset.
       
  4830 
       
  4831 This constructs an array object for an array of type class T objects with 
       
  4832 a specified granularity and a specified key offset value.
       
  4833 
       
  4834 @param aGranularity The granularity of the array.
       
  4835 @param aKeyOffset   The key offset.
       
  4836 
       
  4837 @panic USER 129, if the size of class T is not positive or is not less
       
  4838        than 640.
       
  4839 @panic USER 127, if aGranularity is not positive or the product of this
       
  4840        value and the size of class T is not less than 0x10000000.
       
  4841 @panic USER 128, if aKeyOffset is not positive, or is not less than the 
       
  4842        size of class T, or is not a multiple of 4.
       
  4843 */
       
  4844 	{}
       
  4845 
       
  4846 
       
  4847 
       
  4848 
       
  4849 /**
       
  4850 C++ constructor with minimum growth step and exponential growth factor.
       
  4851 
       
  4852 This constructs an array object for an array of class T objects with the
       
  4853 specified minimum growth step and exponential growth factor.
       
  4854 
       
  4855 @param aMinGrowBy	The minimum growth step of the array. Must be between 1 and
       
  4856 					65535 inclusive.
       
  4857 @param aKeyOffset   The key offset.
       
  4858 @param aFactor		The factor by which the array grows, multiplied by 256.
       
  4859 					For example 512 specifies a factor of 2. Must be between 257
       
  4860 					and 32767 inclusive.
       
  4861 
       
  4862 @panic USER 129, if the size of class T is not positive or is not less than 640.
       
  4863 @panic USER 128, if aKeyOffset is negative, or is not less than the 
       
  4864        size of class T, or is not a multiple of 4.
       
  4865 @panic USER 192, if aMinGrowBy<=0 or aMinGrowBy>65535.
       
  4866 @panic USER 193, if aFactor<=257 or aFactor>32767.
       
  4867 */
       
  4868 template <class T>
       
  4869 inline RArray<T>::RArray(TInt aMinGrowBy, TInt aKeyOffset, TInt aFactor)
       
  4870 	: RArrayBase(sizeof(T), aMinGrowBy, aKeyOffset, aFactor)
       
  4871 	{}
       
  4872 
       
  4873 
       
  4874 
       
  4875 
       
  4876 template <class T>
       
  4877 inline RArray<T>::RArray(TInt aEntrySize,T* aEntries, TInt aCount)
       
  4878 	: RArrayBase(aEntrySize,aEntries,aCount)
       
  4879 /**
       
  4880 C++ constructor with size of entry, a pointer to the first array entry in a 
       
  4881 pre-existing array, and the number of entries in that array.
       
  4882 
       
  4883 This constructor takes a pointer to a pre-existing set of entries of type 
       
  4884 class T objects owned by another RArray object. Ownership of the set of entries 
       
  4885 still resides with the original RArray object.
       
  4886 
       
  4887 This array is assigned a default granularity and key offset value. The default 
       
  4888 granularity is 8 and the default key offset value is zero.
       
  4889 
       
  4890 The purpose of constructing an array in this way is to allow sorting and
       
  4891 finding operations to be done without further allocation of memory.
       
  4892 
       
  4893 @param aEntrySize The size of an entry in the existing array. 
       
  4894 @param aEntries   A pointer to the first entry of type class T in the set of 
       
  4895                   entries belonging to the existing array.
       
  4896 @param aCount     The number of entries in the existing array.
       
  4897  
       
  4898 @panic USER 129, if aEntrySize is not positive or is not less than 640.
       
  4899 @panic USER 156, if aCount is not positive.
       
  4900 */
       
  4901 	{}
       
  4902 
       
  4903 
       
  4904 
       
  4905 
       
  4906 template <class T>
       
  4907 inline void RArray<T>::Close()
       
  4908 /**
       
  4909 Closes the array and frees all memory allocated to the array. 
       
  4910 
       
  4911 The function must be called before this array object is destroyed.
       
  4912 */
       
  4913 	{RArrayBase::Close();}
       
  4914 
       
  4915 
       
  4916 
       
  4917 
       
  4918 template <class T>
       
  4919 inline TInt RArray<T>::Count() const
       
  4920 /**
       
  4921 Gets the number of objects in the array.
       
  4922 
       
  4923 @return The number of objects in the array.
       
  4924 */
       
  4925 	{return RArrayBase::Count();}
       
  4926 
       
  4927 
       
  4928 
       
  4929 
       
  4930 template <class T>
       
  4931 inline const T& RArray<T>::operator[](TInt anIndex) const
       
  4932 /**
       
  4933 Gets a reference to an object located at a specified position within the array.
       
  4934 
       
  4935 The compiler chooses this function if the returned reference is used in an 
       
  4936 expression where the reference cannot be modified.
       
  4937 
       
  4938 @param anIndex The position of the object within the array. The position is 
       
  4939                relative to zero, i.e. zero implies the object at the beginning
       
  4940 			   of the array. 
       
  4941 
       
  4942 @return A const reference to the object at position anIndex within the array.
       
  4943 
       
  4944 @panic USER 130, if anIndex is negative or is greater than the number of 
       
  4945        objects currently in the array
       
  4946 */
       
  4947 	{return *(const T*)At(anIndex); }
       
  4948 
       
  4949 
       
  4950 
       
  4951 
       
  4952 template <class T>
       
  4953 inline T& RArray<T>::operator[](TInt anIndex)
       
  4954 /**
       
  4955 Gets a reference to an object located at a specified position within the array.
       
  4956 
       
  4957 The compiler chooses this function if the returned reference is used in an 
       
  4958 expression where the reference can be modified.
       
  4959 
       
  4960 @param anIndex The position of the object within the array. The position is 
       
  4961                relative to zero, i.e. zero implies the object at the beginning
       
  4962 			   of the array. 
       
  4963 
       
  4964 @return A non-const reference to the object at position anIndex within the array.
       
  4965 
       
  4966 @panic USER 130, if anIndex is negative or is greater than the number of 
       
  4967        objects currently in the array
       
  4968 */
       
  4969 	{return *(T*)At(anIndex); }
       
  4970 
       
  4971 
       
  4972 
       
  4973 
       
  4974 template <class T>
       
  4975 inline TInt RArray<T>::Append(const T& anEntry)
       
  4976 /**
       
  4977 Apends an object onto the array.
       
  4978 
       
  4979 @param anEntry    A reference to the object of type class T to be appended.
       
  4980 
       
  4981 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  4982         wide error codes.
       
  4983 */
       
  4984 	{return RArrayBase::Append(&anEntry);}
       
  4985 
       
  4986 
       
  4987 
       
  4988 
       
  4989 template <class T>
       
  4990 inline TInt RArray<T>::Insert(const T& anEntry, TInt aPos)
       
  4991 /**
       
  4992 Inserts an object into the array at a specified position.
       
  4993 
       
  4994 @param anEntry The class T object to be inserted.
       
  4995 @param aPos    The position within the array where the object is to
       
  4996                be inserted. The position is relative to zero, i.e. zero
       
  4997 			   implies that an object is inserted at the beginning of
       
  4998 			   the array.
       
  4999 			   
       
  5000 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  5001         wide error codes.
       
  5002 
       
  5003 @panic USER 131, if aPos is negative or is greater than the number of objects
       
  5004        currently in the array.
       
  5005 */
       
  5006 	{return RArrayBase::Insert(&anEntry,aPos);}
       
  5007 
       
  5008 
       
  5009 
       
  5010 
       
  5011 template <class T>
       
  5012 inline void RArray<T>::Remove(TInt anIndex)
       
  5013 /**
       
  5014 Removes the object at a specified position from the array.
       
  5015 
       
  5016 @param anIndex The position within the array from where the object is to be 
       
  5017                removed. The position is relative to zero, i.e. zero implies
       
  5018 			   that an object at the beginning of the array is to be removed.
       
  5019 	
       
  5020 @panic USER 130, if anIndex is negative or is greater than the number of
       
  5021        objects currently in the array.
       
  5022 */
       
  5023 	{RArrayBase::Remove(anIndex);}
       
  5024 
       
  5025 
       
  5026 
       
  5027 
       
  5028 template <class T>
       
  5029 inline void RArray<T>::Compress()
       
  5030 /** 
       
  5031 Compresses the array down to a minimum.
       
  5032 
       
  5033 After a call to this function, the memory allocated to the array is just
       
  5034 sufficient for its contained objects. Subsequently adding a new object to the
       
  5035 array always results in a re-allocation of memory.
       
  5036 */
       
  5037 	{RArrayBase::Compress();}
       
  5038 
       
  5039 
       
  5040 
       
  5041 
       
  5042 template <class T>
       
  5043 inline void RArray<T>::Reset()
       
  5044 /**
       
  5045 Empties the array, so that it is ready to be reused.
       
  5046 
       
  5047 The function frees all memory allocated to the array and resets the internal 
       
  5048 state so that it is ready to be reused.
       
  5049 
       
  5050 This array object can be allowed to go out of scope after a call to this function.
       
  5051 */
       
  5052 	{RArrayBase::Reset();}
       
  5053 
       
  5054 
       
  5055 
       
  5056 
       
  5057 template <class T>
       
  5058 inline TInt RArray<T>::Find(const T& anEntry) const
       
  5059 /**
       
  5060 Finds the first object in the array which matches the specified object using 
       
  5061 a sequential search.
       
  5062 
       
  5063 Matching is based on the comparison of a TInt value at the key offset position 
       
  5064 within the objects.
       
  5065 
       
  5066 The find operation always starts at the low index end of the array. There 
       
  5067 is no assumption about the order of objects in the array.
       
  5068 
       
  5069 @param anEntry A reference to an object of type class T to be used for matching.
       
  5070 
       
  5071 @return The index of the first matching object within the array. 
       
  5072         KErrNotFound, if no matching object can be found.
       
  5073 */
       
  5074 	{return RArrayBase::Find(&anEntry);}
       
  5075 
       
  5076 
       
  5077 
       
  5078 
       
  5079 template <class T>
       
  5080 inline TInt RArray<T>::Find(const T& anEntry, TIdentityRelation<T> anIdentity) const
       
  5081 /**
       
  5082 Finds the first object in the array which matches the specified object using 
       
  5083 a sequential search and a matching algorithm.
       
  5084 
       
  5085 The algorithm for determining whether two class T type objects match is provided 
       
  5086 by a function supplied by the caller.
       
  5087 
       
  5088 The find operation always starts at the low index end of the array. There 
       
  5089 is no assumption about the order of objects in the array.
       
  5090 
       
  5091 @param anEntry    A reference to an object of type class T to be used
       
  5092                   for matching.
       
  5093 @param anIdentity A package encapsulating the function which determines whether 
       
  5094                   two class T type objects match.
       
  5095 
       
  5096 @return The index of the first matching object within the array.
       
  5097         KErrNotFound, if no matching object can be found.
       
  5098 */
       
  5099 	{return RArrayBase::Find(&anEntry,anIdentity);}
       
  5100 
       
  5101 
       
  5102 
       
  5103 
       
  5104 template <class T>
       
  5105 inline TInt RArray<T>::FindReverse(const T& anEntry) const
       
  5106 /**
       
  5107 Finds the last object in the array which matches the specified object using 
       
  5108 a sequential search.
       
  5109 
       
  5110 Matching is based on the comparison of a TInt value at the key offset position 
       
  5111 within the objects.
       
  5112 
       
  5113 The find operation always starts at the high index end of the array. There 
       
  5114 is no assumption about the order of objects in the array.
       
  5115 
       
  5116 @param anEntry A reference to an object of type class T to be used for matching.
       
  5117 
       
  5118 @return The index of the last matching object within the array. 
       
  5119         KErrNotFound, if no matching object can be found.
       
  5120 */
       
  5121 	{return RArrayBase::FindReverse(&anEntry);}
       
  5122 
       
  5123 
       
  5124 
       
  5125 
       
  5126 template <class T>
       
  5127 inline TInt RArray<T>::FindReverse(const T& anEntry, TIdentityRelation<T> anIdentity) const
       
  5128 /**
       
  5129 Finds the last object in the array which matches the specified object using 
       
  5130 a sequential search and a matching algorithm.
       
  5131 
       
  5132 The algorithm for determining whether two class T type objects match is provided 
       
  5133 by a function supplied by the caller.
       
  5134 
       
  5135 The find operation always starts at the high index end of the array. There 
       
  5136 is no assumption about the order of objects in the array.
       
  5137 
       
  5138 @param anEntry    A reference to an object of type class T to be used
       
  5139                   for matching.
       
  5140 @param anIdentity A package encapsulating the function which determines whether 
       
  5141                   two class T type objects match.
       
  5142 
       
  5143 @return The index of the last matching object within the array.
       
  5144         KErrNotFound, if no matching object can be found.
       
  5145 */
       
  5146 	{return RArrayBase::FindReverse(&anEntry,anIdentity);}
       
  5147 
       
  5148 
       
  5149 
       
  5150 
       
  5151 template <class T>
       
  5152 inline TInt RArray<T>::FindInSignedKeyOrder(const T& anEntry) const
       
  5153 /**
       
  5154 Finds the object in the array which matches the specified object using a binary 
       
  5155 search technique.
       
  5156 
       
  5157 The function assumes that existing objects within the array are in signed 
       
  5158 key order.
       
  5159 
       
  5160 @param anEntry A reference to an object of type class T to be used for matching.
       
  5161 
       
  5162 @return The index of the matching object within the array, or KErrNotFound 
       
  5163         if no matching object can be found.
       
  5164 */
       
  5165 	{return RArrayBase::FindIsqSigned(&anEntry);}
       
  5166 
       
  5167 
       
  5168 
       
  5169 
       
  5170 template <class T>
       
  5171 inline TInt RArray<T>::FindInUnsignedKeyOrder(const T& anEntry) const
       
  5172 /**
       
  5173 Finds the object in the array which matches the specified object using a binary 
       
  5174 search technique.
       
  5175 
       
  5176 The function assumes that existing objects within the array are in unsigned 
       
  5177 key order.
       
  5178 
       
  5179 @param anEntry A reference to an object of type class T to be used for matching.
       
  5180 
       
  5181 @return The index of the matching object within the array, or KErrNotFound 
       
  5182         if no matching object can be found.
       
  5183 */
       
  5184 	{return RArrayBase::FindIsqUnsigned(&anEntry);}
       
  5185 
       
  5186 
       
  5187 
       
  5188 
       
  5189 template <class T>
       
  5190 inline TInt RArray<T>::FindInOrder(const T& anEntry, TLinearOrder<T> anOrder) const
       
  5191 /**
       
  5192 Finds the object in the array which matches the specified object using a binary 
       
  5193 search technique and an ordering algorithm.
       
  5194 
       
  5195 The function assumes that existing objects within the array are in object 
       
  5196 order as determined by an algorithm supplied by the caller and packaged as 
       
  5197 a TLinearOrder<T>.
       
  5198 
       
  5199 @param anEntry A reference to an object of type class T to be used for matching.
       
  5200 @param anOrder A package encapsulating the function which determines the order 
       
  5201                of two class T objects.
       
  5202 
       
  5203 @return The index of the matching object within the array, or KErrNotFound if 
       
  5204         no matching object can be found.
       
  5205 */
       
  5206 	{return RArrayBase::FindIsq(&anEntry,anOrder);}
       
  5207 
       
  5208 
       
  5209 
       
  5210 
       
  5211 template <class T>
       
  5212 inline TInt RArray<T>::FindInSignedKeyOrder(const T& anEntry, TInt& anIndex) const
       
  5213 /**
       
  5214 Finds the object in the array which matches the specified object using a binary 
       
  5215 search technique.
       
  5216 
       
  5217 The function assumes that existing objects within the array are in signed 
       
  5218 key order.
       
  5219 
       
  5220 @param anEntry A reference to an object of type class T to be used for matching.
       
  5221 @param anIndex On return contains an index value. If the function returns KErrNone,
       
  5222                this is the index of the matching object within the array.
       
  5223                If the function returns KErrNotFound, this is the index of the
       
  5224                first element in the array whose key is bigger than the key of the
       
  5225                element being sought. If there are no elements in the array with
       
  5226                a bigger key, then the index value is the same as the total 
       
  5227                number of elements in the array.
       
  5228 @return KErrNone if a matching object is found, or KErrNotFound if no matching 
       
  5229         object can be found.
       
  5230 */
       
  5231 	{return RArrayBase::BinarySearchSigned(&anEntry,anIndex);}
       
  5232 
       
  5233 
       
  5234 
       
  5235 
       
  5236 template <class T>
       
  5237 inline TInt RArray<T>::FindInUnsignedKeyOrder(const T& anEntry, TInt& anIndex) const
       
  5238 /**
       
  5239 Finds the object in the array which matches the specified object using a binary 
       
  5240 search technique.
       
  5241 
       
  5242 The function assumes that existing objects within the array are in unsigned 
       
  5243 key order.
       
  5244 
       
  5245 @param anEntry A reference to an object of type class T to be used for matching.
       
  5246 @param anIndex On return contains an index value. If the function returns
       
  5247                KErrNone, this is the index of the matching object within the
       
  5248                array. 
       
  5249                If the function returns KErrNotFound, this is the index of the
       
  5250                first element in the array whose key is bigger than the key of the
       
  5251                element being sought. If there are no elements in the array with
       
  5252                a bigger key, then the index value is the same as the total 
       
  5253                number of elements in the array.
       
  5254 @return KErrNone if a matching object is found, or KErrNotFound if no matching 
       
  5255         object can be found.
       
  5256 */
       
  5257 	{return RArrayBase::BinarySearchUnsigned(&anEntry,anIndex);}
       
  5258 
       
  5259 
       
  5260 
       
  5261 
       
  5262 template <class T>
       
  5263 inline TInt RArray<T>::FindInOrder(const T& anEntry, TInt& anIndex, TLinearOrder<T> anOrder) const
       
  5264 /**
       
  5265 Finds the object in the array which matches the specified object using a binary 
       
  5266 search technique and an ordering algorithm.
       
  5267 
       
  5268 The function assumes that existing objects within the array are in object 
       
  5269 order as determined by an algorithm supplied by the caller and packaged as 
       
  5270 a TLinearOrder<T>.
       
  5271 
       
  5272 @param anEntry A reference to an object of type class T to be used for matching.
       
  5273 @param anIndex On return contains an index value. If the function returns
       
  5274                KErrNone, this is the index of the matching object within the
       
  5275                array.
       
  5276                If the function returns KErrNotFound, this is the index of the
       
  5277                first element in the array that is bigger than the element being
       
  5278                searched for - if no elements in the array are bigger, then
       
  5279                the index value is the same as the total number of elements in
       
  5280                the array.
       
  5281 @param anOrder A package encapsulating the function which determines the order 
       
  5282                of two class T objects.
       
  5283 
       
  5284 @return KErrNone if a matching object is found. KErrNotFound if no matching 
       
  5285         object can be found.
       
  5286 */
       
  5287 	{return RArrayBase::BinarySearch(&anEntry,anIndex,anOrder);}
       
  5288 
       
  5289 
       
  5290 
       
  5291 
       
  5292 template <class T>
       
  5293 inline TInt RArray<T>::SpecificFindInSignedKeyOrder(const T& anEntry, TInt aMode) const
       
  5294 /**
       
  5295 Finds the object in the array which matches the specified object using a binary 
       
  5296 search technique.
       
  5297 
       
  5298 The element ordering is determined by a signed 32-bit word
       
  5299 (the key) embedded in each array element. In the case that there is more than
       
  5300 one matching element, finds the first, last or any match as specified by
       
  5301 the value of aMode.
       
  5302 
       
  5303 The function assumes that existing objects within the array are in signed 
       
  5304 key order.
       
  5305 
       
  5306 @param anEntry A reference to an object of type class T to be used for matching.
       
  5307 @param	aMode  Specifies whether to find the first match, the last match or
       
  5308                any match, as defined by one of the TArrayFindMode enum values.
       
  5309                
       
  5310 @return KErrNotFound, if there is no matching element, otherwise the array
       
  5311         index of a matching element -  what the index refers to depends on the
       
  5312         value of aMode:
       
  5313         if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  5314         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  5315         if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  5316         the last matching element - if the last matching element is also the last element of
       
  5317         the array, then the index value is the same as the total number of elements in the array.
       
  5318         
       
  5319 @see TArrayFindMode        
       
  5320 */
       
  5321 	{return RArrayBase::FindIsqSigned(&anEntry,aMode);}
       
  5322 
       
  5323 
       
  5324 
       
  5325 
       
  5326 template <class T>
       
  5327 inline TInt RArray<T>::SpecificFindInUnsignedKeyOrder(const T& anEntry, TInt aMode) const
       
  5328 /**
       
  5329 Finds the object in the array which matches the specified object using a binary 
       
  5330 search technique.
       
  5331 
       
  5332 The element ordering is determined by an unsigned 32-bit word
       
  5333 (the key) embedded in each array element. Where there is more than
       
  5334 one matching element, it finds the first, last or any matching element
       
  5335 as specified by the value of aMode.
       
  5336 
       
  5337 The function assumes that existing objects within the array are in unsigned 
       
  5338 key order.
       
  5339 
       
  5340 @param anEntry A reference to an object of type class T to be used for matching.
       
  5341 @param	aMode  Specifies whether to find the first match, the last match or
       
  5342                any match, as defined by one of the TArrayFindMode enum values.
       
  5343 
       
  5344 @return KErrNotFound, if there is no matching element, otherwise the array
       
  5345         index of a matching element - what the index refers to depends on the
       
  5346         value of aMode:
       
  5347         if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  5348         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  5349         if this is EArrayFindMode_Last, then the index refers to first element that follows the
       
  5350         last matching element - if the last matching element is also the last element of the array,
       
  5351         then the index value is the same as the total number of elements in the array.
       
  5352         
       
  5353 @see TArrayFindMode
       
  5354 */
       
  5355 	{return RArrayBase::FindIsqUnsigned(&anEntry,aMode);}
       
  5356 
       
  5357 
       
  5358 
       
  5359 
       
  5360 template <class T>
       
  5361 inline TInt RArray<T>::SpecificFindInOrder(const T& anEntry, TLinearOrder<T> anOrder, TInt aMode) const
       
  5362 /**
       
  5363 Finds the object in the array which matches the specified object using a binary 
       
  5364 search technique and an ordering algorithm.
       
  5365 
       
  5366 Where there is more than one matching element, it finds the first, the last
       
  5367 or any matching element as specified by the value of aMode.
       
  5368 
       
  5369 The function assumes that existing objects within the array are in object 
       
  5370 order as determined by an algorithm supplied by the caller and packaged as 
       
  5371 a TLinearOrder<T> type.
       
  5372 
       
  5373 @param anEntry A reference to an object of type class T to be used for matching.
       
  5374 @param anOrder A package encapsulating the function which determines the order 
       
  5375                of two class T objects.
       
  5376 @param	aMode  Specifies whether to find the first match, the last match or any
       
  5377                match, as defined by one of the TArrayFindMode enum values.
       
  5378 
       
  5379 @return KErrNotFound, if there is no matching element, otherwise the array index
       
  5380         of a matching element -  what the index refers to depends on the value of
       
  5381         aMode:
       
  5382         if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  5383         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  5384         if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  5385         the last matching element - if the last matching element is also the last element of
       
  5386         the array, then the index value is the same as the total number of elements in the array.
       
  5387 */
       
  5388 	{return RArrayBase::FindIsq(&anEntry,anOrder,aMode);}
       
  5389 
       
  5390 
       
  5391 
       
  5392 
       
  5393 template <class T>
       
  5394 inline TInt RArray<T>::SpecificFindInSignedKeyOrder(const T& anEntry, TInt& anIndex, TInt aMode) const
       
  5395 /**
       
  5396 Finds the object in the array which matches the specified object using a binary 
       
  5397 search technique.
       
  5398 
       
  5399 The element ordering is determined by a signed 32-bit word
       
  5400 (the key) embedded in each array element. Where there is more than
       
  5401 one matching element, finds the first, last or any matching element as
       
  5402 specified specified by the value of aMode.
       
  5403 
       
  5404 The function assumes that existing objects within the array are in signed 
       
  5405 key order.
       
  5406 
       
  5407 @param anEntry A reference to an object of type class T to be used for matching.
       
  5408 @param anIndex A TInt type supplied by the caller. On return, it contains
       
  5409                an index value depending on whether a match is found and on the
       
  5410                value of aMode. If there is no matching element in the array,
       
  5411                then this is the index of the first element in the array that
       
  5412                is bigger than the element being searched for - if no elements
       
  5413                in the array are bigger, then the index value is the same as the
       
  5414                total number of elements in the array. If there is a matching
       
  5415                element, then what the index refers to depends on the value of aMode:
       
  5416                if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  5417                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  5418                if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  5419                the last matching element - if the last matching element is also the last element of
       
  5420                the array, then the index value is the same as the total number of elements in the array.
       
  5421 @param	aMode  Specifies whether to find the first match, the last match or any match,
       
  5422                as defined by one of the TArrayFindMode enum values.
       
  5423                
       
  5424 @return	KErrNone, if a matching object pointer is found;
       
  5425         KErrNotFound, if no suitable object pointer can be found.
       
  5426 */
       
  5427 	{return RArrayBase::BinarySearchSigned(&anEntry,anIndex,aMode);}
       
  5428 
       
  5429 
       
  5430 
       
  5431 
       
  5432 template <class T>
       
  5433 inline TInt RArray<T>::SpecificFindInUnsignedKeyOrder(const T& anEntry, TInt& anIndex, TInt aMode) const
       
  5434 /**
       
  5435 Finds the object in the array which matches the specified object using a binary 
       
  5436 search technique.
       
  5437 
       
  5438 The element ordering is determined by an unsigned 32-bit word
       
  5439 (the key) embedded in each array element. Where there is more than
       
  5440 one matching element, it finds the first, last or any matching element as
       
  5441 specified by the value of aMode.
       
  5442 
       
  5443 The function assumes that existing objects within the array are in unsigned 
       
  5444 key order.
       
  5445 
       
  5446 @param anEntry A reference to an object of type class T to be used for matching.
       
  5447 @param anIndex A TInt type supplied by the caller. On return, it contains an index
       
  5448                value depending on whether a match is found and on the value of aMode.
       
  5449                If there is no matching element in the array, then this is the index
       
  5450                of the first element in the array that is bigger than the element
       
  5451                being searched for - if no elements in the array are bigger, then
       
  5452                the index value is the same as the total number of elements in the array.
       
  5453                If there is a matching element, then what the index refers to depends on
       
  5454                the value of aMode:
       
  5455                if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  5456                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  5457                if this is EArrayFindMode_Last, then the index refers to first element that follows the
       
  5458                last matching element - if the last matching element is also the last element of the array,
       
  5459                then the index value is the same as the total number of elements in the array.
       
  5460 @param	aMode  Specifies whether to find the first match, the last match or any match, as defined by one
       
  5461                of the TArrayFindMode enum values.
       
  5462 @return	KErrNone, if a matching object pointer is found; KErrNotFound, if no suitable object pointer can be found.
       
  5463 
       
  5464 @see TArrayFindMode
       
  5465 */
       
  5466 	{return RArrayBase::BinarySearchUnsigned(&anEntry,anIndex,aMode);}
       
  5467 
       
  5468 
       
  5469 
       
  5470 
       
  5471 template <class T>
       
  5472 inline TInt RArray<T>::SpecificFindInOrder(const T& anEntry, TInt& anIndex, TLinearOrder<T> anOrder, TInt aMode) const
       
  5473 /**
       
  5474 Finds the object in the array which matches the specified object using a binary 
       
  5475 search technique and a specified ordering algorithm.
       
  5476 
       
  5477 Where there is more than one matching element, it finds the first, the last or
       
  5478 any matching element as specified by the value of aMode.
       
  5479 
       
  5480 The function assumes that existing objects within the array are in object 
       
  5481 order as determined by an algorithm supplied by the caller and packaged as 
       
  5482 a TLinearOrder<T> type.
       
  5483 
       
  5484 @param anEntry A reference to an object of type class T to be used for matching.
       
  5485 @param anIndex A TInt type supplied by the caller. On return, it contains
       
  5486                an index value depending on whether a match is found and on the
       
  5487                value of aMode. If there is no matching element in the array,
       
  5488                then this is the index of the first element in the array that
       
  5489                is bigger than the element being searched for - if no elements
       
  5490                in the array are bigger, then the index value is the same as 
       
  5491                the total number of elements in the array.
       
  5492                If there is a matching element, then what the index refers to
       
  5493                depends on the value of aMode:
       
  5494                if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  5495                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  5496                if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  5497                the last matching element - if the last matching element is also
       
  5498                the last element of the array, then the index value is the same as
       
  5499                the total number of elements in the array.
       
  5500 @param anOrder A package encapsulating the function which determines the order 
       
  5501                of two class T objects.
       
  5502 @param	aMode  Specifies whether to find the first match, the last match or any match,
       
  5503                as defined by one of the TArrayFindMode enum values.
       
  5504 @return	KErrNone, if a matching object pointer is found;
       
  5505         KErrNotFound, if no suitable object pointer can be found.
       
  5506 
       
  5507 */
       
  5508 	{return RArrayBase::BinarySearch(&anEntry,anIndex,anOrder,aMode);}
       
  5509 
       
  5510 
       
  5511 
       
  5512 
       
  5513 template <class T>
       
  5514 inline TInt RArray<T>::InsertInSignedKeyOrder(const T& anEntry)
       
  5515 /**
       
  5516 Inserts an object into the array in ascending signed key order.
       
  5517 
       
  5518 The order of two class T type objects is based on comparing a TInt value
       
  5519 located at the key offset position within the class T object.
       
  5520 
       
  5521 No duplicate entries are permitted. The array remains unchanged following
       
  5522 an attempt to insert a duplicate entry.
       
  5523 
       
  5524 @param anEntry A reference to the object of type class T to be inserted.
       
  5525 
       
  5526 @return KErrNone, if the insertion is successful;
       
  5527         KErrAlreadyExists, if an attempt is being made
       
  5528         to insert a duplicate entry; otherwise one of the other system wide
       
  5529         error codes.
       
  5530 */
       
  5531 	{return RArrayBase::InsertIsqSigned(&anEntry,EFalse);}
       
  5532 
       
  5533 
       
  5534 
       
  5535 
       
  5536 template <class T>
       
  5537 inline TInt RArray<T>::InsertInUnsignedKeyOrder(const T& anEntry)
       
  5538 /**
       
  5539 Inserts an object into the array in ascending unsigned key order.
       
  5540 
       
  5541 The order of two class T type objects is based on comparing a TUint value 
       
  5542 located at the key offset position within the class T object. 
       
  5543 
       
  5544 No duplicate entries are permitted. The array remains unchanged following
       
  5545 an attempt to insert a duplicate entry.
       
  5546 
       
  5547 @param anEntry A reference to the object of type class T to be inserted.
       
  5548 
       
  5549 @return KErrNone, if the insertion is successful;
       
  5550         KErrAlreadyExists, if an attempt is being made
       
  5551         to insert a duplicate entry; otherwise one of the other system wide
       
  5552         error codes.
       
  5553 */
       
  5554 	{return RArrayBase::InsertIsqUnsigned(&anEntry,EFalse);}
       
  5555 
       
  5556 
       
  5557 
       
  5558 
       
  5559 template <class T>
       
  5560 inline TInt RArray<T>::InsertInOrder(const T& anEntry, TLinearOrder<T> anOrder)
       
  5561 /**
       
  5562 Inserts an object of into the array in object order.
       
  5563 
       
  5564 The algorithm for determining the order of two class T type objects is provided 
       
  5565 by a function supplied by the caller.
       
  5566 
       
  5567 No duplicate entries are permitted. The array remains unchanged following
       
  5568 an attempt to insert a duplicate entry.
       
  5569 
       
  5570 The function assumes that existing objects within the array are in object 
       
  5571 order.
       
  5572 
       
  5573 @param anEntry A reference to the object of type class T to be inserted.
       
  5574 @param anOrder A package encapsulating the function which determines the order 
       
  5575                of two class T objects.
       
  5576 
       
  5577 @return KErrNone, if the insertion is successful;
       
  5578         KErrAlreadyExists, if an attempt is being made
       
  5579         to insert a duplicate entry; otherwise one of the other system wide
       
  5580         error codes.
       
  5581 */
       
  5582 	{return RArrayBase::InsertIsq(&anEntry,anOrder,EFalse);}
       
  5583 
       
  5584 
       
  5585 
       
  5586 
       
  5587 template <class T>
       
  5588 inline TInt RArray<T>::InsertInSignedKeyOrderAllowRepeats(const T& anEntry)
       
  5589 /**
       
  5590 Inserts an object into the array in ascending signed key order,
       
  5591 allowing duplicates.
       
  5592 
       
  5593 The order of two class T type objects is based on comparing a TInt value
       
  5594 located at the key offset position within the class T object. 
       
  5595 
       
  5596 If anEntry is a duplicate of an existing object in the array, then the new 
       
  5597 object is inserted after the existing object. If more than one duplicate object 
       
  5598 already exists in the array, then any new duplicate object is inserted after 
       
  5599 the last one.
       
  5600 
       
  5601 @param anEntry A reference to the object of type class T to be inserted.
       
  5602 
       
  5603 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  5604         wide error codes.
       
  5605 */
       
  5606 	{return RArrayBase::InsertIsqSigned(&anEntry,ETrue);}
       
  5607 
       
  5608 
       
  5609 
       
  5610 
       
  5611 template <class T>
       
  5612 inline TInt RArray<T>::InsertInUnsignedKeyOrderAllowRepeats(const T& anEntry)
       
  5613 /**
       
  5614 Inserts an object into the array in ascending unsigned key order, allowing 
       
  5615 duplicates.
       
  5616 
       
  5617 The order of two class T type objects is based on comparing a TUint value 
       
  5618 located at the key offset position within the class T object. 
       
  5619 
       
  5620 If anEntry is a duplicate of an existing object in the array, then the new 
       
  5621 object is inserted after the existing object. If more than one duplicate object 
       
  5622 already exists in the array, then any new duplicate object is inserted after 
       
  5623 the last one.
       
  5624 
       
  5625 @param anEntry A reference to the object of type class T to be inserted.
       
  5626 
       
  5627 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  5628         wide error codes. 
       
  5629 */
       
  5630 	{return RArrayBase::InsertIsqUnsigned(&anEntry,ETrue);}
       
  5631 
       
  5632 
       
  5633 
       
  5634 
       
  5635 template <class T>
       
  5636 inline TInt RArray<T>::InsertInOrderAllowRepeats(const T& anEntry, TLinearOrder<T> anOrder)
       
  5637 /**
       
  5638 Inserts an object into the array in object order, allowing duplicates.
       
  5639 
       
  5640 The algorithm for determining the order of two class T type objects is provided 
       
  5641 by a function supplied by the caller.
       
  5642 
       
  5643 If anEntry is a duplicate of an existing object in the array, then the new 
       
  5644 object is inserted after the existing object. If more than one duplicate object 
       
  5645 already exists in the array, then anEntry is inserted after the last one.
       
  5646 
       
  5647 The function assumes that existing objects within the array are in object 
       
  5648 order.
       
  5649 
       
  5650 @param anEntry A reference to the object of type class T to be inserted.
       
  5651 @param anOrder A package encapsulating the function which determines the order 
       
  5652                of two class T objects.
       
  5653 
       
  5654 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  5655         wide error codes.
       
  5656 */
       
  5657 	{return RArrayBase::InsertIsq(&anEntry,anOrder,ETrue);}
       
  5658 
       
  5659 
       
  5660 
       
  5661 #ifndef __KERNEL_MODE__
       
  5662 
       
  5663 template <class T>
       
  5664 inline void RArray<T>::GranularCompress()
       
  5665 /**
       
  5666 Compresses the array down to a granular boundary.
       
  5667 
       
  5668 After a call to this function, the memory allocated to the array is sufficient 
       
  5669 for its contained objects. Adding new objects to the array does not result 
       
  5670 in a re-allocation of memory until the the total number of objects reaches 
       
  5671 a multiple of the granularity.
       
  5672 */
       
  5673 	{RArrayBase::GranularCompress();}
       
  5674 
       
  5675 
       
  5676 
       
  5677 
       
  5678 template <class T>
       
  5679 inline TInt RArray<T>::Reserve(TInt aCount)
       
  5680 /**
       
  5681 Reserves space for the specified number of elements.
       
  5682 
       
  5683 After a call to this function, the memory allocated to the array is sufficient 
       
  5684 to hold the number of objects specified. Adding new objects to the array 
       
  5685 does not result in a re-allocation of memory until the the total number of 
       
  5686 objects exceeds the specified count.
       
  5687 
       
  5688 @param	aCount	The number of objects for which space should be reserved
       
  5689 @return	KErrNone		If the operation completed successfully
       
  5690 @return KErrNoMemory	If the requested amount of memory could not be allocated
       
  5691 */
       
  5692 	{ return RArrayBase::DoReserve(aCount); }
       
  5693 
       
  5694 
       
  5695 
       
  5696 
       
  5697 template <class T>
       
  5698 inline void RArray<T>::SortSigned()
       
  5699 /**
       
  5700 Sorts the objects within the array; the sort order is assumed to be in signed 
       
  5701 integer order.
       
  5702 */
       
  5703 	{HeapSortSigned();}
       
  5704 
       
  5705 
       
  5706 
       
  5707 
       
  5708 template <class T>
       
  5709 inline void RArray<T>::SortUnsigned()
       
  5710 /**
       
  5711 Sorts the objects within the array; the sort order is assumed to be in unsigned 
       
  5712 integer order.
       
  5713 */
       
  5714 	{HeapSortUnsigned();}
       
  5715 
       
  5716 
       
  5717 
       
  5718 
       
  5719 template <class T>
       
  5720 inline void RArray<T>::Sort(TLinearOrder<T> anOrder)
       
  5721 /**
       
  5722 Sorts the objects within the array using the specified TLinearOrder. 
       
  5723 
       
  5724 The sort order is determined by an algorithm supplied by the caller and
       
  5725 packaged as a TLinerOrder<T>.
       
  5726 
       
  5727 @param anOrder A package encapsulating the function which determines the order 
       
  5728                of two class T type objects.
       
  5729 */
       
  5730 	{HeapSort(anOrder);}
       
  5731 
       
  5732 
       
  5733 
       
  5734 
       
  5735 template <class T>
       
  5736 inline TArray<T> RArray<T>::Array() const
       
  5737 /**
       
  5738 Constructs and returns a generic array.
       
  5739 
       
  5740 @return A generic array representing this array.
       
  5741 */
       
  5742 	{ return TArray<T>(GetCount,GetElementPtr,(const CBase*)this); }
       
  5743 #endif
       
  5744 
       
  5745 
       
  5746 
       
  5747 
       
  5748 inline RArray<TInt>::RArray()
       
  5749 	: RPointerArrayBase()
       
  5750 /**
       
  5751 Constructs an array object for an array of signed integers with
       
  5752 default granularity. 
       
  5753 
       
  5754 The default granularity is 8. 
       
  5755 */
       
  5756 	{}
       
  5757 
       
  5758 
       
  5759 
       
  5760 
       
  5761 inline RArray<TInt>::RArray(TInt aGranularity)
       
  5762 	: RPointerArrayBase(aGranularity)
       
  5763 /**
       
  5764 Constructs an array object for an array of signed integers with the specified 
       
  5765 granularity.
       
  5766 	
       
  5767 @param aGranularity The granularity of the array.
       
  5768 
       
  5769 @panic USER 127, if aGranularity is not positive or is greater than or
       
  5770        equal to 0x10000000.
       
  5771 */
       
  5772 	{}
       
  5773 
       
  5774 
       
  5775 
       
  5776 
       
  5777 /**
       
  5778 C++ constructor with minimum growth step and exponential growth factor.
       
  5779 
       
  5780 This constructs an array object for an array of signed integers with the
       
  5781 specified minimum growth step and exponential growth factor.
       
  5782 
       
  5783 @param aMinGrowBy	The minimum growth step of the array. Must be between 1 and
       
  5784 					65535 inclusive.
       
  5785 @param aFactor		The factor by which the array grows, multiplied by 256.
       
  5786 					For example 512 specifies a factor of 2. Must be between 257
       
  5787 					and 32767 inclusive.
       
  5788 
       
  5789 @panic USER 192, if aMinGrowBy<=0 or aMinGrowBy>65535.
       
  5790 @panic USER 193, if aFactor<=257 or aFactor>32767.
       
  5791 */
       
  5792 inline RArray<TInt>::RArray(TInt aMinGrowBy, TInt aFactor)
       
  5793 	: RPointerArrayBase(aMinGrowBy, aFactor)
       
  5794 	{}
       
  5795 
       
  5796 
       
  5797 
       
  5798 
       
  5799 inline void RArray<TInt>::Close()
       
  5800 /**
       
  5801 Closes the array and frees all memory allocated to the array.
       
  5802 	
       
  5803 The function must be called before this array object goes out of scope. 
       
  5804 */
       
  5805 	{RPointerArrayBase::Close();}
       
  5806 
       
  5807 
       
  5808 
       
  5809 
       
  5810 inline TInt RArray<TInt>::Count() const
       
  5811 /**
       
  5812 Gets the number of signed integers in the array.
       
  5813 	
       
  5814 @return The number of signed integers in the array.
       
  5815 */
       
  5816 	{ return RPointerArrayBase::Count(); }
       
  5817 
       
  5818 
       
  5819 
       
  5820 
       
  5821 inline const TInt& RArray<TInt>::operator[](TInt anIndex) const
       
  5822 /**
       
  5823 Gets a reference to the signed integer located at a specified position within 
       
  5824 the array.
       
  5825 	
       
  5826 The compiler chooses this function if the returned reference is used in an 
       
  5827 expression where the reference cannot be modified.
       
  5828 	
       
  5829 @param anIndex The position of the signed integer within the array. The
       
  5830                position is relative to zero, i.e. zero implies the entry
       
  5831 			   at the beginning of the array. 
       
  5832 
       
  5833 @return A const reference to the signed integer at position anIndex within 
       
  5834         the array.
       
  5835 
       
  5836 @panic USER 130, if anIndex is negative, or is greater than the number of 
       
  5837 	   entries currently in the array.
       
  5838 */
       
  5839 	{return (const TInt&)At(anIndex);}
       
  5840 
       
  5841 
       
  5842 
       
  5843 
       
  5844 inline TInt& RArray<TInt>::operator[](TInt anIndex)
       
  5845 /**
       
  5846 Gets a reference to the signed integer located at a specified position within 
       
  5847 the array.
       
  5848 	
       
  5849 The compiler chooses this function if the returned reference is used in an 
       
  5850 expression where the reference can be modified.
       
  5851 	
       
  5852 @param anIndex The position of the signed integer within the array. The
       
  5853                position is relative to zero, i.e. zero implies the entry
       
  5854 			   at the beginning of the array. 
       
  5855 
       
  5856 @return A non-const reference to the signed integer at position anIndex within 
       
  5857         the array.
       
  5858 
       
  5859 @panic USER 130, if anIndex is negative, or is greater than the number of 
       
  5860 	   entries currently in the array.
       
  5861 */
       
  5862 	{return (TInt&)At(anIndex);}
       
  5863 
       
  5864 
       
  5865 
       
  5866 
       
  5867 inline TInt RArray<TInt>::Append(TInt anEntry)
       
  5868 /**
       
  5869 Appends a signed integer onto the array.
       
  5870 	
       
  5871 @param anEntry The signed integer to be appended.
       
  5872 	
       
  5873 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  5874 	    wide error codes.
       
  5875 */
       
  5876 	{ return RPointerArrayBase::Append((const TAny*)anEntry); }
       
  5877 
       
  5878 
       
  5879 
       
  5880 
       
  5881 inline TInt RArray<TInt>::Insert(TInt anEntry, TInt aPos)
       
  5882 /**
       
  5883 Inserts a signed integer into the array at the specified position.
       
  5884 	
       
  5885 @param anEntry The signed integer to be inserted.
       
  5886 @param aPos    The position within the array where the signed integer is to be 
       
  5887 	           inserted. The position is relative to zero, i.e. zero implies
       
  5888 			   that an entry is inserted at the beginning of the array.
       
  5889 			   
       
  5890 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  5891 	    wide error codes.
       
  5892 
       
  5893 @panic USER 131, if aPos is negative, or is greater than the number of entries
       
  5894        currently in the array.
       
  5895 */
       
  5896 	{ return RPointerArrayBase::Insert((const TAny*)anEntry,aPos); }
       
  5897 
       
  5898 
       
  5899 
       
  5900 
       
  5901 inline void RArray<TInt>::Remove(TInt anIndex)
       
  5902 /**
       
  5903 Removes the signed integer at the specified position from the array.
       
  5904 	
       
  5905 @param anIndex The position within the array from where the signed integer 
       
  5906 	           is to be removed. The position is relative to zero, i.e. zero
       
  5907 			   implies that an entry at the beginning of the array is to be
       
  5908 			   removed. 
       
  5909 
       
  5910 @panic USER 130, if anIndex is negative or is greater than the number of
       
  5911        entries currently in the array.
       
  5912 */
       
  5913 	{RPointerArrayBase::Remove(anIndex);}
       
  5914 
       
  5915 
       
  5916 
       
  5917 
       
  5918 inline void RArray<TInt>::Compress()
       
  5919 /**
       
  5920 Compresses the array down to a minimum.
       
  5921 	
       
  5922 After a call to this function, the memory allocated to the array is just
       
  5923 sufficient for its entries. Subsequently adding a new signed integer to the
       
  5924 array always results in a re-allocation of memory.
       
  5925 */
       
  5926 	{RPointerArrayBase::Compress();}
       
  5927 
       
  5928 
       
  5929 
       
  5930 
       
  5931 inline void RArray<TInt>::Reset()
       
  5932 /**
       
  5933 Empties the array.
       
  5934 
       
  5935 The function frees all memory allocated to the array and 
       
  5936 resets the internal state so that it is ready to be reused.
       
  5937 	
       
  5938 This array object can be allowed to go out of scope after a call to this
       
  5939 function.
       
  5940 */
       
  5941 	{RPointerArrayBase::Reset();}
       
  5942 
       
  5943 
       
  5944 
       
  5945 
       
  5946 inline TInt RArray<TInt>::Find(TInt anEntry) const
       
  5947 /**
       
  5948 Finds the first signed integer in the array which matches the specified signed 
       
  5949 integer using a sequential search.
       
  5950 	
       
  5951 The find operation always starts at the low index end of the array. There 
       
  5952 is no assumption about the order of entries in the array.
       
  5953 	
       
  5954 @param anEntry The signed integer to be found.
       
  5955 
       
  5956 @return The index of the first matching signed integer within the array.
       
  5957         KErrNotFound, if no matching entry can be found.
       
  5958 */
       
  5959 	{ return RPointerArrayBase::Find((const TAny*)anEntry); }
       
  5960 
       
  5961 
       
  5962 
       
  5963 
       
  5964 inline TInt RArray<TInt>::FindReverse(TInt anEntry) const
       
  5965 /**
       
  5966 Finds the last signed integer in the array which matches the specified signed 
       
  5967 integer using a sequential search.
       
  5968 	
       
  5969 The find operation always starts at the high index end of the array. There 
       
  5970 is no assumption about the order of entries in the array.
       
  5971 	
       
  5972 @param anEntry The signed integer to be found.
       
  5973 
       
  5974 @return The index of the last matching signed integer within the array.
       
  5975         KErrNotFound, if no matching entry can be found.
       
  5976 */
       
  5977 	{ return RPointerArrayBase::FindReverse((const TAny*)anEntry); }
       
  5978 
       
  5979 
       
  5980 
       
  5981 
       
  5982 inline TInt RArray<TInt>::FindInOrder(TInt anEntry) const
       
  5983 /**
       
  5984 Finds the signed integer in the array that matches the specified signed integer 
       
  5985 using a binary search technique.
       
  5986 	
       
  5987 The function assumes that the array is in signed integer order.
       
  5988 	
       
  5989 @param anEntry The signed integer to find.
       
  5990 
       
  5991 @return The index of the matching signed integer within the array or KErrNotFound, 
       
  5992         if no match can be found.
       
  5993 */
       
  5994 	{ return RPointerArrayBase::FindIsqSigned(anEntry); }
       
  5995 
       
  5996 
       
  5997 
       
  5998 
       
  5999 inline TInt RArray<TInt>::FindInOrder(TInt anEntry, TInt& anIndex) const
       
  6000 /**
       
  6001 Finds the signed integer in the array that matches the specified signed integer
       
  6002 using a binary search technique.
       
  6003 	
       
  6004 The function assumes that the array is in signed integer order.
       
  6005 	
       
  6006 @param anEntry The signed integer to find.
       
  6007 @param anIndex A TInt suplied by the caller. On return contains an index value.
       
  6008                If the function returns KErrNone, this is the index of the
       
  6009                matching signed integer within the array.   
       
  6010                If the function returns KErrNotFound, this is the index of the
       
  6011                first signed integer within the array that is bigger than the
       
  6012                signed integer being searched for - if no signed integers within
       
  6013                the array are bigger, then the index value is the same as the
       
  6014                total number of signed integers within the array.
       
  6015 
       
  6016 @return KErrNone if a matching signed integer is found.
       
  6017         KErrNotFound if no  match can be found.
       
  6018 */
       
  6019 	{ return RPointerArrayBase::BinarySearchSigned(anEntry,anIndex); }
       
  6020 
       
  6021 
       
  6022 
       
  6023 
       
  6024 inline TInt RArray<TInt>::SpecificFindInOrder(TInt anEntry, TInt aMode) const
       
  6025 /**
       
  6026 Finds the signed integer in the array that matches the specified signed integer 
       
  6027 using a binary search technique.
       
  6028 
       
  6029 Where there is more than one matching element, it finds the first, last or any
       
  6030 matching element as specified by the value of aMode.
       
  6031 	
       
  6032 The function assumes that the array is in signed integer order.
       
  6033 	
       
  6034 @param anEntry The signed integer to be found.
       
  6035 @param aMode   Specifies whether to find the first match, the last match or any
       
  6036                match, as defined by one of the TArrayFindMode enum values.
       
  6037 
       
  6038 @return KErrNotFound, if there is no matching element, otherwise the array
       
  6039         index of a matching element -  what the index refers to depends on the
       
  6040         value of aMode:
       
  6041         if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  6042         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  6043         if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  6044         the last matching element - if the last matching element is also the last element
       
  6045         of the array, then the index value is the same as the total number of elements in
       
  6046         the array.
       
  6047 
       
  6048 @see TArrayFindMode         
       
  6049 */
       
  6050 	{ return RPointerArrayBase::FindIsqSigned(anEntry,aMode); }
       
  6051 
       
  6052 
       
  6053 
       
  6054 
       
  6055 inline TInt RArray<TInt>::SpecificFindInOrder(TInt anEntry, TInt& anIndex, TInt aMode) const
       
  6056 /**
       
  6057 Finds the signed integer in the array that matches the specified signed integer
       
  6058 using a binary search technique.
       
  6059 
       
  6060 Where there is more than one matching element, it finds the first, last or any 
       
  6061 matching element  as specified by the value of aMode.
       
  6062 
       
  6063 The function assumes that the array is in signed integer order.
       
  6064 	
       
  6065 @param anEntry The signed integer to be found.
       
  6066 @param anIndex A TInt type supplied by the caller. On return, it contains an index
       
  6067                value depending on whether a match is found and on the value of aMode.
       
  6068                If there is no matching element in the array, then this is the  index of
       
  6069                the first element in the array that is bigger than the element being
       
  6070                searched for - if no elements in the array are bigger, then the index
       
  6071                value is the same as the total number of elements in the array.
       
  6072                If there is a matching element, then what the index refers to depends
       
  6073                on the value of aMode:
       
  6074                if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  6075                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  6076                if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  6077                the last matching element - if the last matching element is also the last element
       
  6078                of the array, then the index value is the same as the total number of elements in the array.
       
  6079                
       
  6080 @param	aMode  Specifies whether to find the first match, the last match or any match,
       
  6081                as defined by one of the TArrayFindMode enum values.
       
  6082                
       
  6083 @return KErrNone, if a matching element is found; 
       
  6084         KErrNotFound, if no suitable element can be found.               
       
  6085         
       
  6086 @see TArrayFindMode
       
  6087 */
       
  6088 	{ return RPointerArrayBase::BinarySearchSigned(anEntry,anIndex,aMode); }
       
  6089 
       
  6090 
       
  6091 
       
  6092 
       
  6093 inline TInt RArray<TInt>::InsertInOrder(TInt anEntry)
       
  6094 /**
       
  6095 Inserts a signed integer into the array in signed integer order.
       
  6096 	
       
  6097 No duplicate entries are permitted. The array remains unchanged following
       
  6098 an attempt to insert a duplicate entry.
       
  6099 	
       
  6100 The function assumes that existing entries within the array are in signed 
       
  6101 integer order.
       
  6102 	
       
  6103 @param anEntry The signed integer to be inserted
       
  6104 
       
  6105 @return KErrNone, if the insertion is successful;
       
  6106         KErrAlreadyExists, if an attempt is being made
       
  6107         to insert a duplicate entry; otherwise one of the other system wide
       
  6108         error codes.
       
  6109 */
       
  6110 	{ return RPointerArrayBase::InsertIsqSigned(anEntry,EFalse); }
       
  6111 
       
  6112 
       
  6113 
       
  6114 
       
  6115 inline TInt RArray<TInt>::InsertInOrderAllowRepeats(TInt anEntry)
       
  6116 /**
       
  6117 Inserts a signed integer into the array in signed integer order,
       
  6118 allowing duplicates.
       
  6119 	
       
  6120 If anEntry is a duplicate of an existing entry in the array, then the new 
       
  6121 signed integer is inserted after the existing one. If more than one duplicate 
       
  6122 entry already exists in the array, then any new duplicate signed integer is 
       
  6123 inserted after the last one.
       
  6124 	
       
  6125 The function assumes that existing entries within the array are in signed 
       
  6126 integer order.
       
  6127 	
       
  6128 @param anEntry The signed integer to be inserted.
       
  6129 
       
  6130 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  6131         wide error codes.
       
  6132 */
       
  6133 	{ return RPointerArrayBase::InsertIsqSigned(anEntry,ETrue); }
       
  6134 
       
  6135 
       
  6136 
       
  6137 
       
  6138 #ifndef __KERNEL_MODE__
       
  6139 inline RArray<TInt>::RArray(TInt* aEntries, TInt aCount)
       
  6140 	: RPointerArrayBase((TAny**)aEntries, aCount)
       
  6141 /**
       
  6142 C++ constructor with a pointer to the first array entry in a 
       
  6143 pre-existing array, and the number of entries in that array.
       
  6144 
       
  6145 This constructor takes a pointer to a pre-existing set of entries of type 
       
  6146 TInt objects. Ownership of the set of entries does not transfer to
       
  6147 this RArray object.
       
  6148 
       
  6149 The purpose of constructing an array in this way is to allow sorting and
       
  6150 finding operations to be done without further allocation of memory.
       
  6151 
       
  6152 @param aEntries   A pointer to the first entry of type class TInt in the set of 
       
  6153                   entries belonging to the existing array.
       
  6154 @param aCount     The number of entries in the existing array.
       
  6155 */
       
  6156 	{}
       
  6157 
       
  6158 inline void RArray<TInt>::GranularCompress()
       
  6159 /**
       
  6160 Compresses the array down to a granular boundary.
       
  6161 	
       
  6162 After a call to this function, the memory allocated to the array is sufficient 
       
  6163 for its contained entries. Adding new signed integers to the array does not 
       
  6164 result in a re-allocation of memory until the total number of entries reaches 
       
  6165 a multiple of the granularity.
       
  6166 */
       
  6167 	{RPointerArrayBase::GranularCompress();}
       
  6168 
       
  6169 
       
  6170 
       
  6171 
       
  6172 inline TInt RArray<TInt>::Reserve(TInt aCount)
       
  6173 /**
       
  6174 Reserves space for the specified number of elements.
       
  6175 
       
  6176 After a call to this function, the memory allocated to the array is sufficient 
       
  6177 to hold the number of integers specified. Adding new integers to the array 
       
  6178 does not result in a re-allocation of memory until the the total number of 
       
  6179 integers exceeds the specified count.
       
  6180 
       
  6181 @param	aCount	The number of integers for which space should be reserved
       
  6182 @return	KErrNone		If the operation completed successfully
       
  6183 @return KErrNoMemory	If the requested amount of memory could not be allocated
       
  6184 */
       
  6185 	{ return RPointerArrayBase::DoReserve(aCount); }
       
  6186 
       
  6187 
       
  6188 
       
  6189 
       
  6190 inline void RArray<TInt>::Sort()
       
  6191 /**
       
  6192 Sorts the array entries into signed integer order.
       
  6193 */
       
  6194 	{ HeapSortSigned(); }
       
  6195 
       
  6196 
       
  6197 
       
  6198 
       
  6199 inline TArray<TInt> RArray<TInt>::Array() const
       
  6200 /**
       
  6201 Constructs and returns a generic array.
       
  6202 	
       
  6203 @return A generic array representing this array.
       
  6204 
       
  6205 @see TArray
       
  6206 */
       
  6207 	{ return TArray<TInt>(GetCount,GetElementPtr,(const CBase*)this); }
       
  6208 #endif
       
  6209 
       
  6210 
       
  6211 
       
  6212 inline RArray<TUint>::RArray()
       
  6213 	: RPointerArrayBase()
       
  6214 /**
       
  6215 Default C++ constructor.
       
  6216 
       
  6217 This constructs an array object for an array of unsigned 
       
  6218 integers with default granularity.
       
  6219 
       
  6220 The default granularity of the array is 8.
       
  6221 */
       
  6222 	{}
       
  6223 
       
  6224 
       
  6225 
       
  6226 
       
  6227 inline RArray<TUint>::RArray(TInt aGranularity)
       
  6228 	: RPointerArrayBase(aGranularity)
       
  6229 /**
       
  6230 Constructs an array object for an array of unsigned integers with the specified 
       
  6231 granularity.
       
  6232 	
       
  6233 @param aGranularity The granularity of the array.
       
  6234 
       
  6235 @panic USER 127, if aGranularity is not positive or is greater than or
       
  6236        equal to 0x10000000.
       
  6237 */
       
  6238 	{}
       
  6239 
       
  6240 
       
  6241 
       
  6242 
       
  6243 /**
       
  6244 C++ constructor with minimum growth step and exponential growth factor.
       
  6245 
       
  6246 This constructs an array object for an array of unsigned integers with the
       
  6247 specified minimum growth step and exponential growth factor.
       
  6248 
       
  6249 @param aMinGrowBy	The minimum growth step of the array. Must be between 1 and
       
  6250 					65535 inclusive.
       
  6251 @param aFactor		The factor by which the array grows, multiplied by 256.
       
  6252 					For example 512 specifies a factor of 2. Must be between 257
       
  6253 					and 32767 inclusive.
       
  6254 
       
  6255 @panic USER 192, if aMinGrowBy<=0 or aMinGrowBy>65535.
       
  6256 @panic USER 193, if aFactor<=257 or aFactor>32767.
       
  6257 */
       
  6258 inline RArray<TUint>::RArray(TInt aMinGrowBy, TInt aFactor)
       
  6259 	: RPointerArrayBase(aMinGrowBy, aFactor)
       
  6260 	{}
       
  6261 
       
  6262 
       
  6263 
       
  6264 
       
  6265 inline void RArray<TUint>::Close()
       
  6266 /**
       
  6267 Closes the array and frees all memory allocated to the array.
       
  6268 	
       
  6269 The function must be called before this array object goes out of scope.
       
  6270 */
       
  6271 	{RPointerArrayBase::Close();}
       
  6272 
       
  6273 
       
  6274 
       
  6275 
       
  6276 inline TInt RArray<TUint>::Count() const
       
  6277 /**
       
  6278 Gets the number of unsigned integers in the array.
       
  6279 
       
  6280 @return The number of unsigned integers in the array.
       
  6281 */
       
  6282 	{return RPointerArrayBase::Count(); }
       
  6283 
       
  6284 
       
  6285 
       
  6286 
       
  6287 inline const TUint& RArray<TUint>::operator[](TInt anIndex) const
       
  6288 /**
       
  6289 Gets a reference to the unsigned integer located at the specified position 
       
  6290 within the array.
       
  6291 	
       
  6292 The compiler uses this variant if the returned reference is used in an
       
  6293 expression where the reference cannot be modified.
       
  6294 	
       
  6295 @param anIndex The position of the unsigned integer within the array, relative 
       
  6296 	           to zero, i.e. zero implies the entry at the beginning of
       
  6297 			   the array.
       
  6298 
       
  6299 @return A reference to the const unsigned integer at position anIndex within 
       
  6300         the array.
       
  6301 
       
  6302 @panic USER 130, if anIndex is negative, or is greater than the number of
       
  6303        entries currently in the array.
       
  6304 */
       
  6305 	{return (const TUint&)At(anIndex);}
       
  6306 
       
  6307 
       
  6308 
       
  6309 
       
  6310 inline TUint& RArray<TUint>::operator[](TInt anIndex)
       
  6311 /**
       
  6312 Gets a reference to the unsigned integer located at the specified position 
       
  6313 within the array.
       
  6314 	
       
  6315 The compiler uses this variant if the returned reference is used in an
       
  6316 expression where the reference can be modified.
       
  6317 	
       
  6318 @param anIndex The position of the unsigned integer within the array, relative 
       
  6319 	           to zero, i.e. zero implies the entry at the beginning of
       
  6320 			   the array.
       
  6321 
       
  6322 @return A reference to the non-const unsigned integer at position anIndex
       
  6323         within the array.
       
  6324 
       
  6325 @panic USER 130, if anIndex is negative, or is greater than the number of
       
  6326        entries currently in the array.
       
  6327 */
       
  6328 	{return (TUint&)At(anIndex);}
       
  6329 
       
  6330 
       
  6331 
       
  6332 
       
  6333 inline TInt RArray<TUint>::Append(TUint anEntry)
       
  6334 /**
       
  6335 Appends an unsigned integer onto the array.
       
  6336 	
       
  6337 @param anEntry The unsigned integer to be appended.
       
  6338 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  6339         wide error codes.
       
  6340 */
       
  6341 	{ return RPointerArrayBase::Append((const TAny*)anEntry); }
       
  6342 
       
  6343 
       
  6344 
       
  6345 
       
  6346 inline TInt RArray<TUint>::Insert(TUint anEntry, TInt aPos)
       
  6347 /**
       
  6348 Inserts an unsigned integer into the array at the specified position.
       
  6349 	
       
  6350 @param anEntry  The unsigned integer to be inserted.
       
  6351 @param aPos     The position within the array where the unsigned integer is to 
       
  6352 	            be inserted. The position is relative to zero, i.e. zero
       
  6353 				implies that an entry is inserted at the beginning of
       
  6354 				the array.
       
  6355 			
       
  6356 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  6357         wide error codes.
       
  6358 
       
  6359 @panic USER 131, if aPos is negative, or is greater than the number of entries
       
  6360        currently in the array.
       
  6361 */
       
  6362 	{ return RPointerArrayBase::Insert((const TAny*)anEntry,aPos); }
       
  6363 
       
  6364 
       
  6365 
       
  6366 
       
  6367 inline void RArray<TUint>::Remove(TInt anIndex)
       
  6368 /**
       
  6369 Removes the unsigned integer at the specified position from the array.
       
  6370 	
       
  6371 @param anIndex The position within the array from where the unsigned integer 
       
  6372                is to be removed. The position is relative to zero, i.e. zero
       
  6373 			   implies that an entry at the beginning of the array is to be
       
  6374 			   removed. 
       
  6375 			   
       
  6376 				 
       
  6377 @panic USER 130, if anIndex is negative, or is greater than the number of
       
  6378        entries currently in the array.
       
  6379 */
       
  6380 	{RPointerArrayBase::Remove(anIndex);}
       
  6381 
       
  6382 
       
  6383 
       
  6384 
       
  6385 inline void RArray<TUint>::Compress()
       
  6386 /**
       
  6387 Compresses the array down to a minimum.
       
  6388 	
       
  6389 After a call to this function, the memory allocated to the array is just
       
  6390 sufficient for its entries. Subsequently adding a new unsigned integer to the
       
  6391 array always results in a re-allocation of memory.
       
  6392 */
       
  6393 	{RPointerArrayBase::Compress();}
       
  6394 
       
  6395 
       
  6396 
       
  6397 
       
  6398 inline void RArray<TUint>::Reset()
       
  6399 /**
       
  6400 Empties the array.
       
  6401 
       
  6402 It frees all memory allocated to the array and resets the 
       
  6403 internal state so that it is ready to be reused.
       
  6404 	
       
  6405 This array object can be allowed to go out of scope after a call to
       
  6406 this function.
       
  6407 */
       
  6408 	{RPointerArrayBase::Reset();}
       
  6409 
       
  6410 
       
  6411 
       
  6412 
       
  6413 inline TInt RArray<TUint>::Find(TUint anEntry) const
       
  6414 /**
       
  6415 Finds the first unsigned integer in the array which matches the specified
       
  6416 value, using a sequential search.
       
  6417 	
       
  6418 The find operation always starts at the low index end of the array. There 
       
  6419 is no assumption about the order of entries in the array.
       
  6420 	
       
  6421 @param anEntry The unsigned integer to be found.
       
  6422 
       
  6423 @return The index of the first matching unsigned integer within the array.
       
  6424         KErrNotFound, if no matching entry can be found.
       
  6425 */
       
  6426 	{ return RPointerArrayBase::Find((const TAny*)anEntry); }
       
  6427 
       
  6428 
       
  6429 
       
  6430 
       
  6431 inline TInt RArray<TUint>::FindReverse(TUint anEntry) const
       
  6432 /**
       
  6433 Finds the last unsigned integer in the array which matches the specified
       
  6434 value, using a sequential search.
       
  6435 	
       
  6436 The find operation always starts at the high index end of the array. There 
       
  6437 is no assumption about the order of entries in the array.
       
  6438 	
       
  6439 @param anEntry The unsigned integer to be found.
       
  6440 
       
  6441 @return The index of the last matching unsigned integer within the array.
       
  6442         KErrNotFound, if no matching entry can be found.
       
  6443 */
       
  6444 	{ return RPointerArrayBase::FindReverse((const TAny*)anEntry); }
       
  6445 
       
  6446 
       
  6447 
       
  6448 
       
  6449 inline TInt RArray<TUint>::FindInOrder(TUint anEntry) const
       
  6450 /**
       
  6451 Finds the unsigned integer in the array which matches the specified value, 
       
  6452 using a binary search technique.
       
  6453 	
       
  6454 The functions assume that existing entries within the array are in unsigned 
       
  6455 integer order.
       
  6456 	
       
  6457 @param anEntry The unsigned integer to be found.
       
  6458 
       
  6459 @return This is either: the index of the matching unsigned integer within the 
       
  6460      	array;
       
  6461 		KErrNotFound, if no suitable entry can be found.
       
  6462 */
       
  6463 	{ return RPointerArrayBase::FindIsqUnsigned(anEntry); }
       
  6464 
       
  6465 
       
  6466 
       
  6467 
       
  6468 inline TInt RArray<TUint>::FindInOrder(TUint anEntry, TInt& anIndex) const
       
  6469 /**
       
  6470 Finds the unsigned integer in the array which matches the specified value, 
       
  6471 using a binary search technique.
       
  6472 
       
  6473 If the index cannot be found, the function returns the index of the last
       
  6474 unsigned integer within the array which logically precedes anEntry.
       
  6475 	
       
  6476 The functions assume that existing entries within the array are in unsigned 
       
  6477 integer order.
       
  6478 	
       
  6479 @param anEntry The unsigned integer to be found.
       
  6480 @param anIndex A TInt supplied by the caller. On return, contains an index
       
  6481                value.
       
  6482                If the function returns KErrNone, this is the index of the
       
  6483                matching unsigned integer within the array.               
       
  6484                If the function returns KErrNotFound, this is the index of the
       
  6485                first unsigned integer within the array that is bigger than the
       
  6486                unsigned integer being searched for - if no unsigned integers within
       
  6487                the array are bigger, then the index value is the same as the
       
  6488                total number of unsigned integers within the array.
       
  6489 @return KErrNone, if a matching unsigned integer is found. 
       
  6490         KErrNotFound, if no suitable entry can be found.
       
  6491 */
       
  6492 	{ return RPointerArrayBase::BinarySearchUnsigned(anEntry,anIndex); }
       
  6493 
       
  6494 
       
  6495 
       
  6496 
       
  6497 inline TInt RArray<TUint>::SpecificFindInOrder(TUint anEntry, TInt aMode) const
       
  6498 /**
       
  6499 Finds the unsigned integer in the array that matches the specified unsigned integer 
       
  6500 using a binary search technique.
       
  6501 
       
  6502 In the case that there is more than one matching element, finds the first, last
       
  6503 or any match as specified by the value of aMode.
       
  6504 	
       
  6505 The function assumes that the array is in unsigned integer order.
       
  6506 	
       
  6507 @param anEntry The unsigned integer to be found..
       
  6508 @param aMode   Specifies whether to find the first match, the last match or any match,
       
  6509                as defined by one of the TArrayFindMode enum values.
       
  6510 
       
  6511 @return KErrNotFound, if there is no matching element, otherwise the array index of
       
  6512         a matching element - what the index refers to depends on the value of
       
  6513         aMode:
       
  6514         if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  6515         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  6516         if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  6517         the last matching element - if the last matching element is also the last element of
       
  6518         the array, then the index value is the same as the total number of elements in the array.
       
  6519         
       
  6520 @see TArrayFindMode
       
  6521 */
       
  6522 	{ return RPointerArrayBase::FindIsqUnsigned(anEntry,aMode); }
       
  6523 
       
  6524 
       
  6525 
       
  6526 
       
  6527 inline TInt RArray<TUint>::SpecificFindInOrder(TUint anEntry, TInt& anIndex, TInt aMode) const
       
  6528 /**
       
  6529 Finds the unsigned integer in the array that matches the specified unsigned integer
       
  6530 using a binary search technique.
       
  6531 
       
  6532 In the case that there is more than one matching element, finds the first, last or any match as specified.
       
  6533 
       
  6534 The function assumes that the array is in unsigned integer order.
       
  6535 	
       
  6536 @param anEntry The unsigned integer to be found.
       
  6537 @param anIndex A TInt type supplied by the caller. On return, it contains an index
       
  6538                value depending on whether a match is found and on the value of aMode.
       
  6539                If there is no matching element in the array, then this is the  index
       
  6540                of the first element in the array that is bigger than the element being
       
  6541                searched for - if no elements in the array are bigger, then the index
       
  6542                value is the same as the total number of elements in the array.
       
  6543                If there is a matching element, then what the index refers to depends
       
  6544                on the value of aMode:
       
  6545                if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  6546                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  6547                if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  6548                the last matching element - if the last matching element is also the last element of the array,
       
  6549                then the index value is the same as the total number of elements in the array.
       
  6550 @param	aMode  Specifies whether to find the first match, the last match or any match, as defined by one
       
  6551                of the TArrayFindMode enum values.
       
  6552                
       
  6553 @return	KErrNone, if a matching entry is found; KErrNotFound, if no matching entry exists.
       
  6554 
       
  6555 @see TArrayFindMode
       
  6556 */
       
  6557 	{ return RPointerArrayBase::BinarySearchUnsigned(anEntry,anIndex,aMode); }
       
  6558 
       
  6559 
       
  6560 
       
  6561 
       
  6562 inline TInt RArray<TUint>::InsertInOrder(TUint anEntry)
       
  6563 /**
       
  6564 Inserts an unsigned integer into the array in unsigned integer order.
       
  6565 	
       
  6566 No duplicate entries are permitted. The array remains unchanged following
       
  6567 an attempt to insert a duplicate entry.
       
  6568 	
       
  6569 The function assumes that existing entries within the array are in unsigned 
       
  6570 integer order.
       
  6571 	
       
  6572 @param anEntry The unsigned integer to be inserted.
       
  6573 
       
  6574 @return KErrNone, if the insertion is successful;
       
  6575         KErrAlreadyExists, if an attempt is being made
       
  6576         to insert a duplicate entry; otherwise one of the other system wide
       
  6577         error codes.
       
  6578 */
       
  6579 	{ return RPointerArrayBase::InsertIsqUnsigned(anEntry,EFalse); }
       
  6580 
       
  6581 
       
  6582 
       
  6583 
       
  6584 inline TInt RArray<TUint>::InsertInOrderAllowRepeats(TUint anEntry)
       
  6585 /**
       
  6586 Inserts an unsigned integer into the array in unsigned integer order, allowing 
       
  6587 duplicates.
       
  6588 	
       
  6589 If the new integer is a duplicate of an existing entry in the array, then 
       
  6590 the new unsigned integer is inserted after the existing one. If more than 
       
  6591 one duplicate entry already exists in the array, then any new duplicate
       
  6592 unsigned integer is inserted after the last one.
       
  6593 	
       
  6594 The function assumes that existing entries within the array are in unsigned 
       
  6595 integer order.
       
  6596 	
       
  6597 @param anEntry The unsigned integer to be inserted.
       
  6598 
       
  6599 @return KErrNone, if the insertion is successful, otherwise one of the system 
       
  6600         wide error codes.
       
  6601 */
       
  6602 	{ return RPointerArrayBase::InsertIsqUnsigned(anEntry,ETrue); }
       
  6603 
       
  6604 
       
  6605 
       
  6606 
       
  6607 #ifndef __KERNEL_MODE__
       
  6608 inline RArray<TUint>::RArray(TUint* aEntries, TInt aCount)
       
  6609 	: RPointerArrayBase((TAny**)aEntries, aCount)
       
  6610 /**
       
  6611 C++ constructor with a pointer to the first array entry in a 
       
  6612 pre-existing array, and the number of entries in that array.
       
  6613 
       
  6614 This constructor takes a pointer to a pre-existing set of entries of type 
       
  6615 TUint objects. Ownership of the set of entries does not transfer to
       
  6616 this RArray object.
       
  6617 
       
  6618 The purpose of constructing an array in this way is to allow sorting and
       
  6619 finding operations to be done without further allocation of memory.
       
  6620 
       
  6621 @param aEntries   A pointer to the first entry of type class TUint in the set of 
       
  6622                   entries belonging to the existing array.
       
  6623 @param aCount     The number of entries in the existing array.
       
  6624 */
       
  6625 	{}
       
  6626 
       
  6627 
       
  6628 
       
  6629 inline void RArray<TUint>::GranularCompress()
       
  6630 /**
       
  6631 Compresses the array down to a granular boundary.
       
  6632 	
       
  6633 After a call to this function, the memory allocated to the array is sufficient 
       
  6634 for its contained entries. Adding new unsigned integers to the array does not 
       
  6635 result in a re-allocation of memory until the total number of entries reaches 
       
  6636 a multiple of the granularity.
       
  6637 */
       
  6638 	{RPointerArrayBase::GranularCompress();}
       
  6639 
       
  6640 
       
  6641 
       
  6642 
       
  6643 inline TInt RArray<TUint>::Reserve(TInt aCount)
       
  6644 /**
       
  6645 Reserves space for the specified number of elements.
       
  6646 
       
  6647 After a call to this function, the memory allocated to the array is sufficient 
       
  6648 to hold the number of integers specified. Adding new integers to the array 
       
  6649 does not result in a re-allocation of memory until the the total number of 
       
  6650 integers exceeds the specified count.
       
  6651 
       
  6652 @param	aCount	The number of integers for which space should be reserved
       
  6653 @return	KErrNone		If the operation completed successfully
       
  6654 @return KErrNoMemory	If the requested amount of memory could not be allocated
       
  6655 */
       
  6656 	{ return RPointerArrayBase::DoReserve(aCount); }
       
  6657 
       
  6658 
       
  6659 
       
  6660 
       
  6661 inline void RArray<TUint>::Sort()
       
  6662 /**
       
  6663 Sorts the array entries into unsigned integer order.
       
  6664 */
       
  6665 	{ HeapSortUnsigned(); }
       
  6666 
       
  6667 
       
  6668 
       
  6669 
       
  6670 inline TArray<TUint> RArray<TUint>::Array() const
       
  6671 /**
       
  6672 Constructs and returns a generic array.
       
  6673 	
       
  6674 @return A generic array representing this array.
       
  6675 
       
  6676 @see TArray
       
  6677 */
       
  6678 	{ return TArray<TUint>(GetCount,GetElementPtr,(const CBase*)this); }
       
  6679 #endif
       
  6680 
       
  6681 
       
  6682 
       
  6683 
       
  6684 /**
       
  6685 Sets an argument to default value and type.
       
  6686 */
       
  6687 inline void TIpcArgs::Set(TInt,TNothing)
       
  6688 	{}
       
  6689 
       
  6690 
       
  6691 
       
  6692 
       
  6693 /**
       
  6694 Sets an argument value of TInt type.
       
  6695 
       
  6696 @param aIndex An index value that identifies the slot in the array of arguments
       
  6697               into which the argument value is to be placed.
       
  6698               This must be a value in the range 0 to 3.
       
  6699 @param aValue The argument value.              
       
  6700 */
       
  6701 inline void TIpcArgs::Set(TInt aIndex,TInt aValue)
       
  6702 	{
       
  6703 	iArgs[aIndex] = aValue;
       
  6704 	iFlags |= EUnspecified<<(aIndex*KBitsPerType);
       
  6705 	}
       
  6706 
       
  6707 
       
  6708 
       
  6709 
       
  6710 /**
       
  6711 Sets an argument value of TAny* type.
       
  6712 
       
  6713 @param aIndex An index value that identifies the slot in the array of arguments
       
  6714               into which the argument value is to be placed.
       
  6715               This must be a value in the range 0 to 3.
       
  6716 @param aValue The argument value.              
       
  6717 */
       
  6718 inline void TIpcArgs::Set(TInt aIndex,const TAny* aValue)
       
  6719 	{
       
  6720 	iArgs[aIndex] = (TInt)aValue;
       
  6721 	iFlags |= EUnspecified<<(aIndex*KBitsPerType);
       
  6722 	}
       
  6723 
       
  6724 
       
  6725 
       
  6726 
       
  6727 /**
       
  6728 Sets an argument value of RHandleBase type.
       
  6729 
       
  6730 @param aIndex An index value that identifies the slot in the array of arguments
       
  6731               into which the argument value is to be placed.
       
  6732               This must be a value in the range 0 to 3.
       
  6733 @param aValue The argument value.              
       
  6734 */
       
  6735 inline void TIpcArgs::Set(TInt aIndex,RHandleBase aValue)
       
  6736 	{
       
  6737 	iArgs[aIndex] = (TInt)aValue.Handle();
       
  6738 	iFlags |= EHandle<<(aIndex*KBitsPerType);
       
  6739 	}
       
  6740 
       
  6741 
       
  6742 
       
  6743 
       
  6744 /**
       
  6745 Sets an argument value TDesC8* type.
       
  6746 
       
  6747 @param aIndex An index value that identifies the slot in the array of arguments
       
  6748               into which the argument value is to be placed.
       
  6749               This must be a value in the range 0 to 3.
       
  6750 @param aValue The argument value.              
       
  6751 */
       
  6752 inline void TIpcArgs::Set(TInt aIndex,const TDesC8* aValue)
       
  6753 	{
       
  6754 	iArgs[aIndex] = (TInt)aValue;
       
  6755 	iFlags |= EDesC8<<(aIndex*KBitsPerType);
       
  6756 	}
       
  6757 
       
  6758 
       
  6759 
       
  6760 
       
  6761 #ifndef __KERNEL_MODE__
       
  6762 
       
  6763 /**
       
  6764 Sets an argument value of TDesC16* type.
       
  6765 
       
  6766 @param aIndex An index value that identifies the slot in the array of arguments
       
  6767               into which the argument value is to be placed.
       
  6768               This must be a value in the range 0 to 3.
       
  6769 @param aValue The argument value.              
       
  6770 */
       
  6771 inline void TIpcArgs::Set(TInt aIndex,const TDesC16* aValue)
       
  6772 	{
       
  6773 	iArgs[aIndex] = (TInt)aValue;
       
  6774 	iFlags |= EDesC16<<(aIndex*KBitsPerType);
       
  6775 	}
       
  6776 
       
  6777 #endif
       
  6778 
       
  6779 
       
  6780 
       
  6781 
       
  6782 /**
       
  6783 Sets an argument value of TDes8* type.
       
  6784 
       
  6785 @param aIndex An index value that identifies the slot in the array of arguments
       
  6786               into which the argument value is to be placed.
       
  6787               This must be a value in the range 0 to 3.
       
  6788 @param aValue The argument value.              
       
  6789 */
       
  6790 inline void TIpcArgs::Set(TInt aIndex,TDes8* aValue)
       
  6791 	{
       
  6792 	iArgs[aIndex] = (TInt)aValue;
       
  6793 	iFlags |= EDes8<<(aIndex*KBitsPerType);
       
  6794 	}
       
  6795 
       
  6796 
       
  6797 
       
  6798 
       
  6799 #ifndef __KERNEL_MODE__
       
  6800 
       
  6801 /**
       
  6802 Sets an argument value of TDes16* type.
       
  6803 
       
  6804 @param aIndex An index value that identifies the slot in the array of arguments
       
  6805               into which the argument value is to be placed.
       
  6806               This must be a value in the range 0 to 3.
       
  6807 @param aValue The argument value.              
       
  6808 */
       
  6809 inline void TIpcArgs::Set(TInt aIndex,TDes16* aValue)
       
  6810 	{
       
  6811 	iArgs[aIndex] = (TInt)aValue;
       
  6812 	iFlags |= EDes16<<(aIndex*KBitsPerType);
       
  6813 	}
       
  6814 
       
  6815 #endif
       
  6816 
       
  6817 
       
  6818 
       
  6819 
       
  6820 inline TIpcArgs::TArgType TIpcArgs::Type(TNothing)
       
  6821 	{ return EUnspecified; }
       
  6822 inline TIpcArgs::TArgType TIpcArgs::Type(TInt)
       
  6823 	{ return EUnspecified; }
       
  6824 inline TIpcArgs::TArgType TIpcArgs::Type(const TAny*)
       
  6825 	{ return EUnspecified; }
       
  6826 inline TIpcArgs::TArgType TIpcArgs::Type(RHandleBase)
       
  6827 	{ return EHandle; }
       
  6828 inline TIpcArgs::TArgType TIpcArgs::Type(const TDesC8*)
       
  6829 	{ return EDesC8; }
       
  6830 #ifndef __KERNEL_MODE__
       
  6831 inline TIpcArgs::TArgType TIpcArgs::Type(const TDesC16*)
       
  6832 	{ return EDesC16; }
       
  6833 #endif
       
  6834 inline TIpcArgs::TArgType TIpcArgs::Type(TDes8*)
       
  6835 	{ return EDes8; }
       
  6836 #ifndef __KERNEL_MODE__
       
  6837 inline TIpcArgs::TArgType TIpcArgs::Type(TDes16*)
       
  6838 	{ return EDes16; }
       
  6839 #endif
       
  6840 inline void TIpcArgs::Assign(TInt&,TIpcArgs::TNothing)
       
  6841 	{}
       
  6842 inline void TIpcArgs::Assign(TInt& aArg,TInt aValue)
       
  6843 	{ aArg = aValue; }
       
  6844 inline void TIpcArgs::Assign(TInt& aArg,const TAny* aValue)
       
  6845 	{ aArg = (TInt)aValue; }
       
  6846 inline void TIpcArgs::Assign(TInt& aArg,RHandleBase aValue)
       
  6847 	{ aArg = (TInt)aValue.Handle(); }
       
  6848 inline void TIpcArgs::Assign(TInt& aArg,const TDesC8* aValue)
       
  6849 	{ aArg = (TInt)aValue; }
       
  6850 #ifndef __KERNEL_MODE__
       
  6851 inline void TIpcArgs::Assign(TInt& aArg,const TDesC16* aValue)
       
  6852 	{ aArg = (TInt)aValue; }
       
  6853 #endif
       
  6854 inline void TIpcArgs::Assign(TInt& aArg,TDes8* aValue)
       
  6855 	{ aArg = (TInt)aValue; }
       
  6856 #ifndef __KERNEL_MODE__
       
  6857 inline void TIpcArgs::Assign(TInt& aArg,TDes16* aValue)
       
  6858 	{ aArg = (TInt)aValue; }
       
  6859 #endif
       
  6860 
       
  6861 
       
  6862 
       
  6863 // Structures for passing 64 bit integers and doubles across GCC/EABI boundaries
       
  6864 
       
  6865 inline SInt64::SInt64()
       
  6866 	{}
       
  6867 
       
  6868 inline SInt64::SInt64(Int64 a)
       
  6869 	{
       
  6870 	iData[0] = (TUint32)((Uint64)a);
       
  6871 	iData[1] = (TUint32)(((Uint64)a)>>32);
       
  6872 	}
       
  6873 
       
  6874 inline SInt64& SInt64::operator=(Int64 a)
       
  6875 	{
       
  6876 	iData[0] = (TUint32)((Uint64)a);
       
  6877 	iData[1] = (TUint32)(((Uint64)a)>>32);
       
  6878 	return *this;
       
  6879 	}
       
  6880 
       
  6881 inline SInt64::operator Int64() const
       
  6882 	{
       
  6883 	Int64 x;
       
  6884 	TUint32* px = (TUint32*)&x;
       
  6885 	px[0] = iData[0];
       
  6886 	px[1] = iData[1];
       
  6887 	return x;
       
  6888 	}
       
  6889 
       
  6890 inline SUint64::SUint64()
       
  6891 	{}
       
  6892 
       
  6893 inline SUint64::SUint64(Uint64 a)
       
  6894 	{
       
  6895 	iData[0] = (TUint32)a;
       
  6896 	iData[1] = (TUint32)(a>>32);
       
  6897 	}
       
  6898 
       
  6899 inline SUint64& SUint64::operator=(Uint64 a)
       
  6900 	{
       
  6901 	iData[0] = (TUint32)a;
       
  6902 	iData[1] = (TUint32)(a>>32);
       
  6903 	return *this;
       
  6904 	}
       
  6905 
       
  6906 inline SUint64::operator Uint64() const
       
  6907 	{
       
  6908 	Uint64 x;
       
  6909 	TUint32* px = (TUint32*)&x;
       
  6910 	px[0] = iData[0];
       
  6911 	px[1] = iData[1];
       
  6912 	return x;
       
  6913 	}
       
  6914 
       
  6915 inline SDouble::SDouble()
       
  6916 	{}
       
  6917 
       
  6918 inline SDouble::SDouble(TReal a)
       
  6919 	{
       
  6920 	const TUint32* pa = (const TUint32*)&a;
       
  6921 #ifdef __DOUBLE_WORDS_SWAPPED__
       
  6922 	iData[0] = pa[1];
       
  6923 	iData[1] = pa[0];	// compiler puts MS word of double first
       
  6924 #else
       
  6925 	iData[0] = pa[0];
       
  6926 	iData[1] = pa[1];	// compiler puts MS word of double second
       
  6927 #endif
       
  6928 	}
       
  6929 
       
  6930 inline SDouble& SDouble::operator=(TReal a)
       
  6931 	{
       
  6932 	new (this) SDouble(a);
       
  6933 	return *this;
       
  6934 	}
       
  6935 
       
  6936 inline SDouble::operator TReal() const
       
  6937 	{
       
  6938 	TReal x;
       
  6939 	TUint32* px = (TUint32*)&x;
       
  6940 #ifdef __DOUBLE_WORDS_SWAPPED__
       
  6941 	px[1] = iData[0];
       
  6942 	px[0] = iData[1];	// compiler puts MS word of double first
       
  6943 #else
       
  6944 	px[0] = iData[0];
       
  6945 	px[1] = iData[1];	// compiler puts MS word of double second
       
  6946 #endif
       
  6947 	return x;
       
  6948 	}
       
  6949 
       
  6950 //
       
  6951 // TSecureId
       
  6952 //
       
  6953 
       
  6954 /** Default constructor. This leaves the object in an undefined state */
       
  6955 inline TSecureId::TSecureId()
       
  6956 	{}
       
  6957 
       
  6958 /** Construct 'this' using a TUint32
       
  6959 @param aId The value for the ID */
       
  6960 inline TSecureId::TSecureId(TUint32 aId)
       
  6961 	: iId(aId) {}
       
  6962 
       
  6963 /** Convert 'this' into a TUint32
       
  6964 */
       
  6965 inline TSecureId::operator TUint32() const
       
  6966 	{ return iId; }
       
  6967 
       
  6968 /** Construct 'this' using a TUid
       
  6969 @param aId The value for the ID */
       
  6970 inline TSecureId::TSecureId(TUid aId)
       
  6971 	: iId(aId.iUid) {}
       
  6972 
       
  6973 /** Convert 'this' into a TUid
       
  6974 */
       
  6975 inline TSecureId::operator TUid() const
       
  6976 	{ return (TUid&)iId; }
       
  6977 
       
  6978 //
       
  6979 // SSecureId
       
  6980 //
       
  6981 inline const TSecureId* SSecureId::operator&() const
       
  6982 	{ return (const TSecureId*)this; }
       
  6983 inline SSecureId::operator const TSecureId&() const
       
  6984 	{ return (const TSecureId&)iId; }
       
  6985 inline SSecureId::operator TUint32() const
       
  6986 	{ return iId; }
       
  6987 inline SSecureId::operator TUid() const
       
  6988 	{ return (TUid&)iId; }
       
  6989 
       
  6990 //
       
  6991 // TVendorId
       
  6992 //
       
  6993 
       
  6994 /** Default constructor which leaves the object in an undefined state */
       
  6995 inline TVendorId::TVendorId()
       
  6996 	{}
       
  6997 
       
  6998 /** Construct 'this' using a TUint32
       
  6999 @param aId The value for the ID */
       
  7000 inline TVendorId::TVendorId(TUint32 aId)
       
  7001 	: iId(aId) {}
       
  7002 
       
  7003 /** Convert 'this' into a TUint32
       
  7004 */
       
  7005 inline TVendorId::operator TUint32() const
       
  7006 	{ return iId; }
       
  7007 
       
  7008 /** Construct 'this' using a TUid
       
  7009 @param aId The value for the ID */
       
  7010 inline TVendorId::TVendorId(TUid aId)
       
  7011 	: iId(aId.iUid) {}
       
  7012 
       
  7013 /** Convert 'this' into a TUid
       
  7014 */
       
  7015 inline TVendorId::operator TUid() const
       
  7016 	{ return (TUid&)iId; }
       
  7017 
       
  7018 //
       
  7019 // SSecureId
       
  7020 //
       
  7021 inline const TVendorId* SVendorId::operator&() const
       
  7022 	{ return (const TVendorId*)this; }
       
  7023 inline SVendorId::operator const TVendorId&() const
       
  7024 	{ return (const TVendorId&)iId; }
       
  7025 inline SVendorId::operator TUint32() const
       
  7026 	{ return iId; }
       
  7027 inline SVendorId::operator TUid() const
       
  7028 	{ return (TUid&)iId; }
       
  7029 
       
  7030 //
       
  7031 // TSharedChunkBufConfigBase
       
  7032 // 
       
  7033 inline TSharedChunkBufConfigBase::TSharedChunkBufConfigBase()
       
  7034 	{memset(this,0,sizeof(TSharedChunkBufConfigBase));}
       
  7035 
       
  7036 /**
       
  7037 Default constructor. This leaves the set in an undefned state.
       
  7038 */
       
  7039 inline TCapabilitySet::TCapabilitySet()
       
  7040 	{}
       
  7041 
       
  7042 /**
       
  7043 Construct a set consisting of a single capability.
       
  7044 @param aCapability The single capability
       
  7045 */
       
  7046 inline TCapabilitySet::TCapabilitySet(TCapability aCapability)
       
  7047 	{ new (this) TCapabilitySet(aCapability, aCapability); }
       
  7048 
       
  7049 /**
       
  7050 Make this set consist of a single capability.
       
  7051 @param aCapability The single capability.
       
  7052 */
       
  7053 inline void TCapabilitySet::Set(TCapability aCapability)
       
  7054 	{ new (this) TCapabilitySet(aCapability, aCapability); }
       
  7055 
       
  7056 /**
       
  7057 Make this set consist of two capabilities.
       
  7058 @param aCapability1 The first capability.
       
  7059 @param aCapability2 The second capability.
       
  7060 */
       
  7061 inline void TCapabilitySet::Set(TCapability aCapability1, TCapability aCapability2)
       
  7062 	{ new (this) TCapabilitySet(aCapability1, aCapability2); }
       
  7063 
       
  7064 
       
  7065 /**
       
  7066 Default constructor. This leaves the object in an undefned state.
       
  7067 */
       
  7068 inline TSecurityInfo::TSecurityInfo()
       
  7069 	{}
       
  7070 
       
  7071 /** Constructs a TSecurityPolicy that will always fail, irrespective of the
       
  7072 checked object's attributes.
       
  7073 */
       
  7074 inline TSecurityPolicy::TSecurityPolicy()
       
  7075 	{ new (this) TSecurityPolicy(EAlwaysFail); }
       
  7076 
       
  7077 /**
       
  7078 'Address of' operator which generates a TSecurityPolicy*
       
  7079 @return A pointer of type TSecurityPolicy which refers to this object
       
  7080 */
       
  7081 inline const TSecurityPolicy* TStaticSecurityPolicy::operator&() const
       
  7082 	{ return (const TSecurityPolicy*)this; }
       
  7083 
       
  7084 /**
       
  7085 'Reference of' operator which generates a TSecurityPolicy&
       
  7086 @return A reference of type TSecurityPolicy which refers to this object
       
  7087 */
       
  7088 inline TStaticSecurityPolicy::operator const TSecurityPolicy&() const
       
  7089 	{ return *(const TSecurityPolicy*)this; }
       
  7090 
       
  7091 /**
       
  7092 A method to explicity generate a TSecurityPolicy reference.
       
  7093 @return A reference of type TSecurityPolicy which refers to this object
       
  7094 */
       
  7095 inline const TSecurityPolicy& TStaticSecurityPolicy::operator()() const
       
  7096 	{ return *(const TSecurityPolicy*)this; }
       
  7097 
       
  7098 #ifdef __KERNEL_MODE__
       
  7099 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  7100 
       
  7101 /** Checks this policy against the platform security attributes of aProcess.
       
  7102 
       
  7103 	When a check fails the action taken is determined by the system wide Platform Security
       
  7104 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
       
  7105 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
       
  7106 	check failed.
       
  7107 
       
  7108 @param aProcess The DProcess object to check against this TSecurityPolicy.
       
  7109 @param aDiagnostic A string that will be emitted along with any diagnostic message
       
  7110 							that may be issued if the policy check fails.
       
  7111 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
       
  7112 							which enables it to be easily removed from the system.
       
  7113 @return ETrue if all the requirements of this TSecurityPolicy are met by the
       
  7114 platform security attributes of aProcess, EFalse otherwise.
       
  7115 @panic KERN-COMMON 190 if 'this' is an invalid SSecurityInfo object
       
  7116 */
       
  7117 inline TBool TSecurityPolicy::CheckPolicy(DProcess* aProcess, const char* aDiagnostic) const
       
  7118 	{
       
  7119 	return DoCheckPolicy(aProcess, aDiagnostic);
       
  7120 	}
       
  7121 
       
  7122 /** Checks this policy against the platform security attributes of the process
       
  7123 owning aThread.
       
  7124 
       
  7125 	When a check fails the action taken is determined by the system wide Platform Security
       
  7126 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
       
  7127 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
       
  7128 	check failed.
       
  7129 
       
  7130 @param aThread The thread whose owning process' platform security attributes
       
  7131 are to be checked against this TSecurityPolicy.
       
  7132 @param aDiagnostic A string that will be emitted along with any diagnostic message
       
  7133 							that may be issued if the policy check fails.
       
  7134 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
       
  7135 							which enables it to be easily removed from the system.
       
  7136 @return ETrue if all the requirements of this TSecurityPolicy are met by the
       
  7137 platform security parameters of the owning process of aThread, EFalse otherwise.
       
  7138 @panic KERN-COMMON 190 if 'this' is an invalid SSecurityInfo object
       
  7139 */
       
  7140 inline TBool TSecurityPolicy::CheckPolicy(DThread* aThread, const char* aDiagnostic) const
       
  7141 	{
       
  7142 	return DoCheckPolicy(aThread, aDiagnostic);
       
  7143 	}
       
  7144 
       
  7145 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  7146 
       
  7147 /** Checks this policy against the platform security attributes of aProcess.
       
  7148 
       
  7149 	When a check fails the action taken is determined by the system wide Platform Security
       
  7150 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
       
  7151 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
       
  7152 	check failed.
       
  7153 
       
  7154 @param aProcess The DProcess object to check against this TSecurityPolicy.
       
  7155 @param aDiagnostic A string that will be emitted along with any diagnostic message
       
  7156 							that may be issued if the policy check fails.
       
  7157 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
       
  7158 							which enables it to be easily removed from the system.
       
  7159 @return ETrue if all the requirements of this TSecurityPolicy are met by the
       
  7160 platform security attributes of aProcess, EFalse otherwise.
       
  7161 @panic KERN-COMMON 190 if 'this' is an invalid SSecurityInfo object
       
  7162 */
       
  7163 inline TBool TSecurityPolicy::CheckPolicy(DProcess* aProcess, OnlyCreateWithNull /*aDiagnostic*/) const
       
  7164 	{
       
  7165 	return DoCheckPolicy(aProcess);
       
  7166 	}
       
  7167 
       
  7168 /** Checks this policy against the platform security attributes of the process
       
  7169 owning aThread.
       
  7170 
       
  7171 	When a check fails the action taken is determined by the system wide Platform Security
       
  7172 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
       
  7173 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
       
  7174 	check failed.
       
  7175 
       
  7176 @param aThread The thread whose owning process' platform security attributes
       
  7177 are to be checked against this TSecurityPolicy.
       
  7178 @param aDiagnostic A string that will be emitted along with any diagnostic message
       
  7179 							that may be issued if the policy check fails.
       
  7180 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
       
  7181 							which enables it to be easily removed from the system.
       
  7182 @return ETrue if all the requirements of this TSecurityPolicy are met by the
       
  7183 platform security parameters of the owning process of aThread, EFalse otherwise.
       
  7184 @panic KERN-COMMON 190 if 'this' is an invalid SSecurityInfo object
       
  7185 */
       
  7186 inline TBool TSecurityPolicy::CheckPolicy(DThread* aThread, OnlyCreateWithNull /*aDiagnostic*/) const
       
  7187 	{
       
  7188 	return DoCheckPolicy(aThread);
       
  7189 	}
       
  7190 
       
  7191 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  7192 #endif // __KERNEL_MODE__