8
#include <boost/tr1/memory.hpp>
16
* Enumeration of the possible values returned
17
* when a wait operation is performed for an IPC
22
WAIT_OBJECT = 0, ///< Wait successful (object got)
23
WAIT_TIMEOUT, ///< Time out
29
* Class base of all the IPC classes that has the basic
30
* operations (<code>Init</code>, <code>Wait</code> and
31
* <code>Dispose</code>) to be overloaded. It has also
32
* an internal boolean value to set the object status.
34
* For the IPC objects the Windows IPC philosophy has
35
* been adopted because of its simplicity and flexibility.
36
* Under this philosophy, the main operation that can be
37
* performed to an IPC object is <code>Wait</code>, to wait
38
* for getting the control of the object. Depending on
39
* the type of the IPC object (mutex, event, etc.), the
40
* meaning of "getting" the control of the object can be
47
* Internal status of the object. As it is a private
48
* member, the derived classes must use the methods
49
* <code>Init</code> and <code>Dispose</code> to set
50
* the value of this status.
56
* Pointer to an IPC object.
58
typedef std::tr1::shared_ptr<IPCObject> Ptr;
61
* Initializes the internal status to <code>false</code>.
69
* Sets the internal status to <code>true</code>
70
* @return <code>true</code> if successful. If it
71
* is not overloaded, it always returns <code>true
81
* Performs a wait operation with the object to get it.
82
* @param time_out Time out (infinite by default).
83
* @return <code>WAIT_OBJECT</code> if successful,
84
* <code>WAIT_TIMEOUT</code> if time out or <code>
85
* WAIT_ERROR</code> is error. If it is not overloaded,
86
* it always returns <code>WAIT_ERROR</code>.
88
virtual WaitResult Wait(int time_out = -1)
94
* Returns <code>true</code> if the object is valid,
95
* that is, the internal status value is <code>true</code>.
103
* Release the resources associated to the IPC object and
104
* sets the internal status to <code>false</code>.
105
* @return <code>true</code> if successful. If it is not
106
* overloaded, it always returns <code>true</code>.
108
virtual bool Dispose()
115
* The desctructor calls the method <code>Dispose</code>.
126
#endif /* _IPC_OBJECT_H_ */