sysstatemgmt/systemstatemgr/cmn/src/ssmstatetransition.cpp
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2007-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 //
       
    15 
       
    16 #include <ssm/ssmstatetransition.h>
       
    17 
       
    18 EXPORT_C TSsmStateTransition::TSsmStateTransition()
       
    19 	: iState(0,0), iReason(0)
       
    20 	{
       
    21 	}
       
    22 
       
    23 /**
       
    24 @param aState	The target system state.
       
    25 @param aReason	A parameter interpreted by the System State Policy DLL implementation.
       
    26 */
       
    27 EXPORT_C TSsmStateTransition::TSsmStateTransition(TSsmState aState, TInt aReason)
       
    28 	: iState(aState), iReason(aReason)
       
    29 	{
       
    30 	} //lint !e1746 Suppress parameter 'aState' could be made const reference
       
    31 
       
    32 /**
       
    33 @param aMainState The target major state.
       
    34 @param aSubState The target sub state.
       
    35 @param aReason	A parameter interpreted by the System State Policy DLL implemtation.
       
    36 */
       
    37 EXPORT_C TSsmStateTransition::TSsmStateTransition(TUint16 aMainState, TUint16 aSubState, TInt aReason)
       
    38 	: iState(aMainState,aSubState), iReason(aReason)
       
    39 	{
       
    40 	}
       
    41 
       
    42 /**
       
    43  Copy constructor
       
    44  */
       
    45 EXPORT_C TSsmStateTransition::TSsmStateTransition(const TSsmStateTransition& aRequest)
       
    46 	: iState(aRequest.iState), iReason(aRequest.iReason)
       
    47 	{
       
    48 	}
       
    49 
       
    50 /**
       
    51  Accessor for the System State attribute
       
    52  @return A copy of the iState attribute in this object
       
    53  */
       
    54 EXPORT_C TSsmState TSsmStateTransition::State() const
       
    55 	{
       
    56 	return iState;
       
    57 	}
       
    58 
       
    59 /**
       
    60  Accessor for the Reason attribute
       
    61  @return A copy of the iReason attribute in this object
       
    62  */
       
    63 EXPORT_C TInt TSsmStateTransition::Reason() const
       
    64 	{
       
    65 	return iReason;
       
    66 	}
       
    67 
       
    68 /**
       
    69 @param aRequest The value to be assigned to this object.
       
    70 @return A reference to this object.
       
    71 */
       
    72 EXPORT_C TSsmStateTransition& TSsmStateTransition::operator=(const TSsmStateTransition& aRequest)
       
    73 	{
       
    74 	// protect against self assignment
       
    75 	if( &aRequest == this)
       
    76 		{
       
    77 		return(*this);
       
    78 		}
       
    79 		
       
    80 	// do assigment
       
    81 	iState = aRequest.iState;
       
    82 	iReason = aRequest.iReason;	
       
    83 	
       
    84 	return(*this);
       
    85 	}
       
    86 
       
    87 /**
       
    88 @param aRequest The value to be compared.
       
    89 @return True, if the values are equal; false otherwise.
       
    90 */
       
    91 EXPORT_C TBool TSsmStateTransition::operator==(const TSsmStateTransition& aRequest) const
       
    92 	{
       
    93 	return ((iState==aRequest.iState) && (iReason==aRequest.iReason));	
       
    94 	}
       
    95 
       
    96 /**
       
    97 @param aRequest The value to be compared.
       
    98 @return True, if the values are not equal; false otherwise.
       
    99 */
       
   100 EXPORT_C TBool TSsmStateTransition::operator!=(const TSsmStateTransition& aRequest) const
       
   101 	{
       
   102 		return !(*this == aRequest);
       
   103 	}