os/persistentdata/traceservices/tracefw/ulogger/src/uloggerserver/uloggerwatcher.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/traceservices/tracefw/ulogger/src/uloggerserver/uloggerwatcher.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,101 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +
    1.20 +#include "uloggerwatcher.h"
    1.21 +
    1.22 +namespace Ulogger
    1.23 +{
    1.24 +
    1.25 +/*
    1.26 +	NewL method
    1.27 +*/
    1.28 +CULoggerWatcher* CULoggerWatcher::NewL()
    1.29 +	{
    1.30 +	CULoggerWatcher* self = CULoggerWatcher::NewLC();
    1.31 +	CleanupStack::Pop(); //self
    1.32 +	return self;
    1.33 +	}
    1.34 +
    1.35 +/*
    1.36 +	NewLC method
    1.37 +*/
    1.38 +CULoggerWatcher* CULoggerWatcher::NewLC()
    1.39 +	{
    1.40 +	CULoggerWatcher* self = new (ELeave) CULoggerWatcher();
    1.41 +	CleanupStack::PushL(self);
    1.42 +	self->ConstructL();
    1.43 +	return self;
    1.44 +	}
    1.45 +	
    1.46 +/*
    1.47 +	default constructor method
    1.48 +*/	
    1.49 +CULoggerWatcher::CULoggerWatcher()
    1.50 +: CActive(CActive::EPriorityUserInput)
    1.51 +	{
    1.52 +	}
    1.53 +
    1.54 +/*
    1.55 +	default destructor method
    1.56 +*/
    1.57 +
    1.58 +CULoggerWatcher::~CULoggerWatcher()
    1.59 +	{
    1.60 +	Cancel();
    1.61 +	}
    1.62 +
    1.63 +/*
    1.64 +	ConstructL method
    1.65 +*/
    1.66 +void CULoggerWatcher::ConstructL()
    1.67 +	{
    1.68 +	CActiveScheduler::Add(this);
    1.69 +	}
    1.70 +
    1.71 +/*
    1.72 +	DoCancel method
    1.73 +*/	
    1.74 +
    1.75 +void CULoggerWatcher::DoCancel()
    1.76 +	{		
    1.77 +	}
    1.78 +	
    1.79 +/*
    1.80 +	RunL method
    1.81 +*/
    1.82 +	
    1.83 +void CULoggerWatcher::RunL()
    1.84 +	{
    1.85 +	if(iStatus.Int() == KErrNone)
    1.86 +		iObserver->DataNotification();	
    1.87 +	}
    1.88 +	
    1.89 +/*
    1.90 +	StartWatching method
    1.91 +	@aObserver
    1.92 +*/
    1.93 +	
    1.94 +void CULoggerWatcher::StartWatching(MDataWatcherObserver* aObserver)
    1.95 +	{
    1.96 +	if(!IsActive())
    1.97 +	{
    1.98 +		iObserver = aObserver;
    1.99 +		SetActive();
   1.100 +		
   1.101 +	}	
   1.102 +	}
   1.103 +	
   1.104 +}//Namespace