|
LRAUV
revA
|
One "entry" in a LogQueue. More...
#include <LogEntry.h>


Public Types | |
| enum | Type { NOT_LOG_ENTRY = -1, EVENT_LOG_ENTRY = 0, DIRECTORY_LOG_ENTRY = 1, DATA_LOG_ENTRY = 2, SYSLOG_LOG_ENTRY = 3 } |
| Defines an enum for "typing" the various LogEntries. More... | |
Public Member Functions | |
| virtual | ~LogEntry () |
| Destructor. More... | |
| virtual unsigned int | write (Timestamp &timeBase, OutStream &logStream) const =0 |
| Send payload to a stream. More... | |
| virtual Str | toString (const Unit *unit=NULL) const =0 |
| Convert payload to Str. More... | |
| const Timestamp & | getTimestamp (void) const |
| Accessors. More... | |
| const Timestamp & | setTimestamp (const Timestamp &newTime) |
| const Timestamp & | setTimestamp (const double newTime) |
| Type | getType (void) const |
Static Public Member Functions | |
| static LogEntry * | Read (Timestamp &timeBase, Timespan &timeAdjust, InStream &inStream, Logger &logger) |
| Read in a new entry from a stream. More... | |
| static const char * | TypeToString (Type theType) |
| Convert types to Strs. More... | |
Static Public Attributes | |
| static const int | TYPE_MASK = 0x0003 |
Protected Member Functions | |
| LogEntry (Type myType, const Timestamp ×tamp=Timestamp::NOT_SET_TIME) | |
| Constructor. More... | |
| unsigned int | writeTimestamp (const Timestamp &timeBase, bool changed, OutStream &logStream, Logger::TimePrecisionType timePrecision) const |
Static Protected Member Functions | |
| static bool | ReadTimestamp (Timestamp ×tamp, bool &changed, InStream &inStream, Logger &logger, Logger::TimePrecisionType timePrecision) |
Protected Attributes | |
| Type | type_ |
| Stores the type of a given LogEntry. More... | |
| Timestamp | timestamp_ |
Static Protected Attributes | |
| static const Str | UNKNOWN |
Private Member Functions | |
| LogEntry (const LogEntry &old) | |
One "entry" in a LogQueue.
Implementations of LogEntry are responsible for serializing and unserializing themselves to and from binary streams (via Read() and write() methods) and for serializing themselves to a text stream (via the toString() method).
Base class. More specialized forms (DataEntry, EventEntry, SyslogEntry) derive from this class.
|
virtual |
Destructor.
|
protected |
Constructor.
References Timestamp::NOT_SET_TIME, Timestamp::Now(), and timestamp_.
|
private |
|
inline |
Accessors.
References timestamp_.
Referenced by LinearApproxLogWriter::VarData::checkNextEntry(), LinearApproximationLogWriter::VarData::checkNextEntry(), TableLogWriter::interpolateDataEntry(), Logger::log(), BinaryLogReader::read(), MostRecentLogWriter::write(), KmlLogWriter::write(), TableLogWriter::write(), FilterLogWriter::write(), SplitFileLogWriter::write(), JsonLogWriter::writeData(), NetCdfLogWriter::writeData(), HDF5LogWriter::writeData(), and TableLogWriter::writeInterpolated().
|
inline |
References type_.
Referenced by TypeRule::check(), EventTypeRule::check(), SyslogSeverityRule::check(), SyslogStartRule::check(), DataWriteRule::check(), Logger::log(), BinaryLogReader::read(), MostRecentLogWriter::write(), KmlLogWriter::write(), DirectoryManagingLogWriter::write(), MultiLogWriter::write(), TableLogWriter::write(), FilterLogWriter::write(), NetCdfTableLogWriter::write(), LinearApproxLogWriter::write(), and TableLogWriter::writeInterpolated().
|
static |
Read in a new entry from a stream.
References DATA_LOG_ENTRY, DIRECTORY_LOG_ENTRY, InStream::eof(), EVENT_LOG_ENTRY, SyslogEntry::Read(), DirectoryEntry::Read(), DataEntry::Read(), EventEntry::Read(), InStream::readUShortCompact(), SYSLOG_LOG_ENTRY, and TYPE_MASK.
Referenced by BinaryLogReader::read().
|
staticprotected |
References Timestamp::addFromMicros(), Timestamp::addFromMillis(), InStream::eof(), Syslog::ERROR, DirectoryEntry::GetCurrentLogVersion(), InStream::readLongLongCompact(), Logger::syslog(), Logger::TIME_PRECISION_MICROS, and Logger::TIME_PRECISION_MILLIS.
Referenced by SyslogEntry::Read(), DataEntry::Read(), and EventEntry::Read().
|
inline |
References timestamp_.
Convert payload to Str.
Implemented in EventEntry, DataEntry, DirectoryEntry, and SyslogEntry.
Referenced by TextLogWriter::write().
|
static |
Convert types to Strs.
Convert a Type to a Str.
References DATA_LOG_ENTRY, DIRECTORY_LOG_ENTRY, EVENT_LOG_ENTRY, NOT_LOG_ENTRY, and SYSLOG_LOG_ENTRY.
Referenced by TypeRule::toString().
|
pure virtual |
Send payload to a stream.
Implemented in EventEntry, DataEntry, DirectoryEntry, and SyslogEntry.
Referenced by BinaryLogWriter::write().
|
protected |
References OutStream::bytesWritten(), Logger::TIME_PRECISION_MICROS, Logger::TIME_PRECISION_MILLIS, timestamp_, and OutStream::writeLongLongCompact().
Referenced by SyslogEntry::write(), DataEntry::write(), and EventEntry::write().
|
protected |
|
static |
Referenced by Read().
|
staticprotected |
Referenced by DataEntry::toString(), and EventEntry::toString().