summaryrefslogtreecommitdiff
path: root/qpid/cpp/include/qmf/engine/Agent.h
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/include/qmf/engine/Agent.h')
-rw-r--r--qpid/cpp/include/qmf/engine/Agent.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/qpid/cpp/include/qmf/engine/Agent.h b/qpid/cpp/include/qmf/engine/Agent.h
index 268e53a9a5..4585ce51cc 100644
--- a/qpid/cpp/include/qmf/engine/Agent.h
+++ b/qpid/cpp/include/qmf/engine/Agent.h
@@ -20,6 +20,7 @@
* under the License.
*/
+#include <qmf/Notifiable.h>
#include <qmf/engine/Schema.h>
#include <qmf/engine/ObjectId.h>
#include <qmf/engine/Object.h>
@@ -65,10 +66,28 @@ namespace engine {
*/
class Agent {
public:
+ /**
+ * Declare a type for a notification callback.
+ */
+ typedef void (*notifyCb)();
+
Agent(const char* vendor, const char* product, const char* name, const char* domain=0, bool internalStore=true);
~Agent();
/**
+ * Provide the Agent with a notification callback that is invoked whenever there is new work
+ * placed on the event queue.
+ *
+ * There are two flavors of notification callback: C-style based on the
+ * type "notifyCb"; and the C++ style based on the Notifiable class.
+ * The C++ style can be used for C++ wrappers/applications and the
+ * C-style can be used for C wrappers/applications and also for
+ * Swig-based script wrappers.
+ */
+ void setNotifyCallback(notifyCb handler);
+ void setNotifyCallback(Notifiable* handler);
+
+ /**
* Set an agent attribute that can be used to describe this agent to consoles.
*@param key Null-terminated string that is the name of the attribute.
*@param value Variant value (or any API type) of the attribute.