summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qpid/cpp/src/Makefile.am7
-rw-r--r--qpid/cpp/src/qpid/sys/PollableCondition.h36
-rw-r--r--qpid/cpp/src/qpid/sys/PollableQueue.h6
-rw-r--r--qpid/cpp/src/qpid/sys/posix/PollableCondition.cpp (renamed from qpid/cpp/src/qpid/sys/PollableCondition.cpp)2
-rw-r--r--qpid/cpp/src/qpid/sys/posix/PollableCondition.h56
5 files changed, 64 insertions, 43 deletions
diff --git a/qpid/cpp/src/Makefile.am b/qpid/cpp/src/Makefile.am
index d66ab405b2..9b391a907f 100644
--- a/qpid/cpp/src/Makefile.am
+++ b/qpid/cpp/src/Makefile.am
@@ -75,7 +75,8 @@ posix_plat_src = \
qpid/sys/posix/Shlib.cpp \
qpid/sys/posix/Mutex.cpp \
qpid/sys/posix/Fork.cpp \
- qpid/sys/posix/StrError.cpp
+ qpid/sys/posix/StrError.cpp \
+ qpid/sys/posix/PollableCondition.cpp
posix_plat_hdr = \
qpid/sys/posix/check.h \
@@ -83,7 +84,8 @@ posix_plat_hdr = \
qpid/sys/posix/PrivatePosix.h \
qpid/sys/posix/Mutex.h \
qpid/sys/posix/Fork.h \
- qpid/sys/posix/LockFile.h
+ qpid/sys/posix/LockFile.h \
+ qpid/sys/posix/PollableCondition.h
if HAVE_EPOLL
poller = qpid/sys/epoll/EpollPoller.cpp
@@ -266,7 +268,6 @@ libqpidcommon_la_SOURCES = \
qpid/sys/AsynchIOHandler.cpp \
qpid/sys/Dispatcher.cpp \
qpid/sys/PollableCondition.h \
- qpid/sys/PollableCondition.cpp \
qpid/sys/PollableQueue.h \
qpid/sys/Runnable.cpp \
qpid/sys/SystemInfo.cpp \
diff --git a/qpid/cpp/src/qpid/sys/PollableCondition.h b/qpid/cpp/src/qpid/sys/PollableCondition.h
index 6f0e12a474..56d38f90da 100644
--- a/qpid/cpp/src/qpid/sys/PollableCondition.h
+++ b/qpid/cpp/src/qpid/sys/PollableCondition.h
@@ -22,39 +22,7 @@
*
*/
-#include "qpid/sys/IOHandle.h"
-
-// FIXME aconway 2008-08-11: this could be of more general interest,
-// move to sys namespace in common lib.
-//
-
-namespace qpid {
-namespace sys {
-
-/**
- * A pollable condition to integrate in-process conditions with IO
- * conditions in a polling loop.
- *
- * Setting the condition makes it readable for a poller.
- *
- * Writable/disconnected conditions are undefined and should not be
- * polled for.
- */
-class PollableCondition : public sys::IOHandle {
- public:
- PollableCondition();
-
- /** Set the condition, triggers readable in a poller. */
- void set();
-
- /** Get the current state of the condition, then clear it.
- *@return The state of the condition before it was cleared.
- */
- bool clear();
-
- private:
- int writeFd;
-};
-}} // namespace qpid::sys
+// Currently only has a posix implementation, add #ifdefs for other platforms as needed.
+#include "posix/PollableCondition.h"
#endif /*!QPID_SYS_POLLABLECONDITION_H*/
diff --git a/qpid/cpp/src/qpid/sys/PollableQueue.h b/qpid/cpp/src/qpid/sys/PollableQueue.h
index 153ae31135..ca97c0d8c9 100644
--- a/qpid/cpp/src/qpid/sys/PollableQueue.h
+++ b/qpid/cpp/src/qpid/sys/PollableQueue.h
@@ -31,13 +31,9 @@
#include <deque>
namespace qpid {
-
-namespace sys { class Poller; }
-
namespace sys {
-// FIXME aconway 2008-08-11: this could be of more general interest,
-// move to common lib.
+class Poller;
/**
* A queue that can be polled by sys::Poller. Any thread can push to
diff --git a/qpid/cpp/src/qpid/sys/PollableCondition.cpp b/qpid/cpp/src/qpid/sys/posix/PollableCondition.cpp
index 5a3bd583cf..4ff66d1106 100644
--- a/qpid/cpp/src/qpid/sys/PollableCondition.cpp
+++ b/qpid/cpp/src/qpid/sys/posix/PollableCondition.cpp
@@ -26,8 +26,8 @@
// move to common lib.
//
+#include "PollableCondition.h"
#include "qpid/sys/posix/PrivatePosix.h"
-#include "qpid/sys/PollableCondition.h"
#include "qpid/Exception.h"
#include <unistd.h>
diff --git a/qpid/cpp/src/qpid/sys/posix/PollableCondition.h b/qpid/cpp/src/qpid/sys/posix/PollableCondition.h
new file mode 100644
index 0000000000..4ec277b0ec
--- /dev/null
+++ b/qpid/cpp/src/qpid/sys/posix/PollableCondition.h
@@ -0,0 +1,56 @@
+#ifndef QPID_SYS_POSIX_POLLABLECONDITION_H
+#define QPID_SYS_POSIX_POLLABLECONDITION_H
+
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include "qpid/sys/IOHandle.h"
+
+namespace qpid {
+namespace sys {
+
+/**
+ * A pollable condition to integrate in-process conditions with IO
+ * conditions in a polling loop.
+ *
+ * Setting the condition makes it readable for a poller.
+ *
+ * Writable/disconnected conditions are undefined and should not be
+ * polled for.
+ */
+class PollableCondition : public sys::IOHandle {
+ public:
+ PollableCondition();
+
+ /** Set the condition, triggers readable in a poller. */
+ void set();
+
+ /** Get the current state of the condition, then clear it.
+ *@return The state of the condition before it was cleared.
+ */
+ bool clear();
+
+ private:
+ int writeFd;
+};
+}} // namespace qpid::sys
+
+#endif /*!QPID_SYS_POSIX_POLLABLECONDITION_H*/