Appender.hpp
Go to the documentation of this file.
1 #ifndef APPENDER_HPP
2 #define APPENDER_HPP 1
3 
4 #include <rtt/TaskContext.hpp>
5 #include <rtt/Port.hpp>
6 #include "LoggingEvent.hpp"
7 
8 // forward declare
9 namespace log4cpp {
10 class Appender;
11 }
12 
13 namespace OCL {
14 namespace logging {
15 
16 class Appender : public RTT::TaskContext
17 {
18 public:
19  Appender(std::string name);
20  virtual ~Appender();
21 
27  virtual bool configureLayout();
29  virtual bool startHook();
31  virtual void stopHook();
32 
35  virtual void drainBuffer();
36 
37 protected:
45  virtual void processEvents(int n);
46 
50 
53 
54  // support layouts for all appenders
59 
60  /* Used by \a processEvents() when popping items from the buffer.
61  * This is a class member, rather than a stack instance, to reduce the
62  * number of real-time memory allocations. The strings inside \a event
63  * will eventually allocate to the largest string seen in the system.
64  *
65  * \warn Assumes that processEvents() is not called by multiple threads!
66  */
68 
69  // diagnostic: count number of times popped max events
70  unsigned int countMaxPopped;
71 };
72 
73 // namespaces
74 }
75 }
76 
77 #endif
A mirror of log4cpp::LoggingEvent, except using real-time capable strings.
log4cpp::Appender * appender
Appender created by derived class.
Definition: Appender.hpp:52
OCL::logging::LoggingEvent event
Definition: Appender.hpp:67
RTT::Property< std::string > layoutName_prop
Layout name (e.g. "simple", "basic", "pattern")
Definition: Appender.hpp:56
RTT::Property< std::string > layoutPattern_prop
Layout conversion pattern (for those layouts that use a pattern)
Definition: Appender.hpp:58
RTT::InputPort< OCL::logging::LoggingEvent > log_port
Definition: Appender.hpp:49
unsigned int countMaxPopped
Definition: Appender.hpp:70


ocl
Author(s): OCL Development Team
autogenerated on Wed Jun 26 2019 19:26:27