LRAUV  revA
MostRecentLogWriter.h
Go to the documentation of this file.
1 
10 #ifndef MOSTRECENTLOGWRITER_H_
11 #define MOSTRECENTLOGWRITER_H_
12 
13 #include "DecimationLogWriter.h"
14 
15 class DataAccess;
16 
21 {
22 public:
23 
25  MostRecentLogWriter( LogWriter& outputTo );
26 
28  virtual ~MostRecentLogWriter();
29 
31  virtual unsigned int writeHeader();
32 
34  virtual unsigned int write( const LogEntry* entry, const Unit* unit = NULL );
35 
37  virtual void endCycle();
38 
40  virtual unsigned int writeFooter();
41 
43  virtual unsigned int flush()
44  {
45  return writeFooter();
46  }
47 
48 private:
49  // Note that the copy constructor below is private and not given a body.
50  // Any attempt to call it will return a compiler error.
51  MostRecentLogWriter( const MostRecentLogWriter& old ); // disallow copy constructor
52  void wipe();
53 
55  const Unit* unit_;
57 
58  // If type == DATA_LOG_ENTRY
61  bool best_;
62 
63  // If type == SYSLOG_LOG_ENTRY
67 
68 
69 
70 
71 };
72 
73 #endif /*MOSTRECENTLOGWRITER_H_*/
virtual unsigned int writeHeader()
Write the log header, if any.
Definition: MostRecentLogWriter.cpp:29
Contains the DecimationLogWriter class definition.
Serializable representation of DataAccessor object.
Definition: DataAccess.h:30
Str message_
Definition: MostRecentLogWriter.h:64
Base class for a generalized set of "log data destinations," including to files (text or binary)...
Definition: LogWriter.h:25
virtual unsigned int write(const LogEntry *entry, const Unit *unit=NULL)
Write the given LogEntry - should lock the writeMutex_.
Definition: MostRecentLogWriter.cpp:55
bool best_
Definition: MostRecentLogWriter.h:61
DataAccess * dataAccess_
Definition: MostRecentLogWriter.h:59
Type
Defines an enum for "typing" the various LogEntries.
Definition: LogEntry.h:38
virtual ~MostRecentLogWriter()
Destructor.
Definition: MostRecentLogWriter.cpp:25
A DataValue is an abstract base class for a data value and associated engineering units of the value...
Definition: DataValue.h:35
const CodedStr * loggerFacility_
Definition: MostRecentLogWriter.h:66
Base class for a generalized set of "log data destinations," including to files (text or binary)...
Definition: DecimationLogWriter.h:22
One "entry" in a LogQueue.
Definition: LogEntry.h:33
Extends the Str class, adding an unsigned short code (actually, the codes are limited to 14 bits...
Definition: CodedStr.h:23
virtual unsigned int writeFooter()
Write the log footer, if any.
Definition: MostRecentLogWriter.cpp:93
Replacement for standard template class string.
Definition: Str.h:12
MostRecentLogWriter(LogWriter &outputTo)
Constructor.
Definition: MostRecentLogWriter.cpp:17
LogEntry::Type type_
Definition: MostRecentLogWriter.h:56
DataValue * dataValue_
Definition: MostRecentLogWriter.h:60
const Unit * unit_
Definition: MostRecentLogWriter.h:55
Only writes a the most recent value when flush() or writeFooter() is called.
Definition: MostRecentLogWriter.h:20
virtual unsigned int flush()
Flush data to output if any.
Definition: MostRecentLogWriter.h:43
Severity
An attempt to define different levels of syslog severity.
Definition: Syslog.h:28
Timestamp timestamp_
Definition: MostRecentLogWriter.h:54
Syslog::Severity severity_
Definition: MostRecentLogWriter.h:65
Code that represents an engineering unit.
Definition: Unit.h:24
virtual void endCycle()
Do what needs to be done at the end of the cycle.
Definition: MostRecentLogWriter.cpp:87
Represents absolute times.
Definition: Timestamp.h:31
void wipe()
Definition: MostRecentLogWriter.cpp:37