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


Public Member Functions | |
| HDF5LogWriter (const Str &filename, bool version4, int varCount, char **varList, char **unitList, int attCount=0, char **attList=NULL) | |
| Constructor. More... | |
| virtual | ~HDF5LogWriter () |
| 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... | |
| const Str & | getFilename () |
| Return the filename. More... | |
Public Member Functions inherited from FilterLogWriter | |
| FilterLogWriter (LogWriter *outputTo, int varCount, char **varList, char **unitList, bool passCycleStarts, int attCount=0, char **attList=NULL) | |
| Constructor. More... | |
| virtual | ~FilterLogWriter () |
| Destructor. 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... | |
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... | |
| 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 () |
Protected Member Functions | |
| virtual unsigned int | writeData (const DataEntry *dataEntry, int index, const Unit *unit) |
| virtual unsigned int | writeAtt (const DataEntry *dataEntry, int index, const Unit *unit) |
Protected Member Functions inherited from FilterLogWriter | |
| virtual void | resetInputs () |
| Reset cached input settings. More... | |
| void | initializeFilterLogWriter () |
| virtual unsigned int | writeCycleStart (const EventEntry *eventEntry) |
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 () | |
Private Member Functions | |
| HDF5LogWriter (const HDF5LogWriter &old) | |
| void | initializeHDF5LogWriter () |
| Initialize variables, etc. More... | |
| void | addVar (const int index, const ElementURI *uri, BinaryDataType binaryType, const Unit &unit, short universalCode, bool useChunks) |
| Add a new variable. More... | |
| void | setAttValue (const DataEntry *dataEntry, const int attIndex) |
| Set an attribute value. More... | |
Private Attributes | |
| const Str | filename_ |
| HDF5File * | hdf5File_ |
| bool | hdf5LogWriterInitialized_ |
| bool | finalized_ |
| HDF5Dataset ** | vars_ |
| HDF5Dataset ** | timeVars_ |
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.
| HDF5LogWriter::HDF5LogWriter | ( | const Str & | filename, |
| bool | version4, | ||
| int | varCount, | ||
| char ** | varList, | ||
| char ** | unitList, | ||
| int | attCount = 0, |
||
| char ** | attList = NULL |
||
| ) |
Constructor.
Streamless Constructor.
References FilterLogWriter::attCount_, timeVars_, FilterLogWriter::varCount_, and vars_.
|
virtual |
Destructor.
References finalized_, hdf5File_, timeVars_, vars_, and writeFooter().
|
private |
|
private |
Add a new variable.
References HDF5HasAttributes::addAttribute(), HDF5Group::addDataset(), HDF5Group::addGroup(), HDF5Group::addScalarDataset(), Str::cStr(), UniversalURI::DEPTH, DOUBLE8, Str::EMPTY_STR, Units::EPOCH_SECOND, Str::find(), HDF5Group::findDataset(), Unit::getAbbreviation(), ElementURI::getBlobType(), ElementURI::getDimension1(), ElementURI::getDimension2(), ElementURI::getDimension3(), ElementURI::getDimensions(), Slate::GetElementURI(), hdf5File_, HDF5File::isMatlab(), FilterLogWriter::isUniversal_, UniversalURI::LATITUDE, UniversalURI::LONGITUDE, Units::MATLAB_TIME, ElementURI::NO_CODE, Str::NO_POS, Units::NONE, Str::replaceChar(), Str::substr(), timeVars_, and vars_.
Referenced by initializeHDF5LogWriter().
|
inlinevirtual |
|
private |
Initialize variables, etc.
References HDF5HasAttributes::addAttribute(), addVar(), FilterLogWriter::attCount_, FilterLogWriter::attUriCodes_, Str::findLastOf(), DataAccess::getBinaryType(), Slate::GetDataAccess(), Slate::GetDataAccessCount(), DataAccess::getElementCode(), Slate::GetElementURI(), Slate::GetElementURICode(), DataAccess::getUnit(), DataAccess::getUniversalCode(), hdf5File_, hdf5LogWriterInitialized_, Slate::IsDirectoryRead(), FilterLogWriter::isUniversal_, Str::NO_POS, NO_TYPE, FilterLogWriter::units_, FilterLogWriter::uriCodes_, FilterLogWriter::varCount_, FilterLogWriter::varList_, and vars_.
Referenced by writeHeader().
|
private |
Set an attribute value.
Write an entry to the buffer.
If a start of cycle is encountered, write the whole record to the NetCDF file.
Reimplemented from FilterLogWriter.
References Slate::GetElementURICount(), hdf5LogWriterInitialized_, FilterLogWriter::initializedFilterLogWriter_, FilterLogWriter::initializeFilterLogWriter(), FilterLogWriter::slateElementURICount_, FilterLogWriter::write(), and writeHeader().
|
protectedvirtual |
Reimplemented from FilterLogWriter.
References FilterLogWriter::varCount_, and writeData().
|
protectedvirtual |
Reimplemented from FilterLogWriter.
References Timestamp::asDouble(), DataValue::copyTo(), DataEntry::getDataValue(), HDF5Dataset::getDataValue(), LogEntry::getTimestamp(), DataValue::getUnit(), Units::SECOND, DataValue::setFrom(), timeVars_, vars_, and HDF5Dataset::writeDataValue().
Referenced by writeAtt().
|
virtual |
Finish writing the NetCDF file.
Reimplemented from FilterLogWriter.
References HDF5File::finalize(), finalized_, hdf5File_, hdf5LogWriterInitialized_, FilterLogWriter::initializedFilterLogWriter_, ElementURI::NO_CODE, FilterLogWriter::uriCodes_, FilterLogWriter::varCount_, FilterLogWriter::varList_, vars_, and LogWriter::wroteFooter_.
Referenced by ~HDF5LogWriter().
|
virtual |
Start writing the NetCDF file.
Reimplemented from FilterLogWriter.
References hdf5File_, hdf5LogWriterInitialized_, initializeHDF5LogWriter(), and HDF5Group::writeHeader().
Referenced by write().
|
private |
Referenced by getFilename().
|
private |
Referenced by writeFooter(), and ~HDF5LogWriter().
|
private |
Referenced by addVar(), initializeHDF5LogWriter(), writeFooter(), writeHeader(), and ~HDF5LogWriter().
|
private |
Referenced by initializeHDF5LogWriter(), write(), writeFooter(), and writeHeader().
|
private |
Referenced by addVar(), HDF5LogWriter(), writeData(), and ~HDF5LogWriter().
|
private |
Referenced by addVar(), HDF5LogWriter(), initializeHDF5LogWriter(), writeData(), writeFooter(), and ~HDF5LogWriter().