ANNA Suite  2020b
Multipurpose development suite for Telco applications
TraceWriterObserver.hpp
Go to the documentation of this file.
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 anna_core_tracing_TraceWriterObserver_hpp
10 #define anna_core_tracing_TraceWriterObserver_hpp
11 
12 #include <string>
13 
14 namespace anna {
15 
16 class TraceWriter;
17 
28 public:
32  const char* getName() const { return a_name; }
33 
38  std::string asString() const {
39  std::string result("anna::TraceWriterObserver { Name: ");
40  result += a_name;
41  return result += " }";
42  }
43 
44 protected:
49  TraceWriterObserver(const char* name) : a_name(name) {;}
50 
57  virtual void handleOpen(const int fd) = 0;
58 
66  virtual void handleClose(const int fd) = 0;
67 
68 private:
69  const char* a_name;
70 
71  friend class TraceWriter;
72 };
73 
74 }
75 
76 #endif
77 
78 
virtual void handleClose(const int fd)=0
TraceWriterObserver(const char *name)
Definition: TraceWriterObserver.hpp:49
const char * getName() const
Definition: TraceWriterObserver.hpp:32
std::string asString() const
Definition: TraceWriterObserver.hpp:38
Definition: app.hpp:12
Definition: TraceWriterObserver.hpp:27
Definition: TraceWriter.hpp:28
virtual void handleOpen(const int fd)=0