os/ossrv/genericopenlibs/openenvcore/backend/inc/StdioServer.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.
     1 /*
     2 * Copyright (c) 2006-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 * Name        : stdioserver.h
    16 * Part of     : stdio server
    17 * To implement the server
    18 * 
    19 *
    20 */
    21 
    22 
    23 
    24  
    25 
    26 #ifndef __STDIOSERVER_H__
    27 #define __STDIOSERVER_H__
    28 
    29 #include <f32file.h>
    30 #include <c32comm.h>
    31 
    32 #include "ShutDown.h"
    33 
    34 /*
    35 Messages supported by server.
    36 */
    37 enum TRedirStream 
    38 	{
    39 	ERead,
    40 	EWrite,
    41 	EFlush,
    42 	ECheckMedia,
    43 	ENotifyActivity,
    44 	ECancelNotify,
    45 	EEcho
    46 	};
    47 
    48 
    49 /*
    50 server name
    51 */
    52 _LIT(KServerName,"StdioServer");
    53 
    54 
    55 /*
    56 A version must be specified when creating a session with the server
    57 */
    58 const TUint KStdioServMajorVersionNumber=1;
    59 
    60 const TUint KStdioServMinorVersionNumber=0;
    61 
    62 const TUint KStdioServBuildVersionNumber=0;
    63 
    64 
    65 //-----------------------------------------------------------------------
    66 //Class name: 	CStdioServer
    67 //Description: 	Implements the STDIO redirection server.
    68 //				This class handles all redirection requests from client
    69 //				process.
    70 //-----------------------------------------------------------------------
    71  
    72 class CStdioServer : public CServer2
    73 	{
    74 public:
    75 	static CServer2* NewL();
    76 	static RFs& FsSession();
    77 	static RCommServ& CsSession();
    78 	void AddSession();
    79 	void RemoveSession();
    80 	void SetStreamFactory();
    81 	~CStdioServer();
    82 	
    83 private:
    84 	CStdioServer(CActive::TPriority aPriority);
    85 	CSession2* NewSessionL(const TVersion&,const RMessage2&)const;
    86 	void ConstructL();
    87 	static RFs iFs;
    88 	static RCommServ iCs;
    89 	TInt iSessionCount;
    90 	CShutDown *iShutDown;
    91 	};
    92 
    93 #endif //__STDIOSERVER_H__
    94 
    95 
    96 
    97