os/persistentdata/loggingservices/filelogger/SSVR/FLOGSVR.H
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @internalTechnology
sl@0
    19
*/
sl@0
    20
sl@0
    21
#ifndef __FLOGSVR_H__
sl@0
    22
#define __FLOGSVR_H__
sl@0
    23
sl@0
    24
#include <f32file.h>
sl@0
    25
#include <flogger.h>
sl@0
    26
sl@0
    27
class CFileLoggerManager;
sl@0
    28
class CFileLogSessionCounter;
sl@0
    29
sl@0
    30
NONSHARABLE_CLASS(CFileLoggerServer) : public CServer2
sl@0
    31
/**
sl@0
    32
@internalComponent
sl@0
    33
*/
sl@0
    34
	{
sl@0
    35
public:
sl@0
    36
	static CFileLoggerServer* NewL();
sl@0
    37
	~CFileLoggerServer();
sl@0
    38
// CServer
sl@0
    39
	virtual CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const;
sl@0
    40
//
sl@0
    41
	CFileLogSessionCounter* SessionCounter() const;
sl@0
    42
	void Error(TInt aError);
sl@0
    43
private:
sl@0
    44
	CFileLoggerServer();
sl@0
    45
	void ConstructL();
sl@0
    46
public:
sl@0
    47
	enum {EPriority=950};
sl@0
    48
private:
sl@0
    49
	CFileLoggerManager* iLoggerManager;
sl@0
    50
	CFileLogSessionCounter* iSessionCounter;
sl@0
    51
	};	
sl@0
    52
sl@0
    53
NONSHARABLE_CLASS(CFileLogSession) : public CSession2
sl@0
    54
/**
sl@0
    55
@internalComponent
sl@0
    56
*/
sl@0
    57
	{
sl@0
    58
public:
sl@0
    59
	static CFileLogSession* NewL(CFileLoggerServer* aServer, CFileLoggerManager* aManager);
sl@0
    60
	~CFileLogSession();
sl@0
    61
	// CSession
sl@0
    62
	virtual void ServiceL(const RMessage2& aMessage);
sl@0
    63
	//
sl@0
    64
private:
sl@0
    65
	CFileLogSession(CFileLoggerServer* aServer, CFileLoggerManager* aManager);
sl@0
    66
	void ConstructL();
sl@0
    67
	void DispatchMessageL(const RMessage2& aMessage);
sl@0
    68
	void OpenLogL(TLogFile& aLogFile);
sl@0
    69
	void CloseLog(TLogFile& aLogFile);
sl@0
    70
private:
sl@0
    71
	CFileLoggerServer* iLoggerServer;
sl@0
    72
	CFileLoggerManager* iLoggerManager;
sl@0
    73
	CArrayFixFlat<TLogFile>* iOpenLogFiles;
sl@0
    74
	};
sl@0
    75
sl@0
    76
class CShutdownTimer;
sl@0
    77
sl@0
    78
NONSHARABLE_CLASS(CFileLogSessionCounter) : public CBase
sl@0
    79
/**
sl@0
    80
@internalComponent
sl@0
    81
*/
sl@0
    82
	{
sl@0
    83
public:
sl@0
    84
	static CFileLogSessionCounter* NewL();
sl@0
    85
	~CFileLogSessionCounter();
sl@0
    86
	void CancelTimer();
sl@0
    87
	void DecrementSessionCount();
sl@0
    88
	void IncrementSessionCount();
sl@0
    89
private:
sl@0
    90
	CFileLogSessionCounter();
sl@0
    91
	void ConstructL();
sl@0
    92
private:
sl@0
    93
	CShutdownTimer* iShutdownTimer;
sl@0
    94
	TInt iSessionCount;
sl@0
    95
	};
sl@0
    96
sl@0
    97
NONSHARABLE_CLASS(CShutdownTimer) : public CTimer
sl@0
    98
/**
sl@0
    99
@internalComponent
sl@0
   100
*/
sl@0
   101
	{
sl@0
   102
public:
sl@0
   103
	static CShutdownTimer* NewL();
sl@0
   104
	~CShutdownTimer();
sl@0
   105
protected:
sl@0
   106
	CShutdownTimer();
sl@0
   107
	void RunL();
sl@0
   108
	};
sl@0
   109
sl@0
   110
#endif // __FLOGSVR_H__
sl@0
   111