testexecfw/stf/stffw/eventsystem/server/src/stateevent.cpp
changeset 2 8bb370ba6d1d
equal deleted inserted replaced
1:bbd31066657e 2:8bb370ba6d1d
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 #include <e32svr.h>
       
    19 #include "stateevent.h"
       
    20 
       
    21 
       
    22 /**
       
    23  * Constructor for performing 1st stage construction
       
    24  */
       
    25 CStateEvent::CStateEvent()
       
    26     {
       
    27     }
       
    28 
       
    29 /**
       
    30  * Destructor.
       
    31  */
       
    32 CStateEvent::~CStateEvent()
       
    33     {
       
    34     delete iEventName;
       
    35     }
       
    36 
       
    37 /**
       
    38  * Two-phased constructor.
       
    39  */
       
    40 CStateEvent* CStateEvent::NewLC(const TDesC& aEventName)
       
    41     {
       
    42     CStateEvent* self = new (ELeave) CStateEvent();
       
    43     CleanupStack::PushL(self);
       
    44     self->ConstructL(aEventName);
       
    45     return self;
       
    46     }
       
    47 
       
    48 /**
       
    49  * Two-phased constructor.
       
    50  */
       
    51 CStateEvent* CStateEvent::NewL(const TDesC& aEventName)
       
    52     {
       
    53     CStateEvent* self = CStateEvent::NewLC(aEventName);
       
    54     CleanupStack::Pop();
       
    55     return self;
       
    56     }
       
    57 
       
    58 /**
       
    59  * Constructor for performing 2nd stage construction
       
    60  */
       
    61 void CStateEvent::ConstructL(const TDesC& aEventName)
       
    62     {
       
    63     iEventName = aEventName.AllocL();
       
    64     iToBeUnset = EFalse;
       
    65     }
       
    66 
       
    67 /**
       
    68  * Checks if event name is the same as provided in argument
       
    69  */
       
    70 TInt CStateEvent::IsMatchingEvent(const TDesC& aEventName)
       
    71     {
       
    72     return (aEventName.Compare(*iEventName) == 0) ? (1) : (0);
       
    73     }
       
    74 
       
    75 /**
       
    76  * Set flag which says that event will be unset when matching waiting event will be released
       
    77  */
       
    78 void CStateEvent::NotifyToBeUnset(TBool aValue)
       
    79     {
       
    80     iToBeUnset = aValue;
       
    81     }
       
    82 
       
    83 /**
       
    84  * Returns flag which says that event will be unset when matching waiting event will be released
       
    85  */
       
    86 bool CStateEvent::IsToBeUnset()
       
    87     {
       
    88     return iToBeUnset;
       
    89     }
       
    90     
       
    91 // EOF