|
LRAUV
revA
|
Defines a LogWriter that generates a NetCDF table of values. More...
#include <NetCdfTableLogWriter.h>


Public Member Functions | |
| NetCdfTableLogWriter (const Str &filename, bool version4, int varCount, char **varListt, char **unitList, bool interpolate=false, int attCount=0, char **attList=NULL) | |
| Constructor. More... | |
| virtual | ~NetCdfTableLogWriter () |
| Destructor. More... | |
| unsigned int | writeHeader () |
| Start writing the NetCDF file. More... | |
| unsigned int | write (const LogEntry *entry, const Unit *unit=NULL) |
| Write an entry to the buffer. More... | |
| unsigned int | writeFooter () |
| Finish writing the NetCDF file. More... | |
| virtual void | clearRow () |
| virtual const Str & | getFilename () |
Public Member Functions inherited from TableLogWriter | |
| 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 | writeAllInterpolated () |
| 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 () |
Public Member Functions inherited from HasFilename | |
| virtual | ~HasFilename () |
Private Member Functions | |
| NetCdfTableLogWriter (const NetCdfTableLogWriter &old) | |
| void | initializeNetCdfTableLogWriter () |
| Initialize variables, etc. More... | |
| void | addVar (const int index, const ElementURI *uri, BinaryDataType binaryType, const Unit &unit, short universalCode) |
| Add a new variable. More... | |
| void | setAttValue (const DataEntry *dataEntry, const int attIndex) |
| Set an attribute value. More... | |
| unsigned int | writeToColumn (const DataEntry *dataEntry, const int column) |
| Write a data item. More... | |
| unsigned int | writeRow () |
| void | netCdfInitialize () |
| Initialize the NetCDF file. More... | |
Private Attributes | |
| const Str | filename_ |
| int | attCount_ |
| char ** | attList_ |
| unsigned short * | attUriCodes_ |
| int * | attCodeLookup_ |
| NetCdfWriter * | netCdfWriter_ |
| bool | netCdfInitialized_ |
| bool | finalized_ |
| const NetCdf::NetCdfAtt ** | atts_ |
| const NetCdf::NetCdfAtt ** | attUnits_ |
| NetCdf::NetCdfVar ** | vars_ |
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] |
Protected Member Functions inherited from TableLogWriter | |
| TableLogWriter (const TableLogWriter &old) | |
| void | initializeTableLogWriter () |
| virtual unsigned int | writeSyslog (const SyslogEntry *syslogEntry) |
| const DataEntry ** | newDataEntryRow () |
| void | deleteDataEntryRow (const DataEntry **dataEntryRow) |
| unsigned int | writeInterpolated (const LogEntry *logEntry, const int column) |
| unsigned int | writeDataEntryRow (unsigned int row) |
| DataEntry * | interpolateDataEntry (const Timestamp ×tamp, const DataEntry *startEntry, const DataEntry *endEntry) |
| DataEntry * | nanDataEntry (const Timestamp ×tamp, 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 Member Functions inherited from HasFilename | |
| HasFilename () | |
Protected Attributes inherited from TableLogWriter | |
| LogWriter * | outputTo_ |
| 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 | |
| OutStream * | logStream_ |
| Stores an OutStream. More... | |
| bool | wroteHeader_ |
| bool | wroteFooter_ |
| Mutex | writeMutex_ |
| int | parentCount_ |
| bool | active_ |
Static Protected Attributes inherited from TableLogWriter | |
| static True | True_ |
Defines a LogWriter that generates a NetCDF 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 record is added to the NetCDF file with the current value of every variable. The Timestamp for each record corresponds to the time of the start of the computation cycle in which any value changed.
| NetCdfTableLogWriter::NetCdfTableLogWriter | ( | const Str & | filename, |
| bool | version4, | ||
| int | varCount, | ||
| char ** | varListt, | ||
| char ** | unitList, | ||
| bool | interpolate = false, |
||
| int | attCount = 0, |
||
| char ** | attList = NULL |
||
| ) |
Constructor.
Streamless Constructor.
References attCodeLookup_, attCount_, atts_, attUnits_, attUriCodes_, initializeNetCdfTableLogWriter(), MAX_CODES, ElementURI::NO_CODE, TableLogWriter::varCount_, and vars_.
|
virtual |
Destructor.
References attCodeLookup_, atts_, attUnits_, attUriCodes_, finalized_, netCdfWriter_, vars_, and writeFooter().
|
private |
|
private |
Add a new variable.
References NetCdfWriter::addVar(), NetCdfWriter::addVarAtt(), Str::cStr(), NetCdf::NetCdfVar::dataValue_, UniversalURI::DEPTH, DOUBLE4, DOUBLE6, DOUBLE8, Str::EMPTY_STR, NetCdf::findVar(), FLOAT2, FLOAT3, FLOAT4, Unit::getAbbreviation(), Slate::GetElementURI(), INT4, TableLogWriter::isUniversal_, UniversalURI::LATITUDE, UniversalURI::LONGITUDE, MULTIVALUE, NetCdf::NC_ABSENT_TYPE, NetCdf::NC_DOUBLE_TYPE, NetCdf::NC_FLOAT_TYPE, NetCdf::NC_INT_TYPE, NetCdf::NC_SHORT_TYPE, netCdfWriter_, ElementURI::NO_CODE, NO_TYPE, Str::replaceChar(), SHORT2, UCHAR1, USHORT2, TableLogWriter::varList_, and vars_.
Referenced by netCdfInitialize().
|
virtual |
Reimplemented from TableLogWriter.
|
inlinevirtual |
Implements HasFilename.
References filename_.
|
private |
Initialize variables, etc.
Referenced by NetCdfTableLogWriter().
|
private |
Initialize the NetCDF file.
References NetCdfWriter::addGlobalAtt(), NetCdfWriter::addVar(), addVar(), attCodeLookup_, attCount_, attList_, atts_, attUnits_, attUriCodes_, Str::cStr(), DOUBLE4, DOUBLE6, DOUBLE8, Str::findLastOf(), FLOAT2, FLOAT3, FLOAT4, DataAccess::getBinaryType(), Slate::GetDataAccess(), Slate::GetDataAccessCount(), DataAccess::getElementCode(), Slate::GetElementURI(), Slate::GetElementURICode(), DataAccess::getUnit(), DataAccess::getUniversalCode(), INT4, Slate::IsDirectoryRead(), TableLogWriter::isUniversal_, MULTIVALUE, NetCdf::NC_FLOAT_TYPE, netCdfInitialized_, netCdfWriter_, ElementURI::NO_CODE, Str::NO_POS, NO_TYPE, Str::replaceChar(), SHORT2, UCHAR1, TableLogWriter::units_, TableLogWriter::uriCodes_, USHORT2, TableLogWriter::varCount_, TableLogWriter::varList_, and vars_.
Referenced by writeHeader().
|
private |
Set an attribute value.
References atts_, attUnits_, DataValue::copyTo(), DataEntry::getDataAccess(), DataEntry::getDataValue(), DataAccess::getElementCode(), Slate::GetElementURI(), Unit::getName(), DataValue::getUnit(), NetCdf::NC_BYTE_TYPE, NetCdf::NC_CHAR_TYPE, NetCdf::NC_DOUBLE_TYPE, NetCdf::NC_FLOAT_TYPE, NetCdf::NC_INT_TYPE, NetCdf::NC_SHORT_TYPE, NetCdf::NetCdfAtt::nelems_, NetCdf::NetCdfAtt::netCdfType_, netCdfWriter_, NetCdfWriter::setAttValue(), and DataValue::toString().
Referenced by write().
|
virtual |
Write an entry to the buffer.
If a start of cycle is encountered, write the whole record to the NetCDF file.
Reimplemented from TableLogWriter.
References attCodeLookup_, LogEntry::DATA_LOG_ENTRY, DataEntry::getDataAccess(), DataAccess::getElementCode(), Slate::GetElementURICount(), LogEntry::getType(), TableLogWriter::initializedTableLogWriter_, TableLogWriter::initializeTableLogWriter(), netCdfInitialized_, setAttValue(), TableLogWriter::slateElementURICount_, TableLogWriter::write(), and writeHeader().
|
virtual |
Finish writing the NetCDF file.
Reimplemented from TableLogWriter.
References NetCdfWriter::finalize(), finalized_, TableLogWriter::initializedTableLogWriter_, TableLogWriter::lastTime_, netCdfInitialized_, netCdfWriter_, ElementURI::NO_CODE, TableLogWriter::uriCodes_, TableLogWriter::varCount_, TableLogWriter::varList_, vars_, TableLogWriter::writeFooter(), NetCdfWriter::writeRecord(), and LogWriter::wroteFooter_.
Referenced by ~NetCdfTableLogWriter().
|
virtual |
Start writing the NetCDF file.
Reimplemented from TableLogWriter.
References NetCdfWriter::initialize(), netCdfInitialize(), netCdfInitialized_, and netCdfWriter_.
Referenced by write().
|
privatevirtual |
Reimplemented from TableLogWriter.
References TableLogWriter::lastTime_, netCdfWriter_, and NetCdfWriter::writeRecord().
|
privatevirtual |
Write a data item.
Reimplemented from TableLogWriter.
References DataValue::copyTo(), NetCdf::NetCdfVar::dataValue_, DataEntry::getDataValue(), DataValue::getUnit(), DataValue::setFrom(), and vars_.
|
private |
Referenced by netCdfInitialize(), NetCdfTableLogWriter(), write(), and ~NetCdfTableLogWriter().
|
private |
Referenced by netCdfInitialize(), and NetCdfTableLogWriter().
|
private |
Referenced by netCdfInitialize().
|
private |
Referenced by netCdfInitialize(), NetCdfTableLogWriter(), setAttValue(), and ~NetCdfTableLogWriter().
|
private |
Referenced by netCdfInitialize(), NetCdfTableLogWriter(), setAttValue(), and ~NetCdfTableLogWriter().
|
private |
Referenced by netCdfInitialize(), NetCdfTableLogWriter(), and ~NetCdfTableLogWriter().
|
private |
Referenced by getFilename().
|
private |
Referenced by writeFooter(), and ~NetCdfTableLogWriter().
|
private |
Referenced by netCdfInitialize(), write(), writeFooter(), and writeHeader().
|
private |
Referenced by addVar(), netCdfInitialize(), setAttValue(), writeFooter(), writeHeader(), writeRow(), and ~NetCdfTableLogWriter().
|
private |
Referenced by addVar(), netCdfInitialize(), NetCdfTableLogWriter(), writeFooter(), writeToColumn(), and ~NetCdfTableLogWriter().