servicediscoveryandcontrol/pnp/test/upnp/Server/Flow/inc/genericcontainer.h
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 // Copyright (c) 2008-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 // @file
       
    15 // @internalComponent
       
    16 // 
       
    17 //
       
    18 
       
    19 #ifndef __GENERIC_CONTAINER_H_
       
    20 #define __GENERIC_CONTAINER_H_
       
    21 
       
    22 #include <comms-infras/ss_protflow.h> 
       
    23 #include <comms-infras/ss_nodemessages.h> 
       
    24 
       
    25 const TInt KAppProtIntfFactoryUid = 0x2000D05B; // Put in common place
       
    26 
       
    27 class CFactory;
       
    28 class CAppProtIntfFactoryContainer : public CBase, public Messages::ASimpleNodeIdBase
       
    29 	{
       
    30 public:
       
    31 	static CAppProtIntfFactoryContainer* NewL ( );
       
    32 	
       
    33 private:
       
    34 	virtual void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage );
       
    35 	CAppProtIntfFactoryContainer (  );
       
    36 	void ConstructL();
       
    37 private:
       
    38 	CFactory *iAppProtIntfFactory;
       
    39 	};
       
    40 
       
    41 
       
    42 class CFactoryObject;
       
    43 class CFactory : public CBase
       
    44 	{
       
    45 	friend class CAppProtIntfFactoryContainer;
       
    46 public:
       
    47 	CFactoryObject* FindFactoryObject ( Factories::MFactoryQuery& aFactoryQuery );
       
    48 	CFactoryObject* FindOrCreateFactoryObjectL ( Factories::MFactoryQuery& aFactoryQuery );
       
    49 	CFactoryObject* CreateFactoryObjectL ( Factories::MFactoryQuery& aFactoryQuery );
       
    50 
       
    51 protected:
       
    52 	CFactory ();
       
    53 	~CFactory ();
       
    54 	virtual CFactoryObject* DoCreateFactoryObjectL ( Factories::MFactoryQuery& aFactoryQuery ) =0;
       
    55 private:
       
    56 	RPointerArray<CFactoryObject> iObjectsList;
       
    57 
       
    58 public:
       
    59 	TUid iDestroyUid;
       
    60 	};
       
    61 	
       
    62 class CFactoryObject : public CBase, public Messages::ASimpleNodeIdBase
       
    63 	{
       
    64 public:
       
    65 	TInt ProtocolType();
       
    66 	virtual ~CFactoryObject();
       
    67 protected:
       
    68 	CFactoryObject(TInt aProtocolType);
       
    69 private:
       
    70 	TInt iProtocolFlag;
       
    71 	};
       
    72 
       
    73 
       
    74 #endif //__GENERIC_CONTAINER_H_