summaryrefslogtreecommitdiff
path: root/cpp/include
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2010-01-29 22:07:03 +0000
committerTed Ross <tross@apache.org>2010-01-29 22:07:03 +0000
commit73ad8a2de26f0c7830aacb608b4b6ea44914f683 (patch)
tree60403e69f3483b0d92c567c77cefd1525525b04d /cpp/include
parent5cd0ee04a9c1095b96f312d5694f607b07d59b63 (diff)
downloadqpid-python-73ad8a2de26f0c7830aacb608b4b6ea44914f683.tar.gz
QPID-2251, QPID-1982 - Added alternative to non-portable FD notifier in the c++ QMF agent.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@904645 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/include')
-rw-r--r--cpp/include/qpid/agent/ManagementAgent.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/cpp/include/qpid/agent/ManagementAgent.h b/cpp/include/qpid/agent/ManagementAgent.h
index 1a8d0c4025..b0f0f1cec4 100644
--- a/cpp/include/qpid/agent/ManagementAgent.h
+++ b/cpp/include/qpid/agent/ManagementAgent.h
@@ -30,6 +30,12 @@
namespace qpid {
namespace management {
+class Notifyable {
+public:
+ virtual ~Notifyable() {}
+ virtual void notify() = 0;
+};
+
class ManagementAgent
{
public:
@@ -150,11 +156,20 @@ class ManagementAgent
virtual uint32_t pollCallbacks(uint32_t callLimit = 0) = 0;
// If "useExternalThread" was set to true in the constructor, this method provides
- // a standard file descriptor that can be used in a select statement to signal that
- // there are method callbacks ready (i.e. that "pollCallbacks" will result in at
- // least one method call). When this fd is ready-for-read, pollCallbacks may be
- // invoked. Calling pollCallbacks shall reset the ready-to-read state of the fd.
+ // a callback that is invoked whenever there is work to be done by pollCallbacks.
+ // This function is invoked on the agent's thread and should not perform any work
+ // except to signal the application's thread.
+ //
+ // There are two flavors of callback:
+ // A C version that uses a pointer to a function with a void* context
+ // A C++ version that uses a class derived from Notifyable
+ //
+ // Either type of callback may be used. If they are both provided, the C++ callback
+ // will be the only one invoked.
//
+ typedef void (*cb_t)(void*);
+ virtual void setSignalCallback(cb_t callback, void* context) = 0;
+ virtual void setSignalCallback(Notifyable& notifyable) = 0;
virtual int getSignalFd() = 0;
};