Parcourir la source

Add path to Output

Eric Ramat il y a 5 ans
Parent
commit
4010825484
2 fichiers modifiés avec 5 ajouts et 4 suppressions
  1. 2 2
      src/artis/kernel/Any.hpp
  2. 3 2
      src/artis/observer/Output.hpp

+ 2 - 2
src/artis/kernel/Any.hpp

@@ -96,8 +96,8 @@ private:
 
     base* ptr_;
 
-    template < typename V >
-    friend struct ValueType;
+/*    template < typename V >
+      friend struct ValueType; */
 
 public:
     Any() : ptr_(nullptr)

+ 3 - 2
src/artis/observer/Output.hpp

@@ -41,13 +41,14 @@ public:
     virtual ~Output()
     { }
 
-    void operator()() const
+    void operator()(const std::string& path = "") const
     {
         const typename Observer < U, V >::Views& views = _observer.views();
 
         for (typename Observer < U, V >::Views::const_iterator it =
                  views.begin(); it != views.end(); ++it) {
-            std::ofstream o((boost::format("%1%.csv") % it->first).str());
+            std::ofstream o((boost::format("%1%/%2%.csv") % path %
+                             it->first).str());
             typename View < U, V >::Values values = it->second->values();
             double begin = it->second->begin();
             double end = it->second->end();