IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
PendingActionRequest.h
1 // PendingActionRequest.h:
3 // -----------------------
4 //
15 
16 #ifndef __IPSDKCORE_PENDINGACTIONREQUEST_H__
17 #define __IPSDKCORE_PENDINGACTIONREQUEST_H__
18 
19 // suppression warnings
20 // warning C4251: 'ipsdk::core::PendingActionRequest::_pAction' : class 'boost::shared_ptr<T>' needs to have dll-interface to be used by clients of class 'ipsdk::core::PendingActionRequest'
21 #pragma warning (push)
22 #pragma warning (disable : 4251)
23 
24 #include <IPSDKCore/Processing/ActionRequest/BaseActionRequest.h>
26 #include <IPSDKComm/TcpIp/Types.h>
27 #include <boost/thread/mutex.hpp>
28 #include <boost/thread/condition_variable.hpp>
29 
30 namespace ipsdk {
31 
32 class BaseIArchive;
33 
34 namespace core {
35 
38 
40 {
41  // friend class for protected accesses
42  friend class UpdatePendingAction;
43  friend class AskForRemoteAction;
44 
45 public:
51 
52 // methods
53 public:
55  eActionRequestType getActionRequestType() const;
56 
63  BoolResult init(const ActionPtr& pAction,
64  const Guid& socketGuid,
65  const Guid& providerGuid,
66  const Guid& requestGuid);
67 
70  const Guid& getSocketGuid() const;
71 
74  const Guid& getProviderGuid() const;
75 
76 protected:
79  BoolResult sendAction();
80 
83  ExecResult executeActionDerived();
84 
89  void updateAction(BaseIArchive& ar);
90 
95  BoolResult notifyActionUpdated();
96 
98  void requestCancellationDerived();
99 
101  void clearDerived();
102 
104  void connectionLostCB(const tcpip::SocketDesc& socketDesc,
105  const boost::system::error_code& ec);
106 
108  void deliveryCB(const Guid& socketGuid,
109  ipUInt64 nDeliveryId,
110  bool bSuccess);
111 
112 // attributes
113 protected:
116 
119 
122 
125 
127  boost::mutex _derivedMutex;
128 };
129 
132 
133 inline eActionRequestType
135 {
137 }
138 
141 
142 } // end of namespace core
143 } // end of namespace ipsdk
144 
145 #pragma warning (pop)
146 
147 #endif // __IPSDKCORE_PENDINGACTIONREQUEST_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Action request issued from local machine, sent to distant and waiting for completion.
Definition: ActionRequestTypes.h:44
eActionRequestType getActionRequestType() const
retrieve action request type
Definition: PendingActionRequest.h:134
Action allowing to update a pending action on a distant machine.
Definition: UpdatePendingAction.h:32
boost::mutex _derivedMutex
mutex used to wait for send acquittal
Definition: PendingActionRequest.h:127
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
Base class for action requests.
Definition: BaseActionRequest.h:40
Guid _socketGuid
socket guid associated to remote request
Definition: PendingActionRequest.h:118
Guid _socketCBGuid
guid of socket deconnection callback
Definition: PendingActionRequest.h:124
boost::shared_ptr< BaseAction > ActionPtr
shared pointer to BaseAction
Definition: ActionTypes.h:54
#define IPSDKCORE_API
Import/Export macro for library IPSDKCore.
Definition: IPSDKCoreExports.h:27
Guid _providerGuid
provider guid associated to remote request
Definition: PendingActionRequest.h:121
Class encapsulating an auto initialized uuid.
Definition: Guid.h:27
Class used for pending action request encapsulation.
Definition: PendingActionRequest.h:39
Base class for serialization input archives.
Definition: BaseIArchive.h:36
Definition: SocketDesc.h:35
eActionRequestType
Enumerate describing action request type.
Definition: ActionRequestTypes.h:38
ActionPtr _pAction
pointer to action associated to request
Definition: PendingActionRequest.h:115
Predefined types for ip addresses management.
Action allowing to ask for a new action on a distant machine.
Definition: AskForRemoteAction.h:31
Predefined types for actions management.