PATCH] [mama] Stats add functions for cpp


Ian Bell <IBell@...>
 

From bc750fb56573155574cb8ba628e82ceea9571b87 Mon Sep 17 00:00:00 2001

Message-Id: <bc750fb56573155574cb8ba628e82ceea9571b87.1348731429.git.ibell@...>

From: Ian Bell <ibell@...>

Date: Thu, 27 Sep 2012 08:35:53 +0100

Subject: [PATCH] [mama] Stats add functions for cpp

 

Added methods to all new stats collector in c++

 

Signed-off-by: Ian Bell <ibell@...>

---

mama/c_cpp/src/cpp/mama/mamacpp.h |   15 ++++++++++++++-

mama/c_cpp/src/cpp/mamacpp.cpp    |   10 ++++++++++

2 files changed, 24 insertions(+), 1 deletion(-)

 

diff --git a/mama/c_cpp/src/cpp/mama/mamacpp.h b/mama/c_cpp/src/cpp/mama/mamacpp.h

index d1a059c..c602cb0 100644

--- a/mama/c_cpp/src/cpp/mama/mamacpp.h

+++ b/mama/c_cpp/src/cpp/mama/mamacpp.h

@@ -69,6 +69,7 @@

#include <mama/MamaSourceManager.h>

#include <mama/MamaSourceGroup.h>

#include <mama/MamaSourceGroupManager.h>

+#include <mama/MamaStatsCollector.h>

 

 namespace Wombat

@@ -484,7 +485,6 @@ public:

     template <typename T>

     static void deleteObject (T* object);

-

     /**

     * Set a MamaBridgeMessageCallback to be invoked whenever information messages

     * are logged at the bridge level.  Information messages vary depenging on the

@@ -492,6 +492,19 @@ public:

     */

     static void setBridgeCallback (mamaBridge bridge, MamaBridgeCallback* callback);

+    /**

+     * It adds the newly created statsCollector to the statsGenerator list

+     * @param statsCollector

+     */

+    static void addStatsCollector (MamaStatsCollector* statsCollector);

+

+    /**

+     * It removes the statsCollector from the statsGenerator list

+     * @param statsCollector

+     */

+    static void removeStatsCollector (MamaStatsCollector* statsCollector);

+

+

private:

     /**

      * Utility class. No instances.

diff --git a/mama/c_cpp/src/cpp/mamacpp.cpp b/mama/c_cpp/src/cpp/mamacpp.cpp

index 5494300..037f97b 100644

--- a/mama/c_cpp/src/cpp/mamacpp.cpp

+++ b/mama/c_cpp/src/cpp/mamacpp.cpp

@@ -307,6 +307,16 @@ namespace Wombat

         mamaTry (mama_setApplicationClassName (className));

     }

+    void Mama::addStatsCollector (MamaStatsCollector* statsCollector)

+    {

+        mamaTry (mama_addStatsCollector (statsCollector->getStatsCollector()));

+    }

+

+    void Mama::removeStatsCollector (MamaStatsCollector* statsCollector)

+    {

+        mamaTry (mama_removeStatsCollector (statsCollector->getStatsCollector()));

+    }

+

     template <typename T>

     void Mama::deleteObject (T* object)

     {

--

1.7.9.5

 




Please consider the environment before printing this e-mail.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Join Openmama-dev@lists.openmama.org to automatically receive all group messages.