epoc32/include/e32std.inl
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
     1.1 --- a/epoc32/include/e32std.inl	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/e32std.inl	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -1,9 +1,9 @@
     1.4  // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5  // All rights reserved.
     1.6  // This component and the accompanying materials are made available
     1.7 -// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.8 +// under the terms of the License "Eclipse Public License v1.0"
     1.9  // which accompanies this distribution, and is available
    1.10 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.12  //
    1.13  // Initial Contributors:
    1.14  // Nokia Corporation - initial contribution.
    1.15 @@ -119,7 +119,7 @@
    1.16  
    1.17  
    1.18  
    1.19 -#ifndef __GCC32__
    1.20 +#if !(defined(__GCC32__) && defined(__MARM__))
    1.21  inline TInt Mem::Compare(const TUint8* aLeft, TInt aLeftL, const TUint8* aRight, TInt aRightL)
    1.22  /**
    1.23  Compares a block of data at one specified location with a block of data at 
    1.24 @@ -2393,6 +2393,8 @@
    1.25  inline TLocale::TLocale(TInt)
    1.26  	{}
    1.27  
    1.28 +inline TInt TLocale::RegionCode() const
    1.29 +	{return(iRegionCode);}
    1.30  inline TInt TLocale::CountryCode() const
    1.31  /**
    1.32  Gets the code which is used to select country-specific locale data.
    1.33 @@ -3203,6 +3205,11 @@
    1.34     	}
    1.35     
    1.36  
    1.37 +/**
    1.38 +Get the pointer to the TLocale object contained in this extended locale.
    1.39 +
    1.40 +@return Pointer to the TLocale object. 
    1.41 +*/
    1.42  inline TLocale*	TExtendedLocale::GetLocale()
    1.43  	{ return &iLocale; }
    1.44  
    1.45 @@ -3552,7 +3559,7 @@
    1.46  // Class RCriticalSection
    1.47  inline TBool RCriticalSection::IsBlocked() const
    1.48  /**
    1.49 -Tests whether the critical section is occupied by another thread.
    1.50 +Tests whether the critical section is occupied by any thread.
    1.51  
    1.52  @return True, if the critical section is occupied by another thread. False, 
    1.53          otherwise.
    1.54 @@ -5006,6 +5013,22 @@
    1.55  
    1.56  #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
    1.57  
    1.58 +
    1.59 +inline const TAny* User::LeaveIfNull(const TAny* aPtr)
    1.60 +/**
    1.61 +Leaves with the reason code KErrNoMemory, if the specified pointer is NULL. 
    1.62 +
    1.63 +If the pointer is not NULL, the function simply returns with the value of 
    1.64 +the pointer.
    1.65 +
    1.66 +Used to check pointers to const objects.
    1.67 +
    1.68 +@param aPtr The pointer to be tested.
    1.69 +
    1.70 +@return If the function returns, the value of aPtr.
    1.71 +*/
    1.72 +	{ return (const TAny*)LeaveIfNull((TAny*)aPtr); }
    1.73 +
    1.74  /** Sets this TSecurityInfo to the security attributes of this process. */
    1.75  inline void TSecurityInfo::SetToCurrentInfo()
    1.76  	{ new (this) TSecurityInfo(RProcess()); }
    1.77 @@ -6147,6 +6170,9 @@
    1.78  Matching is based on the comparison of a TInt value at the key offset position 
    1.79  within the objects.
    1.80  
    1.81 +For classes which define their own equality operator (==), the alternative method
    1.82 +FindL(const T& anEntry, TIdentityRelation<T> anIdentity) is recommended.
    1.83 +
    1.84  The find operation always starts at the low index end of the array. There 
    1.85  is no assumption about the order of objects in the array.
    1.86  
    1.87 @@ -6169,6 +6195,11 @@
    1.88  The algorithm for determining whether two class T type objects match is provided 
    1.89  by a function supplied by the caller.
    1.90  
    1.91 +Such a function need not be supplied if an equality operator (==) is defined for class T. 
    1.92 +In this case, default construction of anIdentity provides matching.
    1.93 +
    1.94 +See Find(const T& anEntry, TIdentityRelation<T> anIdentity) for more details.
    1.95 +
    1.96  The find operation always starts at the low index end of the array. There 
    1.97  is no assumption about the order of objects in the array.
    1.98  
    1.99 @@ -6194,6 +6225,9 @@
   1.100  Matching is based on the comparison of a TInt value at the key offset position 
   1.101  within the objects.
   1.102  
   1.103 +For classes which define their own equality operator (==), the alternative method
   1.104 +FindReverseL(const T& anEntry, TIdentityRelation<T> anIdentity) is recommended.
   1.105 +
   1.106  The find operation always starts at the high index end of the array. There 
   1.107  is no assumption about the order of objects in the array.
   1.108  
   1.109 @@ -6216,6 +6250,11 @@
   1.110  The algorithm for determining whether two class T type objects match is provided 
   1.111  by a function supplied by the caller.
   1.112  
   1.113 +Such a function need not be supplied if an equality operator (==) is defined for class T. 
   1.114 +In this case, default construction of anIdentity provides matching.
   1.115 +
   1.116 +See Find(const T& anEntry, TIdentityRelation<T> anIdentity) for more details.
   1.117 +
   1.118  The find operation always starts at the high index end of the array. There 
   1.119  is no assumption about the order of objects in the array.
   1.120  
   1.121 @@ -7224,6 +7263,94 @@
   1.122  
   1.123  
   1.124  
   1.125 +// class TChunkHeapCreateInfo
   1.126 +/**
   1.127 +Sets single thread property of the chunk heap.
   1.128 +
   1.129 +This overrides any previous call to TChunkHeapCreateInfo::SetSingleThread()
   1.130 +for this TChunkHeapCreateInfo object.
   1.131 +
   1.132 +@param aSingleThread	ETrue when the chunk heap is to be single threaded,
   1.133 +						EFalse otherwise.
   1.134 +*/
   1.135 +inline void TChunkHeapCreateInfo::SetSingleThread(const TBool aSingleThread)
   1.136 +	{
   1.137 +	iSingleThread = aSingleThread;
   1.138 +	}
   1.139 +
   1.140 +
   1.141 +/**
   1.142 +Sets alignment of the cells of the chunk heap to be created.
   1.143 +
   1.144 +This overrides any previous call to TChunkHeapCreateInfo::SetAlignment()
   1.145 +for this TChunkHeapCreateInfo object.
   1.146 +
   1.147 +@param aAlignment	The alignment of the heap cells.
   1.148 +*/
   1.149 +inline void TChunkHeapCreateInfo::SetAlignment(TInt aAlign)
   1.150 +	{
   1.151 +	iAlign = aAlign;
   1.152 +	}
   1.153 +
   1.154 +
   1.155 +/**
   1.156 +Sets the increments to the size of the host chunk.  If the supplied value is 
   1.157 +less than KMinHeapGrowBy, it is discarded and the value KMinHeapGrowBy is 
   1.158 +used instead.
   1.159 +
   1.160 +This overrides any previous call to TChunkHeapCreateInfo::SetGrowBy()
   1.161 +for this TChunkHeapCreateInfo object.
   1.162 +
   1.163 +@param aGrowBy	The increment to the size of the host chunk.
   1.164 +*/
   1.165 +inline void TChunkHeapCreateInfo::SetGrowBy(TInt aGrowBy)
   1.166 +	{
   1.167 +	iGrowBy = aGrowBy;
   1.168 +	}
   1.169 +
   1.170 +
   1.171 +/**
   1.172 +Sets the offset from the base of the host chunk to the start of the heap.
   1.173 +
   1.174 +This overrides any previous call to TChunkHeapCreateInfo::SetOffset()
   1.175 +for this TChunkHeapCreateInfo object.
   1.176 +
   1.177 +@param aOffset	The offset in bytes.
   1.178 +*/
   1.179 +inline void TChunkHeapCreateInfo::SetOffset(TInt aOffset)
   1.180 +	{
   1.181 +	iOffset = aOffset;
   1.182 +	}
   1.183 +
   1.184 +
   1.185 +/**
   1.186 +Sets the mode flags of the chunk heap.
   1.187 +
   1.188 +This overrides any previous call to TChunkHeapCreateInfo::SetMode()
   1.189 +for this TChunkHeapCreateInfo object.
   1.190 +
   1.191 +@param aMode	The mode flags for the chunk heap to be created, this should be
   1.192 +				one or more of the values from TChunkHeapCreateMode.
   1.193 +*/
   1.194 +inline void TChunkHeapCreateInfo::SetMode(TUint aMode)
   1.195 +	{
   1.196 +	iMode = aMode;
   1.197 +	}
   1.198 +
   1.199 +
   1.200 +/**
   1.201 +Sets the paging attribute of the chunk heap to be created.
   1.202 +
   1.203 +This overrides any previous call to TChunkHeapCreateInfo::SetPaging()
   1.204 +for this TChunkHeapCreateInfo object.
   1.205 +
   1.206 +@param aPaging	The paging attribute for the chunk heap to be created.
   1.207 +*/
   1.208 +inline void TChunkHeapCreateInfo::SetPaging(const TChunkHeapPagingAtt aPaging)
   1.209 +	{
   1.210 +	iPaging = aPaging;
   1.211 +	}
   1.212 +
   1.213  
   1.214  /**
   1.215  Sets the priority of the client's process.
   1.216 @@ -7345,8 +7472,11 @@
   1.217  #ifdef __SUPPORT_CPP_EXCEPTIONS__
   1.218  // The standard header file <exception> defines the following guard macro for EDG and CW, VC++, GCC respectively.
   1.219  // The guard below is ugly. It will surely come back and bite us unless we resolve the whole issue of standard headers
   1.220 -// when we move to supporting Standard C++. 
   1.221 -#if !defined(_EXCEPTION) && !defined(_EXCEPTION_) && !defined(__EXCEPTION__)
   1.222 +// when we move to supporting Standard C++.
   1.223 +
   1.224 +// The macro __SYMBIAN_STDCPP_SUPPORT__ is defined when building a StdC++ target.
   1.225 +// In this case, we wish to avoid defining uncaught_exception below since it clashes with the StdC++ specification 
   1.226 +#if !defined(_EXCEPTION) && !defined(_EXCEPTION_) && !defined(__EXCEPTION__) && !defined(__SYMBIAN_STDCPP_SUPPORT__)
   1.227  
   1.228  #if defined(__VC32__) && !defined(_CRTIMP_PURE)
   1.229