realtimenetprots/sipfw/ProfileAgent/Profile/Src/extensionboolparam.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2006-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 "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 // Name        : extensionboolparam.cpp
       
    15 // Part of     : SIP Profile
       
    16 // implementation
       
    17 // Version     : 1.0
       
    18 // INCLUDE FILES
       
    19 //
       
    20 
       
    21 
       
    22 
       
    23 #include "extensionboolparam.h"
       
    24  
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // TExtensionBoolParam::TExtensionBoolParam
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 TExtensionBoolParam::TExtensionBoolParam() : iID(0), iValue(EFalse)
       
    32 	{	
       
    33 	}
       
    34 	
       
    35 // -----------------------------------------------------------------------------
       
    36 // TExtensionBoolParam::TExtensionBoolParam
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 TExtensionBoolParam::TExtensionBoolParam(const TExtensionBoolParam& aParam) :
       
    40 	iID(aParam.ID()),
       
    41 	iValue(aParam.Value())
       
    42 	{		
       
    43 	}
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // TExtensionBoolParam::TExtensionBoolParam
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 TExtensionBoolParam::TExtensionBoolParam(TUint32 aID, TBool aValue) :
       
    50 	iID(aID),
       
    51 	iValue(aValue)
       
    52 	{
       
    53 	}
       
    54 
       
    55 // -----------------------------------------------------------------------------
       
    56 // TExtensionBoolParam::InternalizeL
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 TExtensionBoolParam TExtensionBoolParam::InternalizeL(RReadStream& aReadStream)
       
    60 	{
       
    61 	TUint32 id = aReadStream.ReadUint32L();
       
    62 	TBool value = aReadStream.ReadUint8L();
       
    63 
       
    64 	return TExtensionBoolParam(id, value);	
       
    65 	}
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 // TExtensionBoolParam::ExternalizeL
       
    69 // Boolean value fits in 8-bit 
       
    70 // -----------------------------------------------------------------------------
       
    71 //
       
    72 void TExtensionBoolParam::ExternalizeL(RWriteStream& aWriteStream) const
       
    73 	{
       
    74 	aWriteStream.WriteUint32L(iID);
       
    75 	aWriteStream.WriteUint8L(iValue);	
       
    76 	}
       
    77 
       
    78 // -----------------------------------------------------------------------------
       
    79 // TExtensionBoolParam::ExternalizedSizeL
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 TUint TExtensionBoolParam::ExternalizedSizeL() const
       
    83 	{
       
    84 	return sizeof(iID) + sizeof(TUint8);
       
    85 	}
       
    86 
       
    87 // -----------------------------------------------------------------------------
       
    88 // TExtensionBoolParam::operator==
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 TBool TExtensionBoolParam::operator==(const TExtensionBoolParam& aParam) const
       
    92 	{
       
    93 	return (ID() == aParam.ID()) && (Value() == aParam.Value());
       
    94 	}
       
    95 		
       
    96 // -----------------------------------------------------------------------------
       
    97 // TExtensionBoolParam::ID
       
    98 // -----------------------------------------------------------------------------
       
    99 //
       
   100 TUint32 TExtensionBoolParam::ID() const
       
   101 	{
       
   102 	return iID;
       
   103 	}
       
   104 
       
   105 // -----------------------------------------------------------------------------
       
   106 // TExtensionBoolParam::Value
       
   107 // -----------------------------------------------------------------------------
       
   108 //		
       
   109 TBool TExtensionBoolParam::Value() const
       
   110 	{
       
   111 	return iValue;
       
   112 	}