datacommsserver/esockserver/test/providers/dummy/inc/dummypr_mcprpubsubsubscriber.h
branchRCL_3
changeset 13 0b0e9fce0b58
parent 2 dee179edb159
--- a/datacommsserver/esockserver/test/providers/dummy/inc/dummypr_mcprpubsubsubscriber.h	Mon Mar 15 12:45:15 2010 +0200
+++ b/datacommsserver/esockserver/test/providers/dummy/inc/dummypr_mcprpubsubsubscriber.h	Wed Mar 31 23:27:09 2010 +0300
@@ -31,22 +31,16 @@
 #include <comms-infras/ss_metaconnprov.h>
 
 
-NONSHARABLE_CLASS(CMCPrPubSubSubscriber) : public CActive, public Messages::ASimpleNodeIdBase
+class CMCPrPubSubSubscriber : public CActive, public Messages::ASimpleNodeIdBase
 	{
 public:
-	static CMCPrPubSubSubscriber* NewL(const ESock::CMetaConnectionProviderBase& aProvBase, TUint aStopCode);
-	void StartAvailabilityMonitoringL(const Messages::TNodeCtxId& aAvailabilityActivity);
-	void CancelAvailabilityMonitoring();
 	virtual ~CMCPrPubSubSubscriber();
 
     enum
     {
-		KStart			= 1, // Causes a TStart message to be issued
-		KBlockingStop   = 2, // Causes a TStop to be issued and increments the blocking count to stop the node from being cleaned up.
-		KStop	        = 3  // Causes a TStop to be issued;
+		EAvailabilityTestingPubSubUid = 0x10272F42,
+		EStopTriggeringPubSubUid = 0x10203FDD
 	};
-    
-    enum { EAvailabilityTestingPubSubUid = 0x10272F42 };  
     virtual void ReceivedL(const Messages::TRuntimeCtxId& /*aSender*/, const Messages::TNodeId& /*aRecipient*/, Messages::TSignatureBase& aMessage)
         {
         //This object is only a node because its host needs an TCFClientType::EAvailabilityProvider, which
@@ -60,21 +54,56 @@
         }
 
 
-private:
+protected:
 	CMCPrPubSubSubscriber(const ESock::CMetaConnectionProviderBase& aProvBase, TUint aStopCode);
-	void StartL();
-	void RunL();
+	virtual void StartL();
+
+private:
 	TInt RunError(TInt aError);
 	void DoCancel();
 
-private:
+protected:
     const ESock::CMetaConnectionProviderBase& iNode;
 	TInt iStopCode;
 	RProperty iProperty;
 	TBool iBlocking;
-	
+	};
+
+NONSHARABLE_CLASS(CMCPrPubSubAvailability) : public CMCPrPubSubSubscriber
+    {
+public:
+	static CMCPrPubSubAvailability* NewL(const ESock::CMetaConnectionProviderBase& aProvBase, TUint aStopCode);
+
+	void StartAvailabilityMonitoringL(const Messages::TNodeCtxId& aAvailabilityActivity);
+	void CancelAvailabilityMonitoring();
+
+private:
+	CMCPrPubSubAvailability(const ESock::CMetaConnectionProviderBase& aProvBase, TUint aStopCode);
+	void RunL();
+
 	//the availablity activity subscribing for pubsub availablity changes.
 	Messages::TNodeCtxId iAvailabilityActivity;
+    };
+
+NONSHARABLE_CLASS(CMCPrPubSubStopTrigger) : public CMCPrPubSubSubscriber
+    {
+public:
+    static CMCPrPubSubStopTrigger* NewL(const ESock::CMetaConnectionProviderBase& aProvBase, TUint aStopCode);
+
+    enum
+    {
+		KStart			= 1, // Causes a TStart message to be issued
+		KBlockingStop   = 2, // Causes a TStop to be issued and increments the blocking count to stop the node from being cleaned up.
+		KStop	        = 3  // Causes a TStop to be issued;
 	};
 
+protected:
+    void StartL();
+private:
+	CMCPrPubSubStopTrigger(const ESock::CMetaConnectionProviderBase& aProvBase, TUint aStopCode);
+	void RunL();
+
+	Messages::TNodeId iNodeId;
+    };
+
 #endif // _DUMMYPR_MCPrPUBSUBSUBSCRIBER_H_