|
LRAUV
revA
|
Code unit that represents an event to be stored in the log file. More...
#include <DirectoryEntry.h>


Classes | |
| class | StaticDestructor |
| Makes sure that mallocRing_s is deleted on shutdown. More... | |
Public Types | |
| enum | DirectoryType { ACCESSOR = 'a', ELEMENT = 'e', NAME = 'n', VERSION = 'v' } |
| Type of directory entry. More... | |
Public Types inherited from LogEntry | |
| 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 | |
| DirectoryEntry (const short version=0) | |
| Version Construnctor. More... | |
| DirectoryEntry (DataAccess *dataAccess) | |
| Accessor Constructor. More... | |
| DirectoryEntry (const CodedStr *name) | |
| Name Constructor. More... | |
| DirectoryEntry (ElementURI *elementURI) | |
| ElementURI Constructor. More... | |
| virtual | ~DirectoryEntry () |
| Destructor. More... | |
| void * | operator new (size_t size) |
| Override new. More... | |
| void | operator delete (void *p) |
| Override delete. More... | |
| virtual unsigned int | write (Timestamp &timeBase, OutStream &logStream) const |
| Send payload to a stream. More... | |
| virtual Str | toString (const Unit *unit=NULL) const |
| Convert payload to Str. More... | |
| DirectoryType | getDirectoryType (void) const |
Public Member Functions inherited from LogEntry | |
| virtual | ~LogEntry () |
| Destructor. 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 unsigned short | GetCurrentLogVersion () |
| static unsigned short | GetMinimumLogVersion () |
| static DirectoryEntry * | Read (Timestamp &timeBase, InStream &inStream, unsigned short firstWord, Logger &logger) |
| Read new DirectoryEntry from a stream. More... | |
| static const char * | DirectoryTypeToString (DirectoryType directoryType) |
| Convert actions to Strs. More... | |
Static Public Member Functions inherited from LogEntry | |
| 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 | DIRECTORY_TYPE_MASK = 7 << 2 |
Static Public Attributes inherited from LogEntry | |
| static const int | TYPE_MASK = 0x0003 |
Protected Attributes | |
| DirectoryType | directoryType_ |
| union { | |
| unsigned short version_ | |
| DataAccess * dataAccess_ | |
| ElementURI * elementURI_ | |
| const CodedStr * name_ | |
| }; | |
| bool | wasRead_ |
| Indicates whether the value was read in, and therefore can be deleted. More... | |
Protected Attributes inherited from LogEntry | |
| Type | type_ |
| Stores the type of a given LogEntry. More... | |
| Timestamp | timestamp_ |
Static Protected Attributes | |
| static unsigned short | MinimumLogVersion_ |
| static unsigned short | CurrentLogVersion_ |
| static RingBufferVoid * | MallocRing_ |
| Declared as a pointer to avoid including RingBuffer.h header here. More... | |
| static DirectoryEntry::StaticDestructor | StaticDestructor_ |
| Static instance of StaticDestructor. More... | |
| static FlexArray< ElementURI * > | ElementStore_ |
| Static storage of ElementURIs to delete at cleanup. More... | |
Static Protected Attributes inherited from LogEntry | |
| static const Str | UNKNOWN |
Additional Inherited Members | |
Protected Member Functions inherited from LogEntry | |
| 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 inherited from LogEntry | |
| static bool | ReadTimestamp (Timestamp ×tamp, bool &changed, InStream &inStream, Logger &logger, Logger::TimePrecisionType timePrecision) |
Code unit that represents an event to be stored in the log file.
The kinds of events include:
An DirectoryEntry is serialized as:
| DirectoryEntry::DirectoryEntry | ( | const short | version = 0 | ) |
| DirectoryEntry::DirectoryEntry | ( | DataAccess * | dataAccess | ) |
Accessor Constructor.
| DirectoryEntry::DirectoryEntry | ( | const CodedStr * | name | ) |
Name Constructor.
Entity Name Constructor.
| DirectoryEntry::DirectoryEntry | ( | ElementURI * | elementURI | ) |
ElementURI Constructor.
|
virtual |
Destructor.
|
static |
Convert actions to Strs.
Convert an Action to a char*.
References ACCESSOR, ELEMENT, NAME, and VERSION.
Referenced by toString().
|
inlinestatic |
References CurrentLogVersion_.
Referenced by LogEntry::ReadTimestamp(), and Unserialize::Run().
|
inline |
References directoryType_.
|
inlinestatic |
References MinimumLogVersion_.
Referenced by Unserialize::Run().
| void DirectoryEntry::operator delete | ( | void * | p | ) |
Override delete.
| void * DirectoryEntry::operator new | ( | size_t | size | ) |
Override new.
|
static |
Read new DirectoryEntry from a stream.
Implements requirement: Time values must be stored to at least millisecond resolution, with the option for less resolution.
References ACCESSOR, InStream::bytesRead(), Syslog::CRITICAL, CurrentLogVersion_, LogEntry::DIRECTORY_LOG_ENTRY, DirectoryEntry(), ELEMENT, ElementStore_, Syslog::ERROR, InStream::getName(), InStream::getTotalBytesRead(), MinimumLogVersion_, NAME, FlexArray< T >::push(), CodedStr::Read(), ElementURI::Read(), DataAccess::Read(), InStream::readChar(), InStream::readShortHex(), Slate::RegisterCodedName(), Slate::RegisterDataAccess(), Slate::RegisterElementURI(), Logger::syslog(), and VERSION.
Referenced by LogEntry::Read().
Convert payload to Str.
Implements LogEntry.
References ACCESSOR, DataAccess::asString(), dataAccess_, directoryType_, DirectoryTypeToString(), ELEMENT, elementURI_, CodedStr::getCode(), ElementURI::getCode(), NAME, name_, VERSION, and version_.
Send payload to a stream.
Implements requirement: Time values must be stored to at least millisecond resolution, with the option for less resolution.
Implements LogEntry.
References ACCESSOR, OutStream::bytesWritten(), dataAccess_, LogEntry::DIRECTORY_LOG_ENTRY, directoryType_, ELEMENT, elementURI_, NAME, name_, VERSION, version_, CodedStr::write(), ElementURI::write(), DataAccess::write(), OutStream::writeChar(), OutStream::writeShortHex(), and OutStream::writeUShortCompact().
Referenced by BinaryLogWriter::writeHeader(), and TextLogWriter::writeHeader().
| union { ... } |
|
staticprotected |
Referenced by GetCurrentLogVersion(), and Read().
| DataAccess* DirectoryEntry::dataAccess_ |
Referenced by toString(), and write().
|
static |
|
protected |
Referenced by getDirectoryType(), toString(), and write().
|
staticprotected |
Static storage of ElementURIs to delete at cleanup.
Referenced by Read(), and DirectoryEntry::StaticDestructor::~StaticDestructor().
| ElementURI* DirectoryEntry::elementURI_ |
Referenced by toString(), and write().
|
staticprotected |
Declared as a pointer to avoid including RingBuffer.h header here.
Referenced by DirectoryEntry::StaticDestructor::~StaticDestructor().
|
staticprotected |
Referenced by GetMinimumLogVersion(), and Read().
| const CodedStr* DirectoryEntry::name_ |
Referenced by toString(), and write().
|
staticprotected |
Static instance of StaticDestructor.
| unsigned short DirectoryEntry::version_ |
Referenced by toString(), and write().
|
protected |
Indicates whether the value was read in, and therefore can be deleted.