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


Public Member Functions | |
| JsonLogWriter (bool formatted, int varCount, char **varList, char **unitList, int attCount=0, char **attList=NULL) | |
| Constructor. More... | |
| virtual | ~JsonLogWriter () |
| Destructor. More... | |
| unsigned int | writeHeader () |
| Start writing the Json 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 Json file. 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 () |
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... | |
Private Member Functions | |
| JsonLogWriter (const JsonLogWriter &old) | |
| void | initializeJsonLogWriter () |
| 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... | |
Private Attributes | |
| cJSON * | json_ |
| bool | jsonLogWriterInitialized_ |
| bool | finalized_ |
| bool | formatted_ |
| cJSON ** | vars_ |
| cJSON ** | timeVars_ |
| const Unit ** | units_ |
| const ElementURI ** | uris_ |
Defines a LogWriter that generates a JSON table of values.
A list of variable names is supplied to the constructor.
| JsonLogWriter::JsonLogWriter | ( | bool | formatted, |
| int | varCount, | ||
| char ** | varList, | ||
| char ** | unitList, | ||
| int | attCount = 0, |
||
| char ** | attList = NULL |
||
| ) |
Constructor.
Streamless Constructor.
References FilterLogWriter::attCount_, timeVars_, units_, uris_, FilterLogWriter::varCount_, and vars_.
|
virtual |
Destructor.
References finalized_, json_, timeVars_, units_, uris_, vars_, and writeFooter().
|
private |
|
private |
Add a new variable.
References Str::cStr(), UniversalURI::DEPTH, Str::EMPTY_STR, Str::find(), Unit::getAbbreviation(), Slate::GetElementURI(), FilterLogWriter::isUniversal_, json_, UniversalURI::LATITUDE, UniversalURI::LONGITUDE, ElementURI::NO_CODE, Str::NO_POS, Str::replaceChar(), Str::substr(), timeVars_, units_, uris_, and vars_.
Referenced by initializeJsonLogWriter().
|
private |
Initialize variables, etc.
References addVar(), FilterLogWriter::attCount_, FilterLogWriter::attUriCodes_, Str::findLastOf(), DataAccess::getBinaryType(), Slate::GetDataAccess(), Slate::GetDataAccessCount(), DataAccess::getElementCode(), Slate::GetElementURI(), Slate::GetElementURICode(), DataAccess::getUnit(), DataAccess::getUniversalCode(), Slate::IsDirectoryRead(), FilterLogWriter::isUniversal_, jsonLogWriterInitialized_, Str::NO_POS, NO_TYPE, units_, FilterLogWriter::uriCodes_, FilterLogWriter::varCount_, FilterLogWriter::varList_, and vars_.
Referenced by write().
|
private |
Set an attribute value.
Write an entry to the buffer.
Reimplemented from FilterLogWriter.
References Slate::GetElementURICount(), FilterLogWriter::initializedFilterLogWriter_, FilterLogWriter::initializeFilterLogWriter(), initializeJsonLogWriter(), jsonLogWriterInitialized_, FilterLogWriter::slateElementURICount_, and FilterLogWriter::write().
|
protectedvirtual |
Reimplemented from FilterLogWriter.
References FilterLogWriter::varCount_, and writeData().
|
protectedvirtual |
Reimplemented from FilterLogWriter.
References Timestamp::asDouble(), DataValue::copyTo(), Str::cStr(), BlobValue::get(), DataAccess::getBinaryType(), DataEntry::getDataAccess(), DataEntry::getDataValue(), ElementURI::getDimension1(), ElementURI::getDimension2(), ElementURI::getDimension3(), ElementURI::getDimensions(), BlobValue::getElements(), LogEntry::getTimestamp(), MULTIVALUE, NAN, timeVars_, StrValue::toString(), units_, uris_, and vars_.
Referenced by writeAtt().
|
virtual |
Finish writing the Json file.
Reimplemented from FilterLogWriter.
References formatted_, FilterLogWriter::initializedFilterLogWriter_, json_, jsonLogWriterInitialized_, LogWriter::logStream_, ElementURI::NO_CODE, FilterLogWriter::uriCodes_, FilterLogWriter::varCount_, FilterLogWriter::varList_, vars_, and LogWriter::wroteFooter_.
Referenced by ~JsonLogWriter().
|
virtual |
Start writing the Json file.
Reimplemented from FilterLogWriter.
|
private |
Referenced by ~JsonLogWriter().
|
private |
Referenced by writeFooter().
|
private |
Referenced by addVar(), writeFooter(), and ~JsonLogWriter().
|
private |
Referenced by initializeJsonLogWriter(), write(), and writeFooter().
|
private |
Referenced by addVar(), JsonLogWriter(), writeData(), and ~JsonLogWriter().
|
private |
Referenced by addVar(), initializeJsonLogWriter(), JsonLogWriter(), writeData(), and ~JsonLogWriter().
|
private |
Referenced by addVar(), JsonLogWriter(), writeData(), and ~JsonLogWriter().
|
private |
Referenced by addVar(), initializeJsonLogWriter(), JsonLogWriter(), writeData(), writeFooter(), and ~JsonLogWriter().