Remove dynamic exceptions
[anna.git] / example / diameter / launcher / MyCounterRecorder.hpp
index e69de29..d6b8158 100644 (file)
@@ -0,0 +1,40 @@
+// ANNA - Anna is Not Nothingness Anymore                                                         //
+//                                                                                                //
+// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
+//                                                                                                //
+// See project site at http://redmine.teslayout.com/projects/anna-suite                           //
+// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
+
+
+#ifndef example_diameter_launcher_MyCounterRecorder_hpp
+#define example_diameter_launcher_MyCounterRecorder_hpp
+
+// Standard
+#include <sys/stat.h> // chmod
+#include <fcntl.h>    // open / write
+#include <time.h>
+
+// Process
+#include <MyCounterRecorderClock.hpp>
+
+
+class MyCounterRecorder : public anna::oam::CounterRecorder {
+
+  // attributes
+  int a_stream;
+  std::string a_fileNamePrefix;
+  std::string a_fileName;
+  time_t a_previousTime;
+  std::string a_fixedLine;
+
+  // pure virtual definitions:
+  void open() noexcept(false);
+  void apply(const anna::oam::Counter& counter) noexcept(false);
+  void close() ;
+  std::string asString() const ;
+
+public:
+  MyCounterRecorder(const std::string &fnp);
+};
+
+#endif