epoc32/include/comms-infras/ss_fact_internal.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/comms-infras/ss_fact_internal.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,145 @@
     1.4 +// Copyright (c) 2008-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 "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.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 +//
    1.18 +
    1.19 +/**
    1.20 + @file
    1.21 + @internalTechnology
    1.22 +*/
    1.23 +
    1.24 +#if !defined(__SS_FACT_INTERNAL_H__)
    1.25 +#define __SS_FACT_INTERNAL_H__
    1.26 +
    1.27 +#include <elements/factory.h>
    1.28 +#include <elements/sd_objectbroker.h>
    1.29 +
    1.30 +namespace ESock
    1.31 +{
    1.32 +
    1.33 +class CCommsFactoryBase;
    1.34 +class ACommsFactoryNodeId;
    1.35 +
    1.36 +// We need to redeclare this for the CMetaConnectionProviderBase x86gcc cast operators to work.
    1.37 +#ifndef __CCOMMSFACTORYCONTAINER_DECLARED
    1.38 +#define __CCOMMSFACTORYCONTAINER_DECLARED
    1.39 +NONSHARABLE_CLASS(CCommsFactoryContainer) : public Factories::CFactoryContainerNode
    1.40 +/** Comms Factory Factory Container class is used to store comms factorys of a
    1.41 +    specific type. e.g. sub-connection provider factories. It provides basic
    1.42 +	functionality to find, add and remove factories. It has basic functionality to
    1.43 +	create a factory object. If a container wants to do more than just creating a 
    1.44 +	factory object it should specialise the CCommsFactoryContainer
    1.45 +
    1.46 +@internalTechnology
    1.47 +@released Since 9.0 */
    1.48 +	{
    1.49 +	friend class CPitBoss;	// CPitBoss enumerates factories without needing (or wanting) derived types
    1.50 +
    1.51 +#ifdef __X86GCC__
    1.52 + 	// gcc-mingw does not support declaring friends from different namespaces so we define proxy
    1.53 + 	// functions to do the cast.
    1.54 +    friend  CCommsFactoryContainer* __x86gcc_comms_factory_container_cast(Messages::ANode* aNode);
    1.55 +    friend  CCommsFactoryContainer& __x86gcc_comms_factory_container_cast(Messages::ANode& aNode);
    1.56 +#elif !defined(__GCCXML__)
    1.57 +	friend CCommsFactoryContainer* Messages::mnode_cast<CCommsFactoryContainer>(Messages::ANode* aNode);
    1.58 +#endif
    1.59 +	
    1.60 +public:
    1.61 +	IMPORT_C Factories::CFactoryBase* FindOrCreateFactoryL(TUid aUid);	
    1.62 +	IMPORT_C ACommsFactoryNodeId* Find (Factories::MFactoryQuery& aQuery);
    1.63 +protected:
    1.64 +	Factories::CFactoryBase* CreateFactoryL(TUid aUid);	
    1.65 +	ACommsFactoryNodeId* CreateFactoryObjectNodeL(Messages::TSignatureBase& aMessage);
    1.66 +    virtual void ReceivedL(const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage);
    1.67 +	
    1.68 +protected:
    1.69 +    //Type information for the planes.
    1.70 +    enum TContaineeType
    1.71 +        {
    1.72 +        EUnknown = 0,
    1.73 +	    ETierManagerFactoryContainer,
    1.74 +	    EMetaConnectionFactoryContainer,
    1.75 +	    EConnectionFactoryContainer,
    1.76 +	    ESubConnectionFactoryContainer,
    1.77 +	    ESubConnectionFlowFactoryContainer,
    1.78 +		EProtocolIntfFactoryContainer,
    1.79 +		EProtocolFamilyFactoryContainer,
    1.80 +        };
    1.81 +	CCommsFactoryContainer(TContaineeType aId = EUnknown);
    1.82 +public:
    1.83 +     const TContaineeType iId;
    1.84 +
    1.85 +public:
    1.86 +	static CCommsFactoryContainer* NewL (TContaineeType aId);
    1.87 +	};
    1.88 +#endif // __CCOMMSFACTORYCONTAINER_DECLARED
    1.89 +
    1.90 +
    1.91 +class CCFFactoryContainerBroker : public Den::CCommonObjectBroker
    1.92 +/**
    1.93 +This object broker is intended to be a per technology singleton that forwards
    1.94 +factory requests to a specified factory container.
    1.95 +
    1.96 +Factory containers are added to its client list during the handshaking at worker thread
    1.97 +initialisation.
    1.98 +
    1.99 +@internalTechnology
   1.100 +*/
   1.101 +	{
   1.102 +public:
   1.103 +	static CCFFactoryContainerBroker* NewL();
   1.104 +
   1.105 +protected:
   1.106 +	void ReceivedL(const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage);
   1.107 +	CCFFactoryContainerBroker();
   1.108 +	};
   1.109 +
   1.110 +#ifdef __X86GCC__
   1.111 + 	// gcc-mingw does not support declaring friends from different namespaces so we define proxy
   1.112 + 	// functions to do the cast...
   1.113 + 	
   1.114 +	inline CCommsFactoryContainer* __x86gcc_comms_factory_container_cast(Messages::ANode* aNode)
   1.115 +    	{
   1.116 +    	return static_cast<CCommsFactoryContainer*>(aNode);
   1.117 +    	}
   1.118 +
   1.119 +	inline CCommsFactoryContainer& __x86gcc_comms_factory_container_cast(Messages::ANode& aNode)
   1.120 +    	{
   1.121 +    	return static_cast<CCommsFactoryContainer&>(aNode);
   1.122 +    	}
   1.123 +#endif
   1.124 +}
   1.125 +
   1.126 +
   1.127 +#ifdef __X86GCC__
   1.128 +	namespace Messages
   1.129 +	{
   1.130 + 	// gcc-mingw does not support declaring friends from different namespaces so we define proxy
   1.131 + 	// functions to do the cast...
   1.132 + 	
   1.133 +	template <>
   1.134 +	inline ESock::CCommsFactoryContainer* mnode_cast<ESock::CCommsFactoryContainer>(Messages::ANode* aNode)
   1.135 +		{
   1.136 +		return ESock::__x86gcc_comms_factory_container_cast(aNode);
   1.137 +		}
   1.138 +
   1.139 +	template <>
   1.140 +	inline ESock::CCommsFactoryContainer& mnode_cast<ESock::CCommsFactoryContainer>(Messages::ANode& aNode)
   1.141 +		{
   1.142 +		return ESock::__x86gcc_comms_factory_container_cast(aNode);
   1.143 +		}
   1.144 +	}
   1.145 +#endif
   1.146 +
   1.147 +#endif
   1.148 +// __SS_FACT_INTERNAL_H__