Remove dynamic exceptions
[anna.git] / example / diameter / launcher / MyCounterRecorder.hpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite                           //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7
8
9 #ifndef example_diameter_launcher_MyCounterRecorder_hpp
10 #define example_diameter_launcher_MyCounterRecorder_hpp
11
12 // Standard
13 #include <sys/stat.h> // chmod
14 #include <fcntl.h>    // open / write
15 #include <time.h>
16
17 // Process
18 #include <MyCounterRecorderClock.hpp>
19
20
21 class MyCounterRecorder : public anna::oam::CounterRecorder {
22
23   // attributes
24   int a_stream;
25   std::string a_fileNamePrefix;
26   std::string a_fileName;
27   time_t a_previousTime;
28   std::string a_fixedLine;
29
30   // pure virtual definitions:
31   void open() noexcept(false);
32   void apply(const anna::oam::Counter& counter) noexcept(false);
33   void close() ;
34   std::string asString() const ;
35
36 public:
37   MyCounterRecorder(const std::string &fnp);
38 };
39
40 #endif