examples/SDKExamples/ClientServerSync/server/inc/timeserver.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : timeserver.h
00004 *  Part of     : CSSync
00005 *  Interface   :
00006 *  Description :
00007 *  Version     :
00008 *
00009 *  Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
00010 *  All rights reserved.
00011 *  This component and the accompanying materials are made available
00012 *  under the terms of "Eclipse Public License v1.0"
00013 *  which accompanies this distribution, and is available
00014 *  at the URL "http://www.eclipse.org/legal/epl-v10.html".
00015 * ==============================================================================
00016 */
00017 
00018 
00019 #ifndef __TIMESERVER_H__
00020 #define __TIMESERVER_H__
00021 
00022 // INCLUDE FILES
00023 #include <e32base.h>
00024 #include "SyncServer.pan"
00025 
00026 // CLASS DECLARATION
00032 class CTimeServer : public CServer2
00033     {
00034     public : // Constructors and destructors
00035 
00041         static CTimeServer* NewL();
00042 
00048         static CTimeServer* NewLC();
00049 
00050     public: // New functions
00051 
00058         static TInt ThreadFunction( TAny* aNone );
00059 
00064         void IncrementSessions();
00065 
00071         void DecrementSessions();
00072 
00073     protected: // Functions from base classes
00074 
00081         TInt RunError( TInt aError );
00082 
00083     private: // Constructors and destructors
00084 
00090         CTimeServer( TInt aPriority );
00091 
00096         void ConstructL();
00097 
00098     private: // New methods
00099 
00106         static void PanicClient( const RMessage2& aMessage,
00107                                  TTimeServPanic aReason );
00108 
00114         static void PanicServer( TTimeServPanic aReason );
00115 
00120         static void ThreadFunctionL();
00121 
00122     private: // Functions from base classes
00123 
00131         CSession2* NewSessionL( const TVersion& aVersion, 
00132                                 const RMessage2& aMessage ) const;
00133 
00134     private: // Data
00135 
00139         TInt iSessionCount;
00140     };
00141 
00142 
00143 #endif // __TIMESERVER_H__
00144 
00145 
00146 // End of File

Generated by  doxygen 1.6.2