diff options
author | Ted Ross <tross@apache.org> | 2010-01-29 22:07:03 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2010-01-29 22:07:03 +0000 |
commit | 6f16d9d4fa398056a817726ca8512f356422353d (patch) | |
tree | 3336090b503ae69264abd3d43e84f3be02af41c6 /qpid/cpp/include | |
parent | cbb2022f29b9905e8c80f5622441a46778cb6a4b (diff) | |
download | qpid-python-6f16d9d4fa398056a817726ca8512f356422353d.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@904645 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/include')
-rw-r--r-- | qpid/cpp/include/qpid/agent/ManagementAgent.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/qpid/cpp/include/qpid/agent/ManagementAgent.h b/qpid/cpp/include/qpid/agent/ManagementAgent.h index 1a8d0c4025..b0f0f1cec4 100644 --- a/qpid/cpp/include/qpid/agent/ManagementAgent.h +++ b/qpid/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; }; |