LRAUV  revA
TableLogWriter Class Reference

Defines a LogWriter that generates a text table of values. More...

#include <TableLogWriter.h>

Inheritance diagram for TableLogWriter:
Collaboration diagram for TableLogWriter:

Classes

class  True
 

Public Member Functions

 TableLogWriter (int varCount, char **varList, char **unitList, bool interpolate)
 Constructor. More...
 
 TableLogWriter (LogWriter *outputTo, int varCount, char **varList, char **unitList, bool interpolate)
 Constructor. More...
 
virtual ~TableLogWriter ()
 Destructor. More...
 
virtual unsigned int write (const LogEntry *entry, const Unit *unit=NULL)
 Write an entry to the text log. More...
 
virtual unsigned int writeHeader ()
 Write the log header, if any. More...
 
virtual unsigned int writeAllInterpolated ()
 
virtual unsigned int writeFooter ()
 Write the log footer, if any. More...
 
virtual void resetInputs ()
 Reset cached input settings. More...
 
- Public Member Functions inherited from LogWriter
virtual ~LogWriter ()
 Destructor. More...
 
virtual void setOutStream (OutStream &outStream)
 Sets the OutStream. More...
 
virtual bool isValid ()
 Return true if logStream_ is available. More...
 
virtual void endCycle ()
 Do what needs to be done at the end of the cycle. More...
 
virtual void config (Logger &logger)
 Configure from a config file. More...
 
void addParent ()
 
void removeParent ()
 
int getParentCount ()
 
virtual void activate ()
 
virtual void deactivate ()
 
virtual bool isActive ()
 
virtual void lockWrites ()
 
virtual void unlockWrites ()
 

Protected Member Functions

 TableLogWriter (const TableLogWriter &old)
 
void initializeTableLogWriter ()
 
virtual void clearRow ()
 
virtual unsigned int writeRow ()
 
virtual unsigned int writeSyslog (const SyslogEntry *syslogEntry)
 
virtual unsigned int writeToColumn (const DataEntry *dataEntry, const int column)
 
const DataEntry ** newDataEntryRow ()
 
void deleteDataEntryRow (const DataEntry **dataEntryRow)
 
unsigned int writeInterpolated (const LogEntry *logEntry, const int column)
 
unsigned int writeDataEntryRow (unsigned int row)
 
DataEntryinterpolateDataEntry (const Timestamp &timestamp, const DataEntry *startEntry, const DataEntry *endEntry)
 
DataEntrynanDataEntry (const Timestamp &timestamp, const DataEntry *origEntry)
 
- Protected Member Functions inherited from LogWriter
 LogWriter ()
 Protected constructor for pure virtual class. More...
 
 LogWriter (OutStream &outStream)
 Protected constructor for pure virtual class. More...
 

Protected Attributes

LogWriteroutputTo_
 
int varCount_
 
char ** varList_
 
char ** unitList_
 
const Unit ** units_
 
unsigned short * uriCodes_
 
bool * isUniversal_
 
int * codeLookup_
 
bool interpolate_
 
FlexArray< const DataEntry ** > interpBuffer_
 
FlexArray< SyslogEntry * > interpSyslogs_
 
FlexArray< Timestamp * > interpTimes_
 
FlexArray< const True * > readerColumn_
 
Timestamp lastTime_
 
bool initializedTableLogWriter_
 
unsigned int slateElementURICount_
 
bool deleteLists_
 
- Protected Attributes inherited from LogWriter
OutStreamlogStream_
 Stores an OutStream. More...
 
bool wroteHeader_
 
bool wroteFooter_
 
Mutex writeMutex_
 
int parentCount_
 
bool active_
 

Static Protected Attributes

static True True_
 

Additional Inherited Members

- Public Types inherited from LogWriter
enum  ServiceType {
  NO_SERVICE = -1, SERVICE_COURIER, SERVICE_EXPRESS, SERVICE_PRIORITY,
  SERVICE_NORMAL, SERVICE_BULK, SERVICE_COUNT, SERVICE_MULTI
}
 
