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


Classes | |
| class | StaticDestructor |
| Makes sure that mallocRing_s is deleted on shutdown. More... | |
Public Types | |
| enum | EventType { START_CYCLE = 0, SET_DATA_ACCURACY = 1 << 2, SET_DATA_STATE = 2 << 2, COMPONENT_ACTION = 3 << 2 } |
| Type of data event. More... | |
| enum | DataStateChange { NO_DATA_STATE_CHANGE = 0, DATA_STATE_CHANGE_UNAVAILABLE = 2, DATA_STATE_CHANGE_AVAILABLE = 4, DATA_STATE_CHANGE_ORPHANED = 8, DATA_STATE_CHANGE_UNORPHANED = 16, DATA_STATE_CHANGE_SET_BEST = 32, DATA_STATE_CHANGE_INVALID = 64, DATA_STATE_CHANGE_VALID = 128 } |
| enum | ComponentAction { COMPONENT_LOAD = 0, COMPONENT_MISSION_RUN = 1 << 2, COMPONENT_FAIL = 2 << 2 } |
| Type of component event. 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 | |
| EventEntry (Component *actor, DataElement *dataElement, const EventType eventType) | |
| EventType Constructor. More... | |
| EventEntry (Component *actor, DataElement *dataElement, const DataStateChange dataStateChange) | |
| DataStateChange Constructor. More... | |
| EventEntry (Component *actor, const bool loaded) | |
| ComponentAction = COMPONENT_LOAD Constructor. More... | |
| EventEntry (Component *actor, const int loop) | |
| ComponentAction = COMPONENT_RUN Constructor. More... | |
| EventEntry (Component *actor, const FailureMode::FailType failure, const int failCount) | |
| ComponentAction = COMPONENT_FAIL Constructor. More... | |
| virtual | ~EventEntry () |
| Destructor. More... | |
| void * | operator new (size_t size) |
| Override new. More... | |
| void | operator delete (void *p) |
| Override delete. More... | |
| const void | setAccuracy (const double &accuracy) |
| const double & | getAccuracy (void) const |
| 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... | |
| unsigned short | getActorCode () const |
| ComponentAction | getComponentAction (void) const |
| unsigned short | getDataElementCode (void) const |
| EventType | getEventType (void) const |
| DataStateChange | getDataStateChange (void) const |
| void | setDataStateChange (const DataStateChange dataStateChange) |
| int | getRunLoop () const |
| bool | getLoaded () const |
| FailureMode::FailType | getFailureMode () const |
| int | getFailCount () 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 EventEntry * | Read (Timestamp &timeBase, Timespan &timeAdjust, InStream &inStream, unsigned short firstWord, Logger &logger) |
| Read new EventEntry from a stream. More... | |
| static const char * | EventTypeToString (EventType theAction) |
| Convert actions to Strs. More... | |
| static const char * | StateChangeToString (DataStateChange dataStateChange) |
| 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 | EVENT_TYPE_MASK = 3 << 2 |
| static const int | COMPONENT_ACTION_MASK = 3 << 2 |
Static Public Attributes inherited from LogEntry | |
| static const int | TYPE_MASK = 0x0003 |
Protected Member Functions | |
| EventEntry (const Timestamp ×tamp, const unsigned short actorCode, const unsigned short dataElementCode, const EventType action, const double &accuracy=0.0) | |
| Protected EventType Constructor. More... | |
| EventEntry (const Timestamp ×tamp, const unsigned short actorCode, const unsigned short dataElementCode, const DataStateChange dataStateChange, const double &accuracy=0.0) | |
| Protected DataStateChange Constructor. More... | |
| EventEntry (const Timestamp ×tamp, const unsigned short actorCode, const bool loaded) | |
| Protected ComponentAction = COMPONENT_LOAD Constructor. More... | |
| EventEntry (const Timestamp ×tamp, const unsigned short actorCode, const int loop) | |
| Protected ComponentAction = COMPONENT_RUN Constructor. More... | |
| EventEntry (const Timestamp ×tamp, const unsigned short actorCode, const FailureMode::FailType failure, const int failCount) | |
| Protected ComponentAction = COMPONENT_FAIL Constructor. More... | |
| virtual const Str | makeComponentActionString () const |
| virtual const Str | makeDataValueString () const |
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 |
Protected Attributes | |
| unsigned short | actorCode_ |
| Arg1. More... | |
| union { | |
| unsigned short dataElementCode_ | |
| bool loaded_ | |
| int runLoop_ | |
| FailureMode::FailType failureMode_ | |
| }; | |
| Arg2. More... | |
| EventType | eventType_ |
| Arg3. More... | |
| union { | |
| DataStateChange dataStateChange_ | |
| ComponentAction componentAction_ | |
| }; | |
| Arg4. More... | |
| union { | |
| double accuracy_ | |
| int failCount_ | |
| }; | |
| Arg5. More... | |
Protected Attributes inherited from LogEntry | |
| Type | type_ |
| Stores the type of a given LogEntry. More... | |
| Timestamp | timestamp_ |
Static Protected Attributes | |
| static RingBufferVoid * | MallocRing_ |
| Declared as a pointer to avoid including RingBuffer.h header here. More... | |
| static EventEntry::StaticDestructor | StaticDestructor_ |
| Static instance of StaticDestructor. More... | |
Static Protected Attributes inherited from LogEntry | |
| static const Str | UNKNOWN |
Additional Inherited Members | |
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 EventEntry is serialized as:
| EventEntry::EventEntry | ( | Component * | actor, |
| DataElement * | dataElement, | ||
| const EventType | eventType | ||
| ) |
EventType Constructor.
Referenced by Read().
| EventEntry::EventEntry | ( | Component * | actor, |
| DataElement * | dataElement, | ||
| const DataStateChange | dataStateChange | ||
| ) |
DataStateChange Constructor.
| EventEntry::EventEntry | ( | Component * | actor, |
| const bool | loaded | ||
| ) |
ComponentAction = COMPONENT_LOAD Constructor.
| EventEntry::EventEntry | ( | Component * | actor, |
| const int | loop | ||
| ) |
ComponentAction = COMPONENT_RUN Constructor.
| EventEntry::EventEntry | ( | Component * | actor, |
| const FailureMode::FailType | failure, | ||
| const int | failCount | ||
| ) |
ComponentAction = COMPONENT_FAIL Constructor.
|
virtual |
Destructor.
|
protected |
Protected EventType Constructor.
|
protected |
Protected DataStateChange Constructor.
|
protected |
Protected ComponentAction = COMPONENT_LOAD Constructor.
|
protected |
Protected ComponentAction = COMPONENT_RUN Constructor.
|
protected |
Protected ComponentAction = COMPONENT_FAIL Constructor.
|
static |
Convert actions to Strs.
Convert an Action to a char*.
References COMPONENT_ACTION, SET_DATA_ACCURACY, SET_DATA_STATE, and START_CYCLE.
Referenced by toString(), and EventTypeRule::toString().
|
inline |
|
inline |
References actorCode_.
Referenced by BinaryLogReader::read().
|
inline |
References componentAction_.
Referenced by BinaryLogReader::read(), and write().
|
inline |
References dataElementCode_.
Referenced by write().
|
inline |
References dataStateChange_.
Referenced by write().
|
inline |
References eventType_.
Referenced by EventTypeRule::check(), BinaryLogReader::read(), KmlLogWriter::write(), TableLogWriter::write(), and FilterLogWriter::write().
|
inline |
References failCount_.
Referenced by write().
|
inline |
References failureMode_.
Referenced by write().
|
inline |
References runLoop_.
Referenced by BinaryLogReader::read(), and write().
|
protectedvirtual |
References COMPONENT_FAIL, COMPONENT_LOAD, COMPONENT_MISSION_RUN, componentAction_, failCount_, failureMode_, loaded_, runLoop_, and FailureMode::ToString().
Referenced by toString().
|
protectedvirtual |
References accuracy_, dataStateChange_, eventType_, SET_DATA_ACCURACY, SET_DATA_STATE, and StateChangeToString().
Referenced by toString().
| void EventEntry::operator delete | ( | void * | p | ) |
Override delete.
| void * EventEntry::operator new | ( | size_t | size | ) |
Override new.
|
static |
Read new EventEntry from a stream.
Implements requirement: Time values must be stored to at least millisecond resolution, with the option for less resolution.
References InStream::bytesRead(), COMPONENT_ACTION, COMPONENT_FAIL, COMPONENT_LOAD, COMPONENT_MISSION_RUN, InStream::eof(), Syslog::ERROR, EVENT_TYPE_MASK, EventEntry(), Timestamp::FromMicros(), Timespan::INVALID_TIMESPAN, ElementURI::NO_CODE, InStream::read(), InStream::readChar(), InStream::readInt24(), LogEntry::ReadTimestamp(), InStream::readUShortCompact(), SET_DATA_ACCURACY, SET_DATA_STATE, LogEntry::setTimestamp(), START_CYCLE, Logger::syslog(), and Logger::TIME_PRECISION_MILLIS.
Referenced by LogEntry::Read().
|
inline |
References accuracy_.
|
inline |
References dataStateChange_.
|
static |
Convert actions to Strs.
Convert an Action to a char*.
References DATA_STATE_CHANGE_AVAILABLE, DATA_STATE_CHANGE_INVALID, DATA_STATE_CHANGE_ORPHANED, DATA_STATE_CHANGE_SET_BEST, DATA_STATE_CHANGE_UNAVAILABLE, DATA_STATE_CHANGE_UNORPHANED, DATA_STATE_CHANGE_VALID, and NO_DATA_STATE_CHANGE.
Referenced by makeDataValueString().
Convert payload to Str.
Implements LogEntry.
References actorCode_, Timestamp::asDouble(), COMPONENT_ACTION, dataElementCode_, eventType_, EventTypeToString(), Slate::GetElementURI(), Slate::GetName(), makeComponentActionString(), makeDataValueString(), CodedStr::NO_CODE, START_CYCLE, LogEntry::timestamp_, Timestamp::toString(), and LogEntry::UNKNOWN.
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 actorCode_, Timestamp::asMicros(), OutStream::bytesWritten(), COMPONENT_ACTION, COMPONENT_FAIL, COMPONENT_LOAD, COMPONENT_MISSION_RUN, LogEntry::EVENT_LOG_ENTRY, eventType_, getAccuracy(), getComponentAction(), getDataElementCode(), getDataStateChange(), getFailCount(), getFailureMode(), getLoaded(), getRunLoop(), SET_DATA_ACCURACY, SET_DATA_STATE, START_CYCLE, Logger::TIME_PRECISION_MILLIS, LogEntry::timestamp_, OutStream::write(), OutStream::writeChar(), OutStream::writeFloat2(), OutStream::writeInt24(), LogEntry::writeTimestamp(), and OutStream::writeUShortCompact().
| union { ... } |
Arg2.
| union { ... } |
Arg4.
| union { ... } |
Arg5.
| double EventEntry::accuracy_ |
Referenced by getAccuracy(), makeDataValueString(), and setAccuracy().
|
protected |
Arg1.
Referenced by getActorCode(), toString(), and write().
|
static |
| ComponentAction EventEntry::componentAction_ |
Referenced by getComponentAction(), and makeComponentActionString().
| unsigned short EventEntry::dataElementCode_ |
Referenced by getDataElementCode(), and toString().
| DataStateChange EventEntry::dataStateChange_ |
Referenced by getDataStateChange(), makeDataValueString(), and setDataStateChange().
|
static |
Referenced by Read().
|
protected |
Arg3.
Referenced by getEventType(), makeDataValueString(), toString(), and write().
| int EventEntry::failCount_ |
Referenced by getFailCount(), and makeComponentActionString().
| FailureMode::FailType EventEntry::failureMode_ |
Referenced by getFailureMode(), and makeComponentActionString().
| bool EventEntry::loaded_ |
Referenced by getLoaded(), and makeComponentActionString().
|
staticprotected |
Declared as a pointer to avoid including RingBuffer.h header here.
Referenced by EventEntry::StaticDestructor::~StaticDestructor().
| int EventEntry::runLoop_ |
Referenced by getRunLoop(), and makeComponentActionString().
|
staticprotected |
Static instance of StaticDestructor.