jack2 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
1.9KB

  1. /*
  2. Copyright (C) 2004-2008 Grame
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as published by
  5. the Free Software Foundation; either version 2.1 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. #ifndef __JackMachPort__
  16. #define __JackMachPort__
  17. #include <mach/mach.h>
  18. #include <mach/mach_types.h>
  19. #include <mach/message.h>
  20. #include <mach/mach_error.h>
  21. #include <servers/bootstrap.h>
  22. namespace Jack
  23. {
  24. /*!
  25. \brief Mach port.
  26. */
  27. class JackMachPort
  28. {
  29. protected:
  30. mach_port_t fBootPort;
  31. mach_port_t fServerPort;
  32. public:
  33. JackMachPort():fBootPort(0), fServerPort(0)
  34. {}
  35. virtual ~JackMachPort()
  36. {}
  37. virtual bool AllocatePort(const char* name);
  38. virtual bool AllocatePort(const char* name, int queue);
  39. virtual bool ConnectPort(const char* name);
  40. virtual bool DisconnectPort();
  41. virtual bool DestroyPort();
  42. virtual mach_port_t GetPort();
  43. };
  44. /*!
  45. \brief Mach port set.
  46. */
  47. class JackMachPortSet : public JackMachPort
  48. {
  49. private:
  50. mach_port_t fPortSet;
  51. public:
  52. JackMachPortSet():fPortSet(0)
  53. {}
  54. virtual ~JackMachPortSet()
  55. {}
  56. bool AllocatePort(const char* name);
  57. bool AllocatePort(const char* name, int queue);
  58. bool DisconnectPort();
  59. bool DestroyPort();
  60. mach_port_t GetPortSet();
  61. mach_port_t AddPort();
  62. };
  63. } // end of namespace
  64. #endif