ESA JPIP server  0.1
ipc_object.h
Go to the documentation of this file.
1 #ifndef _IPC_OBJECT_H_
2 #define _IPC_OBJECT_H_
3 
4 
5 #include "tr1_compat.h"
6 
7 
8 namespace ipc
9 {
10 
17  {
21  };
22 
23 
39  class IPCObject
40  {
41  private:
48  bool valid;
49 
50  public:
54  typedef SHARED_PTR<IPCObject> Ptr;
55 
60  {
61  valid = false;
62  }
63 
70  virtual bool Init()
71  {
72  valid = true;
73  return true;
74  }
75 
84  virtual WaitResult Wait(int time_out = -1)
85  {
86  return WAIT_ERROR;
87  }
88 
93  bool IsValid()
94  {
95  return valid;
96  }
97 
104  virtual bool Dispose()
105  {
106  valid = false;
107  return true;
108  }
109 
113  virtual ~IPCObject()
114  {
115  Dispose();
116  }
117  };
118 
119 }
120 
121 
122 #endif /* _IPC_OBJECT_H_ */
SHARED_PTR< IPCObject > Ptr
Pointer to an IPC object.
Definition: ipc_object.h:54
Wait successful (object got)
Definition: ipc_object.h:18
Error.
Definition: ipc_object.h:20
Class base of all the IPC classes that has the basic operations (Init, Wait and Dispose) to be overlo...
Definition: ipc_object.h:39
bool valid
Internal status of the object.
Definition: ipc_object.h:48
Time out.
Definition: ipc_object.h:19
virtual ~IPCObject()
The desctructor calls the method Dispose.
Definition: ipc_object.h:113
bool IsValid()
Returns true if the object is valid, that is, the internal status value is true.
Definition: ipc_object.h:93
Contains classes for working with the IPC mechanisms available in Linux using the pthread library...
Definition: event.cc:7
virtual WaitResult Wait(int time_out=-1)
Performs a wait operation with the object to get it.
Definition: ipc_object.h:84
virtual bool Init()
Sets the internal status to true
Definition: ipc_object.h:70
virtual bool Dispose()
Release the resources associated to the IPC object and sets the internal status to false...
Definition: ipc_object.h:104
IPCObject()
Initializes the internal status to false.
Definition: ipc_object.h:59
WaitResult
Enumeration of the possible values returned when a wait operation is performed for an IPC object...
Definition: ipc_object.h:16