LRAUV  revA
MultiLogWriter.h
Go to the documentation of this file.
1 
10 #ifndef MILTILOGWRITER_H_
11 #define MILTILOGWRITER_H_
12 
13 #include "LogWriter.h"
14 
16 #include "logger/LogEngine.h"
17 #include "utils/FastMap.h"
18 
19 class AllLogWriter;
20 class DataValue;
22 class MultiLogWriter;
23 
28 class MultiLogWriter : public LogWriter
29 {
30 public:
31 
33  MultiLogWriter( LogWriter& outputTo, const Str& name );
34 
36  virtual ~MultiLogWriter();
37 
39  virtual unsigned int writeHeader();
40 
42  virtual unsigned int write( const LogEntry* entry, const Unit* unit = NULL );
43 
45  virtual unsigned int writeFooter();
46 
47  void resetDirectoryEntries();
48 
49  unsigned int forceWrite( DataEntry* dataEntry );
50 
51  unsigned int writeSyslog( const SyslogEntry* syslogEntry );
52 
53  unsigned int flush();
54 
55 protected:
56 
57  friend class DecimationLogManager;
58 
60  {
61  return currentLogWriter_;
62  }
63 
64  void setCurrent( DecimationLogWriter* newLogWriter );
65 
67  const Str varName_;
68  const bool makeDirEntries_;
72 
74 
75 private:
76  // Note that the copy constructor below is private and not given a body.
77  // Any attempt to call it will return a compiler error.
78  MultiLogWriter( const MultiLogWriter& old ); // disallow copy constructor
79 
80 };
81 
82 #endif /*MILTILOGWRITER_H_*/
unsigned int writeSyslog(const SyslogEntry *syslogEntry)
Definition: MultiLogWriter.cpp:180
Contains the DecimationLogWriter class definition.
Serializable representation of DataAccessor object.
Definition: DataAccess.h:30
Base class for a generalized set of "log data destinations," including to files (text or binary)...
Definition: MultiLogWriter.h:28
void resetDirectoryEntries()
Definition: MultiLogWriter.cpp:134
const bool makeDirEntries_
Definition: MultiLogWriter.h:68
Base class for a generalized set of "log data destinations," including to files (text or binary)...
Definition: LogWriter.h:25
Contains the LogWriter class definition.
Definition: DecimationLogManager.h:23
const Str varName_
Definition: MultiLogWriter.h:67
virtual unsigned int writeFooter()
Write the log footer, if any.
Definition: MultiLogWriter.cpp:124
unsigned int forceWrite(DataEntry *dataEntry)
Definition: MultiLogWriter.cpp:150
A DataValue is an abstract base class for a data value and associated engineering units of the value...
Definition: DataValue.h:35
Base class for a generalized set of "log data destinations," including to files (text or binary)...
Definition: AllLogWriter.h:20
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
LogEntry with information specific to "Syslog"-like text logs.
Definition: SyslogEntry.h:54
Code unit that represents an atomic unit of data destined for writing in the log file.
Definition: DataEntry.h:43
Replacement for standard template class string.
Definition: Str.h:12
Contains the LogEngine class definition.
unsigned int flush()
Definition: MultiLogWriter.cpp:196
void setCurrent(DecimationLogWriter *newLogWriter)
Definition: MultiLogWriter.cpp:140
bool dataAccessHidden_
Definition: MultiLogWriter.h:71
MultiLogWriter(LogWriter &outputTo, const Str &name)
Constructor.
Definition: MultiLogWriter.cpp:17
bool nameWritten_
Definition: MultiLogWriter.h:69
Contains the FastMap class declaration.
LogWriter & outputTo_
Definition: MultiLogWriter.h:66
virtual unsigned int writeHeader()
Write the log header, if any.
Definition: MultiLogWriter.cpp:42
DecimationLogWriter * currentLogWriter_
Definition: MultiLogWriter.h:73
virtual unsigned int write(const LogEntry *entry, const Unit *unit=NULL)
Write the given LogEntry - should lock the writeMutex_.
Definition: MultiLogWriter.cpp:54
DataAccess * dataAccess_
Definition: MultiLogWriter.h:70
Code that represents an engineering unit.
Definition: Unit.h:24
Defines a LogWriter that can perform lossy decimation on a stream of DataEntries, by outputting value...
Definition: LinearApproxLogWriter.h:41
DecimationLogWriter * getCurrent()
Definition: MultiLogWriter.h:59
virtual ~MultiLogWriter()
Destructor.
Definition: MultiLogWriter.cpp:29