sysstatemgmt/systemstateplugins/conditionevaluator/src/cndlogical.cpp
changeset 0 4e1aa6a622a0
child 7 1a73e8f1b64d
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 // Name        : resourcecondition.cpp
       
    15 // Part of     : System Startup / Condition
       
    16 // Implementation of ResourceCondition class
       
    17 // Version     : %version: 1 %
       
    18 // This material, including documentation and any related computer
       
    19 // programs, is protected by copyright controlled by Nokia.  All
       
    20 // rights are reserved.  Copying, including reproducing, storing,
       
    21 // adapting or translating, any or all of this material requires the
       
    22 // prior written consent of Nokia.  This material also contains
       
    23 // confidential information which may not be disclosed to others
       
    24 // without the prior written consent of Nokia.
       
    25 // Template version: 4.1
       
    26 // Nokia Core OS *
       
    27 // File renamed from resourcecondition.cpp to cndlogical.cpp as part of Core OS transfer.
       
    28 //
       
    29 
       
    30 
       
    31 
       
    32 #include "cndlogical.h"
       
    33 #include "ssmpanic.h"
       
    34 
       
    35 CLogicalNot::CLogicalNot(CConditionEvaluateBase* aExpr) : iExpr(aExpr)
       
    36     {
       
    37     }
       
    38 
       
    39 CLogicalNot::~CLogicalNot()
       
    40     {
       
    41     delete iExpr;
       
    42     }
       
    43 
       
    44 TBool CLogicalNot::EvaluateL() const
       
    45     {
       
    46     __ASSERT_DEBUG(NULL != iExpr, PanicNow(KPanicCLogicalNot, ENullPtr));
       
    47     TBool retVal = !(iExpr->EvaluateL());
       
    48     return retVal;
       
    49     }
       
    50 
       
    51 CLogicalAnd::CLogicalAnd(CConditionEvaluateBase* aLhs, CConditionEvaluateBase* aRhs)
       
    52   : iLhs(aLhs),
       
    53     iRhs(aRhs)
       
    54     {
       
    55     }
       
    56 
       
    57 CLogicalAnd::~CLogicalAnd()
       
    58     {
       
    59     delete iLhs;
       
    60     delete iRhs;
       
    61     }
       
    62 
       
    63 TBool CLogicalAnd::EvaluateL() const
       
    64     {
       
    65     __ASSERT_DEBUG(NULL != iLhs, PanicNow(KPanicCLogicalAnd, ENullPtr));
       
    66     __ASSERT_DEBUG(NULL != iRhs, PanicNow(KPanicCLogicalAnd, ENullPtr));
       
    67 
       
    68     TBool retVal = (iLhs->EvaluateL() && iRhs->EvaluateL());
       
    69     return retVal;
       
    70     }
       
    71 
       
    72 CLogicalOr::CLogicalOr(CConditionEvaluateBase* aLhs, CConditionEvaluateBase* aRhs)
       
    73   : iLhs(aLhs),
       
    74     iRhs(aRhs)
       
    75     {
       
    76     }
       
    77 
       
    78 CLogicalOr::~CLogicalOr()
       
    79     {
       
    80     delete iLhs;
       
    81     delete iRhs;
       
    82     }
       
    83 
       
    84 TBool CLogicalOr::EvaluateL() const
       
    85     {
       
    86     __ASSERT_DEBUG(NULL != iLhs, PanicNow(KPanicCLogicalOr, ENullPtr));
       
    87     __ASSERT_DEBUG(NULL != iRhs, PanicNow(KPanicCLogicalOr, ENullPtr));
       
    88 
       
    89     TBool retVal = (iLhs->EvaluateL() || iRhs->EvaluateL());
       
    90     return retVal;
       
    91     }