networkcontrol/commsuserpromptmgr/database/inc/netupsthreadentry.h
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 2007-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 // This file provides the Net Ups Database SubEntry.
       
    15 // @internalAll
       
    16 // @prototype
       
    17 // 
       
    18 //
       
    19 
       
    20 #ifndef NETUPSTHREADENTRY_H
       
    21 #define NETUPSTHREADENTRY_H
       
    22 
       
    23 #include <e32base.h>						// defines CBase
       
    24 #include <e32std.h>							// defines TThreadId
       
    25 
       
    26 #include <comms-infras/ss_activities.h>
       
    27 
       
    28 #include <ups/upsclient.h>					// defines the UPS SubSession			
       
    29 
       
    30 #include <comms-infras/commsdebugutility.h> // defines the comms debug logging utility
       
    31 
       
    32 #include "netupsconnectionentry.h"		// defines a structure which specifies the number of connections associated with a Comms Id.
       
    33 
       
    34 namespace NetUps
       
    35 {
       
    36 class CDatabaseEntry;
       
    37 class CProcessEntry;
       
    38 class CThreadMonitor;
       
    39 class CSubSession;
       
    40 class CPolicyCheckRequestQueue;
       
    41 
       
    42 NONSHARABLE_CLASS(CThreadEntry) : public CBase
       
    43 	{
       
    44 public:
       
    45 	static CThreadEntry* NewL(CDatabaseEntry& aDatabaseEntry, CProcessEntry& aProcessEntry, const TThreadId& aThreadId, UserPromptService::RUpsSession& aUpsSession);
       
    46 	virtual ~CThreadEntry();
       
    47 public:
       
    48 	TInt32							 ConnectionCount();
       
    49 	TInt32							 ConnectionCount(const Messages::TNodeId& aCommsId);	
       
    50 	void							 IncrementConnectionCount(const Messages::TNodeId& aCommsId);
       
    51 	void							 IncrementConnectionCountL(const Messages::TNodeId& aCommsId);
       
    52 	void							 DecrementConnectionCount(const Messages::TNodeId& aCommsId);
       
    53 	void							 AddCommsIdL(const Messages::TNodeId& aCommsId);
       
    54 	TBool							 RemoveCommsId(const Messages::TNodeId& aCommsId);
       
    55 	const TThreadId&				 ThreadId() const;
       
    56 	void							 SetIsDead(TBool aDead);
       
    57 	TBool							 IsDead() const;
       
    58 	void 							 SetThreadMonitor(CThreadMonitor* aThreadMonitor);	
       
    59 	CThreadMonitor* 				 ThreadMonitor() const; // client code tests for Null pointer
       
    60 	void							 SetSubSession(CSubSession* aSubSession);
       
    61 	CSubSession*					 SubSession() const;	// client code tests for Null pointer
       
    62 	CPolicyCheckRequestQueue& 		 RequestQueue() const;
       
    63 	RPointerArray<CConnectionEntry>& ConnectionEntry();
       
    64 protected: // class may be specialised by NetUps clients if required
       
    65 	CThreadEntry(const TThreadId&);
       
    66 private:
       
    67 	TBool FindConnectionEntry(const Messages::TNodeId& aCommsId, TInt32& index);
       
    68 	void ConstructL(CDatabaseEntry& aDatabaseEntry, CProcessEntry& aProcessEntry, UserPromptService::RUpsSession& aUpsSession);
       
    69 private:
       
    70 	TBool							iIsDead;
       
    71 	TThreadId						iThreadId;	
       
    72 	CThreadMonitor* 				iThreadMonitor;	// object life cycle may be shorter than CThreadEntry
       
    73 	CSubSession*					iSubSession;	// object life cycle may be shorter than CThreadEntry	
       
    74 	CPolicyCheckRequestQueue* 		iQueue;			// object life cycle may be shorter than CThreadEntry	
       
    75 	RPointerArray<CConnectionEntry> iConnectionEntry;
       
    76 private:
       
    77 	__FLOG_DECLARATION_MEMBER;		
       
    78 	};
       
    79 
       
    80 } // end of namespace NetUps
       
    81 
       
    82 #endif // NETUPSTHREADENTRY_H