serviceproviders/sapi_logging/loggingservice/src/logobserver.cpp
changeset 19 989d2f495d90
equal deleted inserted replaced
14:a36b1e19a461 19:989d2f495d90
       
     1 /*
       
     2 * Copyright (c) 2007 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 the License "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:  Implements logging SAPI logobserver class.
       
    15 *
       
    16 */
       
    17 
       
    18 #include <logwrap.h>
       
    19 #include <logcli.h>
       
    20 #include <logview.h>
       
    21 #include <LOGCLIENTCHANGEOBSERVER.H>
       
    22 
       
    23 #include "loggingsyncservice.h"
       
    24 #include "logobserver.h"
       
    25 
       
    26 
       
    27 /**
       
    28 * Default Constructor
       
    29 */
       
    30 
       
    31 CLogObserver  :: CLogObserver()
       
    32     {
       
    33     }
       
    34 /**
       
    35 * Two phase constructors
       
    36 */
       
    37 
       
    38 CLogObserver* CLogObserver :: NewL()
       
    39     {
       
    40     CLogObserver* self = CLogObserver :: NewLC() ;
       
    41     CleanupStack::Pop(self) ;
       
    42     return self ;
       
    43     }
       
    44 
       
    45 /**
       
    46 * Two phased constructor implementation
       
    47 */
       
    48 
       
    49 CLogObserver* CLogObserver :: NewLC()
       
    50     {
       
    51     CLogObserver* self = new(ELeave)CLogObserver() ;
       
    52     CleanupStack :: PushL(self) ;
       
    53     self->ConstructL() ;
       
    54     return self ;
       
    55     }
       
    56 
       
    57 
       
    58 /**
       
    59 * This function constructs the member elements of CLogObserver Class
       
    60 */
       
    61 
       
    62 void CLogObserver :: ConstructL()
       
    63     {
       
    64     User :: LeaveIfError (iFs.Connect()) ;
       
    65     iLogClient = CLogClient :: NewL(iFs) ;
       
    66     }
       
    67 
       
    68 /**
       
    69 * Default Destructor
       
    70 */
       
    71 
       
    72 CLogObserver :: ~CLogObserver()
       
    73     {
       
    74     delete iLogClient ;
       
    75     iFs.Close() ;
       
    76     }
       
    77 
       
    78 /**
       
    79 * setobserver function
       
    80 */
       
    81 void CLogObserver :: SetObserverL(MLogClientChangeObserver* aObserver)
       
    82     {
       
    83     iLogClient->SetGlobalChangeObserverL(aObserver) ;
       
    84     }