LRAUV  revA
LogAssociation.h
Go to the documentation of this file.
1 /*
2  * LogAssociation.h
3  *
4  * Created on: May 6, 2013
5  * Author: godin
6  */
7 
8 #ifndef LOGASSOCIATION_H_
9 #define LOGASSOCIATION_H_
10 
11 #include "logger/Logger.h"
12 #include "utils/FlexArray.h"
13 
14 class LogEntry;
15 class LogWriter;
16 class Rule;
17 
20 {
21 public:
22 
24  LogAssociation( LogWriter *writerIn, Rule *ruleIn );
25 
28 
30  void resetInputs();
31 
32  bool matchAndProcess( LogEntry *entry );
33 
35  void endCycle();
36 
38  void configLogWriter( Logger& sysLogger );
39 
41  void writeFooter();
42 
43  Rule* getRule() const
44  {
45  return rule_;
46  }
47 
49  {
50  return writer_;
51  }
52 
53  void setWriter( LogWriter* writer )
54  {
55  writer_ = writer;
56  }
57 
58 private:
59  // Note that the copy constructor below is private and not given a body.
60  // Any attempt to call it will return a compiler error.
61  LogAssociation( const LogAssociation& old ); // disallow copy constructor
62 
63  //LogWriter
67 
68 };
69 
71 class LoggerAssociationDeque : public FlexArray<LogAssociation *>
72 {
73 public:
78 
80  LogAssociation* add( LogWriter *writerIn, Rule *ruleIn );
81  void add( LogAssociation *association );
82  void remove( LogWriter *writerOut );
83 };
84 
85 #endif /* LOGASSOCIATION_H_ */
Client-side interface for injecting log data into the log queue.
Definition: Logger.h:30
~LogAssociation()
Destructor.
Definition: LogAssociation.cpp:22
Base class for a generalized set of "log data destinations," including to files (text or binary)...
Definition: LogWriter.h:25
bool wroteInCycle_
Definition: LogAssociation.h:66
~LoggerAssociationDeque()
Destructor.
Definition: LogAssociation.cpp:110
void resetInputs()
Reset cached input settings associated with LogWriter.
Definition: LogAssociation.cpp:39
void configLogWriter(Logger &sysLogger)
Configure logWriter.
Definition: LogAssociation.cpp:95
LogWriter * writer_
Definition: LogAssociation.h:64
Rule * rule_
Definition: LogAssociation.h:65
One "entry" in a LogQueue.
Definition: LogEntry.h:33
Contains the FlexArrayBase and FlexArray class declarations.
LogAssociation(LogWriter *writerIn, Rule *ruleIn)
Constructor.
Definition: LogAssociation.cpp:10
Stores all of the associations as a list.
Definition: LogAssociation.h:71
void endCycle()
Do what needs to be done at the end of a cycle.
Definition: LogAssociation.cpp:73
Handles one mapping between a set of log entry criteria and an LogWriter.
Definition: LogAssociation.h:19
void setWriter(LogWriter *writer)
Definition: LogAssociation.h:53
void writeFooter()
Call logWriter::writeFooter.
Definition: LogAssociation.cpp:86
Abstract base class for classes that are used by LogEngine to determine which LogWriter(s) to use for...
Definition: LoggerRules.h:26
LogWriter * getWriter() const
Definition: LogAssociation.h:48
Contains the Logger class definition.
Simple class providing a flexible size array of pointers.
Definition: DataReader.h:19
LogAssociation * add(LogWriter *writerIn, Rule *ruleIn)
Add a new association to the deque.
Definition: LogAssociation.cpp:115
bool matchAndProcess(LogEntry *entry)
Check whether my rules cover a logEntry, write it if applicable.
Definition: LogAssociation.cpp:51
LoggerAssociationDeque()
Constructor.
Definition: LogAssociation.cpp:104
Rule * getRule() const
Definition: LogAssociation.h:43