LRAUV  revA
LogEntry Class Referenceabstract

One "entry" in a LogQueue. More...

#include <LogEntry.h>

Inheritance diagram for LogEntry:
Collaboration diagram for LogEntry:

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 TimestampgetTimestamp (void) const
 Accessors. More...
 
const TimestampsetTimestamp (const Timestamp &newTime)
 
const TimestampsetTimestamp (const double newTime)
 
Type getType (void) const
 

Static Public Member Functions

static LogEntryRead (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 &timestamp=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 &timestamp, 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)
 

Detailed Description

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.

Constructor & Destructor Documentation

LogEntry::~LogEntry ( )
virtual

Destructor.

LogEntry::LogEntry ( Type  myType,
const Timestamp timestamp = Timestamp::NOT_SET_TIME 
)
protected

Constructor.

References Timestamp::NOT_SET_TIME, Timestamp::Now(), and timestamp_.

LogEntry::LogEntry ( const LogEntry old)
private

Member Function Documentation

LogEntry * LogEntry::Read ( Timestamp timeBase,
Timespan timeAdjust,
InStream inStream,
Logger logger 
)
static
const Timestamp& LogEntry::setTimestamp ( const double  newTime)
inline

References timestamp_.

virtual Str LogEntry::toString ( const Unit unit = NULL) const
pure virtual

Convert payload to Str.

Implemented in EventEntry, DataEntry, DirectoryEntry, and SyslogEntry.

Referenced by TextLogWriter::write().

const char * LogEntry::TypeToString ( Type  theType)
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().

virtual unsigned int LogEntry::write ( Timestamp timeBase,
OutStream logStream 
) const
pure virtual

Send payload to a stream.

Implemented in EventEntry, DataEntry, DirectoryEntry, and SyslogEntry.

Referenced by BinaryLogWriter::write().

unsigned int LogEntry::writeTimestamp ( const Timestamp timeBase,
bool  changed,
OutStream logStream,
Logger::TimePrecisionType  timePrecision 
) const
protected

Member Data Documentation

Type LogEntry::type_
protected

Stores the type of a given LogEntry.

Referenced by getType().

const int LogEntry::TYPE_MASK = 0x0003
static

Referenced by Read().

const Str LogEntry::UNKNOWN
staticprotected

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