epoc32/include/ss_std.inl
branchSymbian2
changeset 2 2fe1408b6811
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/ss_std.inl	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,151 @@
     1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// CSocketServer
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +inline CWorkerThread& CSocketServer::WorkerThread() const 
    1.22 +	{
    1.23 +	return *iOwnerThread;
    1.24 +	};
    1.25 +
    1.26 +inline TWorkerId CSocketServer::WorkerId() const
    1.27 +	{
    1.28 +	return WorkerThread().WorkerId();
    1.29 +	}
    1.30 +
    1.31 +//
    1.32 +// CSockSession
    1.33 +//
    1.34 +
    1.35 +inline const CDealer& CSockSession::Dealer() const 
    1.36 +	{ 
    1.37 +	// NB: this is really only a static_cast<> but the Gordian knot of class dependencies results in a forward
    1.38 +	// declaration
    1.39 +	return *reinterpret_cast<const CDealer*>(Server());	
    1.40 +	}
    1.41 +
    1.42 +inline CSubSessionIx& CSockSession::SubSessions()
    1.43 +	{
    1.44 +	return iSubSessions;
    1.45 +	}
    1.46 +
    1.47 +inline const CSubSessionIx& CSockSession::SubSessions() const
    1.48 +	{
    1.49 +	return iSubSessions;
    1.50 +	}
    1.51 +
    1.52 +inline TSockManData* CSockSession::SockManGlobals() const
    1.53 +    {
    1.54 +        return WorkerThread().SockManGlobals();
    1.55 +    }
    1.56 +
    1.57 +//
    1.58 +// CSockSubSession
    1.59 +//
    1.60 +
    1.61 +inline void CSockSubSession::Open()
    1.62 +	{
    1.63 +	iAccessCount++;
    1.64 +	}
    1.65 +
    1.66 +inline void CSockSubSession::Close()
    1.67 +	{
    1.68 +	iAccessCount--;
    1.69 +	ASSERT(iAccessCount >= 0);
    1.70 +	if(iAccessCount == 0)
    1.71 +		{
    1.72 +		RemoveAndDestroy();
    1.73 +		}
    1.74 +	}
    1.75 +
    1.76 +inline TInt CSockSubSession::AccessCount() const
    1.77 +	{
    1.78 +	return iAccessCount;
    1.79 +	}
    1.80 +
    1.81 +inline CSockSession* CSockSubSession::Session()
    1.82 +	{ 
    1.83 +	ASSERT(iSession); 
    1.84 +	return iSession;
    1.85 +	}
    1.86 +
    1.87 +inline CPlayer& CSockSubSession::Player() const 
    1.88 +	{ 
    1.89 +	ASSERT(iPlayer); 
    1.90 +	return *iPlayer; 
    1.91 +	}
    1.92 +
    1.93 +#ifdef SYMBIAN_NETWORKING_PERFMETRICS
    1.94 +inline void CSockSubSession::IncludePerformanceData(TInt aDeltaClientRxBytes, TInt aDeltaClientRxBuffBytes, TInt aDeltaClientTxBytes)
    1.95 +	{
    1.96 +	iSession->IncludePerformanceData(aDeltaClientRxBytes, aDeltaClientRxBuffBytes, aDeltaClientTxBytes);
    1.97 +	}
    1.98 +#endif
    1.99 +
   1.100 +
   1.101 +inline const RMessage2& CSockSession::Message() const
   1.102 +	{ 
   1.103 +	return *iOurMessage; 
   1.104 +	}
   1.105 +	
   1.106 +inline void CSockSession::CompleteDisconnect()
   1.107 +	{
   1.108 +	RMessage2 dm = iDisconnectMessage;
   1.109 +	inherited::Disconnect(dm);
   1.110 +	}
   1.111 +
   1.112 +
   1.113 +inline void CSocketScheduler::SetGlobals(TSockManData* aGlobals)
   1.114 +    { 
   1.115 +	static_cast<CSocketScheduler*>(CActiveScheduler::Current())->iGlobals = aGlobals; 
   1.116 +	}
   1.117 +
   1.118 +//inline void CSocketScheduler::SetWaitHook(TCallBack* aCall)
   1.119 +//	{ ((CSocketScheduler*)CActiveScheduler::Current())->iWaitHook=aCall; }
   1.120 +
   1.121 +inline TSockManData* CSocketScheduler::Globals()
   1.122 +	{ 
   1.123 +	return static_cast<CSocketScheduler*>(CActiveScheduler::Current())->iGlobals; 
   1.124 +	}
   1.125 +
   1.126 +//
   1.127 +// CSubSessionIx
   1.128 +// 
   1.129 +
   1.130 +/**
   1.131 +Optional locking. When accessing any of the public methods of this class in a multithreaded 
   1.132 +environment, locking is often necessary. This lock does not allow for lock nesting.
   1.133 +*/
   1.134 +inline void CSubSessionIx::Lock() const
   1.135 +	{ 
   1.136 +	iLock.Wait(); 
   1.137 +	}
   1.138 +
   1.139 +/**
   1.140 +Unlocking.
   1.141 +@see Lock()
   1.142 +*/
   1.143 +inline void CSubSessionIx::Unlock() const
   1.144 +	{ 
   1.145 +	iLock.Signal(); 
   1.146 +	}
   1.147 +
   1.148 +/**
   1.149 +@return the number of active sub-sessions in the container.
   1.150 +*/
   1.151 +inline TInt CSubSessionIx::ActiveCount() const
   1.152 +	{
   1.153 +	return iActiveCount;
   1.154 +	}