datacommsserver/esockserver/test/providers/dummy/inc/dummypr_mcprpubsubsubscriber.h
branchRCL_3
changeset 13 0b0e9fce0b58
parent 2 dee179edb159
equal deleted inserted replaced
12:8b5d60ce1e94 13:0b0e9fce0b58
    29 #include <comms-infras/ss_nodemessages.h>
    29 #include <comms-infras/ss_nodemessages.h>
    30 #include <comms-infras/ss_mmcommsprov.h>
    30 #include <comms-infras/ss_mmcommsprov.h>
    31 #include <comms-infras/ss_metaconnprov.h>
    31 #include <comms-infras/ss_metaconnprov.h>
    32 
    32 
    33 
    33 
    34 NONSHARABLE_CLASS(CMCPrPubSubSubscriber) : public CActive, public Messages::ASimpleNodeIdBase
    34 class CMCPrPubSubSubscriber : public CActive, public Messages::ASimpleNodeIdBase
    35 	{
    35 	{
    36 public:
    36 public:
    37 	static CMCPrPubSubSubscriber* NewL(const ESock::CMetaConnectionProviderBase& aProvBase, TUint aStopCode);
       
    38 	void StartAvailabilityMonitoringL(const Messages::TNodeCtxId& aAvailabilityActivity);
       
    39 	void CancelAvailabilityMonitoring();
       
    40 	virtual ~CMCPrPubSubSubscriber();
    37 	virtual ~CMCPrPubSubSubscriber();
    41 
    38 
    42     enum
    39     enum
    43     {
    40     {
    44 		KStart			= 1, // Causes a TStart message to be issued
    41 		EAvailabilityTestingPubSubUid = 0x10272F42,
    45 		KBlockingStop   = 2, // Causes a TStop to be issued and increments the blocking count to stop the node from being cleaned up.
    42 		EStopTriggeringPubSubUid = 0x10203FDD
    46 		KStop	        = 3  // Causes a TStop to be issued;
       
    47 	};
    43 	};
    48     
       
    49     enum { EAvailabilityTestingPubSubUid = 0x10272F42 };  
       
    50     virtual void ReceivedL(const Messages::TRuntimeCtxId& /*aSender*/, const Messages::TNodeId& /*aRecipient*/, Messages::TSignatureBase& aMessage)
    44     virtual void ReceivedL(const Messages::TRuntimeCtxId& /*aSender*/, const Messages::TNodeId& /*aRecipient*/, Messages::TSignatureBase& aMessage)
    51         {
    45         {
    52         //This object is only a node because its host needs an TCFClientType::EAvailabilityProvider, which
    46         //This object is only a node because its host needs an TCFClientType::EAvailabilityProvider, which
    53         //can't be the same as the node.
    47         //can't be the same as the node.
    54         //Unfortunatelly the CAvailabilityActivity is really persistent when it comes to sending TCancel to
    48         //Unfortunatelly the CAvailabilityActivity is really persistent when it comes to sending TCancel to
    58             ASSERT(EFalse);
    52             ASSERT(EFalse);
    59             }
    53             }
    60         }
    54         }
    61 
    55 
    62 
    56 
       
    57 protected:
       
    58 	CMCPrPubSubSubscriber(const ESock::CMetaConnectionProviderBase& aProvBase, TUint aStopCode);
       
    59 	virtual void StartL();
       
    60 
    63 private:
    61 private:
    64 	CMCPrPubSubSubscriber(const ESock::CMetaConnectionProviderBase& aProvBase, TUint aStopCode);
       
    65 	void StartL();
       
    66 	void RunL();
       
    67 	TInt RunError(TInt aError);
    62 	TInt RunError(TInt aError);
    68 	void DoCancel();
    63 	void DoCancel();
    69 
    64 
    70 private:
    65 protected:
    71     const ESock::CMetaConnectionProviderBase& iNode;
    66     const ESock::CMetaConnectionProviderBase& iNode;
    72 	TInt iStopCode;
    67 	TInt iStopCode;
    73 	RProperty iProperty;
    68 	RProperty iProperty;
    74 	TBool iBlocking;
    69 	TBool iBlocking;
    75 	
    70 	};
       
    71 
       
    72 NONSHARABLE_CLASS(CMCPrPubSubAvailability) : public CMCPrPubSubSubscriber
       
    73     {
       
    74 public:
       
    75 	static CMCPrPubSubAvailability* NewL(const ESock::CMetaConnectionProviderBase& aProvBase, TUint aStopCode);
       
    76 
       
    77 	void StartAvailabilityMonitoringL(const Messages::TNodeCtxId& aAvailabilityActivity);
       
    78 	void CancelAvailabilityMonitoring();
       
    79 
       
    80 private:
       
    81 	CMCPrPubSubAvailability(const ESock::CMetaConnectionProviderBase& aProvBase, TUint aStopCode);
       
    82 	void RunL();
       
    83 
    76 	//the availablity activity subscribing for pubsub availablity changes.
    84 	//the availablity activity subscribing for pubsub availablity changes.
    77 	Messages::TNodeCtxId iAvailabilityActivity;
    85 	Messages::TNodeCtxId iAvailabilityActivity;
       
    86     };
       
    87 
       
    88 NONSHARABLE_CLASS(CMCPrPubSubStopTrigger) : public CMCPrPubSubSubscriber
       
    89     {
       
    90 public:
       
    91     static CMCPrPubSubStopTrigger* NewL(const ESock::CMetaConnectionProviderBase& aProvBase, TUint aStopCode);
       
    92 
       
    93     enum
       
    94     {
       
    95 		KStart			= 1, // Causes a TStart message to be issued
       
    96 		KBlockingStop   = 2, // Causes a TStop to be issued and increments the blocking count to stop the node from being cleaned up.
       
    97 		KStop	        = 3  // Causes a TStop to be issued;
    78 	};
    98 	};
    79 
    99 
       
   100 protected:
       
   101     void StartL();
       
   102 private:
       
   103 	CMCPrPubSubStopTrigger(const ESock::CMetaConnectionProviderBase& aProvBase, TUint aStopCode);
       
   104 	void RunL();
       
   105 
       
   106 	Messages::TNodeId iNodeId;
       
   107     };
       
   108 
    80 #endif // _DUMMYPR_MCPrPUBSUBSUBSCRIBER_H_
   109 #endif // _DUMMYPR_MCPrPUBSUBSUBSCRIBER_H_