LRAUV  revA
DataEntry Class Reference

Code unit that represents an atomic unit of data destined for writing in the log file. More...

#include <DataEntry.h>

Inheritance diagram for DataEntry:
Collaboration diagram for DataEntry:

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 &timestamp, 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...
 
DataAccessgetDataAccess (void) const
 
void setDataAccess (DataAccess *dataAccess)
 
DataValuegetDataValue (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 TimestampgetTimestamp (void) const
 Accessors. More...
 
const TimestampsetTimestamp (const Timestamp &newTime)
 
const TimestampsetTimestamp (const double newTime)
 
Type getType (void) const
 

Static Public Member Functions

static DataEntryRead (Timestamp &timeBase, InStream &inStream, unsigned short firstWord, Logger &logger)
 Read new DataEntry from a stream. More...
 
- Static Public Member Functions inherited from LogEntry
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 BEST_MASK = 0x0004
 Mask for Best values. More...
 
- Static Public Attributes inherited from LogEntry
static const int TYPE_MASK = 0x0003
 

Protected Attributes

DataAccessdataAccess_
 
DataValuedataValue_
 
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 RingBufferVoidMallocRing_
 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 &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 inherited from LogEntry
static bool ReadTimestamp (Timestamp &timestamp, bool &changed, InStream &inStream, Logger &logger, Logger::TimePrecisionType timePrecision)
 

Detailed Description

Code unit that represents an atomic unit of data destined for writing in the log file.

A DataEntry is serialized as:

Constructor & Destructor Documentation

DataEntry::DataEntry ( DataAccessor dataAccessor,
const bool  best,
const bool  changed 
)
DataEntry::DataEntry ( const DataEntry dataEntry)

Copy Constructor.

DataEntry::DataEntry ( DataAccess access,
DataValue dataValue,
const Timestamp timestamp,
const bool  best,
const bool  changed 
)

DataAccess Constructor.

DataEntry::~DataEntry ( )
virtual

Destructor.

References dataValue_.

DataEntry::DataEntry ( const DataEntry old)
private

Member Function Documentation

const Str DataEntry::getDataValueString ( const Unit unit = NULL,
bool  hideUnits = false 
) const
virtual
bool DataEntry::isDataWrite ( ) const
void DataEntry::operator delete ( void *  p)

Override delete.

void * DataEntry::operator new ( size_t  size)

Override new.

void DataEntry::setDataAccess ( DataAccess dataAccess)
inline

Member Data Documentation

bool DataEntry::best_
protected

Referenced by isBest(), and write().

const int DataEntry::BEST_MASK = 0x0004
static

Mask for Best values.

Referenced by Read().

bool DataEntry::changed_
protected

Referenced by write().

DataAccess* DataEntry::dataAccess_
protected
DataValue* DataEntry::dataValue_
protected
RingBufferVoid * DataEntry::MallocRing_
staticprotected

Declared as a pointer to avoid including RingBuffer.h header here.

Referenced by DataEntry::StaticDestructor::~StaticDestructor().

DataEntry::StaticDestructor DataEntry::StaticDestructor_
staticprotected

Static instance of StaticDestructor.


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