summaryrefslogtreecommitdiff
path: root/cpp/include/qpid/sys
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/include/qpid/sys')
-rw-r--r--cpp/include/qpid/sys/IOHandle.h15
-rw-r--r--cpp/include/qpid/sys/SystemInfo.h25
-rw-r--r--cpp/include/qpid/sys/posix/PrivatePosix.h22
3 files changed, 25 insertions, 37 deletions
diff --git a/cpp/include/qpid/sys/IOHandle.h b/cpp/include/qpid/sys/IOHandle.h
index 45fc8c240a..06ae65f879 100644
--- a/cpp/include/qpid/sys/IOHandle.h
+++ b/cpp/include/qpid/sys/IOHandle.h
@@ -22,8 +22,6 @@
*
*/
-#include "qpid/CommonImportExport.h"
-
namespace qpid {
namespace sys {
@@ -31,18 +29,7 @@ namespace sys {
* This is a class intended to abstract the Unix concept of file descriptor
* or the Windows concept of HANDLE
*/
-class PollerHandle;
-class IOHandlePrivate;
-class IOHandle {
- friend class PollerHandle;
- friend class IOHandlePrivate;
-
-protected:
- IOHandlePrivate* const impl;
-
- IOHandle(IOHandlePrivate*);
- QPID_COMMON_EXTERN virtual ~IOHandle();
-};
+class IOHandle;
}}
diff --git a/cpp/include/qpid/sys/SystemInfo.h b/cpp/include/qpid/sys/SystemInfo.h
index 24bc099d75..1b5720a5f0 100644
--- a/cpp/include/qpid/sys/SystemInfo.h
+++ b/cpp/include/qpid/sys/SystemInfo.h
@@ -47,16 +47,23 @@ QPID_COMMON_EXTERN long concurrency();
QPID_COMMON_EXTERN bool getLocalHostname (Address &address);
/**
- * Get the (possibly multiple) local IP addresses of this host
- * using the specified port.
+ * Get the names of all the network interfaces connected to
+ * this host.
+ * @param names Receives the list of interface names
*/
-QPID_COMMON_EXTERN void getLocalIpAddresses (uint16_t port, std::vector<Address> &addrList);
+QPID_COMMON_EXTERN void getInterfaceNames(std::vector<std::string>& names );
/**
- * Return true if host names an address of the local host.
- *@param host host name or IP address.
+ * Get strings for each of the IP addresses associated with a named network
+ * interface.
+ * If there is no interface of that name an empty list will be returned.
+ *
+ * @param interface The name of the network interface
+ * @param addresses The list of the strings for the IP addresses are pushed on the back of this parameter
+ * to get just the list you need to clear the vector before using it.
+ * @return true if an interface of the correct name was found, false otherwise
*/
-QPID_COMMON_EXTERN bool isLocalHost(const std::string& host);
+QPID_COMMON_EXTERN bool getInterfaceAddresses(const std::string& interface, std::vector<std::string>& addresses);
/**
* Retrieve system identifiers and versions. This is information that can
@@ -90,6 +97,12 @@ QPID_COMMON_EXTERN uint32_t getParentProcessId();
*/
QPID_COMMON_EXTERN std::string getProcessName();
+/**
+ * Can thread related primitives be trusted during runtime house-cleaning?
+ * (i.e. static destructors, atexit()).
+ */
+QPID_COMMON_EXTERN bool threadSafeShutdown();
+
}}} // namespace qpid::sys::SystemInfo
diff --git a/cpp/include/qpid/sys/posix/PrivatePosix.h b/cpp/include/qpid/sys/posix/PrivatePosix.h
index 79cb950275..0f59fe3176 100644
--- a/cpp/include/qpid/sys/posix/PrivatePosix.h
+++ b/cpp/include/qpid/sys/posix/PrivatePosix.h
@@ -23,7 +23,6 @@
*/
#include "qpid/sys/Time.h"
-#include "qpid/sys/IOHandle.h"
struct timespec;
struct timeval;
@@ -41,32 +40,21 @@ Duration toTime(const struct timespec& ts);
class SocketAddress;
const struct addrinfo& getAddrInfo(const SocketAddress&);
-// Private fd related implementation details
-class IOHandlePrivate {
+// Posix fd as an IOHandle
+class IOHandle {
public:
- IOHandlePrivate(int f = -1) :
- fd(f)
+ IOHandle(int fd0 = -1) :
+ fd(fd0)
{}
int fd;
};
-int toFd(const IOHandlePrivate* h);
-
-// Posix fd as an IOHandle
-class PosixIOHandle : public IOHandle {
-public:
- PosixIOHandle(int fd) :
- IOHandle(new IOHandlePrivate(fd))
- {}
-};
-
// Dummy IOHandle for places it's required in the API
// but we promise not to actually try to do any operations on the IOHandle
class NullIOHandle : public IOHandle {
public:
- NullIOHandle() :
- IOHandle(new IOHandlePrivate)
+ NullIOHandle()
{}
};