datacommsserver/esockserver/inc/ss_tiermanager.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2006-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  @publishedPartner
       
    19  @released
       
    20 */
       
    21 
       
    22 #ifndef SYMBIAN_SS_TIER_MANAGER_H
       
    23 #define SYMBIAN_SS_TIER_MANAGER_H
       
    24 
       
    25 #include <comms-infras/ss_nodemessages_tiermanager.h>
       
    26 #include <comms-infras/ss_mmnode.h>
       
    27 #include <ss_fact.h>
       
    28 
       
    29 namespace ESock
       
    30 {
       
    31 
       
    32 class CTierManagerFactoryContainer;
       
    33 
       
    34 //
       
    35 //CTierManagerBase
       
    36 class CTierManagerFactoryBase;
       
    37 class CTierManagerBase : public CBase, public ACommsFactoryNodeId, public ACFMMNodeBase,
       
    38 						 public TCFTierManager
       
    39 /** Base class for a meta connection provider.
       
    40 */
       
    41 	{
       
    42 	friend class CTierManagerFactoryBase;
       
    43 public:
       
    44 	/**
       
    45 	@return the uid for the tier
       
    46 	*/
       
    47 	IMPORT_C TUid TierId() const;
       
    48 	IMPORT_C TUid TierImplId()const;
       
    49 	const RPointerArray<CMetaConnectionProviderBase>&  GetMetaConnectionProviders() const {return iMetaConnectionProviders;}
       
    50 	IMPORT_C void AddMetaConnectionProviderL(const CMetaConnectionProviderBase* aMetaConnectionProvider);
       
    51 	IMPORT_C void RemoveMetaConnectionProvider(const CMetaConnectionProviderBase* aMetaConnectionProvider);
       
    52 
       
    53 public:
       
    54 	virtual TBool HandleContentionL(CMetaConnectionProviderBase* aMcpr, Messages::TNodeId& aPendingCprId, TUint aPriority) = 0;
       
    55 	virtual TBool IsUnavailableDueToContention(const CMetaConnectionProviderBase* aMetaConnectionProvider) const = 0;
       
    56 
       
    57 	const Messages::TNodeId& Id () const
       
    58 		{
       
    59 		return ANodeId::Id ();	
       
    60 		}
       
    61 
       
    62 protected:
       
    63 	IMPORT_C CTierManagerBase(CTierManagerFactoryBase& aFactory, const MeshMachine::TNodeActivityMap& aActivityMap);
       
    64 	IMPORT_C virtual ~CTierManagerBase();
       
    65 	IMPORT_C virtual NetInterfaces::TInterfaceControl* FetchNodeInterfaceControlL(TInt aInterfaceId);
       
    66 protected:
       
    67 	RPointerArray<CMetaConnectionProviderBase> iMetaConnectionProviders;
       
    68 	};
       
    69 
       
    70 //
       
    71 //Factories - base
       
    72 class CTierManagerFactoryBase : public CCommsFactoryBase
       
    73 /** Base class for selection resolver factories. Specifies the interface
       
    74     that selection resolver factories must implement.
       
    75 */
       
    76 	{
       
    77 	friend class CTierManagerFactoryContainer;
       
    78 public:
       
    79 	/**
       
    80 	Destructor
       
    81 	*/
       
    82 	IMPORT_C virtual ~CTierManagerFactoryBase();
       
    83 	IMPORT_C TUid TierTypeId() const;
       
    84 
       
    85 protected:
       
    86 	/**
       
    87 	@param aFactoryUid Uid of the factory being created
       
    88 	@param aParentContainer Factory container within which the factory is being created
       
    89 	*/
       
    90 	IMPORT_C CTierManagerFactoryBase(TUid aTierTypeId, TUid aFactoryUid, CTierManagerFactoryContainer& aParentContainer);
       
    91 
       
    92 	/**
       
    93 	Create object
       
    94 	@param aQuery Parameters with which to create object
       
    95 	@return The node id of the created object
       
    96 	*/
       
    97 	IMPORT_C virtual ACommsFactoryNodeId* DoCreateObjectL(TFactoryQueryBase& aQuery);
       
    98 
       
    99 	/**
       
   100 	Find or create object
       
   101 	@param aQuery Parameters with which to find or create the object
       
   102 	@return The node id of the found or created object
       
   103 	*/
       
   104 	IMPORT_C virtual ACommsFactoryNodeId* DoFindOrCreateObjectL(TFactoryQueryBase& aQuery);	
       
   105 protected:
       
   106 	TUid iTierTypeId;
       
   107 	};
       
   108 	
       
   109 } //namespace ESock
       
   110 
       
   111 
       
   112 
       
   113 #endif //SYMBIAN_SS_TIER_MANAGER_H
       
   114 
       
   115