22 #if !defined(__SS_FLOWREQUESTSTATES_H__) |
22 #if !defined(__SS_FLOWREQUESTSTATES_H__) |
23 #define __SS_FLOWREQUESTSTATES_H__ |
23 #define __SS_FLOWREQUESTSTATES_H__ |
24 |
24 |
25 #include <comms-infras/ss_coreprstates.h> |
25 #include <comms-infras/ss_coreprstates.h> |
26 #include <comms-infras/ss_corepractivities.h> |
26 #include <comms-infras/ss_corepractivities.h> |
|
27 #include "ss_nodemessages_dataclient.h" |
27 |
28 |
28 #include "ss_flowrequest.h" |
29 #include "ss_flowrequest.h" |
29 |
30 |
30 #include <elements/nm_messages_child.h> |
31 #include <elements/nm_messages_child.h> |
31 |
32 |
97 |
98 |
98 DECLARE_SMELEMENT_HEADER( TLeaveSubConnection, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext ) |
99 DECLARE_SMELEMENT_HEADER( TLeaveSubConnection, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext ) |
99 virtual void DoL(); |
100 virtual void DoL(); |
100 DECLARE_SMELEMENT_FOOTER( TLeaveSubConnection ) |
101 DECLARE_SMELEMENT_FOOTER( TLeaveSubConnection ) |
101 |
102 |
|
103 DECLARE_SMELEMENT_HEADER( TSendClientLeavingAndRemoveControlProvider, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext ) |
|
104 virtual void DoL(); |
|
105 DECLARE_SMELEMENT_FOOTER( TSendClientLeavingAndRemoveControlProvider ) |
102 |
106 |
103 |
107 |
104 // |
108 // |
105 //Cpr specific |
109 //Cpr specific |
106 DECLARE_SMELEMENT_HEADER( TJoinCpr, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext ) |
110 DECLARE_SMELEMENT_HEADER( TJoinCpr, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext ) |
144 { |
148 { |
145 } |
149 } |
146 |
150 |
147 virtual ~CFlowRequestActivity() |
151 virtual ~CFlowRequestActivity() |
148 { |
152 { |
|
153 if( !iBindToSender.IsNull() ) |
|
154 { |
|
155 TInt err = Error() ? Error() : KErrAbort; |
|
156 Messages::RNodeInterface::OpenPostMessageClose(Messages::TNodeCtxId(ActivityId(), iNode.Id()), |
|
157 iBindToSender, Messages::TEBase::TError(ESock::TCFDataClient::TBindToComplete::Id(), err).CRef()); |
|
158 } |
|
159 |
149 static_cast<ESock::CFlowRequest&>(iNode).iFlowParameters.Close(); |
160 static_cast<ESock::CFlowRequest&>(iNode).iFlowParameters.Close(); |
150 __ASSERT_DEBUG(iNode.CountAllActivities()==0, User::Panic(KSpecAssert_ESocksflwrqststs, 1)); |
161 __ASSERT_DEBUG(iNode.CountAllActivities()==0, User::Panic(KSpecAssert_ESocksflwrqststs, 1)); |
151 #ifndef __GCCXML__ |
162 #ifndef __GCCXML__ |
152 Messages::RNodeInterface::OpenPostMessageClose(Messages::TNodeCtxId(ActivityId(), iNode.Id()), |
163 Messages::RNodeInterface::OpenPostMessageClose(Messages::TNodeCtxId(ActivityId(), iNode.Id()), |
153 iNode.Id(), Messages::TEChild::TDestroy().CRef()); |
164 iNode.Id(), Messages::TEChild::TDestroy().CRef()); |
154 #endif |
165 #endif |
155 } |
166 } |
|
167 |
|
168 public: |
|
169 /* A node that has sent TCFDataClient::TBindTo. The response TCFDataClient::TBindToComplete |
|
170 * must be sent to this node. |
|
171 */ |
|
172 Messages::TNodeCtxId iBindToSender; |
156 |
173 |
157 public: |
174 public: |
158 typedef MeshMachine::TNodeContext<ESock::CFlowRequest, CoreStates::TContext> TContext; |
175 typedef MeshMachine::TNodeContext<ESock::CFlowRequest, CoreStates::TContext> TContext; |
|
176 |
|
177 DECLARE_SMELEMENT_HEADER( TAwaitingBindTo, MeshMachine::TState<TContext>, NetStateMachine::MState, TContext ) |
|
178 virtual TBool Accept(); |
|
179 DECLARE_SMELEMENT_FOOTER( TAwaitingBindTo ) |
|
180 |
159 DECLARE_SMELEMENT_HEADER( TStoreFlowParams, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext ) |
181 DECLARE_SMELEMENT_HEADER( TStoreFlowParams, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext ) |
160 virtual void DoL(); |
182 virtual void DoL(); |
161 DECLARE_SMELEMENT_FOOTER( TStoreFlowParams ) |
183 DECLARE_SMELEMENT_FOOTER( TStoreFlowParams ) |
|
184 |
|
185 DECLARE_SMELEMENT_HEADER( TSendBindToComplete, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext ) |
|
186 virtual void DoL(); |
|
187 DECLARE_SMELEMENT_FOOTER( TSendBindToComplete ) |
162 }; |
188 }; |
163 |
189 |
164 class CFlowRequestDestroyActivity : public MeshMachine::CNodeActivityBase, protected MeshMachine::APreallocatedOriginators<1> |
190 class CFlowRequestDestroyActivity : public MeshMachine::CNodeActivityBase, protected MeshMachine::APreallocatedOriginators<1> |
165 { |
191 { |
166 public: |
192 public: |