|
LRAUV
revA
|
Code unit that represents an atomic unit of data destined for writing in the log file. More...
#include <DataEntry.h>


Classes | |
| class | StaticDestructor |
| Makes sure that mallocRing_s is deleted on shutdown. More... | |
Public Types | |
| enum | Best { NOT_BEST = 0x0000, IS_BEST = 0x0004 } |
| Type of 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 | |
| DataEntry (DataAccessor *dataAccessor, const bool best, const bool changed) | |
| Constructor. More... | |
| DataEntry (const DataEntry *dataEntry) | |
| Copy Constructor. More... | |
| DataEntry (DataAccess *access, DataValue *dataValue, const Timestamp ×tamp, const bool best, const bool changed) | |
| DataAccess Constructor. More... | |
| virtual | ~DataEntry () |
| Destructor. More... | |
| void * | operator new (size_t size) |
| Override new. More... | |
| void | operator delete (void *p) |
| Override delete. More... | |
| DataAccess * | getDataAccess (void) const |
| void | setDataAccess (DataAccess *dataAccess) |
| DataValue * | getDataValue (void) const |
| bool | isBest () const |
| bool | isDataWrite () 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... | |
| virtual const Str | getDataValueString (const Unit *unit=NULL, bool hideUnits=false) 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 DataEntry * | Read (Timestamp &timeBase, InStream &inStream, unsigned short firstWord, Logger &logger) |
| Read new DataEntry from a stream. 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 | BEST_MASK = 0x0004 |
| Mask for Best values. More... | |
Static Public Attributes inherited from LogEntry | |
| static const int | TYPE_MASK = 0x0003 |
Protected Attributes | |
| DataAccess * | dataAccess_ |
| DataValue * | dataValue_ |
| bool | best_ |
| bool | changed_ |
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 DataEntry::StaticDestructor | StaticDestructor_ |
| Static instance of StaticDestructor. More... | |
Static Protected Attributes inherited from LogEntry | |
| static const Str | UNKNOWN |
Private Member Functions | |
| DataEntry (const DataEntry &old) | |
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 atomic unit of data destined for writing in the log file.
A DataEntry is serialized as:
| DataEntry::DataEntry | ( | DataAccessor * | dataAccessor, |
| const bool | best, | ||
| const bool | changed | ||
| ) |
Constructor.
References DataValue::copy(), dataValue_, DataElement::getDataValue(), and DataAccessor::getElement().
Referenced by Read().
| DataEntry::DataEntry | ( | const DataEntry * | dataEntry | ) |
Copy Constructor.
| DataEntry::DataEntry | ( | DataAccess * | access, |
| DataValue * | dataValue, | ||
| const Timestamp & | timestamp, | ||
| const bool | best, | ||
| const bool | changed | ||
| ) |
DataAccess Constructor.
|
virtual |
Destructor.
References dataValue_.
|
private |
|
inline |
References dataAccess_.
Referenced by DataNameRule::check(), LinearApproxLogWriter::VarData::checkNextEntry(), LinearApproximationLogWriter::VarData::checkNextEntry(), MultiLogWriter::forceWrite(), LinearApproximationLogWriter::forceWrite(), TableLogWriter::interpolateDataEntry(), LinearApproximationLogWriter::sendOutput(), NetCdfTableLogWriter::setAttValue(), MostRecentLogWriter::write(), KmlLogWriter::write(), MultiLogWriter::write(), TableLogWriter::write(), FilterLogWriter::write(), NetCdfTableLogWriter::write(), DirectoryManagingLogWriter::writeData(), and JsonLogWriter::writeData().
|
inline |
References dataValue_.
Referenced by LinearApproxLogWriter::VarData::checkNextEntry(), LinearApproximationLogWriter::VarData::checkNextEntry(), TableLogWriter::interpolateDataEntry(), TableLogWriter::nanDataEntry(), NetCdfTableLogWriter::setAttValue(), MostRecentLogWriter::write(), KmlLogWriter::write(), JsonLogWriter::writeData(), NetCdfLogWriter::writeData(), HDF5LogWriter::writeData(), and NetCdfTableLogWriter::writeToColumn().
|
virtual |
References dataValue_, DataValue::getUnit(), and DataValue::toString().
Referenced by toString(), and TextTableLogWriter::writeToColumn().
|
inline |
References best_.
Referenced by DataNameRule::check(), toString(), MostRecentLogWriter::write(), KmlLogWriter::write(), TableLogWriter::write(), and FilterLogWriter::write().
| bool DataEntry::isDataWrite | ( | ) | const |
References DataAccessor::DATA_WRITER, dataAccess_, and DataAccess::getAccessorType().
Referenced by DataWriteRule::check().
| void DataEntry::operator delete | ( | void * | p | ) |
Override delete.
| void * DataEntry::operator new | ( | size_t | size | ) |
Override new.
|
static |
Read new DataEntry from a stream.
Implements requirement: Time values must be stored to at least millisecond resolution, with the option for less resolution.
References BEST_MASK, InStream::bytesRead(), DataValue::copy(), DataAccess::copyUnitsTypeAndSizeFrom(), DataEntry(), Syslog::ERROR, DataValue::fromBinary(), DataAccess::getBinaryType(), ElementURI::getBlobType(), Slate::GetDataAccess(), Slate::GetDataAccessCount(), DataElement::getDataValue(), Slate::GetElement(), DataAccess::getElementCode(), Slate::GetElementURI(), DataAccess::getTimePrecision(), InStream::getTotalBytesRead(), DataAccess::getTypeSize(), DataAccess::getUnit(), DataAccess::getUniversalCode(), DataElement::getUri(), IS_BEST, MULTIVALUE, Slate::NewDataElement(), ElementURI::NO_CODE, NO_TYPE, NOT_BLOB, InStream::read(), InStream::readShort(), LogEntry::ReadTimestamp(), ElementURI::SELF_CODE, DataValue::setFrom(), and Logger::syslog().
Referenced by LogEntry::Read().
|
inline |
References dataAccess_.
Referenced by LinearApproximationLogWriter::sendOutput(), and MultiLogWriter::write().
Convert payload to Str.
Implements LogEntry.
References Timestamp::asDouble(), DataAccessor::DATA_WRITER, dataAccess_, DataAccess::getAccessorType(), getDataValueString(), DataAccess::getElementCode(), Slate::GetElementURI(), Slate::GetName(), DataAccess::getOwnerCode(), DataAccess::getTimePrecision(), isBest(), Logger::TIME_PRECISION_MICROS, Logger::TIME_PRECISION_MILLIS, 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 best_, OutStream::bytesWritten(), changed_, LogEntry::DATA_LOG_ENTRY, dataAccess_, dataValue_, DataAccess::getCode(), DataAccess::getTimePrecision(), IS_BEST, NOT_BEST, DataValue::toStream(), LogEntry::writeTimestamp(), and OutStream::writeUShortCompact().
|
static |
Mask for Best values.
Referenced by Read().
|
protected |
Referenced by write().
|
protected |
Referenced by getDataAccess(), isDataWrite(), setDataAccess(), toString(), and write().
|
protected |
Referenced by DataEntry(), getDataValue(), getDataValueString(), write(), and ~DataEntry().
|
staticprotected |
Declared as a pointer to avoid including RingBuffer.h header here.
Referenced by DataEntry::StaticDestructor::~StaticDestructor().
|
staticprotected |
Static instance of StaticDestructor.