You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2008/11/18 16:15:05 UTC

svn commit: r718631 - in /activemq/activemq-cpp/trunk/src/main/decaf/internal: AprPool.cpp AprPool.h

Author: tabish
Date: Tue Nov 18 07:15:05 2008
New Revision: 718631

URL: http://svn.apache.org/viewvc?rev=718631&view=rev
Log:
Adds a shortcut to get to the Global APR Pool from this class.

Modified:
    activemq/activemq-cpp/trunk/src/main/decaf/internal/AprPool.cpp
    activemq/activemq-cpp/trunk/src/main/decaf/internal/AprPool.h

Modified: activemq/activemq-cpp/trunk/src/main/decaf/internal/AprPool.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/internal/AprPool.cpp?rev=718631&r1=718630&r2=718631&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/internal/AprPool.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/internal/AprPool.cpp Tue Nov 18 07:15:05 2008
@@ -16,9 +16,10 @@
  */
 
 #include "AprPool.h"
-#include <decaf/lang/Runtime.h>
+#include <decaf/internal/DecafRuntime.h>
 
 using namespace decaf;
+using namespace decaf::lang;
 using namespace decaf::internal;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -63,10 +64,18 @@
 apr_pool_t* AprPool::getAprPool() const {
 
     // Ensure there is a Runtime instance created.
-    decaf::lang::Runtime::getRuntime();
+    Runtime::getRuntime();
 
     // Ensure that the pool has been allocated.
     allocatePool();
 
     return aprPool;
 }
+
+////////////////////////////////////////////////////////////////////////////////
+apr_pool_t* AprPool::getGlobalPool() {
+
+    // Ensure there is a Runtime instance created so we have a global pool
+    DecafRuntime* runtime = dynamic_cast<DecafRuntime*>( Runtime::getRuntime() );
+    return runtime->getGlobalPool();
+}

Modified: activemq/activemq-cpp/trunk/src/main/decaf/internal/AprPool.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/internal/AprPool.h?rev=718631&r1=718630&r2=718631&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/internal/AprPool.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/internal/AprPool.h Tue Nov 18 07:15:05 2008
@@ -56,6 +56,12 @@
          */
         void cleanup();
 
+        /**
+         * Gets a pointer to the Global APR Pool used for the Application
+         * @return pointer to the global APR Pool
+         */
+        static apr_pool_t* getGlobalPool();
+
     private:
 
         /**
@@ -67,6 +73,7 @@
          * Destroys the pool if it has been allocated.
          */
         void destroyPool();
+
     };
 
 }}