os/kernelhwsrv/kernel/eka/include/e32cmn.inl
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.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 // Class TPoint3D
  2966 #ifndef __KERNEL_MODE__
  2967 inline TPoint3D::TPoint3D()
  2968 	: iX(0),iY(0),iZ(0)
  2969 /**
  2970 Constructs default 3Dpoint, initialising its iX, iY and iZ members to zero.
  2971 */
  2972 	{}
  2973 
  2974 inline TPoint3D::TPoint3D(TInt aX,TInt aY,TInt aZ)
  2975 	: iX(aX),iY(aY),iZ(aZ)
  2976 /**
  2977 Constructs  TPoint3D with the specified x,y  and z co-ordinates.
  2978 
  2979 @param aX The x co-ordinate value.
  2980 @param aY The y co-ordinate value.
  2981 @param aZ The z co-ordinate value.
  2982 */
  2983 	{}
  2984 
  2985 
  2986 
  2987 
  2988 inline TPoint3D::TPoint3D(const  TPoint& aPoint)
  2989 :iX(aPoint.iX),iY(aPoint.iY),iZ(0)
  2990 /* 
  2991 Copy Construct from TPoint , initialises Z co-ordinate to  Zero
  2992 @param aPoint The TPoint from which we create TPoint3D object
  2993 */
  2994 	{}
  2995 
  2996 
  2997 #endif
  2998 
  2999 
  3000 // Class TFindHandle
  3001 inline TFindHandle::TFindHandle()
  3002 	: iHandle(0), iSpare1(0), iObjectIdLow(0), iObjectIdHigh(0)
  3003 	{}
  3004 
  3005 
  3006 
  3007 
  3008 inline TInt TFindHandle::Handle() const
  3009 /**
  3010 @publishedAll
  3011 @released
  3012 
  3013 Gets the find-handle number associated with the Kernel object. 
  3014 
  3015 The find-handle number identifies the kernel object with respect to
  3016 its container.
  3017 	
  3018 Note that setting the find-handle number into a TFindHandle object is not
  3019 implemented by this class; it is implemented by derived classes, typically by
  3020 their Next() member functions. The class TFindSemaphore is a good example.
  3021 	
  3022 @return The find-handle number.
  3023 */
  3024 	{return iHandle;}
  3025 
  3026 
  3027 
  3028 
  3029 #ifdef __KERNEL_MODE__
  3030 const TInt KFindHandleUniqueIdShift=16;    ///< @internalComponent
  3031 const TInt KFindHandleUniqueIdMask=0x7fff; ///< @internalComponent
  3032 const TInt KFindHandleIndexMask=0x7fff;    ///< @internalComponent
  3033 
  3034 
  3035 
  3036 
  3037 /**
  3038 Gets the index into its container at which the kernel object was last seen.
  3039 
  3040 @return The object's index in its container.
  3041 */
  3042 inline TInt TFindHandle::Index() const
  3043 	{return(iHandle&KFindHandleIndexMask);}
  3044 
  3045 
  3046 
  3047 
  3048 /**
  3049 Gets the unique ID of the kernel container this object resides in.
  3050 
  3051 @return The ID of this object's container.
  3052 */
  3053 inline TInt TFindHandle::UniqueID() const
  3054 	{return((iHandle>>KFindHandleUniqueIdShift)&KFindHandleUniqueIdMask);}
  3055 
  3056 
  3057 
  3058 
  3059 /**
  3060 Gets the unique ID of the kernel object itself.
  3061 
  3062 @return The ID of the object.
  3063 */
  3064 inline TUint64 TFindHandle::ObjectID() const
  3065 	{return MAKE_TUINT64(iObjectIdHigh, iObjectIdLow);}
  3066 
  3067 
  3068 
  3069 
  3070 /**
  3071 Sets the find handle to refer to a specific object.
  3072 
  3073 @oaram aIndex The current index of the object in its container.
  3074 @param aUniqueId The unique ID of the container object.
  3075 @param aObjectId The unique ID of the object iteself.
  3076 */
  3077 inline void TFindHandle::Set(TInt aIndex, TInt aUniqueId, TUint64 aObjectId)
  3078 	{
  3079 	iHandle=(TInt)((aUniqueId<<KFindHandleUniqueIdShift)|aIndex);
  3080 	iObjectIdLow=I64LOW(aObjectId);
  3081 	iObjectIdHigh=I64HIGH(aObjectId);
  3082 	}
  3083 
  3084 
  3085 #else
  3086 
  3087 
  3088 /**
  3089 Resets the find handle to its initial state.
  3090 */
  3091 inline void TFindHandle::Reset()
  3092 	{
  3093 	iHandle=iSpare1=iObjectIdLow=iObjectIdHigh=0;
  3094 	}
  3095 #endif
  3096 
  3097 
  3098 
  3099 
  3100 // Class RHandleBase
  3101 inline RHandleBase::RHandleBase()
  3102 	: iHandle(0)
  3103 /**
  3104 Default constructor.
  3105 */
  3106 	{}
  3107 
  3108 
  3109 
  3110 
  3111 #ifndef __KERNEL_MODE__
  3112 inline RHandleBase::RHandleBase(TInt aHandle)
  3113 	: iHandle(aHandle)
  3114 /**
  3115 Copy constructor.
  3116 
  3117 It constructs this handle from an existing one. Specifically, the handle-number 
  3118 encapsulated by the specified handle is copied to this handle.
  3119 
  3120 @param aHandle The existing handle to be copied.
  3121 */
  3122 	{}
  3123 #endif
  3124 
  3125 
  3126 
  3127 
  3128 inline void RHandleBase::SetHandle(TInt aHandle)
  3129 /**
  3130 Sets the handle-number of this handle to the specified 
  3131 value.
  3132 
  3133 @param aHandle The handle-number to be set.
  3134 */
  3135 	{ iHandle=aHandle; }
  3136 
  3137 
  3138 
  3139 
  3140 inline TInt RHandleBase::Handle() const
  3141 /**
  3142 Retrieves the handle-number of the object associated with this handle.
  3143 
  3144 @return The handle number
  3145 */
  3146 	{return(iHandle);}
  3147 
  3148 
  3149 
  3150 
  3151 inline TInt RHandleBase::SetReturnedHandle(TInt aHandleOrError)
  3152 /**
  3153 Sets the handle-number of this handle to the specified 
  3154 value.
  3155 
  3156 The function can take a (zero or positive) handle-number,
  3157 or a (negative) error number.
  3158 
  3159 If aHandleOrError represents a handle-number, then the handle-number of this handle
  3160 is set to that value.
  3161 If aHandleOrError represents an error number, then the handle-number of this handle is set to zero
  3162 and the negative value is returned.
  3163 
  3164 @param aHandleOrError A handle-number, if zero or positive; an error value, if negative.
  3165 
  3166 @return KErrNone, if aHandle is a handle-number; the value of aHandleOrError, otherwise.
  3167 */
  3168 	{
  3169 #ifndef __SYMC__
  3170 	if(aHandleOrError>=0)
  3171 		{
  3172 		iHandle = aHandleOrError;
  3173 		return KErrNone;
  3174 		}
  3175 	iHandle = 0;
  3176 	return aHandleOrError;
  3177 #elif defined(_WIN32)
  3178 	//Our problem is that win32 handles can be negative
  3179 	if (aHandleOrError==NULL)
  3180 		{
  3181 		//TODO: check GetLastError and return proper error code
  3182 		return KErrUnknown;
  3183 		}
  3184 	//Valid handle
  3185 	iHandle = aHandleOrError;
  3186 	return KErrNone;
  3187 #else
  3188 #error "Platform not supported"
  3189 #endif
  3190 	}
  3191 
  3192 
  3193 
  3194 
  3195 // Class RSemaphore
  3196 #ifndef __KERNEL_MODE__
  3197 inline TInt RSemaphore::Open(const TFindSemaphore& aFind,TOwnerType aType)
  3198 /**
  3199 Opens a handle to the global semaphore found using a TFindSemaphore object.
  3200 
  3201 A TFindSemaphore object is used to find all global semaphores whose full names 
  3202 match a specified pattern.
  3203 
  3204 By default, any thread in the process can use this instance of RSemaphore 
  3205 to access the semaphore. However, specifying EOwnerThread as the second parameter 
  3206 to this function, means that only the opening thread can use this instance 
  3207 of RSemaphore to access the semaphore; any other thread in this process that 
  3208 wants to access the semaphore must either duplicate the handle or use OpenGlobal() 
  3209 again.
  3210 
  3211 @param aFind A reference to the TFindSemaphore object used to find the semaphore. 
  3212 @param aType An enumeration whose enumerators define the ownership of this 
  3213              semaphore handle. If not explicitly specified, EOwnerProcess is
  3214 			 taken as default. 
  3215 
  3216 @return KErrNone if successful otherwise another of the system wide error codes.
  3217 */
  3218 	{return(RHandleBase::Open((const TFindHandleBase&)aFind,aType));}
  3219 #endif
  3220 
  3221 
  3222 
  3223 
  3224 // Class RFastLock
  3225 
  3226 
  3227 /**
  3228 Default constructor.
  3229 */
  3230 inline RFastLock::RFastLock()
  3231 	:	iCount(0)
  3232 	{}
  3233 
  3234 
  3235 
  3236 
  3237 /**
  3238 Default constructor.
  3239 */
  3240 inline RReadWriteLock::RReadWriteLock()
  3241 	: iValues(0), iPriority(EAlternatePriority), iReaderSem(), iWriterSem()
  3242 	{}
  3243 
  3244 
  3245 
  3246 
  3247 // Class RMessagePtr2
  3248 
  3249 
  3250 /**
  3251 Default constructor
  3252 */
  3253 inline RMessagePtr2::RMessagePtr2()
  3254 	: iHandle(0)
  3255 	{}
  3256 
  3257 
  3258 
  3259 
  3260 /**
  3261 Tests whether this message handle is empty.
  3262 
  3263 @return True, if this message handle is empty, false, otherwise.
  3264 */
  3265 inline TBool RMessagePtr2::IsNull() const
  3266 	{return iHandle==0;}
  3267 
  3268 
  3269 
  3270 
  3271 /**
  3272 Gets the message handle value.
  3273 
  3274 @return The message handle value.
  3275 */
  3276 inline TInt RMessagePtr2::Handle() const
  3277 	{return iHandle;}
  3278 inline TBool operator==(RMessagePtr2 aLeft,RMessagePtr2 aRight)
  3279 	{return aLeft.Handle()==aRight.Handle();}
  3280 inline TBool operator!=(RMessagePtr2 aLeft,RMessagePtr2 aRight)
  3281 	{return aLeft.Handle()!=aRight.Handle();}
  3282 
  3283 
  3284 
  3285 
  3286 
  3287 // Class RMessage
  3288 
  3289 
  3290 /**
  3291 Default constructor
  3292 */
  3293 inline RMessage2::RMessage2()
  3294 	:iFunction(0), iSpare1(0), iSessionPtr(NULL), iFlags(0), iSpare3(0)
  3295 	{}
  3296 
  3297 
  3298 
  3299 
  3300 /**
  3301 Gets the the number of the function requested by the client.
  3302 
  3303 @return The function number. 
  3304 */
  3305 inline TInt RMessage2::Function() const
  3306 	{return(iFunction);}
  3307 
  3308 
  3309 
  3310 
  3311 /**
  3312 Gets the first message argument as an integer value.
  3313 
  3314 @return The first message argument.
  3315 */
  3316 inline TInt RMessage2::Int0() const
  3317 	{return(iArgs[0]);}
  3318 
  3319 
  3320 
  3321 
  3322 /**
  3323 Gets the second message argument as an integer value.
  3324 
  3325 @return The second message argument.
  3326 */
  3327 inline TInt RMessage2::Int1() const
  3328 	{return(iArgs[1]);}
  3329 
  3330 
  3331 
  3332 
  3333 /**
  3334 Gets the third message argument as an integer value.
  3335 
  3336 @return The third message argument.
  3337 */
  3338 inline TInt RMessage2::Int2() const
  3339 	{return(iArgs[2]);}
  3340 
  3341 
  3342 
  3343 /**
  3344 Gets the fourth message argument as an integer value.
  3345 
  3346 @return The fourth message argument.
  3347 */
  3348 inline TInt RMessage2::Int3() const
  3349 	{return(iArgs[3]);}
  3350 
  3351 
  3352 
  3353 /**
  3354 Gets the first message argument as a pointer type.
  3355 
  3356 @return The first message argument.
  3357 */
  3358 inline const TAny *RMessage2::Ptr0() const
  3359 	{return((const TAny *)iArgs[0]);}
  3360 
  3361 
  3362 
  3363 
  3364 /**
  3365 Gets the second message argument as a pointer type.
  3366 
  3367 @return The second message argument.
  3368 */
  3369 inline const TAny *RMessage2::Ptr1() const
  3370 	{return((const TAny *)iArgs[1]);}
  3371 
  3372 
  3373 
  3374 
  3375 /**
  3376 Gets the third message argument as a pointer type.
  3377 
  3378 @return The third message argument.
  3379 */
  3380 inline const TAny *RMessage2::Ptr2() const
  3381 	{return((const TAny *)iArgs[2]);}
  3382 
  3383 
  3384 
  3385 
  3386 /**
  3387 Gets the fourth message argument as a pointer type.
  3388 
  3389 @return The fourth message argument.
  3390 */
  3391 inline const TAny *RMessage2::Ptr3() const
  3392 	{return((const TAny *)iArgs[3]);}
  3393 
  3394 
  3395 
  3396 /**
  3397 Gets a pointer to the session.
  3398 
  3399 @return A pointer to the session object.
  3400 */
  3401 inline CSession2* RMessage2::Session() const
  3402 	{return (CSession2*)iSessionPtr; }
  3403 
  3404 
  3405 
  3406 
  3407 // Class TUid
  3408 inline TUid TUid::Uid(TInt aUid)
  3409 /**
  3410 Constructs the TUid object from a 32-bit integer.
  3411 
  3412 @param aUid The 32-bit integer value from which the TUid object is to be
  3413             constructed.
  3414 
  3415 @return The constructed TUid object.
  3416 */
  3417 	{TUid uid={aUid};return uid;}
  3418 
  3419 
  3420 
  3421 
  3422 inline TUid TUid::Null()
  3423 /**
  3424 Constructs a Null-valued TUid object.
  3425 
  3426 @return The constructed Null-valued TUid object.
  3427 */
  3428 	{TUid uid={KNullUidValue};return uid;}
  3429 
  3430 
  3431 
  3432 
  3433 #ifndef __KERNEL_MODE__
  3434 // Template class TArray
  3435 template <class T>
  3436 inline TArray<T>::TArray(TInt (*aCount)(const CBase *aPtr),const TAny *(*anAt)(const CBase *aPtr,TInt anIndex),const CBase *aPtr)
  3437 	: iPtr(aPtr),iCount(aCount),iAt(anAt)
  3438 /**
  3439 Constructor.
  3440 
  3441 A TArray object is not intended to be instantiated explicitly. An object of
  3442 this type is instantiated as a result of a call to to the Array() member
  3443 function of a concrete array class
  3444 
  3445 @param aCount A pointer to a function which takes a
  3446               @code
  3447 			  const CBase*
  3448               @endcode
  3449               argument and returns a
  3450               @code
  3451               TInt
  3452               @endcode
  3453               aCount must point to the member function which returns the
  3454               current number of elements of type class T contained in the
  3455 	          array at aPtr, for which this TArray is being constructed.
  3456               This argument is supplied by the Array() member function of the
  3457               array class. 
  3458 @param anAt   A pointer to a function which takes a
  3459               @code
  3460               const CBase*
  3461               @endcode
  3462               and a 
  3463               @code
  3464               TInt
  3465               @endcode
  3466               argument, and returns a pointer to
  3467               @code
  3468               TAny
  3469               @endcode
  3470               anAt must point to the member function which returns a reference
  3471               to the element located at position anIndex within the array at
  3472               aPtr, for which this TArray is being constructed.
  3473               This argument is supplied by the Array() member function of the
  3474               array class.
  3475 @param aPtr   A pointer to the array for which this TArray is being
  3476               constructed. This argument is supplied by the Array() member
  3477               function of the array class.
  3478 
  3479 @see CArrayFixFlat::Array
  3480 @see CArrayFixSeg::Array
  3481 @see CArrayVarFlat::Array
  3482 @see CArrayVarSeg::Array
  3483 @see CArrayPakFlat::Array
  3484 @see RArray::Array
  3485 @see RPointerArray::Array
  3486 @see RArray<TInt>::Array
  3487 @see RArray<TUint>::Array
  3488 */
  3489 	{}
  3490 
  3491 
  3492 
  3493 
  3494 template <class T>
  3495 inline TInt TArray<T>::Count() const
  3496 /**
  3497 Gets the number of elements currently held in the array for which this generic 
  3498 array has been constructed.
  3499 
  3500 @return The number of array elements.
  3501 */
  3502 	{return((*iCount)(iPtr));}
  3503 
  3504 
  3505 
  3506 
  3507 template <class T>
  3508 inline const T &TArray<T>::operator[](TInt anIndex) const
  3509 /**
  3510 Gets a reference to the element located at the specified position.
  3511 
  3512 The returned reference is const and cannot be used to change the element.
  3513 Any member function of the referenced template class T must be declared
  3514 as const if that function is to be accessed through this operator.
  3515 
  3516 @param anIndex The position of the element within the array for which this
  3517                TArray has been constructed. The position is relative to zero;
  3518 			   i.e. zero implies the first element in the array. 
  3519 
  3520 @return A const reference to the element located at position anIndex within
  3521         the array for which this TArray has been constructed.
  3522 
  3523 @panic E32USER-CBase 21, if anIndex is negative, or greater than or equal to
  3524        the number of objects currently within the array.
  3525 */
  3526 	{return(*((const T *)(*iAt)(iPtr,anIndex)));}
  3527 #endif
  3528 
  3529 
  3530 
  3531 
  3532 // Class TIdentityRelation<T>
  3533 template <class T>
  3534 inline TIdentityRelation<T>::TIdentityRelation()
  3535 /**
  3536 Constructs the object to use the equality operator (==) defined for class T
  3537 to determine whether two class T type objects match.
  3538 */
  3539 	{iIdentity=(TGeneralIdentityRelation)&EqualityOperatorCompare;}
  3540 
  3541 
  3542 
  3543 
  3544 template <class T>
  3545 inline TIdentityRelation<T>::TIdentityRelation( TBool (*anIdentity)(const T&, const T&) )
  3546 /**
  3547 Constructs the object taking the specified function as an argument.
  3548 
  3549 The specified function should implement an algorithm for determining whether
  3550 two class T type objects match. It should return:
  3551 
  3552 1. true, if the two objects match.
  3553 
  3554 2. false, if the two objects do not match.
  3555 
  3556 @param anIdentity A pointer to a function that takes constant references to two
  3557                   class T objects and returns a TInt value. 
  3558 */
  3559 	{ iIdentity=(TGeneralIdentityRelation)anIdentity; }
  3560 
  3561 
  3562 
  3563 
  3564 template <class T>
  3565 inline TIdentityRelation<T>::operator TGeneralIdentityRelation() const
  3566 /**
  3567 Operator that gets the function that determines whether two
  3568 objects of a given class type match.
  3569 */
  3570 	{ return iIdentity; }
  3571 
  3572 
  3573 
  3574 template <class T>
  3575 inline TBool TIdentityRelation<T>::EqualityOperatorCompare(const T& aLeft, const T& aRight)
  3576 /**
  3577 Compares two objects of class T using the equality operator defined for class T.
  3578 */
  3579 	{return aLeft == aRight;}
  3580 
  3581 
  3582 
  3583 // Class TLinearOrder<T>
  3584 template <class T>
  3585 inline TLinearOrder<T>::TLinearOrder( TInt(*anOrder)(const T&, const T&) )
  3586 /**
  3587 Constructs the object taking the specified function as an argument.
  3588 
  3589 The specified function should implement an algorithm that determines the
  3590 order of two class T type objects. It should return:
  3591 
  3592 1. zero, if the two objects are equal.
  3593 
  3594 2. a negative value, if the first object is less than the second.
  3595 
  3596 3. a positive value, if the first object is greater than the second.
  3597 
  3598 @param anOrder A pointer to a function that takes constant references to two
  3599                class T objects and returns a TInt value. 
  3600 */
  3601 	{ iOrder=(TGeneralLinearOrder)anOrder; }
  3602 
  3603 
  3604 
  3605 
  3606 template <class T>
  3607 inline TLinearOrder<T>::operator TGeneralLinearOrder() const
  3608 /**
  3609 Operator that gets the function that determines the order of two
  3610 objects of a given class type.
  3611 */
  3612 	{ return iOrder; }
  3613 
  3614 
  3615 
  3616 
  3617 // Class RPointerArray<T>
  3618 
  3619 /**
  3620 Default C++ constructor.
  3621 
  3622 This constructs an array object for an array of pointers with default
  3623 granularity, which is 8.
  3624 */
  3625 template <class T>
  3626 inline RPointerArray<T>::RPointerArray()
  3627 	: RPointerArrayBase()
  3628 	{}
  3629 
  3630 
  3631 
  3632 
  3633 /**
  3634 C++ constructor with granularity.
  3635 
  3636 This constructs an array object for an array of pointers with the specified 
  3637 granularity.
  3638 
  3639 @param aGranularity The granularity of the array.
  3640 
  3641 @panic USER 127, if aGranularity is not positive, or greater than or equal
  3642        to 0x10000000.
  3643 */
  3644 template <class T>
  3645 inline RPointerArray<T>::RPointerArray(TInt aGranularity)
  3646 	: RPointerArrayBase(aGranularity)
  3647 	{}
  3648 
  3649 
  3650 
  3651 
  3652 /**
  3653 C++ constructor with minimum growth step and exponential growth factor.
  3654 
  3655 This constructs an array object for an array of pointers with the specified 
  3656 minimum growth step and exponential growth factor.
  3657 
  3658 @param aMinGrowBy	The minimum growth step of the array. Must be between 1 and
  3659 					65535 inclusive.
  3660 @param aFactor		The factor by which the array grows, multiplied by 256.
  3661 					For example 512 specifies a factor of 2. Must be between 257
  3662 					and 32767 inclusive.
  3663 
  3664 @panic USER 192, if aMinGrowBy<=0 or aMinGrowBy>65535.
  3665 @panic USER 193, if aFactor<=257 or aFactor>32767.
  3666 */
  3667 template <class T>
  3668 inline RPointerArray<T>::RPointerArray(TInt aMinGrowBy, TInt aFactor)
  3669 	: RPointerArrayBase(aMinGrowBy, aFactor)
  3670 	{}
  3671 
  3672 
  3673 
  3674 
  3675 template <class T>
  3676 inline void RPointerArray<T>::Close()
  3677 /**
  3678 Closes the array and frees all memory allocated to it.
  3679 
  3680 The function must be called before this array object goes out of scope.
  3681 
  3682 Note that the function does not delete the objects whose pointers are contained
  3683 in the array.
  3684 */
  3685 	{RPointerArrayBase::Close();}
  3686 
  3687 
  3688 
  3689 
  3690 template <class T>
  3691 inline TInt RPointerArray<T>::Count() const
  3692 /**
  3693 Gets the number of object pointers in the array.
  3694 
  3695 @return The number of object pointers in the array.
  3696 */
  3697 	{ return RPointerArrayBase::Count(); }
  3698 
  3699 
  3700 
  3701 
  3702 template <class T>
  3703 inline T* const& RPointerArray<T>::operator[](TInt anIndex) const
  3704 /**
  3705 Gets a reference to the object pointer located at the specified 
  3706 position within the array.
  3707 
  3708 The compiler chooses this option if the returned reference is used in
  3709 an expression where the reference cannot be modified.
  3710 
  3711 @param anIndex The position of the object pointer within the array. The
  3712                position is relative to zero, i.e. zero implies the object
  3713 			   pointer at the beginning of the array.
  3714 
  3715 @return A const reference to the object pointer at position anIndex within 
  3716         the array.
  3717 
  3718 @panic USER 130, if anIndex is negative, or is greater than the number of
  3719        objects currently in the array.
  3720 */
  3721 	{return (T* const&)At(anIndex);}
  3722 
  3723 
  3724 
  3725 
  3726 template <class T>
  3727 inline T*& RPointerArray<T>::operator[](TInt anIndex)
  3728 /**
  3729 Gets a reference to the object pointer located at the specified 
  3730 position within the array.
  3731 
  3732 The compiler chooses this option if the returned reference is used in
  3733 an expression where the reference can be modified.
  3734 
  3735 @param anIndex The position of the object pointer within the array. The
  3736                position is relative to zero, i.e. zero implies the object
  3737 			   pointer at the beginning of the array.
  3738 
  3739 @return A non-const reference to the object pointer at position anIndex within 
  3740         the array.
  3741 
  3742 @panic USER 130, if anIndex is negative, or is greater than the number of
  3743        objects currently in the array.
  3744 */
  3745 	{return (T*&)At(anIndex);}
  3746 
  3747 
  3748 
  3749 
  3750 template <class T>
  3751 inline TInt RPointerArray<T>::Append(const T* anEntry)
  3752 /**
  3753 Appends an object pointer onto the array.
  3754 
  3755 @param anEntry The object pointer to be appended.
  3756 
  3757 @return KErrNone, if the insertion is successful, otherwise one of the system 
  3758         wide error codes.
  3759 */
  3760 	{ return RPointerArrayBase::Append(anEntry); }
  3761 
  3762 
  3763 
  3764 
  3765 template <class T>
  3766 inline TInt RPointerArray<T>::Insert(const T* anEntry, TInt aPos)
  3767 /**
  3768 Inserts an object pointer into the array at the specified position.
  3769 
  3770 @param anEntry The object pointer to be inserted.
  3771 @param aPos    The position within the array where the object pointer is to be 
  3772                inserted. The position is relative to zero, i.e. zero implies
  3773 			   that a pointer is inserted at the beginning of the array.
  3774 
  3775 @return KErrNone, if the insertion is successful, otherwise one of the system 
  3776         wide error codes.
  3777 
  3778 @panic USER 131, if aPos is negative, or is greater than the number of object
  3779        pointers currently in the array.
  3780 */
  3781 	{ return RPointerArrayBase::Insert(anEntry,aPos); }
  3782 
  3783 
  3784 
  3785 
  3786 template <class T>
  3787 inline void RPointerArray<T>::Remove(TInt anIndex)
  3788 /**
  3789 Removes the object pointer at the specified position from the array.
  3790 
  3791 Note that the function does not delete the object whose pointer is removed.
  3792 
  3793 @param anIndex The position within the array from where the object pointer 
  3794                is to be removed. The position is relative to zero, i.e. zero
  3795 			   implies that a pointer at the beginning of the array is to be
  3796 			   removed.
  3797 			   
  3798 @panic USER 130, if anIndex is negative, or is greater than the number of
  3799        objects currently in the array. 
  3800 */
  3801 	{RPointerArrayBase::Remove(anIndex);}
  3802 
  3803 
  3804 
  3805 
  3806 template <class T>
  3807 inline void RPointerArray<T>::Compress()
  3808 /**
  3809 Compresses the array down to a minimum.
  3810 
  3811 After a call to this function, the memory allocated to the array is just
  3812 sufficient for its contained object pointers.
  3813 Subsequently adding a new object pointer to the array 
  3814 always results in a re-allocation of memory.
  3815 */
  3816 	{RPointerArrayBase::Compress();}
  3817 
  3818 
  3819 
  3820 
  3821 template <class T>
  3822 inline void RPointerArray<T>::Reset()
  3823 /**
  3824 Empties the array.
  3825 
  3826 It frees all memory allocated to the array and resets the internal state so 
  3827 that it is ready to be reused.
  3828 
  3829 This array object can be allowed to go out of scope after a call to this
  3830 function.
  3831 
  3832 Note that the function does not delete the objects whose pointers are contained
  3833 in the array.
  3834 */
  3835 	{RPointerArrayBase::Reset();}
  3836 
  3837 
  3838 
  3839 
  3840 template <class T>
  3841 inline TInt RPointerArray<T>::Find(const T* anEntry) const
  3842 /**
  3843 Finds the first object pointer in the array which matches the specified object 
  3844 pointer, using a sequential search.
  3845 
  3846 Matching is based on the comparison of pointers.
  3847 
  3848 The find operation always starts at the low index end of the array. There 
  3849 is no assumption about the order of objects in the array.
  3850 
  3851 @param anEntry The object pointer to be found.
  3852 @return The index of the first matching object pointer within the array.
  3853         KErrNotFound, if no matching object pointer can be found.
  3854 */
  3855 	{ return RPointerArrayBase::Find(anEntry); }
  3856 
  3857 
  3858 
  3859 
  3860 template <class T>
  3861 inline TInt RPointerArray<T>::Find(const T* anEntry, TIdentityRelation<T> anIdentity) const
  3862 /**
  3863 Finds the first object pointer in the array whose object matches the specified 
  3864 object, using a sequential search and a matching algorithm.
  3865 
  3866 The algorithm for determining whether two class T objects match is provided 
  3867 by a function supplied by the caller.
  3868 
  3869 The find operation always starts at the low index end of the array. There 
  3870 is no assumption about the order of objects in the array.
  3871 
  3872 @param anEntry    The object pointer to be found.
  3873 @param anIdentity A package encapsulating the function which determines whether 
  3874                   two class T objects match.
  3875 
  3876 @return The index of the first matching object pointer within the array.
  3877         KErrNotFound, if no suitable object pointer can be found.
  3878 */
  3879 	{ return RPointerArrayBase::Find(anEntry,anIdentity); }
  3880 
  3881 
  3882 
  3883 
  3884 template <class T>
  3885 inline TInt RPointerArray<T>::FindReverse(const T* anEntry) const
  3886 /**
  3887 Finds the last object pointer in the array which matches the specified object 
  3888 pointer, using a sequential search.
  3889 
  3890 Matching is based on the comparison of pointers.
  3891 
  3892 The find operation always starts at the high index end of the array. There 
  3893 is no assumption about the order of objects in the array.
  3894 
  3895 @param anEntry The object pointer to be found.
  3896 @return The index of the last matching object pointer within the array.
  3897         KErrNotFound, if no matching object pointer can be found.
  3898 */
  3899 	{ return RPointerArrayBase::FindReverse(anEntry); }
  3900 
  3901 
  3902 
  3903 
  3904 template <class T>
  3905 inline TInt RPointerArray<T>::FindReverse(const T* anEntry, TIdentityRelation<T> anIdentity) const
  3906 /**
  3907 Finds the last object pointer in the array whose object matches the specified 
  3908 object, using a sequential search and a matching algorithm.
  3909 
  3910 The algorithm for determining whether two class T objects match is provided 
  3911 by a function supplied by the caller.
  3912 
  3913 The find operation always starts at the high index end of the array. There 
  3914 is no assumption about the order of objects in the array.
  3915 
  3916 @param anEntry    The object pointer to be found.
  3917 @param anIdentity A package encapsulating the function which determines whether 
  3918                   two class T objects match.
  3919 
  3920 @return The index of the last matching object pointer within the array.
  3921         KErrNotFound, if no suitable object pointer can be found.
  3922 */
  3923 	{ return RPointerArrayBase::FindReverse(anEntry,anIdentity); }
  3924 
  3925 
  3926 
  3927 
  3928 template <class T>
  3929 inline TInt RPointerArray<T>::FindInAddressOrder(const T* anEntry) const
  3930 /**
  3931 Finds the object pointer in the array that matches the specified object
  3932 pointer, using a binary search technique.
  3933 
  3934 The function assumes that object pointers in the array are in address order.
  3935 
  3936 @param anEntry The object pointer to be found.
  3937 
  3938 @return The index of the matching object pointer within the array or KErrNotFound 
  3939         if no suitable object pointer can be found.
  3940 */
  3941 	{ return RPointerArrayBase::FindIsqUnsigned((TUint)anEntry); }
  3942 
  3943 
  3944 
  3945 
  3946 template <class T>
  3947 inline TInt RPointerArray<T>::FindInOrder(const T* anEntry, TLinearOrder<T> anOrder) const
  3948 /**
  3949 Finds the object pointer in the array whose object matches the specified
  3950 object, using a binary search technique and an ordering algorithm.
  3951 
  3952 The function assumes that existing object pointers in the array are ordered 
  3953 so that the objects themselves are in object order as determined by an algorithm 
  3954 supplied by the caller and packaged as a TLinearOrder<T>.
  3955 
  3956 @param anEntry The object pointer to be found.
  3957 @param anOrder A package encapsulating the function which determines the order 
  3958                of two class T objects.
  3959 
  3960 @return The index of the matching object pointer within the array or KErrNotFound, 
  3961         if no suitable object pointer can be found.
  3962 */
  3963 	{ return RPointerArrayBase::FindIsq(anEntry,anOrder); }
  3964 
  3965 
  3966 
  3967 
  3968 template <class T>
  3969 inline TInt RPointerArray<T>::FindInAddressOrder(const T* anEntry, TInt& anIndex) const
  3970 /**
  3971 Finds the object pointer in the array that matches the specified object
  3972 pointer, using a binary search technique.
  3973 
  3974 The function assumes that object pointers in the array are in address order.
  3975 
  3976 @param anEntry The object pointer to be found.
  3977 @param anIndex A TInt supplied by the caller. On return, contains an index
  3978                value:
  3979                If the function returns KErrNone, this is the index of the
  3980                matching object pointer within the array. 
  3981                If the function returns KErrNotFound,  this is the
  3982                index of the first object pointer within the array which
  3983                logically follows after anEntry.
  3984 
  3985 @return KErrNone, if a matching object pointer is found.
  3986         KErrNotFound, if no suitable object pointer can be found.
  3987 */
  3988 	{ return RPointerArrayBase::BinarySearchUnsigned((TUint)anEntry,anIndex); }
  3989 
  3990 
  3991 
  3992 
  3993 template <class T>
  3994 inline TInt RPointerArray<T>::FindInOrder(const T* anEntry, TInt& anIndex, TLinearOrder<T> anOrder) const
  3995 /**
  3996 Finds the object pointer in the array whose object matches the specified
  3997 object, using a binary search technique and an ordering algorithm.
  3998 
  3999 The function assumes that existing object pointers in the array are ordered 
  4000 so that the objects themselves are in object order as determined by an
  4001 algorithm supplied by the caller and packaged as a TLinearOrder<T>.
  4002 
  4003 @param anEntry The object pointer to be found.
  4004 @param anIndex A TInt supplied by the caller. On return, contains an
  4005                index value:
  4006                If the function returns KErrNone, this is the index of the
  4007                matching object pointer within the array. 
  4008                If the function returns KErrNotFound, this is the index of
  4009                the first object pointer in the array whose object is larger
  4010                than the entry being searched for - if no objects pointed to in
  4011                the array are larger, then the index value is the same as the
  4012                total number of object pointers in the array.
  4013 
  4014 @param anOrder A package encapsulating the function which determines the order 
  4015                of two class T objects.
  4016 
  4017 @return KErrNone, if a matching object pointer is found.
  4018         KErrNotFound, if no suitable object pointer can be found.
  4019 */
  4020 	{ return RPointerArrayBase::BinarySearch(anEntry,anIndex,anOrder); }
  4021 
  4022 
  4023 
  4024 
  4025 template <class T>
  4026 inline TInt RPointerArray<T>::SpecificFindInAddressOrder(const T* anEntry, TInt aMode) const
  4027 /**
  4028 Finds the object pointer in the array that matches the specified object
  4029 pointer, using a binary search technique.
  4030 
  4031 Where there is more than one matching element, it finds the first, the last 
  4032 or any matching element as specified by the value of aMode.
  4033 
  4034 The function assumes that object pointers in the array are in address order.
  4035 
  4036 @param	anEntry The object pointer to be found.
  4037 @param	aMode   Specifies whether to find the first match, the last match or
  4038                 any match, as defined by one of the TArrayFindMode enum values.
  4039 
  4040 @return KErrNotFound, if there is no matching element, otherwise the array
  4041         index of a matching element - what the index refers to depends on the
  4042         value of aMode:
  4043         if this is EArrayFindMode_First, then the index refers to the first matching element;
  4044         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
  4045         if this is EArrayFindMode_Last, then the index refers to first element that follows
  4046         the last matching element - if the last matching element is also the last element of
  4047         the array, then the index value is the same as the total number of elements in the array.
  4048         
  4049 @see TArrayFindMode
  4050 */
  4051 	{ return RPointerArrayBase::FindIsqUnsigned((TUint)anEntry, aMode); }
  4052 
  4053 
  4054 
  4055 
  4056 template <class T>
  4057 inline TInt RPointerArray<T>::SpecificFindInOrder(const T* anEntry, TLinearOrder<T> anOrder, TInt aMode) const
  4058 /**
  4059 Finds the object pointer in the array whose object matches the specified
  4060 object, using a binary search technique and an ordering algorithm.
  4061 
  4062 Where there is more than one matching element, it finds the first, the last
  4063 or any matching element as specified by the value of aMode.
  4064 
  4065 The function assumes that existing object pointers in the array are ordered 
  4066 so that the objects themselves are in object order as determined by an algorithm 
  4067 supplied by the caller and packaged as a TLinearOrder<T> type.
  4068 
  4069 @param anEntry The object pointer to be found.
  4070 @param anOrder A package encapsulating the function which determines the order 
  4071                of two class T objects.
  4072 @param	aMode  Specifies whether to find the first match, the last match or any match,
  4073                as defined by one of the TArrayFindMode enum values.
  4074 
  4075 @return KErrNotFound, if there is no matching element, otherwise the array
  4076         index of a matching element -  what the index refers to depends on
  4077         the value of aMode:
  4078         if this is EArrayFindMode_First, then the index refers to the first matching element;
  4079         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
  4080         if this is EArrayFindMode_Last, then the index refers to first element that follows
  4081         the last matching element - if the last matching element is also the last element of the array,
  4082         then the index value is the same as the total number of elements in the array.
  4083         
  4084 @see TArrayFindMode   
  4085 */
  4086 	{ return RPointerArrayBase::FindIsq(anEntry,anOrder,aMode); }
  4087 
  4088 
  4089 
  4090 
  4091 template <class T>
  4092 inline TInt RPointerArray<T>::SpecificFindInAddressOrder(const T* anEntry, TInt& anIndex, TInt aMode) const
  4093 /**
  4094 Finds the object pointer in the array that matches the specified object
  4095 pointer, using a binary search technique.
  4096 
  4097 Where there is more than one matching element, it finds the first, the last
  4098 or any matching element as specified by the value of aMode.
  4099 
  4100 The function assumes that object pointers in the array are in address order.
  4101 
  4102 @param anEntry The object pointer to be found.
  4103 @param anIndex A TInt type supplied by the caller. On return, it contains an
  4104                index value depending on whether a match is found and on the
  4105                value of aMode.
  4106                If there is no matching element in the array, then this is
  4107                the index of the first element in the array that is bigger than
  4108                the element being searched for - if no elements in the array are
  4109                bigger, then the index value is the same as the total number of
  4110                elements in the array. If there is a matching element, then what
  4111                the index refers to depends on the value of aMode:
  4112                if this is EArrayFindMode_First, then the index refers to the first matching element;
  4113                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
  4114                if this is EArrayFindMode_Last, then the index refers to first element that follows the
  4115                last matching element - if the last matching element is also the last element of the array,
  4116                then the index value is the same as the total number of elements in the array.
  4117                
  4118 @param	aMode  Specifies whether to find the first match, the last match or any
  4119                match, as defined by one of the TArrayFindMode enum values.
  4120 
  4121 @return KErrNone, if a matching object pointer is found.
  4122         KErrNotFound, if no suitable object pointer can be found.
  4123         
  4124 @see TArrayFindMode
  4125 */
  4126 	{ return RPointerArrayBase::BinarySearchUnsigned((TUint)anEntry,anIndex,aMode); }
  4127 
  4128 
  4129 
  4130 
  4131 template <class T>
  4132 inline TInt RPointerArray<T>::SpecificFindInOrder(const T* anEntry, TInt& anIndex, TLinearOrder<T> anOrder, TInt aMode) const
  4133 /**
  4134 Finds the object pointer in the array whose object matches the specified
  4135 object, using a binary search technique and an ordering algorithm.
  4136 
  4137 Where there is more than one matching element, it finds the first, the last or any
  4138 matching element as specified by the value of aMode.
  4139 
  4140 The function assumes that existing object pointers in the array are ordered 
  4141 so that the objects themselves are in object order as determined by an
  4142 algorithm supplied by the caller and packaged as a TLinearOrder<T> type.
  4143 
  4144 @param anEntry The object pointer to be found.
  4145 @param anIndex A TInt type supplied by the caller. On return, it contains an
  4146                index value depending on whether a match is found and on the
  4147                value of aMode. If there is no matching element in the array,
  4148                then this is the index of the first element in the array
  4149                that is bigger than the element being searched for - if
  4150                no elements in the array are bigger, then the index value
  4151                is the same as the total number of elements in the array.
  4152                If there is a matching element, then what the index refers to
  4153                depends on the value of aMode:
  4154                if this is EArrayFindMode_First, then the index refers to the first matching element;
  4155                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
  4156                if this is EArrayFindMode_Last, then the index refers to first element that follows
  4157                the last matching element - if the last matching element is also the last element
  4158                of the array, then the index value is the same as the total number of elements in the array.
  4159 
  4160 @param anOrder A package encapsulating the function which determines the order 
  4161                of two class T objects.
  4162 @param	aMode  Specifies whether to find the first match, the last match or
  4163                any match, as defined by one of the TArrayFindMode enum values.
  4164 
  4165 @return KErrNone, if a matching object pointer is found.
  4166         KErrNotFound, if no suitable object pointer can be found.
  4167         
  4168 @see TArrayFindMode
  4169 */
  4170 	{ return RPointerArrayBase::BinarySearch(anEntry,anIndex,anOrder,aMode); }
  4171 
  4172 
  4173 
  4174 
  4175 template <class T>
  4176 inline TInt RPointerArray<T>::InsertInAddressOrder(const T* anEntry)
  4177 /**
  4178 Inserts an object pointer into the array in address order.
  4179 
  4180 No duplicate entries are permitted. The array remains unchanged following
  4181 an attempt to insert a duplicate entry.
  4182 
  4183 The function assumes that existing object pointers within the array are in 
  4184 address order.
  4185 
  4186 @param anEntry The object pointer to be inserted.
  4187 
  4188 @return KErrNone, if the insertion is successful;
  4189         KErrAlreadyExists, if an attempt is being made
  4190         to insert a duplicate entry; otherwise one of the other system wide
  4191         error codes.
  4192 */
  4193 	{ return RPointerArrayBase::InsertIsqUnsigned((TUint)anEntry,EFalse); }
  4194 
  4195 
  4196 
  4197 
  4198 template <class T>
  4199 inline TInt RPointerArray<T>::InsertInOrder(const T* anEntry, TLinearOrder<T> anOrder)
  4200 /**
  4201 Inserts an object pointer into the array so that the object itself is in object 
  4202 order.
  4203 
  4204 The algorithm for determining the order of two class T objects is provided 
  4205 by a function supplied by the caller.
  4206 
  4207 No duplicate entries are permitted. The array remains unchanged following
  4208 an attempt to insert a duplicate entry.
  4209 
  4210 The function assumes that the array is ordered so that the referenced objects 
  4211 are in object order.
  4212 
  4213 @param anEntry The object pointer to be inserted.
  4214 @param anOrder A package encapsulating the function which determines the order 
  4215                of two class T objects.
  4216 
  4217 @return KErrNone, if the insertion is successful;
  4218         KErrAlreadyExists, if an attempt is being made
  4219         to insert a duplicate entry; otherwise one of the other system wide
  4220         error codes.
  4221 */
  4222 	{ return RPointerArrayBase::InsertIsq(anEntry,anOrder,EFalse); }
  4223 
  4224 
  4225 
  4226 
  4227 template <class T>
  4228 inline TInt RPointerArray<T>::InsertInAddressOrderAllowRepeats(const T* anEntry)
  4229 /**
  4230 Inserts an object pointer into the array in address order, allowing duplicates.
  4231 
  4232 If the new object pointer is a duplicate of an existing object pointer in 
  4233 the array, then the new pointer is inserted after the existing one. If more 
  4234 than one duplicate object pointer already exists in the array, then any new 
  4235 duplicate pointer is inserted after the last one.
  4236 
  4237 The function assumes that existing object pointers within the array are in 
  4238 address order.
  4239 
  4240 @param anEntry The object pointer to be inserted.
  4241 
  4242 @return KErrNone, if the insertion is successful, otherwise one of the system 
  4243         wide error codes.
  4244 */
  4245 	{ return RPointerArrayBase::InsertIsqUnsigned((TUint)anEntry,ETrue); }
  4246 
  4247 
  4248 
  4249 
  4250 template <class T>
  4251 inline TInt RPointerArray<T>::InsertInOrderAllowRepeats(const T* anEntry, TLinearOrder<T> anOrder)
  4252 /**
  4253 Inserts an object pointer into the array so that the object itself is in object 
  4254 order, allowing duplicates
  4255 
  4256 The algorithm for determining the order of two class T objects is provided 
  4257 by a function supplied by the caller.
  4258 
  4259 If the specified object is a duplicate of an existing object, then the new 
  4260 pointer is inserted after the pointer to the existing object. If more than 
  4261 one duplicate object already exists, then the new pointer is inserted after 
  4262 the pointer to the last one.
  4263 
  4264 @param anEntry The object pointer to be inserted. 
  4265 @param anOrder A package encapsulating the function which determines the order 
  4266                of two class T objects.
  4267 
  4268 @return KErrNone, if the insertion is successful, otherwise one of the system 
  4269         wide error codes.
  4270 */
  4271 	{ return RPointerArrayBase::InsertIsq(anEntry,anOrder,ETrue); }
  4272 
  4273 
  4274 
  4275 
  4276 #ifndef __KERNEL_MODE__
  4277 template <class T>
  4278 inline RPointerArray<T>::RPointerArray(T** aEntries, TInt aCount)
  4279 	: RPointerArrayBase((TAny **)aEntries, aCount)
  4280 /**
  4281 C++ constructor with a pointer to the first array entry in a pre-existing
  4282 array, and the number of entries in that array.
  4283 
  4284 This constructor takes a pointer to a pre-existing set of entries of type 
  4285 pointer to class T, which is owned by another RPointerArray object. Ownership 
  4286 of the set of entries still resides with the original RPointerArray object.
  4287 
  4288 @param aEntries A pointer to the first entry of type pointer to class T in 
  4289                 the set of entries belonging to the existing array.
  4290 @param aCount   The number of entries in the existing array. The granularity of
  4291                 this array is set to this value.
  4292 
  4293 @panic USER 156, if aCount is not positive.
  4294 */
  4295 	{}
  4296 
  4297 
  4298 
  4299 
  4300 template <class T>
  4301 inline void RPointerArray<T>::GranularCompress()
  4302 /**
  4303 Compresses the array down to a granular boundary.
  4304 
  4305 After a call to this function, the memory allocated to the array is sufficient 
  4306 for its contained object pointers. Adding new object pointers to the array 
  4307 does not result in a re-allocation of memory until the the total number of 
  4308 pointers reaches a multiple of the granularity.
  4309 */
  4310 	{RPointerArrayBase::GranularCompress();}
  4311 
  4312 
  4313 
  4314 
  4315 template <class T>
  4316 inline TInt RPointerArray<T>::Reserve(TInt aCount)
  4317 /**
  4318 Reserves space for the specified number of elements.
  4319 
  4320 After a call to this function, the memory allocated to the array is sufficient 
  4321 to hold the number of object pointers specified. Adding new object pointers to the array 
  4322 does not result in a re-allocation of memory until the the total number of 
  4323 pointers exceeds the specified count.
  4324 
  4325 @param	aCount	The number of object pointers for which space should be reserved
  4326 @return	KErrNone		If the operation completed successfully
  4327 @return KErrNoMemory	If the requested amount of memory could not be allocated
  4328 */
  4329 	{ return RPointerArrayBase::DoReserve(aCount); }
  4330 
  4331 
  4332 
  4333 
  4334 template <class T>
  4335 inline void RPointerArray<T>::SortIntoAddressOrder()
  4336 /**
  4337 Sorts the object pointers within the array into address order.
  4338 */
  4339 	{ HeapSortUnsigned(); }
  4340 
  4341 
  4342 
  4343 
  4344 template <class T>
  4345 inline void RPointerArray<T>::Sort(TLinearOrder<T> anOrder)
  4346 /**
  4347 Sorts the object pointers within the array. 
  4348 
  4349 The sort order of the pointers is based on the order of the referenced objects. 
  4350 The referenced object order is determined by an algorithm supplied by the 
  4351 caller and packaged as a TLinerOrder<T>.
  4352 
  4353 @param anOrder A package encapsulating the function which determines the order 
  4354                of two class T objects.
  4355 */
  4356 	{ HeapSort(anOrder); }
  4357 
  4358 
  4359 
  4360 
  4361 template <class T>
  4362 inline TArray<T*> RPointerArray<T>::Array() const
  4363 /**
  4364 Constructs and returns a generic array.
  4365 
  4366 @return A generic array representing this array.
  4367 
  4368 @see TArray
  4369 */
  4370 	{ return TArray<T*>(GetCount,GetElementPtr,(const CBase*)this); }
  4371 #endif
  4372 
  4373 
  4374 
  4375 template <class T>
  4376 void RPointerArray<T>::ResetAndDestroy()
  4377 /**
  4378 Empties the array and deletes the referenced objects.
  4379 
  4380 It frees all memory allocated to the array and resets the internal state so 
  4381 that it is ready to be reused. The function also deletes all of the objects 
  4382 whose pointers are contained by the array.
  4383 
  4384 This array object can be allowed to go out of scope after a call to this function.
  4385 */
  4386 	{
  4387 	TInt c=Count();
  4388 	T** pE=(T**)Entries();
  4389 	ZeroCount();
  4390 	TInt i;
  4391 	for (i=0; i<c; i++)
  4392 		{
  4393 		delete *pE;
  4394 		pE++;
  4395 		}
  4396 	Reset();
  4397 	}
  4398 
  4399 
  4400 
  4401 // Specialization for RPointerArray<TAny>
  4402 
  4403 /**
  4404 Default C++ constructor.
  4405 
  4406 This constructs an array object for an array of TAny pointers with default
  4407 granularity, which is 8.
  4408 */
  4409 inline RPointerArray<TAny>::RPointerArray()
  4410 	: RPointerArrayBase()
  4411 	{}
  4412 
  4413 
  4414 
  4415 
  4416 /**
  4417 C++ constructor with granularity.
  4418 
  4419 This constructs an array object for an array of TAny pointers with the specified 
  4420 granularity.
  4421 
  4422 @param aGranularity The granularity of the array.
  4423 
  4424 @panic USER 127, if aGranularity is not positive, or greater than or equal
  4425        to 0x10000000.
  4426 */
  4427 inline RPointerArray<TAny>::RPointerArray(TInt aGranularity)
  4428 	: RPointerArrayBase(aGranularity)
  4429 	{}
  4430 
  4431 
  4432 
  4433 
  4434 /**
  4435 C++ constructor with minimum growth step and exponential growth factor.
  4436 
  4437 This constructs an array object for an array of TAny pointers with the specified 
  4438 minimum growth step and exponential growth factor.
  4439 
  4440 @param aMinGrowBy	The minimum growth step of the array. Must be between 1 and
  4441 					65535 inclusive.
  4442 @param aFactor		The factor by which the array grows, multiplied by 256.
  4443 					For example 512 specifies a factor of 2. Must be between 257
  4444 					and 32767 inclusive.
  4445 
  4446 @panic USER 192, if aMinGrowBy<=0 or aMinGrowBy>65535.
  4447 @panic USER 193, if aFactor<=257 or aFactor>32767.
  4448 */
  4449 inline RPointerArray<TAny>::RPointerArray(TInt aMinGrowBy, TInt aFactor)
  4450 	: RPointerArrayBase(aMinGrowBy, aFactor)
  4451 	{}
  4452 
  4453 
  4454 
  4455 
  4456 inline void RPointerArray<TAny>::Close()
  4457 /**
  4458 Closes the array and frees all memory allocated to it.
  4459 
  4460 The function must be called before this array object goes out of scope.
  4461 
  4462 Note that the function does not delete the objects whose pointers are contained
  4463 in the array.
  4464 */
  4465 	{RPointerArrayBase::Close();}
  4466 
  4467 
  4468 
  4469 
  4470 inline TInt RPointerArray<TAny>::Count() const
  4471 /**
  4472 Gets the number of pointers in the array.
  4473 
  4474 @return The number of pointers in the array.
  4475 */
  4476 	{ return RPointerArrayBase::Count(); }
  4477 
  4478 
  4479 
  4480 
  4481 inline TAny* const& RPointerArray<TAny>::operator[](TInt anIndex) const
  4482 /**
  4483 Gets a reference to the pointer located at the specified 
  4484 position within the array.
  4485 
  4486 The compiler chooses this option if the returned reference is used in
  4487 an expression where the reference cannot be modified.
  4488 
  4489 @param anIndex The position of the pointer within the array. The
  4490                position is relative to zero, i.e. zero implies the object
  4491 			   pointer at the beginning of the array.
  4492 
  4493 @return A const reference to the pointer at position anIndex within 
  4494         the array.
  4495 
  4496 @panic USER 130, if anIndex is negative, or is greater than the number of
  4497        objects currently in the array.
  4498 */
  4499 	{return At(anIndex);}
  4500 
  4501 
  4502 
  4503 
  4504 inline TAny*& RPointerArray<TAny>::operator[](TInt anIndex)
  4505 /**
  4506 Gets a reference to the pointer located at the specified 
  4507 position within the array.
  4508 
  4509 The compiler chooses this option if the returned reference is used in
  4510 an expression where the reference can be modified.
  4511 
  4512 @param anIndex The position of the pointer within the array. The
  4513                position is relative to zero, i.e. zero implies the object
  4514 			   pointer at the beginning of the array.
  4515 
  4516 @return A non-const reference to the pointer at position anIndex within 
  4517         the array.
  4518 
  4519 @panic USER 130, if anIndex is negative, or is greater than the number of
  4520        objects currently in the array.
  4521 */
  4522 	{return At(anIndex);}
  4523 
  4524 
  4525 
  4526 
  4527 inline TInt RPointerArray<TAny>::Append(const TAny* anEntry)
  4528 /**
  4529 Appends an pointer onto the array.
  4530 
  4531 @param anEntry The pointer to be appended.
  4532 
  4533 @return KErrNone, if the insertion is successful, otherwise one of the system 
  4534         wide error codes.
  4535 */
  4536 	{ return RPointerArrayBase::Append(anEntry); }
  4537 
  4538 
  4539 
  4540 
  4541 inline TInt RPointerArray<TAny>::Insert(const TAny* anEntry, TInt aPos)
  4542 /**
  4543 Inserts an pointer into the array at the specified position.
  4544 
  4545 @param anEntry The pointer to be inserted.
  4546 @param aPos    The position within the array where the pointer is to be 
  4547                inserted. The position is relative to zero, i.e. zero implies
  4548 			   that a pointer is inserted at the beginning of the array.
  4549 
  4550 @return KErrNone, if the insertion is successful, otherwise one of the system 
  4551         wide error codes.
  4552 
  4553 @panic USER 131, if aPos is negative, or is greater than the number of object
  4554        pointers currently in the array.
  4555 */
  4556 	{ return RPointerArrayBase::Insert(anEntry,aPos); }
  4557 
  4558 
  4559 
  4560 
  4561 inline void RPointerArray<TAny>::Remove(TInt anIndex)
  4562 /**
  4563 Removes the pointer at the specified position from the array.
  4564 
  4565 Note that the function does not delete the object whose pointer is removed.
  4566 
  4567 @param anIndex The position within the array from where the pointer 
  4568                is to be removed. The position is relative to zero, i.e. zero
  4569 			   implies that a pointer at the beginning of the array is to be
  4570 			   removed.
  4571 			   
  4572 @panic USER 130, if anIndex is negative, or is greater than the number of
  4573        objects currently in the array. 
  4574 */
  4575 	{RPointerArrayBase::Remove(anIndex);}
  4576 
  4577 
  4578 
  4579 
  4580 inline void RPointerArray<TAny>::Compress()
  4581 /**
  4582 Compresses the array down to a minimum.
  4583 
  4584 After a call to this function, the memory allocated to the array is just
  4585 sufficient for its contained pointers.
  4586 Subsequently adding a new pointer to the array 
  4587 always results in a re-allocation of memory.
  4588 */
  4589 	{RPointerArrayBase::Compress();}
  4590 
  4591 
  4592 
  4593 
  4594 inline void RPointerArray<TAny>::Reset()
  4595 /**
  4596 Empties the array.
  4597 
  4598 It frees all memory allocated to the array and resets the internal state so 
  4599 that it is ready to be reused.
  4600 
  4601 This array object can be allowed to go out of scope after a call to this
  4602 function.
  4603 
  4604 Note that the function does not delete the objects whose pointers are contained
  4605 in the array.
  4606 */
  4607 	{RPointerArrayBase::Reset();}
  4608 
  4609 
  4610 
  4611 
  4612 inline TInt RPointerArray<TAny>::Find(const TAny* anEntry) const
  4613 /**
  4614 Finds the first pointer in the array which matches the specified pointer, using
  4615 a sequential search.
  4616 
  4617 Matching is based on the comparison of pointers.
  4618 
  4619 The find operation always starts at the low index end of the array. There 
  4620 is no assumption about the order of objects in the array.
  4621 
  4622 @param anEntry The pointer to be found.
  4623 @return The index of the first matching pointer within the array.
  4624         KErrNotFound, if no matching pointer can be found.
  4625 */
  4626 	{ return RPointerArrayBase::Find(anEntry); }
  4627 
  4628 
  4629 
  4630 
  4631 inline TInt RPointerArray<TAny>::FindReverse(const TAny* anEntry) const
  4632 /**
  4633 Finds the last pointer in the array which matches the specified pointer, using
  4634 a sequential search.
  4635 
  4636 Matching is based on the comparison of pointers.
  4637 
  4638 The find operation always starts at the high index end of the array. There 
  4639 is no assumption about the order of objects in the array.
  4640 
  4641 @param anEntry The pointer to be found.
  4642 @return The index of the last matching pointer within the array.
  4643         KErrNotFound, if no matching pointer can be found.
  4644 */
  4645 	{ return RPointerArrayBase::FindReverse(anEntry); }
  4646 
  4647 
  4648 
  4649 
  4650 inline TInt RPointerArray<TAny>::FindInAddressOrder(const TAny* anEntry) const
  4651 /**
  4652 Finds the pointer in the array that matches the specified object
  4653 pointer, using a binary search technique.
  4654 
  4655 The function assumes that pointers in the array are in address order.
  4656 
  4657 @param anEntry The pointer to be found.
  4658 
  4659 @return The index of the matching pointer within the array or KErrNotFound 
  4660         if no suitable pointer can be found.
  4661 */
  4662 	{ return RPointerArrayBase::FindIsqUnsigned((TUint)anEntry); }
  4663 
  4664 
  4665 
  4666 
  4667 inline TInt RPointerArray<TAny>::FindInAddressOrder(const TAny* anEntry, TInt& anIndex) const
  4668 /**
  4669 Finds the pointer in the array that matches the specified object
  4670 pointer, using a binary search technique.
  4671 
  4672 The function assumes that pointers in the array are in address order.
  4673 
  4674 @param anEntry The pointer to be found.
  4675 @param anIndex A TInt supplied by the caller. On return, contains an index
  4676                value:
  4677                If the function returns KErrNone, this is the index of the
  4678 			   matching pointer within the array. 
  4679                If the function returns KErrNotFound, this is the index of the
  4680 			   last pointer within the array which logically
  4681 			   precedes anEntry.
  4682 
  4683 @return KErrNone, if a matching pointer is found.
  4684         KErrNotFound, if no suitable pointer can be found.
  4685 */
  4686 	{ return RPointerArrayBase::BinarySearchUnsigned((TUint)anEntry,anIndex); }
  4687 
  4688 
  4689 
  4690 
  4691 inline TInt RPointerArray<TAny>::SpecificFindInAddressOrder(const TAny* anEntry, TInt aMode) const
  4692 /**
  4693 Finds the pointer in the array that matches the specified pointer, using a
  4694 binary search technique.
  4695 
  4696 Where there is more than one matching element, it finds the first, the last 
  4697 or any matching element as specified by the value of aMode.
  4698 
  4699 The function assumes that pointers in the array are in address order.
  4700 
  4701 @param	anEntry The pointer to be found.
  4702 @param	aMode   Specifies whether to find the first match, the last match or
  4703                 any match, as defined by one of the TArrayFindMode enum values.
  4704 
  4705 @return KErrNotFound, if there is no matching element, otherwise the array
  4706         index of a matching element - what the index refers to depends on the
  4707         value of aMode:
  4708         if this is EArrayFindMode_First, then the index refers to the first matching element;
  4709         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
  4710         if this is EArrayFindMode_Last, then the index refers to first element that follows
  4711         the last matching element - if the last matching element is also the last element of
  4712         the array, then the index value is the same as the total number of elements in the array.
  4713         
  4714 @see TArrayFindMode
  4715 */
  4716 	{ return RPointerArrayBase::FindIsqUnsigned((TUint)anEntry, aMode); }
  4717 
  4718 
  4719 
  4720 
  4721 inline TInt RPointerArray<TAny>::SpecificFindInAddressOrder(const TAny* anEntry, TInt& anIndex, TInt aMode) const
  4722 /**
  4723 Finds the pointer in the array that matches the specified pointer, using a
  4724 binary search technique.
  4725 
  4726 Where there is more than one matching element, it finds the first, the last
  4727 or any matching element as specified by the value of aMode.
  4728 
  4729 The function assumes that pointers in the array are in address order.
  4730 
  4731 @param anEntry The pointer to be found.
  4732 @param anIndex A TInt type supplied by the caller. On return, it contains an
  4733                index value depending on whether a match is found and on the
  4734                value of aMode.
  4735                If there is no matching element in the array, then this is
  4736                the index of the first element in the array that is bigger than
  4737                the element being searched for - if no elements in the array are
  4738                bigger, then the index value is the same as the total number of
  4739                elements in the array. If there is a matching element, then what
  4740                the index refers to depends on the value of aMode:
  4741                if this is EArrayFindMode_First, then the index refers to the first matching element;
  4742                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
  4743                if this is EArrayFindMode_Last, then the index refers to first element that follows the
  4744                last matching element - if the last matching element is also the last element of the array,
  4745                then the index value is the same as the total number of elements in the array.
  4746                
  4747 @param	aMode  Specifies whether to find the first match, the last match or any
  4748                match, as defined by one of the TArrayFindMode enum values.
  4749 
  4750 @return KErrNone, if a matching pointer is found.
  4751         KErrNotFound, if no suitable pointer can be found.
  4752         
  4753 @see TArrayFindMode
  4754 */
  4755 	{ return RPointerArrayBase::BinarySearchUnsigned((TUint)anEntry,anIndex,aMode); }
  4756 
  4757 
  4758 
  4759 
  4760 inline TInt RPointerArray<TAny>::InsertInAddressOrder(const TAny* anEntry)
  4761 /**
  4762 Inserts an pointer into the array in address order.
  4763 
  4764 No duplicate entries are permitted. The array remains unchanged following
  4765 an attempt to insert a duplicate entry.
  4766 
  4767 The function assumes that existing pointers within the array are in 
  4768 address order.
  4769 
  4770 @param anEntry The pointer to be inserted.
  4771 
  4772 @return KErrNone, if the insertion is successful;
  4773         KErrAlreadyExists, if an attempt is being made
  4774         to insert a duplicate entry; otherwise one of the other system wide
  4775         error codes.
  4776 */
  4777 	{ return RPointerArrayBase::InsertIsqUnsigned((TUint)anEntry,EFalse); }
  4778 
  4779 
  4780 
  4781 
  4782 inline TInt RPointerArray<TAny>::InsertInAddressOrderAllowRepeats(const TAny* anEntry)
  4783 /**
  4784 Inserts an pointer into the array in address order, allowing duplicates.
  4785 
  4786 If the new pointer is a duplicate of an existing pointer in 
  4787 the array, then the new pointer is inserted after the existing one. If more 
  4788 than one duplicate pointer already exists in the array, then any new 
  4789 duplicate pointer is inserted after the last one.
  4790 
  4791 The function assumes that existing pointers within the array are in 
  4792 address order.
  4793 
  4794 @param anEntry The pointer to be inserted.
  4795 
  4796 @return KErrNone, if the insertion is successful, otherwise one of the system 
  4797         wide error codes.
  4798 */
  4799 	{ return RPointerArrayBase::InsertIsqUnsigned((TUint)anEntry,ETrue); }
  4800 
  4801 
  4802 
  4803 
  4804 #ifndef __KERNEL_MODE__
  4805 inline RPointerArray<TAny>::RPointerArray(TAny** aEntries, TInt aCount)
  4806 	: RPointerArrayBase((TAny **)aEntries, aCount)
  4807 /**
  4808 C++ constructor with a pointer to the first array entry in a pre-existing
  4809 array, and the number of entries in that array.
  4810 
  4811 This constructor takes a pointer to a pre-existing set of entries of type TAny*,
  4812 which is owned by another RPointerArray object. Ownership of the set of entries
  4813 still resides with the original RPointerArray object.
  4814 
  4815 @param aEntries A pointer to the first entry of type TAny* in the set of entries
  4816                 belonging to the existing array.                
  4817 @param aCount   The number of entries in the existing array. The granularity of
  4818                 this array is set to this value.
  4819 
  4820 @panic USER 156, if aCount is not positive.
  4821 */
  4822 	{}
  4823 
  4824 
  4825 
  4826 
  4827 inline void RPointerArray<TAny>::GranularCompress()
  4828 /**
  4829 Compresses the array down to a granular boundary.
  4830 
  4831 After a call to this function, the memory allocated to the array is sufficient 
  4832 for its contained pointers. Adding new pointers to the array 
  4833 does not result in a re-allocation of memory until the the total number of 
  4834 pointers reaches a multiple of the granularity.
  4835 */
  4836 	{RPointerArrayBase::GranularCompress();}
  4837 
  4838 
  4839 
  4840 
  4841 inline void RPointerArray<TAny>::SortIntoAddressOrder()
  4842 /**
  4843 Sorts the pointers within the array into address order.
  4844 */
  4845 	{ HeapSortUnsigned(); }
  4846 
  4847 
  4848 
  4849 
  4850 inline TArray<TAny*> RPointerArray<TAny>::Array() const
  4851 /**
  4852 Constructs and returns a generic array.
  4853 
  4854 @return A generic array representing this array.
  4855 
  4856 @see TArray
  4857 */
  4858 	{ return TArray<TAny*>(GetCount,GetElementPtr,(const CBase*)this); }
  4859 #endif
  4860 
  4861 
  4862 
  4863 template <class T>
  4864 inline RArray<T>::RArray()
  4865 	: RArrayBase(sizeof(T))
  4866 /** 
  4867 Default C++ constructor. 
  4868 
  4869 This constructs an array object for an array of type class T objects with 
  4870 default granularity and key offset value. The default granularity is 8 and 
  4871 the defaul key offset value is zero.
  4872 
  4873 @panic USER 129, if the size of class T is not positive or is not less
  4874        than 640.
  4875 */
  4876 	{}
  4877 
  4878 
  4879 
  4880 
  4881 template <class T>
  4882 inline RArray<T>::RArray(TInt aGranularity)
  4883 	: RArrayBase(sizeof(T),aGranularity)
  4884 /**
  4885 C++ constructor with granularity. 
  4886 
  4887 This constructs an array object for an array of type class T objects with 
  4888 a specified granularity and default key offset value. The default key offset 
  4889 value is zero.
  4890 
  4891 @param aGranularity The granularity of the array.
  4892 
  4893 @panic USER 129, if the size of class T is not positive or is not less
  4894        than 640.
  4895 @panic USER 127, if aGranularity is not positive or the product of this
  4896        value and the size of class T is not less than 0x10000000.
  4897 */
  4898 	{}
  4899 
  4900 
  4901 
  4902 
  4903 template <class T>
  4904 inline RArray<T>::RArray(TInt aGranularity, TInt aKeyOffset)
  4905 	: RArrayBase(sizeof(T),aGranularity,aKeyOffset)
  4906 /**
  4907 C++ constructor with granularity and key offset.
  4908 
  4909 This constructs an array object for an array of type class T objects with 
  4910 a specified granularity and a specified key offset value.
  4911 
  4912 @param aGranularity The granularity of the array.
  4913 @param aKeyOffset   The key offset.
  4914 
  4915 @panic USER 129, if the size of class T is not positive or is not less
  4916        than 640.
  4917 @panic USER 127, if aGranularity is not positive or the product of this
  4918        value and the size of class T is not less than 0x10000000.
  4919 @panic USER 128, if aKeyOffset is not positive, or is not less than the 
  4920        size of class T, or is not a multiple of 4.
  4921 */
  4922 	{}
  4923 
  4924 
  4925 
  4926 
  4927 /**
  4928 C++ constructor with minimum growth step and exponential growth factor.
  4929 
  4930 This constructs an array object for an array of class T objects with the
  4931 specified minimum growth step and exponential growth factor.
  4932 
  4933 @param aMinGrowBy	The minimum growth step of the array. Must be between 1 and
  4934 					65535 inclusive.
  4935 @param aKeyOffset   The key offset.
  4936 @param aFactor		The factor by which the array grows, multiplied by 256.
  4937 					For example 512 specifies a factor of 2. Must be between 257
  4938 					and 32767 inclusive.
  4939 
  4940 @panic USER 129, if the size of class T is not positive or is not less than 640.
  4941 @panic USER 128, if aKeyOffset is negative, or is not less than the 
  4942        size of class T, or is not a multiple of 4.
  4943 @panic USER 192, if aMinGrowBy<=0 or aMinGrowBy>65535.
  4944 @panic USER 193, if aFactor<=257 or aFactor>32767.
  4945 */
  4946 template <class T>
  4947 inline RArray<T>::RArray(TInt aMinGrowBy, TInt aKeyOffset, TInt aFactor)
  4948 	: RArrayBase(sizeof(T), aMinGrowBy, aKeyOffset, aFactor)
  4949 	{}
  4950 
  4951 
  4952 
  4953 
  4954 template <class T>
  4955 inline RArray<T>::RArray(TInt aEntrySize,T* aEntries, TInt aCount)
  4956 	: RArrayBase(aEntrySize,aEntries,aCount)
  4957 /**
  4958 C++ constructor with size of entry, a pointer to the first array entry in a 
  4959 pre-existing array, and the number of entries in that array.
  4960 
  4961 This constructor takes a pointer to a pre-existing set of entries of type 
  4962 class T objects owned by another RArray object. Ownership of the set of entries 
  4963 still resides with the original RArray object.
  4964 
  4965 This array is assigned a default granularity and key offset value. The default 
  4966 granularity is 8 and the default key offset value is zero.
  4967 
  4968 The purpose of constructing an array in this way is to allow sorting and
  4969 finding operations to be done without further allocation of memory.
  4970 
  4971 @param aEntrySize The size of an entry in the existing array. 
  4972 @param aEntries   A pointer to the first entry of type class T in the set of 
  4973                   entries belonging to the existing array.
  4974 @param aCount     The number of entries in the existing array.
  4975  
  4976 @panic USER 129, if aEntrySize is not positive or is not less than 640.
  4977 @panic USER 156, if aCount is not positive.
  4978 */
  4979 	{}
  4980 
  4981 
  4982 
  4983 
  4984 template <class T>
  4985 inline void RArray<T>::Close()
  4986 /**
  4987 Closes the array and frees all memory allocated to the array. 
  4988 
  4989 The function must be called before this array object is destroyed.
  4990 */
  4991 	{RArrayBase::Close();}
  4992 
  4993 
  4994 
  4995 
  4996 template <class T>
  4997 inline TInt RArray<T>::Count() const
  4998 /**
  4999 Gets the number of objects in the array.
  5000 
  5001 @return The number of objects in the array.
  5002 */
  5003 	{return RArrayBase::Count();}
  5004 
  5005 
  5006 
  5007 
  5008 template <class T>
  5009 inline const T& RArray<T>::operator[](TInt anIndex) const
  5010 /**
  5011 Gets a reference to an object located at a specified position within the array.
  5012 
  5013 The compiler chooses this function if the returned reference is used in an 
  5014 expression where the reference cannot be modified.
  5015 
  5016 @param anIndex The position of the object within the array. The position is 
  5017                relative to zero, i.e. zero implies the object at the beginning
  5018 			   of the array. 
  5019 
  5020 @return A const reference to the object at position anIndex within the array.
  5021 
  5022 @panic USER 130, if anIndex is negative or is greater than the number of 
  5023        objects currently in the array
  5024 */
  5025 	{return *(const T*)At(anIndex); }
  5026 
  5027 
  5028 
  5029 
  5030 template <class T>
  5031 inline T& RArray<T>::operator[](TInt anIndex)
  5032 /**
  5033 Gets a reference to an object located at a specified position within the array.
  5034 
  5035 The compiler chooses this function if the returned reference is used in an 
  5036 expression where the reference can be modified.
  5037 
  5038 @param anIndex The position of the object within the array. The position is 
  5039                relative to zero, i.e. zero implies the object at the beginning
  5040 			   of the array. 
  5041 
  5042 @return A non-const reference to the object at position anIndex within the array.
  5043 
  5044 @panic USER 130, if anIndex is negative or is greater than the number of 
  5045        objects currently in the array
  5046 */
  5047 	{return *(T*)At(anIndex); }
  5048 
  5049 
  5050 
  5051 
  5052 template <class T>
  5053 inline TInt RArray<T>::Append(const T& anEntry)
  5054 /**
  5055 Apends an object onto the array.
  5056 
  5057 @param anEntry    A reference to the object of type class T to be appended.
  5058 
  5059 @return KErrNone, if the insertion is successful, otherwise one of the system 
  5060         wide error codes.
  5061 */
  5062 	{return RArrayBase::Append(&anEntry);}
  5063 
  5064 
  5065 
  5066 
  5067 template <class T>
  5068 inline TInt RArray<T>::Insert(const T& anEntry, TInt aPos)
  5069 /**
  5070 Inserts an object into the array at a specified position.
  5071 
  5072 @param anEntry The class T object to be inserted.
  5073 @param aPos    The position within the array where the object is to
  5074                be inserted. The position is relative to zero, i.e. zero
  5075 			   implies that an object is inserted at the beginning of
  5076 			   the array.
  5077 			   
  5078 @return KErrNone, if the insertion is successful, otherwise one of the system 
  5079         wide error codes.
  5080 
  5081 @panic USER 131, if aPos is negative or is greater than the number of objects
  5082        currently in the array.
  5083 */
  5084 	{return RArrayBase::Insert(&anEntry,aPos);}
  5085 
  5086 
  5087 
  5088 
  5089 template <class T>
  5090 inline void RArray<T>::Remove(TInt anIndex)
  5091 /**
  5092 Removes the object at a specified position from the array.
  5093 
  5094 @param anIndex The position within the array from where the object is to be 
  5095                removed. The position is relative to zero, i.e. zero implies
  5096 			   that an object at the beginning of the array is to be removed.
  5097 	
  5098 @panic USER 130, if anIndex is negative or is greater than the number of
  5099        objects currently in the array.
  5100 */
  5101 	{RArrayBase::Remove(anIndex);}
  5102 
  5103 
  5104 
  5105 
  5106 template <class T>
  5107 inline void RArray<T>::Compress()
  5108 /** 
  5109 Compresses the array down to a minimum.
  5110 
  5111 After a call to this function, the memory allocated to the array is just
  5112 sufficient for its contained objects. Subsequently adding a new object to the
  5113 array always results in a re-allocation of memory.
  5114 */
  5115 	{RArrayBase::Compress();}
  5116 
  5117 
  5118 
  5119 
  5120 template <class T>
  5121 inline void RArray<T>::Reset()
  5122 /**
  5123 Empties the array, so that it is ready to be reused.
  5124 
  5125 The function frees all memory allocated to the array and resets the internal 
  5126 state so that it is ready to be reused.
  5127 
  5128 This array object can be allowed to go out of scope after a call to this function.
  5129 */
  5130 	{RArrayBase::Reset();}
  5131 
  5132 
  5133 
  5134 
  5135 template <class T>
  5136 inline TInt RArray<T>::Find(const T& anEntry) const
  5137 /**
  5138 Finds the first object in the array which matches the specified object using 
  5139 a sequential search.
  5140 
  5141 Matching is based on the comparison of a TInt value at the key offset position 
  5142 within the objects.
  5143 
  5144 For classes which define their own equality operator (==), the alternative method
  5145 Find(const T& anEntry, TIdentityRelation<T> anIdentity) is recommended.
  5146 
  5147 The find operation always starts at the low index end of the array. There 
  5148 is no assumption about the order of objects in the array.
  5149 
  5150 @param anEntry A reference to an object of type class T to be used for matching.
  5151 
  5152 @return The index of the first matching object within the array. 
  5153         KErrNotFound, if no matching object can be found.
  5154 */
  5155 	{return RArrayBase::Find(&anEntry);}
  5156 
  5157 
  5158 
  5159 
  5160 template <class T>
  5161 inline TInt RArray<T>::Find(const T& anEntry, TIdentityRelation<T> anIdentity) const
  5162 /**
  5163 Finds the first object in the array which matches the specified object using 
  5164 a sequential search and a matching algorithm.
  5165 
  5166 The algorithm for determining whether two class T type objects match is provided 
  5167 by a function supplied by the caller.
  5168 
  5169 Such a function need not be supplied if an equality operator (==) is defined for class T. 
  5170 In this case, default construction of anIdentity provides matching, as in the example below:
  5171 
  5172 @code
  5173 //Construct a TPoint and append to an RArray<TPoint>
  5174 TPoint p1(0,0);
  5175 RArray<TPoint> points;
  5176 points.AppendL(p1);
  5177 //Find position of p1 in points using TIdentityRelation<TPoint> default construction
  5178 TInt r = points.Find(p1, TIdentityRelation<TPoint>());
  5179 @endcode
  5180 
  5181 The find operation always starts at the low index end of the array. There 
  5182 is no assumption about the order of objects in the array.
  5183 
  5184 @param anEntry    A reference to an object of type class T to be used
  5185                   for matching.
  5186 @param anIdentity A package encapsulating the function which determines whether 
  5187                   two class T type objects match.
  5188 
  5189 @return The index of the first matching object within the array.
  5190         KErrNotFound, if no matching object can be found.
  5191 */
  5192 	{return RArrayBase::Find(&anEntry,anIdentity);}
  5193 
  5194 
  5195 
  5196 
  5197 template <class T>
  5198 inline TInt RArray<T>::FindReverse(const T& anEntry) const
  5199 /**
  5200 Finds the last object in the array which matches the specified object using 
  5201 a sequential search.
  5202 
  5203 Matching is based on the comparison of a TInt value at the key offset position 
  5204 within the objects.
  5205 
  5206 For classes which define their own equality operator (==), the alternative method
  5207 FindReverse(const T& anEntry, TIdentityRelation<T> anIdentity) is recommended.
  5208 
  5209 The find operation always starts at the high index end of the array. There 
  5210 is no assumption about the order of objects in the array.
  5211 
  5212 @param anEntry A reference to an object of type class T to be used for matching.
  5213 
  5214 @return The index of the last matching object within the array. 
  5215         KErrNotFound, if no matching object can be found.
  5216 */
  5217 	{return RArrayBase::FindReverse(&anEntry);}
  5218 
  5219 
  5220 
  5221 
  5222 template <class T>
  5223 inline TInt RArray<T>::FindReverse(const T& anEntry, TIdentityRelation<T> anIdentity) const
  5224 /**
  5225 Finds the last object in the array which matches the specified object using 
  5226 a sequential search and a matching algorithm.
  5227 
  5228 The algorithm for determining whether two class T type objects match is provided 
  5229 by a function supplied by the caller.
  5230 
  5231 Such a function need not be supplied if an equality operator (==) is defined for class T. 
  5232 In this case, default construction of anIdentity provides matching.
  5233 
  5234 See Find(const T& anEntry, TIdentityRelation<T> anIdentity) for more details.
  5235 
  5236 The find operation always starts at the high index end of the array. There 
  5237 is no assumption about the order of objects in the array.
  5238 
  5239 @param anEntry    A reference to an object of type class T to be used
  5240                   for matching.
  5241 @param anIdentity A package encapsulating the function which determines whether 
  5242                   two class T type objects match.
  5243 
  5244 @return The index of the last matching object within the array.
  5245         KErrNotFound, if no matching object can be found.
  5246 */
  5247 	{return RArrayBase::FindReverse(&anEntry,anIdentity);}
  5248 
  5249 
  5250 
  5251 
  5252 template <class T>
  5253 inline TInt RArray<T>::FindInSignedKeyOrder(const T& anEntry) const
  5254 /**
  5255 Finds the object in the array which matches the specified object using a binary 
  5256 search technique.
  5257 
  5258 The function assumes that existing objects within the array are in signed 
  5259 key order.
  5260 
  5261 @param anEntry A reference to an object of type class T to be used for matching.
  5262 
  5263 @return The index of the matching object within the array, or KErrNotFound 
  5264         if no matching object can be found.
  5265 */
  5266 	{return RArrayBase::FindIsqSigned(&anEntry);}
  5267 
  5268 
  5269 
  5270 
  5271 template <class T>
  5272 inline TInt RArray<T>::FindInUnsignedKeyOrder(const T& anEntry) const
  5273 /**
  5274 Finds the object in the array which matches the specified object using a binary 
  5275 search technique.
  5276 
  5277 The function assumes that existing objects within the array are in unsigned 
  5278 key order.
  5279 
  5280 @param anEntry A reference to an object of type class T to be used for matching.
  5281 
  5282 @return The index of the matching object within the array, or KErrNotFound 
  5283         if no matching object can be found.
  5284 */
  5285 	{return RArrayBase::FindIsqUnsigned(&anEntry);}
  5286 
  5287 
  5288 
  5289 
  5290 template <class T>
  5291 inline TInt RArray<T>::FindInOrder(const T& anEntry, TLinearOrder<T> anOrder) const
  5292 /**
  5293 Finds the object in the array which matches the specified object using a binary 
  5294 search technique and an ordering algorithm.
  5295 
  5296 The function assumes that existing objects within the array are in object 
  5297 order as determined by an algorithm supplied by the caller and packaged as 
  5298 a TLinearOrder<T>.
  5299 
  5300 @param anEntry A reference to an object of type class T to be used for matching.
  5301 @param anOrder A package encapsulating the function which determines the order 
  5302                of two class T objects.
  5303 
  5304 @return The index of the matching object within the array, or KErrNotFound if 
  5305         no matching object can be found.
  5306 */
  5307 	{return RArrayBase::FindIsq(&anEntry,anOrder);}
  5308 
  5309 
  5310 
  5311 
  5312 template <class T>
  5313 inline TInt RArray<T>::FindInSignedKeyOrder(const T& anEntry, TInt& anIndex) const
  5314 /**
  5315 Finds the object in the array which matches the specified object using a binary 
  5316 search technique.
  5317 
  5318 The function assumes that existing objects within the array are in signed 
  5319 key order.
  5320 
  5321 @param anEntry A reference to an object of type class T to be used for matching.
  5322 @param anIndex On return contains an index value. If the function returns KErrNone,
  5323                this is the index of the matching object within the array.
  5324                If the function returns KErrNotFound, this is the index of the
  5325                first element in the array whose key is bigger than the key of the
  5326                element being sought. If there are no elements in the array with
  5327                a bigger key, then the index value is the same as the total 
  5328                number of elements in the array.
  5329 @return KErrNone if a matching object is found, or KErrNotFound if no matching 
  5330         object can be found.
  5331 */
  5332 	{return RArrayBase::BinarySearchSigned(&anEntry,anIndex);}
  5333 
  5334 
  5335 
  5336 
  5337 template <class T>
  5338 inline TInt RArray<T>::FindInUnsignedKeyOrder(const T& anEntry, TInt& anIndex) const
  5339 /**
  5340 Finds the object in the array which matches the specified object using a binary 
  5341 search technique.
  5342 
  5343 The function assumes that existing objects within the array are in unsigned 
  5344 key order.
  5345 
  5346 @param anEntry A reference to an object of type class T to be used for matching.
  5347 @param anIndex On return contains an index value. If the function returns
  5348                KErrNone, this is the index of the matching object within the
  5349                array. 
  5350                If the function returns KErrNotFound, this is the index of the
  5351                first element in the array whose key is bigger than the key of the
  5352                element being sought. If there are no elements in the array with
  5353                a bigger key, then the index value is the same as the total 
  5354                number of elements in the array.
  5355 @return KErrNone if a matching object is found, or KErrNotFound if no matching 
  5356         object can be found.
  5357 */
  5358 	{return RArrayBase::BinarySearchUnsigned(&anEntry,anIndex);}
  5359 
  5360 
  5361 
  5362 
  5363 template <class T>
  5364 inline TInt RArray<T>::FindInOrder(const T& anEntry, TInt& anIndex, TLinearOrder<T> anOrder) const
  5365 /**
  5366 Finds the object in the array which matches the specified object using a binary 
  5367 search technique and an ordering algorithm.
  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>.
  5372 
  5373 @param anEntry A reference to an object of type class T to be used for matching.
  5374 @param anIndex On return contains an index value. If the function returns
  5375                KErrNone, this is the index of the matching object within the
  5376                array.
  5377                If the function returns KErrNotFound, this is the index of the
  5378                first element in the array that is bigger than the element being
  5379                searched for - if no elements in the array are bigger, then
  5380                the index value is the same as the total number of elements in
  5381                the array.
  5382 @param anOrder A package encapsulating the function which determines the order 
  5383                of two class T objects.
  5384 
  5385 @return KErrNone if a matching object is found. KErrNotFound if no matching 
  5386         object can be found.
  5387 */
  5388 	{return RArrayBase::BinarySearch(&anEntry,anIndex,anOrder);}
  5389 
  5390 
  5391 
  5392 
  5393 template <class T>
  5394 inline TInt RArray<T>::SpecificFindInSignedKeyOrder(const T& anEntry, 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. In the case that there is more than
  5401 one matching element, finds the first, last or any match as specified by
  5402 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	aMode  Specifies whether to find the first match, the last match or
  5409                any match, as defined by one of the TArrayFindMode enum values.
  5410                
  5411 @return KErrNotFound, if there is no matching element, otherwise the array
  5412         index of a matching element -  what the index refers to depends on the
  5413         value of aMode:
  5414         if this is EArrayFindMode_First, then the index refers to the first matching element;
  5415         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
  5416         if this is EArrayFindMode_Last, then the index refers to first element that follows
  5417         the last matching element - if the last matching element is also the last element of
  5418         the array, then the index value is the same as the total number of elements in the array.
  5419         
  5420 @see TArrayFindMode        
  5421 */
  5422 	{return RArrayBase::FindIsqSigned(&anEntry,aMode);}
  5423 
  5424 
  5425 
  5426 
  5427 template <class T>
  5428 inline TInt RArray<T>::SpecificFindInUnsignedKeyOrder(const T& anEntry, TInt aMode) const
  5429 /**
  5430 Finds the object in the array which matches the specified object using a binary 
  5431 search technique.
  5432 
  5433 The element ordering is determined by an unsigned 32-bit word
  5434 (the key) embedded in each array element. Where there is more than
  5435 one matching element, it finds the first, last or any matching element
  5436 as specified by the value of aMode.
  5437 
  5438 The function assumes that existing objects within the array are in unsigned 
  5439 key order.
  5440 
  5441 @param anEntry A reference to an object of type class T to be used for matching.
  5442 @param	aMode  Specifies whether to find the first match, the last match or
  5443                any match, as defined by one of the TArrayFindMode enum values.
  5444 
  5445 @return KErrNotFound, if there is no matching element, otherwise the array
  5446         index of a matching element - what the index refers to depends on the
  5447         value of aMode:
  5448         if this is EArrayFindMode_First, then the index refers to the first matching element;
  5449         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
  5450         if this is EArrayFindMode_Last, then the index refers to first element that follows the
  5451         last matching element - if the last matching element is also the last element of the array,
  5452         then the index value is the same as the total number of elements in the array.
  5453         
  5454 @see TArrayFindMode
  5455 */
  5456 	{return RArrayBase::FindIsqUnsigned(&anEntry,aMode);}
  5457 
  5458 
  5459 
  5460 
  5461 template <class T>
  5462 inline TInt RArray<T>::SpecificFindInOrder(const T& anEntry, TLinearOrder<T> anOrder, TInt aMode) const
  5463 /**
  5464 Finds the object in the array which matches the specified object using a binary 
  5465 search technique and an ordering algorithm.
  5466 
  5467 Where there is more than one matching element, it finds the first, the last
  5468 or any matching element as specified by the value of aMode.
  5469 
  5470 The function assumes that existing objects within the array are in object 
  5471 order as determined by an algorithm supplied by the caller and packaged as 
  5472 a TLinearOrder<T> type.
  5473 
  5474 @param anEntry A reference to an object of type class T to be used for matching.
  5475 @param anOrder A package encapsulating the function which determines the order 
  5476                of two class T objects.
  5477 @param	aMode  Specifies whether to find the first match, the last match or any
  5478                match, as defined by one of the TArrayFindMode enum values.
  5479 
  5480 @return KErrNotFound, if there is no matching element, otherwise the array index
  5481         of a matching element -  what the index refers to depends on the value of
  5482         aMode:
  5483         if this is EArrayFindMode_First, then the index refers to the first matching element;
  5484         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
  5485         if this is EArrayFindMode_Last, then the index refers to first element that follows
  5486         the last matching element - if the last matching element is also the last element of
  5487         the array, then the index value is the same as the total number of elements in the array.
  5488 */
  5489 	{return RArrayBase::FindIsq(&anEntry,anOrder,aMode);}
  5490 
  5491 
  5492 
  5493 
  5494 template <class T>
  5495 inline TInt RArray<T>::SpecificFindInSignedKeyOrder(const T& anEntry, TInt& anIndex, TInt aMode) const
  5496 /**
  5497 Finds the object in the array which matches the specified object using a binary 
  5498 search technique.
  5499 
  5500 The element ordering is determined by a signed 32-bit word
  5501 (the key) embedded in each array element. Where there is more than
  5502 one matching element, finds the first, last or any matching element as
  5503 specified specified by the value of aMode.
  5504 
  5505 The function assumes that existing objects within the array are in signed 
  5506 key order.
  5507 
  5508 @param anEntry A reference to an object of type class T to be used for matching.
  5509 @param anIndex A TInt type supplied by the caller. On return, it contains
  5510                an index value depending on whether a match is found and on the
  5511                value of aMode. If there is no matching element in the array,
  5512                then this is the index of the first element in the array that
  5513                is bigger than the element being searched for - if no elements
  5514                in the array are bigger, then the index value is the same as the
  5515                total number of elements in the array. If there is a matching
  5516                element, then what the index refers to depends on the value of aMode:
  5517                if this is EArrayFindMode_First, then the index refers to the first matching element;
  5518                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
  5519                if this is EArrayFindMode_Last, then the index refers to first element that follows
  5520                the last matching element - if the last matching element is also the last element of
  5521                the array, then the index value is the same as the total number of elements in the array.
  5522 @param	aMode  Specifies whether to find the first match, the last match or any match,
  5523                as defined by one of the TArrayFindMode enum values.
  5524                
  5525 @return	KErrNone, if a matching object pointer is found;
  5526         KErrNotFound, if no suitable object pointer can be found.
  5527 */
  5528 	{return RArrayBase::BinarySearchSigned(&anEntry,anIndex,aMode);}
  5529 
  5530 
  5531 
  5532 
  5533 template <class T>
  5534 inline TInt RArray<T>::SpecificFindInUnsignedKeyOrder(const T& anEntry, TInt& anIndex, TInt aMode) const
  5535 /**
  5536 Finds the object in the array which matches the specified object using a binary 
  5537 search technique.
  5538 
  5539 The element ordering is determined by an unsigned 32-bit word
  5540 (the key) embedded in each array element. Where there is more than
  5541 one matching element, it finds the first, last or any matching element as
  5542 specified by the value of aMode.
  5543 
  5544 The function assumes that existing objects within the array are in unsigned 
  5545 key order.
  5546 
  5547 @param anEntry A reference to an object of type class T to be used for matching.
  5548 @param anIndex A TInt type supplied by the caller. On return, it contains an index
  5549                value depending on whether a match is found and on the value of aMode.
  5550                If there is no matching element in the array, then this is the index
  5551                of the first element in the array that is bigger than the element
  5552                being searched for - if no elements in the array are bigger, then
  5553                the index value is the same as the total number of elements in the array.
  5554                If there is a matching element, then what the index refers to depends on
  5555                the value of aMode:
  5556                if this is EArrayFindMode_First, then the index refers to the first matching element;
  5557                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
  5558                if this is EArrayFindMode_Last, then the index refers to first element that follows the
  5559                last matching element - if the last matching element is also the last element of the array,
  5560                then the index value is the same as the total number of elements in the array.
  5561 @param	aMode  Specifies whether to find the first match, the last match or any match, as defined by one
  5562                of the TArrayFindMode enum values.
  5563 @return	KErrNone, if a matching object pointer is found; KErrNotFound, if no suitable object pointer can be found.
  5564 
  5565 @see TArrayFindMode
  5566 */
  5567 	{return RArrayBase::BinarySearchUnsigned(&anEntry,anIndex,aMode);}
  5568 
  5569 
  5570 
  5571 
  5572 template <class T>
  5573 inline TInt RArray<T>::SpecificFindInOrder(const T& anEntry, TInt& anIndex, TLinearOrder<T> anOrder, TInt aMode) const
  5574 /**
  5575 Finds the object in the array which matches the specified object using a binary 
  5576 search technique and a specified ordering algorithm.
  5577 
  5578 Where there is more than one matching element, it finds the first, the last or
  5579 any matching element as specified by the value of aMode.
  5580 
  5581 The function assumes that existing objects within the array are in object 
  5582 order as determined by an algorithm supplied by the caller and packaged as 
  5583 a TLinearOrder<T> type.
  5584 
  5585 @param anEntry A reference to an object of type class T to be used for matching.
  5586 @param anIndex A TInt type supplied by the caller. On return, it contains
  5587                an index value depending on whether a match is found and on the
  5588                value of aMode. If there is no matching element in the array,
  5589                then this is the index of the first element in the array that
  5590                is bigger than the element being searched for - if no elements
  5591                in the array are bigger, then the index value is the same as 
  5592                the total number of elements in the array.
  5593                If there is a matching element, then what the index refers to
  5594                depends on the value of aMode:
  5595                if this is EArrayFindMode_First, then the index refers to the first matching element;
  5596                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
  5597                if this is EArrayFindMode_Last, then the index refers to first element that follows
  5598                the last matching element - if the last matching element is also
  5599                the last element of the array, then the index value is the same as
  5600                the total number of elements in the array.
  5601 @param anOrder A package encapsulating the function which determines the order 
  5602                of two class T objects.
  5603 @param	aMode  Specifies whether to find the first match, the last match or any match,
  5604                as defined by one of the TArrayFindMode enum values.
  5605 @return	KErrNone, if a matching object pointer is found;
  5606         KErrNotFound, if no suitable object pointer can be found.
  5607 
  5608 */
  5609 	{return RArrayBase::BinarySearch(&anEntry,anIndex,anOrder,aMode);}
  5610 
  5611 
  5612 
  5613 
  5614 template <class T>
  5615 inline TInt RArray<T>::InsertInSignedKeyOrder(const T& anEntry)
  5616 /**
  5617 Inserts an object into the array in ascending signed key order.
  5618 
  5619 The order of two class T type objects is based on comparing a TInt value
  5620 located at the key offset position within the class T object.
  5621 
  5622 No duplicate entries are permitted. The array remains unchanged following
  5623 an attempt to insert a duplicate entry.
  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;
  5628         KErrAlreadyExists, if an attempt is being made
  5629         to insert a duplicate entry; otherwise one of the other system wide
  5630         error codes.
  5631 */
  5632 	{return RArrayBase::InsertIsqSigned(&anEntry,EFalse);}
  5633 
  5634 
  5635 
  5636 
  5637 template <class T>
  5638 inline TInt RArray<T>::InsertInUnsignedKeyOrder(const T& anEntry)
  5639 /**
  5640 Inserts an object into the array in ascending unsigned key order.
  5641 
  5642 The order of two class T type objects is based on comparing a TUint value 
  5643 located at the key offset position within the class T object. 
  5644 
  5645 No duplicate entries are permitted. The array remains unchanged following
  5646 an attempt to insert a duplicate entry.
  5647 
  5648 @param anEntry A reference to the object of type class T to be inserted.
  5649 
  5650 @return KErrNone, if the insertion is successful;
  5651         KErrAlreadyExists, if an attempt is being made
  5652         to insert a duplicate entry; otherwise one of the other system wide
  5653         error codes.
  5654 */
  5655 	{return RArrayBase::InsertIsqUnsigned(&anEntry,EFalse);}
  5656 
  5657 
  5658 
  5659 
  5660 template <class T>
  5661 inline TInt RArray<T>::InsertInOrder(const T& anEntry, TLinearOrder<T> anOrder)
  5662 /**
  5663 Inserts an object of into the array in object order.
  5664 
  5665 The algorithm for determining the order of two class T type objects is provided 
  5666 by a function supplied by the caller.
  5667 
  5668 No duplicate entries are permitted. The array remains unchanged following
  5669 an attempt to insert a duplicate entry.
  5670 
  5671 The function assumes that existing objects within the array are in object 
  5672 order.
  5673 
  5674 @param anEntry A reference to the object of type class T to be inserted.
  5675 @param anOrder A package encapsulating the function which determines the order 
  5676                of two class T objects.
  5677 
  5678 @return KErrNone, if the insertion is successful;
  5679         KErrAlreadyExists, if an attempt is being made
  5680         to insert a duplicate entry; otherwise one of the other system wide
  5681         error codes.
  5682 */
  5683 	{return RArrayBase::InsertIsq(&anEntry,anOrder,EFalse);}
  5684 
  5685 
  5686 
  5687 
  5688 template <class T>
  5689 inline TInt RArray<T>::InsertInSignedKeyOrderAllowRepeats(const T& anEntry)
  5690 /**
  5691 Inserts an object into the array in ascending signed key order,
  5692 allowing duplicates.
  5693 
  5694 The order of two class T type objects is based on comparing a TInt value
  5695 located at the key offset position within the class T object. 
  5696 
  5697 If anEntry is a duplicate of an existing object in the array, then the new 
  5698 object is inserted after the existing object. If more than one duplicate object 
  5699 already exists in the array, then any new duplicate object is inserted after 
  5700 the last one.
  5701 
  5702 @param anEntry A reference to the object of type class T to be inserted.
  5703 
  5704 @return KErrNone, if the insertion is successful, otherwise one of the system 
  5705         wide error codes.
  5706 */
  5707 	{return RArrayBase::InsertIsqSigned(&anEntry,ETrue);}
  5708 
  5709 
  5710 
  5711 
  5712 template <class T>
  5713 inline TInt RArray<T>::InsertInUnsignedKeyOrderAllowRepeats(const T& anEntry)
  5714 /**
  5715 Inserts an object into the array in ascending unsigned key order, allowing 
  5716 duplicates.
  5717 
  5718 The order of two class T type objects is based on comparing a TUint value 
  5719 located at the key offset position within the class T object. 
  5720 
  5721 If anEntry is a duplicate of an existing object in the array, then the new 
  5722 object is inserted after the existing object. If more than one duplicate object 
  5723 already exists in the array, then any new duplicate object is inserted after 
  5724 the last one.
  5725 
  5726 @param anEntry A reference to the object of type class T to be inserted.
  5727 
  5728 @return KErrNone, if the insertion is successful, otherwise one of the system 
  5729         wide error codes. 
  5730 */
  5731 	{return RArrayBase::InsertIsqUnsigned(&anEntry,ETrue);}
  5732 
  5733 
  5734 
  5735 
  5736 template <class T>
  5737 inline TInt RArray<T>::InsertInOrderAllowRepeats(const T& anEntry, TLinearOrder<T> anOrder)
  5738 /**
  5739 Inserts an object into the array in object order, allowing duplicates.
  5740 
  5741 The algorithm for determining the order of two class T type objects is provided 
  5742 by a function supplied by the caller.
  5743 
  5744 If anEntry is a duplicate of an existing object in the array, then the new 
  5745 object is inserted after the existing object. If more than one duplicate object 
  5746 already exists in the array, then anEntry is inserted after the last one.
  5747 
  5748 The function assumes that existing objects within the array are in object 
  5749 order.
  5750 
  5751 @param anEntry A reference to the object of type class T to be inserted.
  5752 @param anOrder A package encapsulating the function which determines the order 
  5753                of two class T objects.
  5754 
  5755 @return KErrNone, if the insertion is successful, otherwise one of the system 
  5756         wide error codes.
  5757 */
  5758 	{return RArrayBase::InsertIsq(&anEntry,anOrder,ETrue);}
  5759 
  5760 
  5761 
  5762 #ifndef __KERNEL_MODE__
  5763 
  5764 template <class T>
  5765 inline void RArray<T>::GranularCompress()
  5766 /**
  5767 Compresses the array down to a granular boundary.
  5768 
  5769 After a call to this function, the memory allocated to the array is sufficient 
  5770 for its contained objects. Adding new objects to the array does not result 
  5771 in a re-allocation of memory until the the total number of objects reaches 
  5772 a multiple of the granularity.
  5773 */
  5774 	{RArrayBase::GranularCompress();}
  5775 
  5776 
  5777 
  5778 
  5779 template <class T>
  5780 inline TInt RArray<T>::Reserve(TInt aCount)
  5781 /**
  5782 Reserves space for the specified number of elements.
  5783 
  5784 After a call to this function, the memory allocated to the array is sufficient 
  5785 to hold the number of objects specified. Adding new objects to the array 
  5786 does not result in a re-allocation of memory until the the total number of 
  5787 objects exceeds the specified count.
  5788 
  5789 @param	aCount	The number of objects for which space should be reserved
  5790 @return	KErrNone		If the operation completed successfully
  5791 @return KErrNoMemory	If the requested amount of memory could not be allocated
  5792 */
  5793 	{ return RArrayBase::DoReserve(aCount); }
  5794 
  5795 
  5796 
  5797 
  5798 template <class T>
  5799 inline void RArray<T>::SortSigned()
  5800 /**
  5801 Sorts the objects within the array; the sort order is assumed to be in signed 
  5802 integer order.
  5803 */
  5804 	{HeapSortSigned();}
  5805 
  5806 
  5807 
  5808 
  5809 template <class T>
  5810 inline void RArray<T>::SortUnsigned()
  5811 /**
  5812 Sorts the objects within the array; the sort order is assumed to be in unsigned 
  5813 integer order.
  5814 */
  5815 	{HeapSortUnsigned();}
  5816 
  5817 
  5818 
  5819 
  5820 template <class T>
  5821 inline void RArray<T>::Sort(TLinearOrder<T> anOrder)
  5822 /**
  5823 Sorts the objects within the array using the specified TLinearOrder. 
  5824 
  5825 The sort order is determined by an algorithm supplied by the caller and
  5826 packaged as a TLinerOrder<T>.
  5827 
  5828 @param anOrder A package encapsulating the function which determines the order 
  5829                of two class T type objects.
  5830 */
  5831 	{HeapSort(anOrder);}
  5832 
  5833 
  5834 
  5835 
  5836 template <class T>
  5837 inline TArray<T> RArray<T>::Array() const
  5838 /**
  5839 Constructs and returns a generic array.
  5840 
  5841 @return A generic array representing this array.
  5842 */
  5843 	{ return TArray<T>(GetCount,GetElementPtr,(const CBase*)this); }
  5844 #endif
  5845 
  5846 
  5847 
  5848 
  5849 inline RArray<TInt>::RArray()
  5850 	: RPointerArrayBase()
  5851 /**
  5852 Constructs an array object for an array of signed integers with
  5853 default granularity. 
  5854 
  5855 The default granularity is 8. 
  5856 */
  5857 	{}
  5858 
  5859 
  5860 
  5861 
  5862 inline RArray<TInt>::RArray(TInt aGranularity)
  5863 	: RPointerArrayBase(aGranularity)
  5864 /**
  5865 Constructs an array object for an array of signed integers with the specified 
  5866 granularity.
  5867 	
  5868 @param aGranularity The granularity of the array.
  5869 
  5870 @panic USER 127, if aGranularity is not positive or is greater than or
  5871        equal to 0x10000000.
  5872 */
  5873 	{}
  5874 
  5875 
  5876 
  5877 
  5878 /**
  5879 C++ constructor with minimum growth step and exponential growth factor.
  5880 
  5881 This constructs an array object for an array of signed integers with the
  5882 specified minimum growth step and exponential growth factor.
  5883 
  5884 @param aMinGrowBy	The minimum growth step of the array. Must be between 1 and
  5885 					65535 inclusive.
  5886 @param aFactor		The factor by which the array grows, multiplied by 256.
  5887 					For example 512 specifies a factor of 2. Must be between 257
  5888 					and 32767 inclusive.
  5889 
  5890 @panic USER 192, if aMinGrowBy<=0 or aMinGrowBy>65535.
  5891 @panic USER 193, if aFactor<=257 or aFactor>32767.
  5892 */
  5893 inline RArray<TInt>::RArray(TInt aMinGrowBy, TInt aFactor)
  5894 	: RPointerArrayBase(aMinGrowBy, aFactor)
  5895 	{}
  5896 
  5897 
  5898 
  5899 
  5900 inline void RArray<TInt>::Close()
  5901 /**
  5902 Closes the array and frees all memory allocated to the array.
  5903 	
  5904 The function must be called before this array object goes out of scope. 
  5905 */
  5906 	{RPointerArrayBase::Close();}
  5907 
  5908 
  5909 
  5910 
  5911 inline TInt RArray<TInt>::Count() const
  5912 /**
  5913 Gets the number of signed integers in the array.
  5914 	
  5915 @return The number of signed integers in the array.
  5916 */
  5917 	{ return RPointerArrayBase::Count(); }
  5918 
  5919 
  5920 
  5921 
  5922 inline const TInt& RArray<TInt>::operator[](TInt anIndex) const
  5923 /**
  5924 Gets a reference to the signed integer located at a specified position within 
  5925 the array.
  5926 	
  5927 The compiler chooses this function if the returned reference is used in an 
  5928 expression where the reference cannot be modified.
  5929 	
  5930 @param anIndex The position of the signed integer within the array. The
  5931                position is relative to zero, i.e. zero implies the entry
  5932 			   at the beginning of the array. 
  5933 
  5934 @return A const reference to the signed integer at position anIndex within 
  5935         the array.
  5936 
  5937 @panic USER 130, if anIndex is negative, or is greater than the number of 
  5938 	   entries currently in the array.
  5939 */
  5940 	{return (const TInt&)At(anIndex);}
  5941 
  5942 
  5943 
  5944 
  5945 inline TInt& RArray<TInt>::operator[](TInt anIndex)
  5946 /**
  5947 Gets a reference to the signed integer located at a specified position within 
  5948 the array.
  5949 	
  5950 The compiler chooses this function if the returned reference is used in an 
  5951 expression where the reference can be modified.
  5952 	
  5953 @param anIndex The position of the signed integer within the array. The
  5954                position is relative to zero, i.e. zero implies the entry
  5955 			   at the beginning of the array. 
  5956 
  5957 @return A non-const reference to the signed integer at position anIndex within 
  5958         the array.
  5959 
  5960 @panic USER 130, if anIndex is negative, or is greater than the number of 
  5961 	   entries currently in the array.
  5962 */
  5963 	{return (TInt&)At(anIndex);}
  5964 
  5965 
  5966 
  5967 
  5968 inline TInt RArray<TInt>::Append(TInt anEntry)
  5969 /**
  5970 Appends a signed integer onto the array.
  5971 	
  5972 @param anEntry The signed integer to be appended.
  5973 	
  5974 @return KErrNone, if the insertion is successful, otherwise one of the system 
  5975 	    wide error codes.
  5976 */
  5977 	{ return RPointerArrayBase::Append((const TAny*)anEntry); }
  5978 
  5979 
  5980 
  5981 
  5982 inline TInt RArray<TInt>::Insert(TInt anEntry, TInt aPos)
  5983 /**
  5984 Inserts a signed integer into the array at the specified position.
  5985 	
  5986 @param anEntry The signed integer to be inserted.
  5987 @param aPos    The position within the array where the signed integer is to be 
  5988 	           inserted. The position is relative to zero, i.e. zero implies
  5989 			   that an entry is inserted at the beginning of the array.
  5990 			   
  5991 @return KErrNone, if the insertion is successful, otherwise one of the system 
  5992 	    wide error codes.
  5993 
  5994 @panic USER 131, if aPos is negative, or is greater than the number of entries
  5995        currently in the array.
  5996 */
  5997 	{ return RPointerArrayBase::Insert((const TAny*)anEntry,aPos); }
  5998 
  5999 
  6000 
  6001 
  6002 inline void RArray<TInt>::Remove(TInt anIndex)
  6003 /**
  6004 Removes the signed integer at the specified position from the array.
  6005 	
  6006 @param anIndex The position within the array from where the signed integer 
  6007 	           is to be removed. The position is relative to zero, i.e. zero
  6008 			   implies that an entry at the beginning of the array is to be
  6009 			   removed. 
  6010 
  6011 @panic USER 130, if anIndex is negative or is greater than the number of
  6012        entries currently in the array.
  6013 */
  6014 	{RPointerArrayBase::Remove(anIndex);}
  6015 
  6016 
  6017 
  6018 
  6019 inline void RArray<TInt>::Compress()
  6020 /**
  6021 Compresses the array down to a minimum.
  6022 	
  6023 After a call to this function, the memory allocated to the array is just
  6024 sufficient for its entries. Subsequently adding a new signed integer to the
  6025 array always results in a re-allocation of memory.
  6026 */
  6027 	{RPointerArrayBase::Compress();}
  6028 
  6029 
  6030 
  6031 
  6032 inline void RArray<TInt>::Reset()
  6033 /**
  6034 Empties the array.
  6035 
  6036 The function frees all memory allocated to the array and 
  6037 resets the internal state so that it is ready to be reused.
  6038 	
  6039 This array object can be allowed to go out of scope after a call to this
  6040 function.
  6041 */
  6042 	{RPointerArrayBase::Reset();}
  6043 
  6044 
  6045 
  6046 
  6047 inline TInt RArray<TInt>::Find(TInt anEntry) const
  6048 /**
  6049 Finds the first signed integer in the array which matches the specified signed 
  6050 integer using a sequential search.
  6051 	
  6052 The find operation always starts at the low index end of the array. There 
  6053 is no assumption about the order of entries in the array.
  6054 	
  6055 @param anEntry The signed integer to be found.
  6056 
  6057 @return The index of the first matching signed integer within the array.
  6058         KErrNotFound, if no matching entry can be found.
  6059 */
  6060 	{ return RPointerArrayBase::Find((const TAny*)anEntry); }
  6061 
  6062 
  6063 
  6064 
  6065 inline TInt RArray<TInt>::FindReverse(TInt anEntry) const
  6066 /**
  6067 Finds the last signed integer in the array which matches the specified signed 
  6068 integer using a sequential search.
  6069 	
  6070 The find operation always starts at the high index end of the array. There 
  6071 is no assumption about the order of entries in the array.
  6072 	
  6073 @param anEntry The signed integer to be found.
  6074 
  6075 @return The index of the last matching signed integer within the array.
  6076         KErrNotFound, if no matching entry can be found.
  6077 */
  6078 	{ return RPointerArrayBase::FindReverse((const TAny*)anEntry); }
  6079 
  6080 
  6081 
  6082 
  6083 inline TInt RArray<TInt>::FindInOrder(TInt anEntry) const
  6084 /**
  6085 Finds the signed integer in the array that matches the specified signed integer 
  6086 using a binary search technique.
  6087 	
  6088 The function assumes that the array is in signed integer order.
  6089 	
  6090 @param anEntry The signed integer to find.
  6091 
  6092 @return The index of the matching signed integer within the array or KErrNotFound, 
  6093         if no match can be found.
  6094 */
  6095 	{ return RPointerArrayBase::FindIsqSigned(anEntry); }
  6096 
  6097 
  6098 
  6099 
  6100 inline TInt RArray<TInt>::FindInOrder(TInt anEntry, TInt& anIndex) const
  6101 /**
  6102 Finds the signed integer in the array that matches the specified signed integer
  6103 using a binary search technique.
  6104 	
  6105 The function assumes that the array is in signed integer order.
  6106 	
  6107 @param anEntry The signed integer to find.
  6108 @param anIndex A TInt suplied by the caller. On return contains an index value.
  6109                If the function returns KErrNone, this is the index of the
  6110                matching signed integer within the array.   
  6111                If the function returns KErrNotFound, this is the index of the
  6112                first signed integer within the array that is bigger than the
  6113                signed integer being searched for - if no signed integers within
  6114                the array are bigger, then the index value is the same as the
  6115                total number of signed integers within the array.
  6116 
  6117 @return KErrNone if a matching signed integer is found.
  6118         KErrNotFound if no  match can be found.
  6119 */
  6120 	{ return RPointerArrayBase::BinarySearchSigned(anEntry,anIndex); }
  6121 
  6122 
  6123 
  6124 
  6125 inline TInt RArray<TInt>::SpecificFindInOrder(TInt anEntry, TInt aMode) const
  6126 /**
  6127 Finds the signed integer in the array that matches the specified signed integer 
  6128 using a binary search technique.
  6129 
  6130 Where there is more than one matching element, it finds the first, last or any
  6131 matching element as specified by the value of aMode.
  6132 	
  6133 The function assumes that the array is in signed integer order.
  6134 	
  6135 @param anEntry The signed integer to be found.
  6136 @param aMode   Specifies whether to find the first match, the last match or any
  6137                match, as defined by one of the TArrayFindMode enum values.
  6138 
  6139 @return KErrNotFound, if there is no matching element, otherwise the array
  6140         index of a matching element -  what the index refers to depends on the
  6141         value of aMode:
  6142         if this is EArrayFindMode_First, then the index refers to the first matching element;
  6143         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
  6144         if this is EArrayFindMode_Last, then the index refers to first element that follows
  6145         the last matching element - if the last matching element is also the last element
  6146         of the array, then the index value is the same as the total number of elements in
  6147         the array.
  6148 
  6149 @see TArrayFindMode         
  6150 */
  6151 	{ return RPointerArrayBase::FindIsqSigned(anEntry,aMode); }
  6152 
  6153 
  6154 
  6155 
  6156 inline TInt RArray<TInt>::SpecificFindInOrder(TInt anEntry, TInt& anIndex, TInt aMode) const
  6157 /**
  6158 Finds the signed integer in the array that matches the specified signed integer
  6159 using a binary search technique.
  6160 
  6161 Where there is more than one matching element, it finds the first, last or any 
  6162 matching element  as specified by the value of aMode.
  6163 
  6164 The function assumes that the array is in signed integer order.
  6165 	
  6166 @param anEntry The signed integer to be found.
  6167 @param anIndex A TInt type supplied by the caller. On return, it contains an index
  6168                value depending on whether a match is found and on the value of aMode.
  6169                If there is no matching element in the array, then this is the  index of
  6170                the first element in the array that is bigger than the element being
  6171                searched for - if no elements in the array are bigger, then the index
  6172                value is the same as the total number of elements in the array.
  6173                If there is a matching element, then what the index refers to depends
  6174                on the value of aMode:
  6175                if this is EArrayFindMode_First, then the index refers to the first matching element;
  6176                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
  6177                if this is EArrayFindMode_Last, then the index refers to first element that follows
  6178                the last matching element - if the last matching element is also the last element
  6179                of the array, then the index value is the same as the total number of elements in the array.
  6180                
  6181 @param	aMode  Specifies whether to find the first match, the last match or any match,
  6182                as defined by one of the TArrayFindMode enum values.
  6183                
  6184 @return KErrNone, if a matching element is found; 
  6185         KErrNotFound, if no suitable element can be found.               
  6186         
  6187 @see TArrayFindMode
  6188 */
  6189 	{ return RPointerArrayBase::BinarySearchSigned(anEntry,anIndex,aMode); }
  6190 
  6191 
  6192 
  6193 
  6194 inline TInt RArray<TInt>::InsertInOrder(TInt anEntry)
  6195 /**
  6196 Inserts a signed integer into the array in signed integer order.
  6197 	
  6198 No duplicate entries are permitted. The array remains unchanged following
  6199 an attempt to insert a duplicate entry.
  6200 	
  6201 The function assumes that existing entries within the array are in signed 
  6202 integer order.
  6203 	
  6204 @param anEntry The signed integer to be inserted
  6205 
  6206 @return KErrNone, if the insertion is successful;
  6207         KErrAlreadyExists, if an attempt is being made
  6208         to insert a duplicate entry; otherwise one of the other system wide
  6209         error codes.
  6210 */
  6211 	{ return RPointerArrayBase::InsertIsqSigned(anEntry,EFalse); }
  6212 
  6213 
  6214 
  6215 
  6216 inline TInt RArray<TInt>::InsertInOrderAllowRepeats(TInt anEntry)
  6217 /**
  6218 Inserts a signed integer into the array in signed integer order,
  6219 allowing duplicates.
  6220 	
  6221 If anEntry is a duplicate of an existing entry in the array, then the new 
  6222 signed integer is inserted after the existing one. If more than one duplicate 
  6223 entry already exists in the array, then any new duplicate signed integer is 
  6224 inserted after the last one.
  6225 	
  6226 The function assumes that existing entries within the array are in signed 
  6227 integer order.
  6228 	
  6229 @param anEntry The signed integer to be inserted.
  6230 
  6231 @return KErrNone, if the insertion is successful, otherwise one of the system 
  6232         wide error codes.
  6233 */
  6234 	{ return RPointerArrayBase::InsertIsqSigned(anEntry,ETrue); }
  6235 
  6236 
  6237 
  6238 
  6239 #ifndef __KERNEL_MODE__
  6240 inline RArray<TInt>::RArray(TInt* aEntries, TInt aCount)
  6241 	: RPointerArrayBase((TAny**)aEntries, aCount)
  6242 /**
  6243 C++ constructor with a pointer to the first array entry in a 
  6244 pre-existing array, and the number of entries in that array.
  6245 
  6246 This constructor takes a pointer to a pre-existing set of entries of type 
  6247 TInt objects. Ownership of the set of entries does not transfer to
  6248 this RArray object.
  6249 
  6250 The purpose of constructing an array in this way is to allow sorting and
  6251 finding operations to be done without further allocation of memory.
  6252 
  6253 @param aEntries   A pointer to the first entry of type class TInt in the set of 
  6254                   entries belonging to the existing array.
  6255 @param aCount     The number of entries in the existing array.
  6256 */
  6257 	{}
  6258 
  6259 inline void RArray<TInt>::GranularCompress()
  6260 /**
  6261 Compresses the array down to a granular boundary.
  6262 	
  6263 After a call to this function, the memory allocated to the array is sufficient 
  6264 for its contained entries. Adding new signed integers to the array does not 
  6265 result in a re-allocation of memory until the total number of entries reaches 
  6266 a multiple of the granularity.
  6267 */
  6268 	{RPointerArrayBase::GranularCompress();}
  6269 
  6270 
  6271 
  6272 
  6273 inline TInt RArray<TInt>::Reserve(TInt aCount)
  6274 /**
  6275 Reserves space for the specified number of elements.
  6276 
  6277 After a call to this function, the memory allocated to the array is sufficient 
  6278 to hold the number of integers specified. Adding new integers to the array 
  6279 does not result in a re-allocation of memory until the the total number of 
  6280 integers exceeds the specified count.
  6281 
  6282 @param	aCount	The number of integers for which space should be reserved
  6283 @return	KErrNone		If the operation completed successfully
  6284 @return KErrNoMemory	If the requested amount of memory could not be allocated
  6285 */
  6286 	{ return RPointerArrayBase::DoReserve(aCount); }
  6287 
  6288 
  6289 
  6290 
  6291 inline void RArray<TInt>::Sort()
  6292 /**
  6293 Sorts the array entries into signed integer order.
  6294 */
  6295 	{ HeapSortSigned(); }
  6296 
  6297 
  6298 
  6299 
  6300 inline TArray<TInt> RArray<TInt>::Array() const
  6301 /**
  6302 Constructs and returns a generic array.
  6303 	
  6304 @return A generic array representing this array.
  6305 
  6306 @see TArray
  6307 */
  6308 	{ return TArray<TInt>(GetCount,GetElementPtr,(const CBase*)this); }
  6309 #endif
  6310 
  6311 
  6312 
  6313 inline RArray<TUint>::RArray()
  6314 	: RPointerArrayBase()
  6315 /**
  6316 Default C++ constructor.
  6317 
  6318 This constructs an array object for an array of unsigned 
  6319 integers with default granularity.
  6320 
  6321 The default granularity of the array is 8.
  6322 */
  6323 	{}
  6324 
  6325 
  6326 
  6327 
  6328 inline RArray<TUint>::RArray(TInt aGranularity)
  6329 	: RPointerArrayBase(aGranularity)
  6330 /**
  6331 Constructs an array object for an array of unsigned integers with the specified 
  6332 granularity.
  6333 	
  6334 @param aGranularity The granularity of the array.
  6335 
  6336 @panic USER 127, if aGranularity is not positive or is greater than or
  6337        equal to 0x10000000.
  6338 */
  6339 	{}
  6340 
  6341 
  6342 
  6343 
  6344 /**
  6345 C++ constructor with minimum growth step and exponential growth factor.
  6346 
  6347 This constructs an array object for an array of unsigned integers with the
  6348 specified minimum growth step and exponential growth factor.
  6349 
  6350 @param aMinGrowBy	The minimum growth step of the array. Must be between 1 and
  6351 					65535 inclusive.
  6352 @param aFactor		The factor by which the array grows, multiplied by 256.
  6353 					For example 512 specifies a factor of 2. Must be between 257
  6354 					and 32767 inclusive.
  6355 
  6356 @panic USER 192, if aMinGrowBy<=0 or aMinGrowBy>65535.
  6357 @panic USER 193, if aFactor<=257 or aFactor>32767.
  6358 */
  6359 inline RArray<TUint>::RArray(TInt aMinGrowBy, TInt aFactor)
  6360 	: RPointerArrayBase(aMinGrowBy, aFactor)
  6361 	{}
  6362 
  6363 
  6364 
  6365 
  6366 inline void RArray<TUint>::Close()
  6367 /**
  6368 Closes the array and frees all memory allocated to the array.
  6369 	
  6370 The function must be called before this array object goes out of scope.
  6371 */
  6372 	{RPointerArrayBase::Close();}
  6373 
  6374 
  6375 
  6376 
  6377 inline TInt RArray<TUint>::Count() const
  6378 /**
  6379 Gets the number of unsigned integers in the array.
  6380 
  6381 @return The number of unsigned integers in the array.
  6382 */
  6383 	{return RPointerArrayBase::Count(); }
  6384 
  6385 
  6386 
  6387 
  6388 inline const TUint& RArray<TUint>::operator[](TInt anIndex) const
  6389 /**
  6390 Gets a reference to the unsigned integer located at the specified position 
  6391 within the array.
  6392 	
  6393 The compiler uses this variant if the returned reference is used in an
  6394 expression where the reference cannot be modified.
  6395 	
  6396 @param anIndex The position of the unsigned integer within the array, relative 
  6397 	           to zero, i.e. zero implies the entry at the beginning of
  6398 			   the array.
  6399 
  6400 @return A reference to the const unsigned integer at position anIndex within 
  6401         the array.
  6402 
  6403 @panic USER 130, if anIndex is negative, or is greater than the number of
  6404        entries currently in the array.
  6405 */
  6406 	{return (const TUint&)At(anIndex);}
  6407 
  6408 
  6409 
  6410 
  6411 inline TUint& RArray<TUint>::operator[](TInt anIndex)
  6412 /**
  6413 Gets a reference to the unsigned integer located at the specified position 
  6414 within the array.
  6415 	
  6416 The compiler uses this variant if the returned reference is used in an
  6417 expression where the reference can be modified.
  6418 	
  6419 @param anIndex The position of the unsigned integer within the array, relative 
  6420 	           to zero, i.e. zero implies the entry at the beginning of
  6421 			   the array.
  6422 
  6423 @return A reference to the non-const unsigned integer at position anIndex
  6424         within the array.
  6425 
  6426 @panic USER 130, if anIndex is negative, or is greater than the number of
  6427        entries currently in the array.
  6428 */
  6429 	{return (TUint&)At(anIndex);}
  6430 
  6431 
  6432 
  6433 
  6434 inline TInt RArray<TUint>::Append(TUint anEntry)
  6435 /**
  6436 Appends an unsigned integer onto the array.
  6437 	
  6438 @param anEntry The unsigned integer to be appended.
  6439 @return KErrNone, if the insertion is successful, otherwise one of the system 
  6440         wide error codes.
  6441 */
  6442 	{ return RPointerArrayBase::Append((const TAny*)anEntry); }
  6443 
  6444 
  6445 
  6446 
  6447 inline TInt RArray<TUint>::Insert(TUint anEntry, TInt aPos)
  6448 /**
  6449 Inserts an unsigned integer into the array at the specified position.
  6450 	
  6451 @param anEntry  The unsigned integer to be inserted.
  6452 @param aPos     The position within the array where the unsigned integer is to 
  6453 	            be inserted. The position is relative to zero, i.e. zero
  6454 				implies that an entry is inserted at the beginning of
  6455 				the array.
  6456 			
  6457 @return KErrNone, if the insertion is successful, otherwise one of the system 
  6458         wide error codes.
  6459 
  6460 @panic USER 131, if aPos is negative, or is greater than the number of entries
  6461        currently in the array.
  6462 */
  6463 	{ return RPointerArrayBase::Insert((const TAny*)anEntry,aPos); }
  6464 
  6465 
  6466 
  6467 
  6468 inline void RArray<TUint>::Remove(TInt anIndex)
  6469 /**
  6470 Removes the unsigned integer at the specified position from the array.
  6471 	
  6472 @param anIndex The position within the array from where the unsigned integer 
  6473                is to be removed. The position is relative to zero, i.e. zero
  6474 			   implies that an entry at the beginning of the array is to be
  6475 			   removed. 
  6476 			   
  6477 				 
  6478 @panic USER 130, if anIndex is negative, or is greater than the number of
  6479        entries currently in the array.
  6480 */
  6481 	{RPointerArrayBase::Remove(anIndex);}
  6482 
  6483 
  6484 
  6485 
  6486 inline void RArray<TUint>::Compress()
  6487 /**
  6488 Compresses the array down to a minimum.
  6489 	
  6490 After a call to this function, the memory allocated to the array is just
  6491 sufficient for its entries. Subsequently adding a new unsigned integer to the
  6492 array always results in a re-allocation of memory.
  6493 */
  6494 	{RPointerArrayBase::Compress();}
  6495 
  6496 
  6497 
  6498 
  6499 inline void RArray<TUint>::Reset()
  6500 /**
  6501 Empties the array.
  6502 
  6503 It frees all memory allocated to the array and resets the 
  6504 internal state so that it is ready to be reused.
  6505 	
  6506 This array object can be allowed to go out of scope after a call to
  6507 this function.
  6508 */
  6509 	{RPointerArrayBase::Reset();}
  6510 
  6511 
  6512 
  6513 
  6514 inline TInt RArray<TUint>::Find(TUint anEntry) const
  6515 /**
  6516 Finds the first unsigned integer in the array which matches the specified
  6517 value, using a sequential search.
  6518 	
  6519 The find operation always starts at the low index end of the array. There 
  6520 is no assumption about the order of entries in the array.
  6521 	
  6522 @param anEntry The unsigned integer to be found.
  6523 
  6524 @return The index of the first matching unsigned integer within the array.
  6525         KErrNotFound, if no matching entry can be found.
  6526 */
  6527 	{ return RPointerArrayBase::Find((const TAny*)anEntry); }
  6528 
  6529 
  6530 
  6531 
  6532 inline TInt RArray<TUint>::FindReverse(TUint anEntry) const
  6533 /**
  6534 Finds the last unsigned integer in the array which matches the specified
  6535 value, using a sequential search.
  6536 	
  6537 The find operation always starts at the high index end of the array. There 
  6538 is no assumption about the order of entries in the array.
  6539 	
  6540 @param anEntry The unsigned integer to be found.
  6541 
  6542 @return The index of the last matching unsigned integer within the array.
  6543         KErrNotFound, if no matching entry can be found.
  6544 */
  6545 	{ return RPointerArrayBase::FindReverse((const TAny*)anEntry); }
  6546 
  6547 
  6548 
  6549 
  6550 inline TInt RArray<TUint>::FindInOrder(TUint anEntry) const
  6551 /**
  6552 Finds the unsigned integer in the array which matches the specified value, 
  6553 using a binary search technique.
  6554 	
  6555 The functions assume that existing entries within the array are in unsigned 
  6556 integer order.
  6557 	
  6558 @param anEntry The unsigned integer to be found.
  6559 
  6560 @return This is either: the index of the matching unsigned integer within the 
  6561      	array;
  6562 		KErrNotFound, if no suitable entry can be found.
  6563 */
  6564 	{ return RPointerArrayBase::FindIsqUnsigned(anEntry); }
  6565 
  6566 
  6567 
  6568 
  6569 inline TInt RArray<TUint>::FindInOrder(TUint anEntry, TInt& anIndex) const
  6570 /**
  6571 Finds the unsigned integer in the array which matches the specified value, 
  6572 using a binary search technique.
  6573 
  6574 If the index cannot be found, the function returns the index of the last
  6575 unsigned integer within the array which logically precedes anEntry.
  6576 	
  6577 The functions assume that existing entries within the array are in unsigned 
  6578 integer order.
  6579 	
  6580 @param anEntry The unsigned integer to be found.
  6581 @param anIndex A TInt supplied by the caller. On return, contains an index
  6582                value.
  6583                If the function returns KErrNone, this is the index of the
  6584                matching unsigned integer within the array.               
  6585                If the function returns KErrNotFound, this is the index of the
  6586                first unsigned integer within the array that is bigger than the
  6587                unsigned integer being searched for - if no unsigned integers within
  6588                the array are bigger, then the index value is the same as the
  6589                total number of unsigned integers within the array.
  6590 @return KErrNone, if a matching unsigned integer is found. 
  6591         KErrNotFound, if no suitable entry can be found.
  6592 */
  6593 	{ return RPointerArrayBase::BinarySearchUnsigned(anEntry,anIndex); }
  6594 
  6595 
  6596 
  6597 
  6598 inline TInt RArray<TUint>::SpecificFindInOrder(TUint anEntry, TInt aMode) const
  6599 /**
  6600 Finds the unsigned integer in the array that matches the specified unsigned integer 
  6601 using a binary search technique.
  6602 
  6603 In the case that there is more than one matching element, finds the first, last
  6604 or any match as specified by the value of aMode.
  6605 	
  6606 The function assumes that the array is in unsigned integer order.
  6607 	
  6608 @param anEntry The unsigned integer to be found..
  6609 @param aMode   Specifies whether to find the first match, the last match or any match,
  6610                as defined by one of the TArrayFindMode enum values.
  6611 
  6612 @return KErrNotFound, if there is no matching element, otherwise the array index of
  6613         a matching element - what the index refers to depends on the value of
  6614         aMode:
  6615         if this is EArrayFindMode_First, then the index refers to the first matching element;
  6616         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
  6617         if this is EArrayFindMode_Last, then the index refers to first element that follows
  6618         the last matching element - if the last matching element is also the last element of
  6619         the array, then the index value is the same as the total number of elements in the array.
  6620         
  6621 @see TArrayFindMode
  6622 */
  6623 	{ return RPointerArrayBase::FindIsqUnsigned(anEntry,aMode); }
  6624 
  6625 
  6626 
  6627 
  6628 inline TInt RArray<TUint>::SpecificFindInOrder(TUint anEntry, TInt& anIndex, TInt aMode) const
  6629 /**
  6630 Finds the unsigned integer in the array that matches the specified unsigned integer
  6631 using a binary search technique.
  6632 
  6633 In the case that there is more than one matching element, finds the first, last or any match as specified.
  6634 
  6635 The function assumes that the array is in unsigned integer order.
  6636 	
  6637 @param anEntry The unsigned integer to be found.
  6638 @param anIndex A TInt type supplied by the caller. On return, it contains an index
  6639                value depending on whether a match is found and on the value of aMode.
  6640                If there is no matching element in the array, then this is the  index
  6641                of the first element in the array that is bigger than the element being
  6642                searched for - if no elements in the array are bigger, then the index
  6643                value is the same as the total number of elements in the array.
  6644                If there is a matching element, then what the index refers to depends
  6645                on the value of aMode:
  6646                if this is EArrayFindMode_First, then the index refers to the first matching element;
  6647                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
  6648                if this is EArrayFindMode_Last, then the index refers to first element that follows
  6649                the last matching element - if the last matching element is also the last element of the array,
  6650                then the index value is the same as the total number of elements in the array.
  6651 @param	aMode  Specifies whether to find the first match, the last match or any match, as defined by one
  6652                of the TArrayFindMode enum values.
  6653                
  6654 @return	KErrNone, if a matching entry is found; KErrNotFound, if no matching entry exists.
  6655 
  6656 @see TArrayFindMode
  6657 */
  6658 	{ return RPointerArrayBase::BinarySearchUnsigned(anEntry,anIndex,aMode); }
  6659 
  6660 
  6661 
  6662 
  6663 inline TInt RArray<TUint>::InsertInOrder(TUint anEntry)
  6664 /**
  6665 Inserts an unsigned integer into the array in unsigned integer order.
  6666 	
  6667 No duplicate entries are permitted. The array remains unchanged following
  6668 an attempt to insert a duplicate entry.
  6669 	
  6670 The function assumes that existing entries within the array are in unsigned 
  6671 integer order.
  6672 	
  6673 @param anEntry The unsigned integer to be inserted.
  6674 
  6675 @return KErrNone, if the insertion is successful;
  6676         KErrAlreadyExists, if an attempt is being made
  6677         to insert a duplicate entry; otherwise one of the other system wide
  6678         error codes.
  6679 */
  6680 	{ return RPointerArrayBase::InsertIsqUnsigned(anEntry,EFalse); }
  6681 
  6682 
  6683 
  6684 
  6685 inline TInt RArray<TUint>::InsertInOrderAllowRepeats(TUint anEntry)
  6686 /**
  6687 Inserts an unsigned integer into the array in unsigned integer order, allowing 
  6688 duplicates.
  6689 	
  6690 If the new integer is a duplicate of an existing entry in the array, then 
  6691 the new unsigned integer is inserted after the existing one. If more than 
  6692 one duplicate entry already exists in the array, then any new duplicate
  6693 unsigned integer is inserted after the last one.
  6694 	
  6695 The function assumes that existing entries within the array are in unsigned 
  6696 integer order.
  6697 	
  6698 @param anEntry The unsigned integer to be inserted.
  6699 
  6700 @return KErrNone, if the insertion is successful, otherwise one of the system 
  6701         wide error codes.
  6702 */
  6703 	{ return RPointerArrayBase::InsertIsqUnsigned(anEntry,ETrue); }
  6704 
  6705 
  6706 
  6707 
  6708 #ifndef __KERNEL_MODE__
  6709 inline RArray<TUint>::RArray(TUint* aEntries, TInt aCount)
  6710 	: RPointerArrayBase((TAny**)aEntries, aCount)
  6711 /**
  6712 C++ constructor with a pointer to the first array entry in a 
  6713 pre-existing array, and the number of entries in that array.
  6714 
  6715 This constructor takes a pointer to a pre-existing set of entries of type 
  6716 TUint objects. Ownership of the set of entries does not transfer to
  6717 this RArray object.
  6718 
  6719 The purpose of constructing an array in this way is to allow sorting and
  6720 finding operations to be done without further allocation of memory.
  6721 
  6722 @param aEntries   A pointer to the first entry of type class TUint in the set of 
  6723                   entries belonging to the existing array.
  6724 @param aCount     The number of entries in the existing array.
  6725 */
  6726 	{}
  6727 
  6728 
  6729 
  6730 inline void RArray<TUint>::GranularCompress()
  6731 /**
  6732 Compresses the array down to a granular boundary.
  6733 	
  6734 After a call to this function, the memory allocated to the array is sufficient 
  6735 for its contained entries. Adding new unsigned integers to the array does not 
  6736 result in a re-allocation of memory until the total number of entries reaches 
  6737 a multiple of the granularity.
  6738 */
  6739 	{RPointerArrayBase::GranularCompress();}
  6740 
  6741 
  6742 
  6743 
  6744 inline TInt RArray<TUint>::Reserve(TInt aCount)
  6745 /**
  6746 Reserves space for the specified number of elements.
  6747 
  6748 After a call to this function, the memory allocated to the array is sufficient 
  6749 to hold the number of integers specified. Adding new integers to the array 
  6750 does not result in a re-allocation of memory until the the total number of 
  6751 integers exceeds the specified count.
  6752 
  6753 @param	aCount	The number of integers for which space should be reserved
  6754 @return	KErrNone		If the operation completed successfully
  6755 @return KErrNoMemory	If the requested amount of memory could not be allocated
  6756 */
  6757 	{ return RPointerArrayBase::DoReserve(aCount); }
  6758 
  6759 
  6760 
  6761 
  6762 inline void RArray<TUint>::Sort()
  6763 /**
  6764 Sorts the array entries into unsigned integer order.
  6765 */
  6766 	{ HeapSortUnsigned(); }
  6767 
  6768 
  6769 
  6770 
  6771 inline TArray<TUint> RArray<TUint>::Array() const
  6772 /**
  6773 Constructs and returns a generic array.
  6774 	
  6775 @return A generic array representing this array.
  6776 
  6777 @see TArray
  6778 */
  6779 	{ return TArray<TUint>(GetCount,GetElementPtr,(const CBase*)this); }
  6780 #endif
  6781 
  6782 
  6783 
  6784 
  6785 /**
  6786 Sets an argument to default value and type.
  6787 */
  6788 inline void TIpcArgs::Set(TInt,TNothing)
  6789 	{}
  6790 
  6791 
  6792 
  6793 
  6794 /**
  6795 Sets an argument value of TInt type.
  6796 
  6797 @param aIndex An index value that identifies the slot in the array of arguments
  6798               into which the argument value is to be placed.
  6799               This must be a value in the range 0 to 3.
  6800 @param aValue The argument value.              
  6801 */
  6802 inline void TIpcArgs::Set(TInt aIndex,TInt aValue)
  6803 	{
  6804 	iArgs[aIndex] = aValue;
  6805 	iFlags |= EUnspecified<<(aIndex*KBitsPerType);
  6806 	}
  6807 
  6808 
  6809 
  6810 
  6811 /**
  6812 Sets an argument value of TAny* type.
  6813 
  6814 @param aIndex An index value that identifies the slot in the array of arguments
  6815               into which the argument value is to be placed.
  6816               This must be a value in the range 0 to 3.
  6817 @param aValue The argument value.              
  6818 */
  6819 inline void TIpcArgs::Set(TInt aIndex,const TAny* aValue)
  6820 	{
  6821 	iArgs[aIndex] = (TInt)aValue;
  6822 	iFlags |= EUnspecified<<(aIndex*KBitsPerType);
  6823 	}
  6824 
  6825 
  6826 
  6827 
  6828 /**
  6829 Sets an argument value of RHandleBase type.
  6830 
  6831 @param aIndex An index value that identifies the slot in the array of arguments
  6832               into which the argument value is to be placed.
  6833               This must be a value in the range 0 to 3.
  6834 @param aValue The argument value.              
  6835 */
  6836 inline void TIpcArgs::Set(TInt aIndex,RHandleBase aValue)
  6837 	{
  6838 	iArgs[aIndex] = (TInt)aValue.Handle();
  6839 	iFlags |= EHandle<<(aIndex*KBitsPerType);
  6840 	}
  6841 
  6842 
  6843 
  6844 
  6845 /**
  6846 Sets an argument value TDesC8* type.
  6847 
  6848 @param aIndex An index value that identifies the slot in the array of arguments
  6849               into which the argument value is to be placed.
  6850               This must be a value in the range 0 to 3.
  6851 @param aValue The argument value.              
  6852 */
  6853 inline void TIpcArgs::Set(TInt aIndex,const TDesC8* aValue)
  6854 	{
  6855 	iArgs[aIndex] = (TInt)aValue;
  6856 	iFlags |= EDesC8<<(aIndex*KBitsPerType);
  6857 	}
  6858 
  6859 
  6860 
  6861 
  6862 #ifndef __KERNEL_MODE__
  6863 
  6864 /**
  6865 Sets an argument value of TDesC16* type.
  6866 
  6867 @param aIndex An index value that identifies the slot in the array of arguments
  6868               into which the argument value is to be placed.
  6869               This must be a value in the range 0 to 3.
  6870 @param aValue The argument value.              
  6871 */
  6872 inline void TIpcArgs::Set(TInt aIndex,const TDesC16* aValue)
  6873 	{
  6874 	iArgs[aIndex] = (TInt)aValue;
  6875 	iFlags |= EDesC16<<(aIndex*KBitsPerType);
  6876 	}
  6877 
  6878 #endif
  6879 
  6880 
  6881 
  6882 
  6883 /**
  6884 Sets an argument value of TDes8* type.
  6885 
  6886 @param aIndex An index value that identifies the slot in the array of arguments
  6887               into which the argument value is to be placed.
  6888               This must be a value in the range 0 to 3.
  6889 @param aValue The argument value.              
  6890 */
  6891 inline void TIpcArgs::Set(TInt aIndex,TDes8* aValue)
  6892 	{
  6893 	iArgs[aIndex] = (TInt)aValue;
  6894 	iFlags |= EDes8<<(aIndex*KBitsPerType);
  6895 	}
  6896 
  6897 
  6898 
  6899 
  6900 #ifndef __KERNEL_MODE__
  6901 
  6902 /**
  6903 Sets an argument value of TDes16* type.
  6904 
  6905 @param aIndex An index value that identifies the slot in the array of arguments
  6906               into which the argument value is to be placed.
  6907               This must be a value in the range 0 to 3.
  6908 @param aValue The argument value.              
  6909 */
  6910 inline void TIpcArgs::Set(TInt aIndex,TDes16* aValue)
  6911 	{
  6912 	iArgs[aIndex] = (TInt)aValue;
  6913 	iFlags |= EDes16<<(aIndex*KBitsPerType);
  6914 	}
  6915 
  6916 #endif
  6917 
  6918 
  6919 /**
  6920 Allows the client to specify whether each argument of the TIpcArgs object will
  6921 be pinned before being sent to the server.
  6922 
  6923 To pin all the arguments in the TIpcArgs object pass no parameters to this
  6924 method.
  6925 
  6926 @return A reference to this TIpcArgs object that can be passed as a parameter to
  6927 		one of the overloads the DSession::Send() and DSession::SendReceive() methods.
  6928 */
  6929 inline TIpcArgs& TIpcArgs::PinArgs(TBool aPinArg0, TBool aPinArg1, TBool aPinArg2, TBool aPinArg3)
  6930 	{
  6931 	__ASSERT_COMPILE(!((1 << ((KBitsPerType*KMaxMessageArguments)-1)) & KPinMask));
  6932 	if (aPinArg0)
  6933 		iFlags |= KPinArg0;
  6934 	if (aPinArg1)
  6935 		iFlags |= KPinArg1;
  6936 	if (aPinArg2)
  6937 		iFlags |= KPinArg2;
  6938 	if (aPinArg3)
  6939 		iFlags |= KPinArg3;
  6940 	return *this;
  6941 	}
  6942 
  6943 
  6944 inline TIpcArgs::TArgType TIpcArgs::Type(TNothing)
  6945 	{ return EUnspecified; }
  6946 inline TIpcArgs::TArgType TIpcArgs::Type(TInt)
  6947 	{ return EUnspecified; }
  6948 inline TIpcArgs::TArgType TIpcArgs::Type(const TAny*)
  6949 	{ return EUnspecified; }
  6950 inline TIpcArgs::TArgType TIpcArgs::Type(RHandleBase)
  6951 	{ return EHandle; }
  6952 inline TIpcArgs::TArgType TIpcArgs::Type(const TDesC8*)
  6953 	{ return EDesC8; }
  6954 #ifndef __KERNEL_MODE__
  6955 inline TIpcArgs::TArgType TIpcArgs::Type(const TDesC16*)
  6956 	{ return EDesC16; }
  6957 #endif
  6958 inline TIpcArgs::TArgType TIpcArgs::Type(TDes8*)
  6959 	{ return EDes8; }
  6960 #ifndef __KERNEL_MODE__
  6961 inline TIpcArgs::TArgType TIpcArgs::Type(TDes16*)
  6962 	{ return EDes16; }
  6963 #endif
  6964 inline void TIpcArgs::Assign(TInt&,TIpcArgs::TNothing)
  6965 	{}
  6966 inline void TIpcArgs::Assign(TInt& aArg,TInt aValue)
  6967 	{ aArg = aValue; }
  6968 inline void TIpcArgs::Assign(TInt& aArg,const TAny* aValue)
  6969 	{ aArg = (TInt)aValue; }
  6970 inline void TIpcArgs::Assign(TInt& aArg,RHandleBase aValue)
  6971 	{ aArg = (TInt)aValue.Handle(); }
  6972 inline void TIpcArgs::Assign(TInt& aArg,const TDesC8* aValue)
  6973 	{ aArg = (TInt)aValue; }
  6974 #ifndef __KERNEL_MODE__
  6975 inline void TIpcArgs::Assign(TInt& aArg,const TDesC16* aValue)
  6976 	{ aArg = (TInt)aValue; }
  6977 #endif
  6978 inline void TIpcArgs::Assign(TInt& aArg,TDes8* aValue)
  6979 	{ aArg = (TInt)aValue; }
  6980 #ifndef __KERNEL_MODE__
  6981 inline void TIpcArgs::Assign(TInt& aArg,TDes16* aValue)
  6982 	{ aArg = (TInt)aValue; }
  6983 #endif
  6984 
  6985 
  6986 
  6987 // Structures for passing 64 bit integers and doubles across GCC/EABI boundaries
  6988 
  6989 inline SInt64::SInt64()
  6990 	{}
  6991 
  6992 inline SInt64::SInt64(Int64 a)
  6993 	{
  6994 	iData[0] = (TUint32)((Uint64)a);
  6995 	iData[1] = (TUint32)(((Uint64)a)>>32);
  6996 	}
  6997 
  6998 inline SInt64& SInt64::operator=(Int64 a)
  6999 	{
  7000 	iData[0] = (TUint32)((Uint64)a);
  7001 	iData[1] = (TUint32)(((Uint64)a)>>32);
  7002 	return *this;
  7003 	}
  7004 
  7005 inline SInt64::operator Int64() const
  7006 	{
  7007 	Int64 x;
  7008 	TUint32* px = (TUint32*)&x;
  7009 	px[0] = iData[0];
  7010 	px[1] = iData[1];
  7011 	return x;
  7012 	}
  7013 
  7014 inline SUint64::SUint64()
  7015 	{}
  7016 
  7017 inline SUint64::SUint64(Uint64 a)
  7018 	{
  7019 	iData[0] = (TUint32)a;
  7020 	iData[1] = (TUint32)(a>>32);
  7021 	}
  7022 
  7023 inline SUint64& SUint64::operator=(Uint64 a)
  7024 	{
  7025 	iData[0] = (TUint32)a;
  7026 	iData[1] = (TUint32)(a>>32);
  7027 	return *this;
  7028 	}
  7029 
  7030 inline SUint64::operator Uint64() const
  7031 	{
  7032 	Uint64 x;
  7033 	TUint32* px = (TUint32*)&x;
  7034 	px[0] = iData[0];
  7035 	px[1] = iData[1];
  7036 	return x;
  7037 	}
  7038 
  7039 inline SDouble::SDouble()
  7040 	{}
  7041 
  7042 inline SDouble::SDouble(TReal a)
  7043 	{
  7044 	const TUint32* pa = (const TUint32*)&a;
  7045 #ifdef __DOUBLE_WORDS_SWAPPED__
  7046 	iData[0] = pa[1];
  7047 	iData[1] = pa[0];	// compiler puts MS word of double first
  7048 #else
  7049 	iData[0] = pa[0];
  7050 	iData[1] = pa[1];	// compiler puts MS word of double second
  7051 #endif
  7052 	}
  7053 
  7054 inline SDouble& SDouble::operator=(TReal a)
  7055 	{
  7056 	new (this) SDouble(a);
  7057 	return *this;
  7058 	}
  7059 
  7060 inline SDouble::operator TReal() const
  7061 	{
  7062 	TReal x;
  7063 	TUint32* px = (TUint32*)&x;
  7064 #ifdef __DOUBLE_WORDS_SWAPPED__
  7065 	px[1] = iData[0];
  7066 	px[0] = iData[1];	// compiler puts MS word of double first
  7067 #else
  7068 	px[0] = iData[0];
  7069 	px[1] = iData[1];	// compiler puts MS word of double second
  7070 #endif
  7071 	return x;
  7072 	}
  7073 
  7074 //
  7075 // TSecureId
  7076 //
  7077 
  7078 /** Default constructor. This leaves the object in an undefined state */
  7079 inline TSecureId::TSecureId()
  7080 	{}
  7081 
  7082 /** Construct 'this' using a TUint32
  7083 @param aId The value for the ID */
  7084 inline TSecureId::TSecureId(TUint32 aId)
  7085 	: iId(aId) {}
  7086 
  7087 /** Convert 'this' into a TUint32
  7088 */
  7089 inline TSecureId::operator TUint32() const
  7090 	{ return iId; }
  7091 
  7092 /** Construct 'this' using a TUid
  7093 @param aId The value for the ID */
  7094 inline TSecureId::TSecureId(TUid aId)
  7095 	: iId(aId.iUid) {}
  7096 
  7097 /** Convert 'this' into a TUid
  7098 */
  7099 inline TSecureId::operator TUid() const
  7100 	{ return (TUid&)iId; }
  7101 
  7102 //
  7103 // SSecureId
  7104 //
  7105 inline const TSecureId* SSecureId::operator&() const
  7106 	{ return (const TSecureId*)this; }
  7107 inline SSecureId::operator const TSecureId&() const
  7108 	{ /* coverity[return_local_addr] */ return (const TSecureId&)iId; }
  7109 inline SSecureId::operator TUint32() const
  7110 	{ return iId; }
  7111 inline SSecureId::operator TUid() const
  7112 	{ return (TUid&)iId; }
  7113 
  7114 //
  7115 // TVendorId
  7116 //
  7117 
  7118 /** Default constructor which leaves the object in an undefined state */
  7119 inline TVendorId::TVendorId()
  7120 	{}
  7121 
  7122 /** Construct 'this' using a TUint32
  7123 @param aId The value for the ID */
  7124 inline TVendorId::TVendorId(TUint32 aId)
  7125 	: iId(aId) {}
  7126 
  7127 /** Convert 'this' into a TUint32
  7128 */
  7129 inline TVendorId::operator TUint32() const
  7130 	{ return iId; }
  7131 
  7132 /** Construct 'this' using a TUid
  7133 @param aId The value for the ID */
  7134 inline TVendorId::TVendorId(TUid aId)
  7135 	: iId(aId.iUid) {}
  7136 
  7137 /** Convert 'this' into a TUid
  7138 */
  7139 inline TVendorId::operator TUid() const
  7140 	{ return (TUid&)iId; }
  7141 
  7142 //
  7143 // SSecureId
  7144 //
  7145 inline const TVendorId* SVendorId::operator&() const
  7146 	{ return (const TVendorId*)this; }
  7147 inline SVendorId::operator const TVendorId&() const
  7148 	{ /* coverity[return_local_addr] */ return (const TVendorId&)iId; }
  7149 inline SVendorId::operator TUint32() const
  7150 	{ return iId; }
  7151 inline SVendorId::operator TUid() const
  7152 	{ return (TUid&)iId; }
  7153 
  7154 //
  7155 // TSharedChunkBufConfigBase
  7156 // 
  7157 inline TSharedChunkBufConfigBase::TSharedChunkBufConfigBase()
  7158 	{memset(this,0,sizeof(TSharedChunkBufConfigBase));}
  7159 
  7160 /**
  7161 Default constructor. This leaves the set in an undefned state.
  7162 */
  7163 inline TCapabilitySet::TCapabilitySet()
  7164 	{}
  7165 
  7166 /**
  7167 Construct a set consisting of a single capability.
  7168 @param aCapability The single capability
  7169 */
  7170 inline TCapabilitySet::TCapabilitySet(TCapability aCapability)
  7171 	{ new (this) TCapabilitySet(aCapability, aCapability); }
  7172 
  7173 /**
  7174 Make this set consist of a single capability.
  7175 @param aCapability The single capability.
  7176 */
  7177 inline void TCapabilitySet::Set(TCapability aCapability)
  7178 	{ new (this) TCapabilitySet(aCapability, aCapability); }
  7179 
  7180 /**
  7181 Make this set consist of two capabilities.
  7182 @param aCapability1 The first capability.
  7183 @param aCapability2 The second capability.
  7184 */
  7185 inline void TCapabilitySet::Set(TCapability aCapability1, TCapability aCapability2)
  7186 	{ new (this) TCapabilitySet(aCapability1, aCapability2); }
  7187 
  7188 
  7189 /**
  7190 Default constructor. This leaves the object in an undefned state.
  7191 */
  7192 inline TSecurityInfo::TSecurityInfo()
  7193 	{}
  7194 
  7195 /** Constructs a TSecurityPolicy that will always fail, irrespective of the
  7196 checked object's attributes.
  7197 */
  7198 inline TSecurityPolicy::TSecurityPolicy()
  7199 	{ new (this) TSecurityPolicy(EAlwaysFail); }
  7200 
  7201 /**
  7202 'Address of' operator which generates a TSecurityPolicy*
  7203 @return A pointer of type TSecurityPolicy which refers to this object
  7204 */
  7205 inline const TSecurityPolicy* TStaticSecurityPolicy::operator&() const
  7206 	{ return (const TSecurityPolicy*)this; }
  7207 
  7208 /**
  7209 'Reference of' operator which generates a TSecurityPolicy&
  7210 @return A reference of type TSecurityPolicy which refers to this object
  7211 */
  7212 inline TStaticSecurityPolicy::operator const TSecurityPolicy&() const
  7213 	{ return *(const TSecurityPolicy*)this; }
  7214 
  7215 /**
  7216 A method to explicity generate a TSecurityPolicy reference.
  7217 @return A reference of type TSecurityPolicy which refers to this object
  7218 */
  7219 inline const TSecurityPolicy& TStaticSecurityPolicy::operator()() const
  7220 	{ return *(const TSecurityPolicy*)this; }
  7221 
  7222 #ifdef __KERNEL_MODE__
  7223 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
  7224 
  7225 /** Checks this policy against the platform security attributes of aProcess.
  7226 
  7227 	When a check fails the action taken is determined by the system wide Platform Security
  7228 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
  7229 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
  7230 	check failed.
  7231 
  7232 @param aProcess The DProcess object to check against this TSecurityPolicy.
  7233 @param aDiagnostic A string that will be emitted along with any diagnostic message
  7234 							that may be issued if the policy check fails.
  7235 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
  7236 							which enables it to be easily removed from the system.
  7237 @return ETrue if all the requirements of this TSecurityPolicy are met by the
  7238 platform security attributes of aProcess, EFalse otherwise.
  7239 @panic KERN-COMMON 190 if 'this' is an invalid SSecurityInfo object
  7240 */
  7241 inline TBool TSecurityPolicy::CheckPolicy(DProcess* aProcess, const char* aDiagnostic) const
  7242 	{
  7243 	return DoCheckPolicy(aProcess, aDiagnostic);
  7244 	}
  7245 
  7246 /** Checks this policy against the platform security attributes of the process
  7247 owning aThread.
  7248 
  7249 	When a check fails the action taken is determined by the system wide Platform Security
  7250 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
  7251 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
  7252 	check failed.
  7253 
  7254 @param aThread The thread whose owning process' platform security attributes
  7255 are to be checked against this TSecurityPolicy.
  7256 @param aDiagnostic A string that will be emitted along with any diagnostic message
  7257 							that may be issued if the policy check fails.
  7258 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
  7259 							which enables it to be easily removed from the system.
  7260 @return ETrue if all the requirements of this TSecurityPolicy are met by the
  7261 platform security parameters of the owning process of aThread, EFalse otherwise.
  7262 @panic KERN-COMMON 190 if 'this' is an invalid SSecurityInfo object
  7263 */
  7264 inline TBool TSecurityPolicy::CheckPolicy(DThread* aThread, const char* aDiagnostic) const
  7265 	{
  7266 	return DoCheckPolicy(aThread, aDiagnostic);
  7267 	}
  7268 
  7269 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
  7270 
  7271 /** Checks this policy against the platform security attributes of aProcess.
  7272 
  7273 	When a check fails the action taken is determined by the system wide Platform Security
  7274 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
  7275 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
  7276 	check failed.
  7277 
  7278 @param aProcess The DProcess object to check against this TSecurityPolicy.
  7279 @param aDiagnostic A string that will be emitted along with any diagnostic message
  7280 							that may be issued if the policy check fails.
  7281 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
  7282 							which enables it to be easily removed from the system.
  7283 @return ETrue if all the requirements of this TSecurityPolicy are met by the
  7284 platform security attributes of aProcess, EFalse otherwise.
  7285 @panic KERN-COMMON 190 if 'this' is an invalid SSecurityInfo object
  7286 */
  7287 inline TBool TSecurityPolicy::CheckPolicy(DProcess* aProcess, OnlyCreateWithNull /*aDiagnostic*/) const
  7288 	{
  7289 	return DoCheckPolicy(aProcess);
  7290 	}
  7291 
  7292 /** Checks this policy against the platform security attributes of the process
  7293 owning aThread.
  7294 
  7295 	When a check fails the action taken is determined by the system wide Platform Security
  7296 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
  7297 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
  7298 	check failed.
  7299 
  7300 @param aThread The thread whose owning process' platform security attributes
  7301 are to be checked against this TSecurityPolicy.
  7302 @param aDiagnostic A string that will be emitted along with any diagnostic message
  7303 							that may be issued if the policy check fails.
  7304 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
  7305 							which enables it to be easily removed from the system.
  7306 @return ETrue if all the requirements of this TSecurityPolicy are met by the
  7307 platform security parameters of the owning process of aThread, EFalse otherwise.
  7308 @panic KERN-COMMON 190 if 'this' is an invalid SSecurityInfo object
  7309 */
  7310 inline TBool TSecurityPolicy::CheckPolicy(DThread* aThread, OnlyCreateWithNull /*aDiagnostic*/) const
  7311 	{
  7312 	return DoCheckPolicy(aThread);
  7313 	}
  7314 
  7315 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
  7316 #endif // __KERNEL_MODE__