[mathicgb] 241/393: Library interface now allows limited access to the logging framework.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Fri Apr 3 15:59:10 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch upstream
in repository mathicgb.

commit 01faa35737e56385ea148ca89e1d73262644e8e9
Author: Bjarke Hammersholt Roune <bjarkehr.code at gmail.com>
Date:   Fri Apr 12 17:27:24 2013 -0400

    Library interface now allows limited access to the logging framework.
---
 src/mathicgb.cpp | 21 +++++++++++++++++++--
 src/mathicgb.h   |  7 +++++++
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/src/mathicgb.cpp b/src/mathicgb.cpp
index e1d310c..1ab9ec2 100755
--- a/src/mathicgb.cpp
+++ b/src/mathicgb.cpp
@@ -7,6 +7,7 @@
 #include "mathicgb/Reducer.hpp"
 #include "mathicgb/BuchbergerAlg.hpp"
 #include "mathicgb/mtbb.hpp"
+#include "mathicgb/LogDomainSet.hpp"
 #include <mathic.h>
 
 namespace {
@@ -313,7 +314,8 @@ namespace mgb {
       mModulus(modulus),
       mVarCount(varCount),
       mReducer(DefaultReducer),
-      mMaxThreadCount(0)
+      mMaxThreadCount(0),
+      mLogging()
 #ifdef MATHICGB_DEBUG
       , mHasBeenDestroyed(false)
 #endif
@@ -346,6 +348,7 @@ namespace mgb {
     const VarIndex mVarCount;
     Reducer mReducer;
     size_t mMaxThreadCount;
+    std::string mLogging;
     MATHICGB_IF_DEBUG(bool mHasBeenDestroyed);
   };
 
@@ -409,6 +412,17 @@ namespace mgb {
   size_t GroebnerConfiguration::maxThreadCount() const {
     return mPimpl->mMaxThreadCount;
   }
+
+  void GroebnerConfiguration::setLogging(const char* logging) {
+    if (logging == 0)
+      mPimpl->mLogging.clear();
+    else
+      mPimpl->mLogging = logging;
+  }
+
+  const char* GroebnerConfiguration::logging() const {
+    return mPimpl->mLogging.c_str();
+  }
 }
 
 // ** Implementation of class GroebnerInputIdealStream
@@ -439,7 +453,7 @@ namespace mgb {
     const GroebnerConfiguration conf;
     MATHICGB_IF_DEBUG(bool hasBeenDestroyed);
     MATHICGB_IF_DEBUG(::mgbi::StreamStateChecker checker); 
- };
+  };
 
   GroebnerInputIdealStream::GroebnerInputIdealStream(
     const GroebnerConfiguration& conf
@@ -646,6 +660,9 @@ namespace mgbi {
       mgb::tbb::task_scheduler_init::automatic : maxThreadCount;
     mgb::tbb::task_scheduler_init scheduler(tbbMaxThreadCount);
 
+    // Set up logging
+    LogDomainSet::singleton().performLogCommands(conf.logging());
+
     // Make reducer
     typedef GroebnerConfiguration GConf;
     Reducer::ReducerType reducerType;
diff --git a/src/mathicgb.h b/src/mathicgb.h
index 9f2ef0b..1ebbeb8 100755
--- a/src/mathicgb.h
+++ b/src/mathicgb.h
@@ -50,6 +50,13 @@ namespace mgb { // Part of the public interface of MathicGB
     void setMaxThreadCount(size_t maxThreadCount);
     size_t maxThreadCount() const;
 
+    /// Sets logging to occur according to the string. The format of the
+    /// string is the same as for the -logs command line parameter.
+    /// Ownership of the string is not taken over.
+    /// @todo: describe the format in more detail.
+    void setLogging(const char* logging);
+    const char* logging() const;
+
   private:
     friend class mgbi::PimplOf;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mathicgb.git



More information about the debian-science-commits mailing list