epoc32/include/e32std.inl
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
   117 	{ memclr(aTrg, aLength); }
   117 	{ memclr(aTrg, aLength); }
   118 
   118 
   119 
   119 
   120 
   120 
   121 
   121 
   122 #ifndef __GCC32__
   122 #if !(defined(__GCC32__) && defined(__MARM__))
   123 inline TInt Mem::Compare(const TUint8* aLeft, TInt aLeftL, const TUint8* aRight, TInt aRightL)
   123 inline TInt Mem::Compare(const TUint8* aLeft, TInt aLeftL, const TUint8* aRight, TInt aRightL)
   124 /**
   124 /**
   125 Compares a block of data at one specified location with a block of data at 
   125 Compares a block of data at one specified location with a block of data at 
   126 another specified location.
   126 another specified location.
   127 
   127 
  2391 
  2391 
  2392 // Class TLocale
  2392 // Class TLocale
  2393 inline TLocale::TLocale(TInt)
  2393 inline TLocale::TLocale(TInt)
  2394 	{}
  2394 	{}
  2395 
  2395 
       
  2396 inline TInt TLocale::RegionCode() const
       
  2397 	{return(iRegionCode);}
  2396 inline TInt TLocale::CountryCode() const
  2398 inline TInt TLocale::CountryCode() const
  2397 /**
  2399 /**
  2398 Gets the code which is used to select country-specific locale data.
  2400 Gets the code which is used to select country-specific locale data.
  2399 
  2401 
  2400 The country code is the code used as the international dialling prefix.
  2402 The country code is the code used as the international dialling prefix.
  3201    	{
  3203    	{
  3202    	iDeviceTimeState=aState;
  3204    	iDeviceTimeState=aState;
  3203    	}
  3205    	}
  3204    
  3206    
  3205 
  3207 
       
  3208 /**
       
  3209 Get the pointer to the TLocale object contained in this extended locale.
       
  3210 
       
  3211 @return Pointer to the TLocale object. 
       
  3212 */
  3206 inline TLocale*	TExtendedLocale::GetLocale()
  3213 inline TLocale*	TExtendedLocale::GetLocale()
  3207 	{ return &iLocale; }
  3214 	{ return &iLocale; }
  3208 
  3215 
  3209 
  3216 
  3210 /**
  3217 /**
  3550 
  3557 
  3551 
  3558 
  3552 // Class RCriticalSection
  3559 // Class RCriticalSection
  3553 inline TBool RCriticalSection::IsBlocked() const
  3560 inline TBool RCriticalSection::IsBlocked() const
  3554 /**
  3561 /**
  3555 Tests whether the critical section is occupied by another thread.
  3562 Tests whether the critical section is occupied by any thread.
  3556 
  3563 
  3557 @return True, if the critical section is occupied by another thread. False, 
  3564 @return True, if the critical section is occupied by another thread. False, 
  3558         otherwise.
  3565         otherwise.
  3559 */
  3566 */
  3560 	{return(iBlocked!=1);}
  3567 	{return(iBlocked!=1);}
  5003 	}
  5010 	}
  5004 
  5011 
  5005 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
  5012 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
  5006 
  5013 
  5007 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
  5014 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  5015 
       
  5016 
       
  5017 inline const TAny* User::LeaveIfNull(const TAny* aPtr)
       
  5018 /**
       
  5019 Leaves with the reason code KErrNoMemory, if the specified pointer is NULL. 
       
  5020 
       
  5021 If the pointer is not NULL, the function simply returns with the value of 
       
  5022 the pointer.
       
  5023 
       
  5024 Used to check pointers to const objects.
       
  5025 
       
  5026 @param aPtr The pointer to be tested.
       
  5027 
       
  5028 @return If the function returns, the value of aPtr.
       
  5029 */
       
  5030 	{ return (const TAny*)LeaveIfNull((TAny*)aPtr); }
  5008 
  5031 
  5009 /** Sets this TSecurityInfo to the security attributes of this process. */
  5032 /** Sets this TSecurityInfo to the security attributes of this process. */
  5010 inline void TSecurityInfo::SetToCurrentInfo()
  5033 inline void TSecurityInfo::SetToCurrentInfo()
  5011 	{ new (this) TSecurityInfo(RProcess()); }
  5034 	{ new (this) TSecurityInfo(RProcess()); }
  5012 
  5035 
  6145 a sequential search.
  6168 a sequential search.
  6146 
  6169 
  6147 Matching is based on the comparison of a TInt value at the key offset position 
  6170 Matching is based on the comparison of a TInt value at the key offset position 
  6148 within the objects.
  6171 within the objects.
  6149 
  6172 
       
  6173 For classes which define their own equality operator (==), the alternative method
       
  6174 FindL(const T& anEntry, TIdentityRelation<T> anIdentity) is recommended.
       
  6175 
  6150 The find operation always starts at the low index end of the array. There 
  6176 The find operation always starts at the low index end of the array. There 
  6151 is no assumption about the order of objects in the array.
  6177 is no assumption about the order of objects in the array.
  6152 
  6178 
  6153 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
  6179 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
  6154 
  6180 
  6166 Finds the first object in the array which matches the specified object using 
  6192 Finds the first object in the array which matches the specified object using 
  6167 a sequential search and a matching algorithm.
  6193 a sequential search and a matching algorithm.
  6168 
  6194 
  6169 The algorithm for determining whether two class T type objects match is provided 
  6195 The algorithm for determining whether two class T type objects match is provided 
  6170 by a function supplied by the caller.
  6196 by a function supplied by the caller.
       
  6197 
       
  6198 Such a function need not be supplied if an equality operator (==) is defined for class T. 
       
  6199 In this case, default construction of anIdentity provides matching.
       
  6200 
       
  6201 See Find(const T& anEntry, TIdentityRelation<T> anIdentity) for more details.
  6171 
  6202 
  6172 The find operation always starts at the low index end of the array. There 
  6203 The find operation always starts at the low index end of the array. There 
  6173 is no assumption about the order of objects in the array.
  6204 is no assumption about the order of objects in the array.
  6174 
  6205 
  6175 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
  6206 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
  6192 a sequential search.
  6223 a sequential search.
  6193 
  6224 
  6194 Matching is based on the comparison of a TInt value at the key offset position 
  6225 Matching is based on the comparison of a TInt value at the key offset position 
  6195 within the objects.
  6226 within the objects.
  6196 
  6227 
       
  6228 For classes which define their own equality operator (==), the alternative method
       
  6229 FindReverseL(const T& anEntry, TIdentityRelation<T> anIdentity) is recommended.
       
  6230 
  6197 The find operation always starts at the high index end of the array. There 
  6231 The find operation always starts at the high index end of the array. There 
  6198 is no assumption about the order of objects in the array.
  6232 is no assumption about the order of objects in the array.
  6199 
  6233 
  6200 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
  6234 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
  6201 
  6235 
  6213 Finds the last object in the array which matches the specified object using 
  6247 Finds the last object in the array which matches the specified object using 
  6214 a sequential search and a matching algorithm.
  6248 a sequential search and a matching algorithm.
  6215 
  6249 
  6216 The algorithm for determining whether two class T type objects match is provided 
  6250 The algorithm for determining whether two class T type objects match is provided 
  6217 by a function supplied by the caller.
  6251 by a function supplied by the caller.
       
  6252 
       
  6253 Such a function need not be supplied if an equality operator (==) is defined for class T. 
       
  6254 In this case, default construction of anIdentity provides matching.
       
  6255 
       
  6256 See Find(const T& anEntry, TIdentityRelation<T> anIdentity) for more details.
  6218 
  6257 
  6219 The find operation always starts at the high index end of the array. There 
  6258 The find operation always starts at the high index end of the array. There 
  6220 is no assumption about the order of objects in the array.
  6259 is no assumption about the order of objects in the array.
  6221 
  6260 
  6222 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
  6261 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
  7222 inline void RArray<TUint>::ReserveL(TInt aCount)
  7261 inline void RArray<TUint>::ReserveL(TInt aCount)
  7223 	{ User::LeaveIfError(RPointerArrayBase::DoReserve(aCount)); }
  7262 	{ User::LeaveIfError(RPointerArrayBase::DoReserve(aCount)); }
  7224 
  7263 
  7225 
  7264 
  7226 
  7265 
       
  7266 // class TChunkHeapCreateInfo
       
  7267 /**
       
  7268 Sets single thread property of the chunk heap.
       
  7269 
       
  7270 This overrides any previous call to TChunkHeapCreateInfo::SetSingleThread()
       
  7271 for this TChunkHeapCreateInfo object.
       
  7272 
       
  7273 @param aSingleThread	ETrue when the chunk heap is to be single threaded,
       
  7274 						EFalse otherwise.
       
  7275 */
       
  7276 inline void TChunkHeapCreateInfo::SetSingleThread(const TBool aSingleThread)
       
  7277 	{
       
  7278 	iSingleThread = aSingleThread;
       
  7279 	}
       
  7280 
       
  7281 
       
  7282 /**
       
  7283 Sets alignment of the cells of the chunk heap to be created.
       
  7284 
       
  7285 This overrides any previous call to TChunkHeapCreateInfo::SetAlignment()
       
  7286 for this TChunkHeapCreateInfo object.
       
  7287 
       
  7288 @param aAlignment	The alignment of the heap cells.
       
  7289 */
       
  7290 inline void TChunkHeapCreateInfo::SetAlignment(TInt aAlign)
       
  7291 	{
       
  7292 	iAlign = aAlign;
       
  7293 	}
       
  7294 
       
  7295 
       
  7296 /**
       
  7297 Sets the increments to the size of the host chunk.  If the supplied value is 
       
  7298 less than KMinHeapGrowBy, it is discarded and the value KMinHeapGrowBy is 
       
  7299 used instead.
       
  7300 
       
  7301 This overrides any previous call to TChunkHeapCreateInfo::SetGrowBy()
       
  7302 for this TChunkHeapCreateInfo object.
       
  7303 
       
  7304 @param aGrowBy	The increment to the size of the host chunk.
       
  7305 */
       
  7306 inline void TChunkHeapCreateInfo::SetGrowBy(TInt aGrowBy)
       
  7307 	{
       
  7308 	iGrowBy = aGrowBy;
       
  7309 	}
       
  7310 
       
  7311 
       
  7312 /**
       
  7313 Sets the offset from the base of the host chunk to the start of the heap.
       
  7314 
       
  7315 This overrides any previous call to TChunkHeapCreateInfo::SetOffset()
       
  7316 for this TChunkHeapCreateInfo object.
       
  7317 
       
  7318 @param aOffset	The offset in bytes.
       
  7319 */
       
  7320 inline void TChunkHeapCreateInfo::SetOffset(TInt aOffset)
       
  7321 	{
       
  7322 	iOffset = aOffset;
       
  7323 	}
       
  7324 
       
  7325 
       
  7326 /**
       
  7327 Sets the mode flags of the chunk heap.
       
  7328 
       
  7329 This overrides any previous call to TChunkHeapCreateInfo::SetMode()
       
  7330 for this TChunkHeapCreateInfo object.
       
  7331 
       
  7332 @param aMode	The mode flags for the chunk heap to be created, this should be
       
  7333 				one or more of the values from TChunkHeapCreateMode.
       
  7334 */
       
  7335 inline void TChunkHeapCreateInfo::SetMode(TUint aMode)
       
  7336 	{
       
  7337 	iMode = aMode;
       
  7338 	}
       
  7339 
       
  7340 
       
  7341 /**
       
  7342 Sets the paging attribute of the chunk heap to be created.
       
  7343 
       
  7344 This overrides any previous call to TChunkHeapCreateInfo::SetPaging()
       
  7345 for this TChunkHeapCreateInfo object.
       
  7346 
       
  7347 @param aPaging	The paging attribute for the chunk heap to be created.
       
  7348 */
       
  7349 inline void TChunkHeapCreateInfo::SetPaging(const TChunkHeapPagingAtt aPaging)
       
  7350 	{
       
  7351 	iPaging = aPaging;
       
  7352 	}
       
  7353 
  7227 
  7354 
  7228 /**
  7355 /**
  7229 Sets the priority of the client's process.
  7356 Sets the priority of the client's process.
  7230 
  7357 
  7231 @param aPriority The priority value.
  7358 @param aPriority The priority value.
  7343 #endif // !__KERNEL_MODE__
  7470 #endif // !__KERNEL_MODE__
  7344 
  7471 
  7345 #ifdef __SUPPORT_CPP_EXCEPTIONS__
  7472 #ifdef __SUPPORT_CPP_EXCEPTIONS__
  7346 // The standard header file <exception> defines the following guard macro for EDG and CW, VC++, GCC respectively.
  7473 // The standard header file <exception> defines the following guard macro for EDG and CW, VC++, GCC respectively.
  7347 // The guard below is ugly. It will surely come back and bite us unless we resolve the whole issue of standard headers
  7474 // The guard below is ugly. It will surely come back and bite us unless we resolve the whole issue of standard headers
  7348 // when we move to supporting Standard C++. 
  7475 // when we move to supporting Standard C++.
  7349 #if !defined(_EXCEPTION) && !defined(_EXCEPTION_) && !defined(__EXCEPTION__)
  7476 
       
  7477 // The macro __SYMBIAN_STDCPP_SUPPORT__ is defined when building a StdC++ target.
       
  7478 // In this case, we wish to avoid defining uncaught_exception below since it clashes with the StdC++ specification 
       
  7479 #if !defined(_EXCEPTION) && !defined(_EXCEPTION_) && !defined(__EXCEPTION__) && !defined(__SYMBIAN_STDCPP_SUPPORT__)
  7350 
  7480 
  7351 #if defined(__VC32__) && !defined(_CRTIMP_PURE)
  7481 #if defined(__VC32__) && !defined(_CRTIMP_PURE)
  7352 
  7482 
  7353 	// Declare MS EH runtime functions
  7483 	// Declare MS EH runtime functions
  7354 	bool __uncaught_exception(void);
  7484 	bool __uncaught_exception(void);