1 /* 2 * Copyright 2019, Ryan Leavengood 3 * Copyright 2009, Axel Dörfler, axeld@pinc-software.de. 4 * Distributed under the terms of the MIT License. 5 */ 6 #ifndef _PORT_POOL_H 7 #define _PORT_POOL_H 8 9 10 #include <ServerInterface.h> 11 12 #include <set> 13 14 15 namespace BPrivate { 16 namespace media { 17 18 19 class PortPool : BLocker { 20 public: 21 PortPool(); 22 ~PortPool(); 23 24 port_id GetPort(); 25 void PutPort(port_id port); 26 27 private: 28 typedef std::set<port_id> PortSet; 29 30 PortSet fPool; 31 }; 32 33 34 extern PortPool* gPortPool; 35 36 37 } // namespace media 38 } // namespace BPrivate 39 40 41 #endif // _PORT_POOL_H