datacommsserver/esockserver/inc/ss_threadtransport.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2005-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 SS_THREADTRANSPORT_H
       
    22 #define SS_THREADTRANSPORT_H
       
    23 
       
    24 #include <comms-infras/ss_common.h>
       
    25 #include <elements/cftransport.h>
       
    26 
       
    27 namespace Den
       
    28 {
       
    29 	class TWorkerTransportMsg;
       
    30 }
       
    31 
       
    32 NONSHARABLE_CLASS(TRequestWrapper)
       
    33 	{
       
    34 public:
       
    35 	IMPORT_C TRequestWrapper();
       
    36 	IMPORT_C TRequestWrapper(TRequestStatus& aStatus, TBool aSyncLocalCall);
       
    37 	inline void SetPeerThread(const RThread& aPeerThread);
       
    38 	inline const RThread& PeerThread () const;
       
    39 	inline operator TRequestStatus*();
       
    40 	IMPORT_C void RequestComplete(TInt aReason);
       
    41 private:
       
    42 	TRequestStatus* iStatus;
       
    43 	const RThread* iPeerThread;
       
    44 	TBool iSyncLocalCall;
       
    45 	};
       
    46 
       
    47 NONSHARABLE_CLASS(TTransportUserStorage)
       
    48 	{
       
    49 public:
       
    50 	inline TTransportUserStorage();
       
    51 	inline TAny* Ptr() const;
       
    52 	inline TAny*& RefPtr();
       
    53 private:
       
    54 	TAny* iStorage;
       
    55 	};
       
    56 
       
    57 class CWorkerTransportReceiver;
       
    58 NONSHARABLE_CLASS(TTransportUser)
       
    59 	{
       
    60 public:
       
    61 	inline TTransportUser();
       
    62 	static TInt Compare(const TTransportUser& aLHS, const TTransportUser& aRHS);
       
    63 public:
       
    64 	TInt iInterfaceId;
       
    65 	TUid iDtorId;
       
    66 	CWorkerTransportReceiver* iUser;
       
    67 	TTransportUserStorage* iUserStorage;
       
    68 	};
       
    69 
       
    70 
       
    71 class TTransportReceiverFactoryArgs
       
    72 	{
       
    73 public:
       
    74 	inline TTransportReceiverFactoryArgs(TTransportUserStorage* aStorage, CommsFW::TWorkerId aWorkerId);
       
    75 public:
       
    76 	TTransportUserStorage* iStorage;
       
    77 	CommsFW::TWorkerId iWorkerId;
       
    78 	};
       
    79 
       
    80 
       
    81 // Receiving side of transport
       
    82 class CWorkerTransportReceiver : public CBase
       
    83 	{
       
    84 public:
       
    85 	virtual void ProcessMessage(const Den::TWorkerTransportMsg& aMsg, TRequestWrapper& aRequest, TTransportUserStorage& aStorage, CommsFW::TWorkerId aWorker) = 0;
       
    86 	virtual void OnPeerDeath(CommsFW::TWorkerId aPeer, TTransportUserStorage& aStorage) = 0;
       
    87 	virtual void Shutdown(TBool aAlreadyDead, TTransportUserStorage& aStorage) = 0;
       
    88 	};
       
    89 
       
    90 #include "comms-infras/ss_threadtransport.inl"
       
    91 
       
    92 #endif
       
    93