00001 #ifndef QPID_SYS_POSIX_FORK_H
00002 #define QPID_SYS_POSIX_FORK_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <string>
00023 #include <sys/types.h>
00024
00025 namespace qpid {
00026 namespace sys {
00027
00031 class Fork {
00032 public:
00033 Fork();
00034 virtual ~Fork();
00035
00040 virtual void fork();
00041
00042 protected:
00043
00047 virtual void parent(pid_t child) = 0;
00048
00050 virtual void child() = 0;
00051 };
00052
00057 class ForkWithMessage : public Fork {
00058 public:
00059 ForkWithMessage();
00060 void fork();
00061
00062 protected:
00067 std::string wait(int timeout);
00068
00072 void ready(const std::string& value);
00073
00074 private:
00075 int pipeFds[2];
00076 };
00077
00078 }}
00079
00080
00081
00082 #endif