loggingservices/filelogger/SSVR/FLOGSVR.H
changeset 0 08ec8eefde2f
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 1997-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 /**
       
    17  @file
       
    18  @internalTechnology
       
    19 */
       
    20 
       
    21 #ifndef __FLOGSVR_H__
       
    22 #define __FLOGSVR_H__
       
    23 
       
    24 #include <f32file.h>
       
    25 #include <flogger.h>
       
    26 
       
    27 class CFileLoggerManager;
       
    28 class CFileLogSessionCounter;
       
    29 
       
    30 NONSHARABLE_CLASS(CFileLoggerServer) : public CServer2
       
    31 /**
       
    32 @internalComponent
       
    33 */
       
    34 	{
       
    35 public:
       
    36 	static CFileLoggerServer* NewL();
       
    37 	~CFileLoggerServer();
       
    38 // CServer
       
    39 	virtual CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const;
       
    40 //
       
    41 	CFileLogSessionCounter* SessionCounter() const;
       
    42 	void Error(TInt aError);
       
    43 private:
       
    44 	CFileLoggerServer();
       
    45 	void ConstructL();
       
    46 public:
       
    47 	enum {EPriority=950};
       
    48 private:
       
    49 	CFileLoggerManager* iLoggerManager;
       
    50 	CFileLogSessionCounter* iSessionCounter;
       
    51 	};	
       
    52 
       
    53 NONSHARABLE_CLASS(CFileLogSession) : public CSession2
       
    54 /**
       
    55 @internalComponent
       
    56 */
       
    57 	{
       
    58 public:
       
    59 	static CFileLogSession* NewL(CFileLoggerServer* aServer, CFileLoggerManager* aManager);
       
    60 	~CFileLogSession();
       
    61 	// CSession
       
    62 	virtual void ServiceL(const RMessage2& aMessage);
       
    63 	//
       
    64 private:
       
    65 	CFileLogSession(CFileLoggerServer* aServer, CFileLoggerManager* aManager);
       
    66 	void ConstructL();
       
    67 	void DispatchMessageL(const RMessage2& aMessage);
       
    68 	void OpenLogL(TLogFile& aLogFile);
       
    69 	void CloseLog(TLogFile& aLogFile);
       
    70 private:
       
    71 	CFileLoggerServer* iLoggerServer;
       
    72 	CFileLoggerManager* iLoggerManager;
       
    73 	CArrayFixFlat<TLogFile>* iOpenLogFiles;
       
    74 	};
       
    75 
       
    76 class CShutdownTimer;
       
    77 
       
    78 NONSHARABLE_CLASS(CFileLogSessionCounter) : public CBase
       
    79 /**
       
    80 @internalComponent
       
    81 */
       
    82 	{
       
    83 public:
       
    84 	static CFileLogSessionCounter* NewL();
       
    85 	~CFileLogSessionCounter();
       
    86 	void CancelTimer();
       
    87 	void DecrementSessionCount();
       
    88 	void IncrementSessionCount();
       
    89 private:
       
    90 	CFileLogSessionCounter();
       
    91 	void ConstructL();
       
    92 private:
       
    93 	CShutdownTimer* iShutdownTimer;
       
    94 	TInt iSessionCount;
       
    95 	};
       
    96 
       
    97 NONSHARABLE_CLASS(CShutdownTimer) : public CTimer
       
    98 /**
       
    99 @internalComponent
       
   100 */
       
   101 	{
       
   102 public:
       
   103 	static CShutdownTimer* NewL();
       
   104 	~CShutdownTimer();
       
   105 protected:
       
   106 	CShutdownTimer();
       
   107 	void RunL();
       
   108 	};
       
   109 
       
   110 #endif // __FLOGSVR_H__
       
   111