IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ComputerInfoPool.h
1 // ComputerInfoPool.h:
3 // -------------------
4 //
15 
16 #ifndef __IPSDKCORE_COMPUTERINFOPOOL_H__
17 #define __IPSDKCORE_COMPUTERINFOPOOL_H__
18 
19 // suppression warnings
20 // warning C4275: non dll-interface class 'boost::noncopyable_::noncopyable' used as base for dll-interface class 'ipsdk::core::ComputerInfoPool'
21 // warning C4251: 'ipsdk::core::ComputerInfoPool::_computerInfoMap' : class 'std::map<_Kty,_Ty>' needs to have dll-interface to be used by clients of class 'ipsdk::core::ComputerInfoPool'
22 #pragma warning (push)
23 #pragma warning (disable : 4275 4251)
24 
26 #include <IPSDKCore/ComputerInfo/LocalComputerInfo.h>
28 #include <IPSDKUtil/Tools/ProcessingResult.h>
30 #include <boost/noncopyable.hpp>
31 #include <map>
32 
33 namespace ipsdk {
34 namespace core {
35 
38 
39 class IPSDKCORE_API ComputerInfoPool : public boost::noncopyable
40 {
41 protected:
47 
48 // access to singleton
49 public:
51  static ComputerInfoPool& getInstance();
52 
53 // methods
54 public:
56  bool isInit() const;
57 
59  BoolResult init(const LocalConfiguration& localConfiguration);
60 
64  const LocalComputerInfo& getLocalComputerInfoConst() const;
65  LocalComputerInfo& getLocalComputerInfo();
67 
70  bool existsRemoteComputerInfo(const Guid& socketGuid) const;
71 
75  RemoteComputerInfoConstPtr getRemoteComputerInfo(const Guid& socketGuid) const;
76 
79  void retrieveDirectSlaves(GuidSet& guidSet) const;
80 
83  void retrieveAllSlaves(GuidSet& guidSet) const;
84 
86 
90  BoolResult addDirectSlave(const RemoteComputerInfoPtr& pRemoteComputerInfo);
91 
95  BoolResult addIndirectSlave(const RemoteComputerInfoPtr& pRemoteComputerInfo);
96 
100  BoolResult addComputer(const RemoteComputerInfoPtr& pRemoteComputerInfo);
101 
105  BoolResult removeComputer(const Guid& socketGuid);
106 
108  void clear();
109 
110 protected:
112  void clearInternal();
113 
114 // attributes
115 protected:
118 
121 
124 
125  // collection of all slaves
126  GuidSet _allSlaves;
127 
129  bool _bInit;
130 };
131 
134 
135 inline bool
137 {
138  return _bInit;
139 }
140 
143 
144 } // end of namespace core
145 } // end of namespace ipsdk
146 
147 #pragma warning (pop)
148 
149 #endif // __IPSDKCORE_COMPUTERINFOPOOL_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
RemoteComputerInfoMap _remoteComputerInfoMap
collection of remote computer informations associated to pool
Definition: ComputerInfoPool.h:120
Definition: LocalComputerInfo.h:28
bool isInit() const
retrieve object initialization flag
Definition: ComputerInfoPool.h:136
boost::shared_ptr< const RemoteComputerInfo > RemoteComputerInfoConstPtr
shared pointer to const remote computer informations
Definition: ComputerInfoPoolTypes.h:34
GuidSet _directSlaves
collection of direct slaves guid
Definition: ComputerInfoPool.h:123
Definition of import/export macro for library.
Class allowing to describe local computer processing configuration.
Definition: LocalConfiguration.h:35
#define IPSDKCORE_API
Import/Export macro for library IPSDKCore.
Definition: IPSDKCoreExports.h:27
std::map< Guid, RemoteComputerInfoPtr > RemoteComputerInfoMap
Definition: ComputerInfoPoolTypes.h:38
Class encapsulating an auto initialized uuid.
Definition: Guid.h:27
LocalComputerInfo _localComputerInfo
local computer informations associated to pool
Definition: ComputerInfoPool.h:117
Singleton allowing to store local and remote informations about computers into processing pool...
Definition: ComputerInfoPool.h:39
boost::shared_ptr< RemoteComputerInfo > RemoteComputerInfoPtr
shared pointer to remote computer informations
Definition: ComputerInfoPoolTypes.h:25
bool _bInit
object initialization flag
Definition: ComputerInfoPool.h:129
Predefined types for computer information pool management.
std::set< Guid > GuidSet
collection of unique ordered guid
Definition: GuidTypes.h:27
Predefined types for guid management.