00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __JackMachPort__
00021 #define __JackMachPort__
00022
00023 #include <mach/mach.h>
00024 #include <mach/mach_types.h>
00025 #include <mach/message.h>
00026 #include <mach/mach_error.h>
00027 #include <servers/bootstrap.h>
00028
00029 namespace Jack
00030 {
00031
00036 class JackMachPort
00037 {
00038
00039 protected:
00040
00041 mach_port_t fBootPort;
00042 mach_port_t fServerPort;
00043
00044 public:
00045
00046 JackMachPort():fBootPort(0), fServerPort(0)
00047 {}
00048 virtual ~JackMachPort()
00049 {}
00050
00051 virtual bool AllocatePort(const char* name);
00052 virtual bool AllocatePort(const char* name, int queue);
00053 virtual bool ConnectPort(const char* name);
00054 virtual bool DisconnectPort();
00055 virtual bool DestroyPort();
00056 virtual mach_port_t GetPort();
00057 };
00058
00063 class JackMachPortSet : public JackMachPort
00064 {
00065
00066 private:
00067
00068 mach_port_t fPortSet;
00069
00070 public:
00071
00072 JackMachPortSet():fPortSet(0)
00073 {}
00074 virtual ~JackMachPortSet()
00075 {}
00076
00077 bool AllocatePort(const char* name);
00078 bool AllocatePort(const char* name, int queue);
00079 bool DisconnectPort();
00080 bool DestroyPort();
00081 mach_port_t GetPortSet();
00082 mach_port_t AddPort();
00083 };
00084
00085 }
00086
00087 #endif
00088