IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
PendingActionRequestManager.h
1 // PendingActionRequestManager.h:
3 // ------------------------------
4 //
14 
15 #ifndef __IPSDKCORE_PENDINGACTIONREQUESTMANAGER_H__
16 #define __IPSDKCORE_PENDINGACTIONREQUESTMANAGER_H__
17 
18 // suppression warnings
19 // warning C4275: non dll-interface class 'boost::noncopyable_::noncopyable' used as base for dll-interface class 'ipsdk::core::PendingActionRequestManager'
20 // warning C4251: 'ipsdk::core::PendingActionRequestManager::_mutex' : class 'boost::mutex' needs to have dll-interface to be used by clients of class 'ipsdk::core::PendingActionRequestManager'
21 #pragma warning (push)
22 #pragma warning (disable : 4275 4251)
23 
26 #include <IPSDKUtil/Tools/Guid.h>
27 #include <boost/noncopyable.hpp>
28 #include <boost/thread/mutex.hpp>
29 #include <map>
30 
31 namespace ipsdk {
32 namespace core {
33 
36 
37 class IPSDKCORE_API PendingActionRequestManager : public boost::noncopyable
38 {
39 public:
41  static PendingActionRequestManager& getInstance();
42 
43 protected:
46 
47 public:
50 
51 // methods
52 public:
58  void registerRequest(const PendingActionRequestPtr& pRequest);
59 
62  bool isRegistredRequest(const Guid& requestGuid) const;
63 
66  PendingActionRequestPtr releaseRequest(const Guid& requestGuid);
67 
68 // attributes
69 protected:
71  mutable boost::mutex _mutex;
72 
74  typedef std::map<Guid, PendingActionRequestPtr> RequestMap;
75 
78 };
79 
82 
83 } // end of namespace core
84 } // end of namespace ipsdk
85 
86 #pragma warning (pop)
87 
88 #endif // __IPSDKCORE_PENDINGACTIONREQUESTMANAGER_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Definition of import/export macro for library.
RequestMap _requestMap
collection of registred requests
Definition: PendingActionRequestManager.h:77
#define IPSDKCORE_API
Import/Export macro for library IPSDKCore.
Definition: IPSDKCoreExports.h:27
boost::shared_ptr< PendingActionRequest > PendingActionRequestPtr
shared pointer to pending action request
Definition: ActionRequestTypes.h:55
Class encapsulating an auto initialized uuid.
Definition: Guid.h:27
Predefined types for action resquests management.
boost::mutex _mutex
mutex allowing to lock object data during execution
Definition: PendingActionRequestManager.h:71
std::map< Guid, PendingActionRequestPtr > RequestMap
collection allowing to associated a guid to a request
Definition: PendingActionRequestManager.h:74
Singleton class allowing to store and manage pending action requests.
Definition: PendingActionRequestManager.h:37