epoc32/include/e32cmn.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:
  2960 	{}
  2960 	{}
  2961 #endif
  2961 #endif
  2962 
  2962 
  2963 
  2963 
  2964 
  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 
  2965 
  2999 
  2966 // Class TFindHandle
  3000 // Class TFindHandle
  2967 inline TFindHandle::TFindHandle()
  3001 inline TFindHandle::TFindHandle()
  2968 	: iHandle(0), iSpare1(0), iObjectIdLow(0), iObjectIdHigh(0)
  3002 	: iHandle(0), iSpare1(0), iObjectIdLow(0), iObjectIdHigh(0)
  2969 	{}
  3003 	{}
  3184 	{}
  3218 	{}
  3185 
  3219 
  3186 
  3220 
  3187 
  3221 
  3188 
  3222 
       
  3223 /**
       
  3224 Default constructor.
       
  3225 */
       
  3226 inline RReadWriteLock::RReadWriteLock()
       
  3227 	: iValues(0), iPriority(EAlternatePriority), iReaderSem(), iWriterSem()
       
  3228 	{}
       
  3229 
       
  3230 
       
  3231 
       
  3232 
  3189 // Class RMessagePtr2
  3233 // Class RMessagePtr2
  3190 
  3234 
  3191 
  3235 
  3192 /**
  3236 /**
  3193 Default constructor
  3237 Default constructor
  3231 
  3275 
  3232 /**
  3276 /**
  3233 Default constructor
  3277 Default constructor
  3234 */
  3278 */
  3235 inline RMessage2::RMessage2()
  3279 inline RMessage2::RMessage2()
       
  3280 	:iFunction(0), iSpare1(0), iSessionPtr(NULL), iFlags(0), iSpare3(0)
  3236 	{}
  3281 	{}
  3237 
  3282 
  3238 
  3283 
  3239 
  3284 
  3240 
  3285 
  3470 
  3515 
  3471 
  3516 
  3472 
  3517 
  3473 // Class TIdentityRelation<T>
  3518 // Class TIdentityRelation<T>
  3474 template <class T>
  3519 template <class T>
       
  3520 inline TIdentityRelation<T>::TIdentityRelation()
       
  3521 /**
       
  3522 Constructs the object to use the equality operator (==) defined for class T
       
  3523 to determine whether two class T type objects match.
       
  3524 */
       
  3525 	{iIdentity=(TGeneralIdentityRelation)&EqualityOperatorCompare;}
       
  3526 
       
  3527 
       
  3528 
       
  3529 
       
  3530 template <class T>
  3475 inline TIdentityRelation<T>::TIdentityRelation( TBool (*anIdentity)(const T&, const T&) )
  3531 inline TIdentityRelation<T>::TIdentityRelation( TBool (*anIdentity)(const T&, const T&) )
  3476 /**
  3532 /**
  3477 Constructs the object taking the specified function as an argument.
  3533 Constructs the object taking the specified function as an argument.
  3478 
  3534 
  3479 The specified function should implement an algorithm for determining whether
  3535 The specified function should implement an algorithm for determining whether
  3497 Operator that gets the function that determines whether two
  3553 Operator that gets the function that determines whether two
  3498 objects of a given class type match.
  3554 objects of a given class type match.
  3499 */
  3555 */
  3500 	{ return iIdentity; }
  3556 	{ return iIdentity; }
  3501 
  3557 
       
  3558 
       
  3559 
       
  3560 template <class T>
       
  3561 inline TBool TIdentityRelation<T>::EqualityOperatorCompare(const T& aLeft, const T& aRight)
       
  3562 /**
       
  3563 Compares two objects of class T using the equality operator defined for class T.
       
  3564 */
       
  3565 	{return aLeft == aRight;}
  3502 
  3566 
  3503 
  3567 
  3504 
  3568 
  3505 // Class TLinearOrder<T>
  3569 // Class TLinearOrder<T>
  3506 template <class T>
  3570 template <class T>
  5061 a sequential search.
  5125 a sequential search.
  5062 
  5126 
  5063 Matching is based on the comparison of a TInt value at the key offset position 
  5127 Matching is based on the comparison of a TInt value at the key offset position 
  5064 within the objects.
  5128 within the objects.
  5065 
  5129 
       
  5130 For classes which define their own equality operator (==), the alternative method
       
  5131 Find(const T& anEntry, TIdentityRelation<T> anIdentity) is recommended.
       
  5132 
  5066 The find operation always starts at the low index end of the array. There 
  5133 The find operation always starts at the low index end of the array. There 
  5067 is no assumption about the order of objects in the array.
  5134 is no assumption about the order of objects in the array.
  5068 
  5135 
  5069 @param anEntry A reference to an object of type class T to be used for matching.
  5136 @param anEntry A reference to an object of type class T to be used for matching.
  5070 
  5137 
  5082 Finds the first object in the array which matches the specified object using 
  5149 Finds the first object in the array which matches the specified object using 
  5083 a sequential search and a matching algorithm.
  5150 a sequential search and a matching algorithm.
  5084 
  5151 
  5085 The algorithm for determining whether two class T type objects match is provided 
  5152 The algorithm for determining whether two class T type objects match is provided 
  5086 by a function supplied by the caller.
  5153 by a function supplied by the caller.
       
  5154 
       
  5155 Such a function need not be supplied if an equality operator (==) is defined for class T. 
       
  5156 In this case, default construction of anIdentity provides matching, as in the example below:
       
  5157 
       
  5158 @code
       
  5159 //Construct a TPoint and append to an RArray<TPoint>
       
  5160 TPoint p1(0,0);
       
  5161 RArray<TPoint> points;
       
  5162 points.AppendL(p1);
       
  5163 //Find position of p1 in points using TIdentityRelation<TPoint> default construction
       
  5164 TInt r = points.Find(p1, TIdentityRelation<TPoint>());
       
  5165 @endcode
  5087 
  5166 
  5088 The find operation always starts at the low index end of the array. There 
  5167 The find operation always starts at the low index end of the array. There 
  5089 is no assumption about the order of objects in the array.
  5168 is no assumption about the order of objects in the array.
  5090 
  5169 
  5091 @param anEntry    A reference to an object of type class T to be used
  5170 @param anEntry    A reference to an object of type class T to be used
  5108 a sequential search.
  5187 a sequential search.
  5109 
  5188 
  5110 Matching is based on the comparison of a TInt value at the key offset position 
  5189 Matching is based on the comparison of a TInt value at the key offset position 
  5111 within the objects.
  5190 within the objects.
  5112 
  5191 
       
  5192 For classes which define their own equality operator (==), the alternative method
       
  5193 FindReverse(const T& anEntry, TIdentityRelation<T> anIdentity) is recommended.
       
  5194 
  5113 The find operation always starts at the high index end of the array. There 
  5195 The find operation always starts at the high index end of the array. There 
  5114 is no assumption about the order of objects in the array.
  5196 is no assumption about the order of objects in the array.
  5115 
  5197 
  5116 @param anEntry A reference to an object of type class T to be used for matching.
  5198 @param anEntry A reference to an object of type class T to be used for matching.
  5117 
  5199 
  5129 Finds the last object in the array which matches the specified object using 
  5211 Finds the last object in the array which matches the specified object using 
  5130 a sequential search and a matching algorithm.
  5212 a sequential search and a matching algorithm.
  5131 
  5213 
  5132 The algorithm for determining whether two class T type objects match is provided 
  5214 The algorithm for determining whether two class T type objects match is provided 
  5133 by a function supplied by the caller.
  5215 by a function supplied by the caller.
       
  5216 
       
  5217 Such a function need not be supplied if an equality operator (==) is defined for class T. 
       
  5218 In this case, default construction of anIdentity provides matching.
       
  5219 
       
  5220 See Find(const T& anEntry, TIdentityRelation<T> anIdentity) for more details.
  5134 
  5221 
  5135 The find operation always starts at the high index end of the array. There 
  5222 The find operation always starts at the high index end of the array. There 
  5136 is no assumption about the order of objects in the array.
  5223 is no assumption about the order of objects in the array.
  5137 
  5224 
  5138 @param anEntry    A reference to an object of type class T to be used
  5225 @param anEntry    A reference to an object of type class T to be used
  6813 	}
  6900 	}
  6814 
  6901 
  6815 #endif
  6902 #endif
  6816 
  6903 
  6817 
  6904 
       
  6905 /**
       
  6906 Allows the client to specify whether each argument of the TIpcArgs object will
       
  6907 be pinned before being sent to the server.
       
  6908 
       
  6909 To pin all the arguments in the TIpcArgs object pass no parameters to this
       
  6910 method.
       
  6911 
       
  6912 @return A reference to this TIpcArgs object that can be passed as a parameter to
       
  6913 		one of the overloads the DSession::Send() and DSession::SendReceive() methods.
       
  6914 */
       
  6915 inline TIpcArgs& TIpcArgs::PinArgs(TBool aPinArg0, TBool aPinArg1, TBool aPinArg2, TBool aPinArg3)
       
  6916 	{
       
  6917 	__ASSERT_COMPILE(!((1 << ((KBitsPerType*KMaxMessageArguments)-1)) & KPinMask));
       
  6918 	if (aPinArg0)
       
  6919 		iFlags |= KPinArg0;
       
  6920 	if (aPinArg1)
       
  6921 		iFlags |= KPinArg1;
       
  6922 	if (aPinArg2)
       
  6923 		iFlags |= KPinArg2;
       
  6924 	if (aPinArg3)
       
  6925 		iFlags |= KPinArg3;
       
  6926 	return *this;
       
  6927 	}
  6818 
  6928 
  6819 
  6929 
  6820 inline TIpcArgs::TArgType TIpcArgs::Type(TNothing)
  6930 inline TIpcArgs::TArgType TIpcArgs::Type(TNothing)
  6821 	{ return EUnspecified; }
  6931 	{ return EUnspecified; }
  6822 inline TIpcArgs::TArgType TIpcArgs::Type(TInt)
  6932 inline TIpcArgs::TArgType TIpcArgs::Type(TInt)
  6979 // SSecureId
  7089 // SSecureId
  6980 //
  7090 //
  6981 inline const TSecureId* SSecureId::operator&() const
  7091 inline const TSecureId* SSecureId::operator&() const
  6982 	{ return (const TSecureId*)this; }
  7092 	{ return (const TSecureId*)this; }
  6983 inline SSecureId::operator const TSecureId&() const
  7093 inline SSecureId::operator const TSecureId&() const
  6984 	{ return (const TSecureId&)iId; }
  7094 	{ /* coverity[return_local_addr] */ return (const TSecureId&)iId; }
  6985 inline SSecureId::operator TUint32() const
  7095 inline SSecureId::operator TUint32() const
  6986 	{ return iId; }
  7096 	{ return iId; }
  6987 inline SSecureId::operator TUid() const
  7097 inline SSecureId::operator TUid() const
  6988 	{ return (TUid&)iId; }
  7098 	{ return (TUid&)iId; }
  6989 
  7099 
  7019 // SSecureId
  7129 // SSecureId
  7020 //
  7130 //
  7021 inline const TVendorId* SVendorId::operator&() const
  7131 inline const TVendorId* SVendorId::operator&() const
  7022 	{ return (const TVendorId*)this; }
  7132 	{ return (const TVendorId*)this; }
  7023 inline SVendorId::operator const TVendorId&() const
  7133 inline SVendorId::operator const TVendorId&() const
  7024 	{ return (const TVendorId&)iId; }
  7134 	{ /* coverity[return_local_addr] */ return (const TVendorId&)iId; }
  7025 inline SVendorId::operator TUint32() const
  7135 inline SVendorId::operator TUint32() const
  7026 	{ return iId; }
  7136 	{ return iId; }
  7027 inline SVendorId::operator TUid() const
  7137 inline SVendorId::operator TUid() const
  7028 	{ return (TUid&)iId; }
  7138 	{ return (TUid&)iId; }
  7029 
  7139