- Static Public Member Functions inherited from LogWriter
static ServiceType Str2ServiceType (const char *const serviceTypeStr, int len=-1)
 
static const char * ServiceType2Str (LogWriter::ServiceType serviceType)
 
static size_t ServiceType2Strlen (LogWriter::ServiceType serviceType)
 
- Static Public Attributes inherited from LogWriter
static const char *const SERVICE_TYPE_STRS [SERVICE_COUNT]
 
static size_t const SERVICE_TYPE_STRLEN [SERVICE_COUNT]
 

Detailed Description

Defines a LogWriter that generates a text table of values.

A list of variable names is supplied to the constructor. If any of these variables change their value in a computation cycle, then a new line is added to the text table listing the current value of every variable.

See FileLogWriter for output to the filesystem.

Constructor & Destructor Documentation

TableLogWriter::TableLogWriter ( int  varCount,
char **  varList,
char **  unitList,
bool  interpolate 
)

Constructor.

References resetInputs().

TableLogWriter::TableLogWriter ( LogWriter outputTo,
int  varCount,
char **  varList,
char **  unitList,
bool  interpolate 
)

Constructor.

References LogWriter::addParent(), outputTo_, and resetInputs().

TableLogWriter::TableLogWriter ( const TableLogWriter old)
protected

Member Function Documentation

void TableLogWriter::clearRow ( )
protectedvirtual

Reimplemented in NetCdfTableLogWriter.

Referenced by write().

void TableLogWriter::deleteDataEntryRow ( const DataEntry **  dataEntryRow)
protected

References varCount_.

Referenced by writeDataEntryRow(), and ~TableLogWriter().

DataEntry * TableLogWriter::nanDataEntry ( const Timestamp timestamp,
const DataEntry origEntry 
)
protected
const DataEntry ** TableLogWriter::newDataEntryRow ( )
protected

References varCount_.

Referenced by writeInterpolated().

void TableLogWriter::resetInputs ( )
virtual
unsigned int TableLogWriter::writeAllInterpolated ( )
virtual
unsigned int TableLogWriter::writeDataEntryRow ( unsigned int  row)
protected
unsigned int TableLogWriter::writeFooter ( )
virtual
unsigned int TableLogWriter::writeHeader ( )
virtual

Write the log header, if any.

Reimplemented from LogWriter.

Reimplemented in LinearApproximationLogWriter, NetCdfTableLogWriter, and TextTableLogWriter.

References outputTo_, and LogWriter::writeHeader().

unsigned int TableLogWriter::writeRow ( )
protectedvirtual
unsigned int TableLogWriter::writeSyslog ( const SyslogEntry syslogEntry)
protectedvirtual

Reimplemented in LinearApproximationLogWriter.

References outputTo_, and LogWriter::write().

Referenced by write(), and writeDataEntryRow().

unsigned int TableLogWriter::writeToColumn ( const DataEntry dataEntry,
const int  column 
)
protectedvirtual

Member Data Documentation

int* TableLogWriter::codeLookup_
protected
bool TableLogWriter::deleteLists_
protected
bool TableLogWriter::initializedTableLogWriter_
protected
FlexArray<const DataEntry**> TableLogWriter::interpBuffer_
protected
bool TableLogWriter::interpolate_
protected

Referenced by write(), and writeAllInterpolated().

FlexArray<SyslogEntry*> TableLogWriter::interpSyslogs_
protected
FlexArray<Timestamp*> TableLogWriter::interpTimes_
protected
FlexArray<const True*> TableLogWriter::readerColumn_
protected
unsigned int TableLogWriter::slateElementURICount_
protected
TableLogWriter::True TableLogWriter::True_
staticprotected
char** TableLogWriter::unitList_
protected

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