LRAUV  revA
MostRecentLogWriter Class Reference

Only writes a the most recent value when flush() or writeFooter() is called. More...

#include <MostRecentLogWriter.h>

Inheritance diagram for MostRecentLogWriter:
Collaboration diagram for MostRecentLogWriter:

Public Member Functions

 MostRecentLogWriter (LogWriter &outputTo)
 Constructor. More...
 
virtual ~MostRecentLogWriter ()
 Destructor. More...
 
virtual unsigned int writeHeader ()
 Write the log header, if any. More...
 
virtual unsigned int write (const LogEntry *entry, const Unit *unit=NULL)
 Write the given LogEntry - should lock the writeMutex_. More...
 
virtual void endCycle ()
 Do what needs to be done at the end of the cycle. More...
 
virtual unsigned int writeFooter ()
 Write the log footer, if any. More...
 
virtual unsigned int flush ()
 Flush data to output if any. More...
 
- Public Member Functions inherited from DecimationLogWriter
 DecimationLogWriter (LogWriter &outputTo, DecimationType decimationType)
 Constructor. More...
 
virtual ~DecimationLogWriter ()
 Destructor. More...
 
DecimationType getDecimationType () const
 
virtual void setParameter (DataValue *parameter, Logger &logger)
 
- Public Member Functions inherited from LogWriter
virtual ~LogWriter ()
 Destructor. More...
 
virtual void setOutStream (OutStream &outStream)
 Sets the OutStream. More...
 
virtual bool isValid ()
 Return true if logStream_ is available. More...
 
virtual void config (Logger &logger)
 Configure from a config file. More...
 
virtual void resetInputs ()
 Reset cached input settings. More...
 
void addParent ()
 
void removeParent ()
 
int getParentCount ()
 
virtual void activate ()
 
virtual void deactivate ()
 
virtual bool isActive ()
 
virtual void lockWrites ()
 
virtual void unlockWrites ()
 

Private Member Functions

 MostRecentLogWriter (const MostRecentLogWriter &old)
 
void wipe ()
 

Private Attributes

Timestamp timestamp_
 
const Unitunit_
 
LogEntry::Type type_
 
DataAccessdataAccess_
 
DataValuedataValue_
 
bool best_
 
Str message_
 
Syslog::Severity severity_
 
const CodedStrloggerFacility_
 

Additional Inherited Members

- Public Types inherited from DecimationLogWriter
enum  DecimationType {
  UNDEFINED_DECIMATION = -1, NO_DECIMATION, ALL_DATA, LINEAR_APPROXIMATION,
  MOST_RECENT, DECIMATION_COUNT, DECIMATION_MULTI
}
 
- Public Types inherited from LogWriter
enum  ServiceType {
  NO_SERVICE = -1, SERVICE_COURIER, SERVICE_EXPRESS, SERVICE_PRIORITY,
  SERVICE_NORMAL, SERVICE_BULK, SERVICE_COUNT, SERVICE_MULTI
}
 
- Static Public Member Functions inherited from DecimationLogWriter
static const char * DecimationType2Str (DecimationLogWriter::DecimationType decimationType)
 
static DecimationType Str2DecimationType (const char *const typeStr, int len=-1)
 
- Static Public Member Functions inherited from LogWriter
static ServiceType Str2ServiceType (const char *const serviceTypeStr, int len=-1)
 
static const char * ServiceType2Str (LogWriter::ServiceType serviceType)
 
static size_t ServiceType2Strlen (LogWriter::ServiceType serviceType)
 
- Static Public Attributes inherited from DecimationLogWriter
static const char *const DECIMATION_TYPE_STRS [DECIMATION_COUNT]
 
static const size_t DECIMATION_TYPE_STRLEN [DECIMATION_COUNT]
 
- Static Public Attributes inherited from LogWriter
static const char *const SERVICE_TYPE_STRS [SERVICE_COUNT]
 
static size_t const SERVICE_TYPE_STRLEN [SERVICE_COUNT]
 
- Protected Member Functions inherited from LogWriter
 LogWriter ()
 Protected constructor for pure virtual class. More...
 
 LogWriter (OutStream &outStream)
 Protected constructor for pure virtual class. More...
 
- Protected Attributes inherited from DecimationLogWriter
LogWriteroutputTo_
 Stores an LogWriter. More...
 
DecimationType decimationType_
 Stores the decimationType. More...
 
- Protected Attributes inherited from LogWriter
OutStreamlogStream_
 Stores an OutStream. More...
 
bool wroteHeader_
 
bool wroteFooter_
 
Mutex writeMutex_
 
int parentCount_
 
bool active_
 

Detailed Description

Only writes a the most recent value when flush() or writeFooter() is called.

Constructor & Destructor Documentation

MostRecentLogWriter::MostRecentLogWriter ( LogWriter outputTo)

Constructor.

References wipe().

MostRecentLogWriter::~MostRecentLogWriter ( )
virtual

Destructor.

MostRecentLogWriter::MostRecentLogWriter ( const MostRecentLogWriter old)
private

Member Function Documentation

void MostRecentLogWriter::endCycle ( )
virtual

Do what needs to be done at the end of the cycle.

Reimplemented from LogWriter.

References LogWriter::endCycle(), and DecimationLogWriter::outputTo_.

virtual unsigned int MostRecentLogWriter::flush ( )
inlinevirtual

Flush data to output if any.

Reimplemented from DecimationLogWriter.

References writeFooter().

unsigned int MostRecentLogWriter::writeFooter ( )
virtual
unsigned int MostRecentLogWriter::writeHeader ( )
virtual

Write the log header, if any.

Reimplemented from LogWriter.

References DecimationLogWriter::outputTo_, LogWriter::writeHeader(), and LogWriter::wroteHeader_.

Member Data Documentation

bool MostRecentLogWriter::best_
private

Referenced by wipe(), write(), and writeFooter().

DataAccess* MostRecentLogWriter::dataAccess_
private

Referenced by wipe(), write(), and writeFooter().

DataValue* MostRecentLogWriter::dataValue_
private

Referenced by wipe(), write(), and writeFooter().

const CodedStr* MostRecentLogWriter::loggerFacility_
private

Referenced by wipe(), write(), and writeFooter().

Str MostRecentLogWriter::message_
private

Referenced by wipe(), write(), and writeFooter().

Syslog::Severity MostRecentLogWriter::severity_
private

Referenced by wipe(), write(), and writeFooter().

Timestamp MostRecentLogWriter::timestamp_
private

Referenced by wipe(), write(), and writeFooter().

LogEntry::Type MostRecentLogWriter::type_
private

Referenced by wipe(), write(), and writeFooter().

const Unit* MostRecentLogWriter::unit_
private

Referenced by wipe(), write(), and writeFooter().


The documentation for this class was generated from the following files: