|
LRAUV
revA
|
Wraps a string (see Str) as a DataValue, so strings can be written to and read from the slate. More...
#include <StrValue.h>


Public Member Functions | |
| StrValue () | |
| Default constructior. More... | |
| StrValue (const char *value, size_t length=Str::NO_POS, const Unit &unit=Units::NONE) | |
| Two value constructior. More... | |
| StrValue (const Str value) | |
| Single value constructior. More... | |
| StrValue (const StrValue &value) | |
| Copy Constructor. More... | |
| StrValue (const void *binary) | |
| Constructor from binary. More... | |
| virtual | ~StrValue () |
| Destructor. More... | |
| void * | operator new (size_t size) |
| Override new. More... | |
| void | operator delete (void *p) |
| Override delete. More... | |
| StrValue * | copy () const |
| Return a pointer to a new copy. More... | |
| virtual void | minus (const DataValue *rhs, DataValue *assignTo) const |
| Subtraction of another DataValue to yield another DataValue. More... | |
| virtual void | times (const double rhs, DataValue *assignTo) const |
| Multiplication by a double to yield another DataValue. More... | |
| virtual double | absDiff (const DataValue *rhs) const |
| Return the absolute value of this difference from another DataValue. More... | |
| virtual bool | copyTo (const Unit &unit, unsigned char &assignTo) const |
| Copy value to unsigned char. More... | |
| virtual bool | copyTo (const Unit &unit, double &assignTo, unsigned int dim) const |
| Copy n-dimensional value to double. More... | |
| virtual bool | copyTo (const Unit &unit, double &assignTo) const |
| Copy value to double. More... | |
| virtual bool | copyTo (const Unit &unit, float &assignTo) const |
| Copy value to float. More... | |
| virtual bool | copyTo (const Unit &unit, int &assignTo) const |
| Copy value to unsigned int. More... | |
| virtual int | compare (const Unit &unit, const unsigned char &compareTo) const |
| Comparison with unsigned char. More... | |
| virtual int | compare (const Unit &unit, const double &compareTo) const |
| Comparison with double. More... | |
| virtual int | compare (const Unit &unit, const float &compareTo) const |
| Comparison with float. More... | |
| virtual int | compare (const Unit &unit, const int &compareTo) const |
| Comparison with int. More... | |
| virtual int | compare (const DataValue &compareTo) const |
| Comparison with another DataValue. More... | |
| virtual bool | equals (const Unit &unit, const unsigned char &compareTo) const |
| Equality test with with unsigned char. More... | |
| virtual bool | equals (const Unit &unit, const float &compareTo) const |
| Equality test with float. More... | |
| virtual bool | equals (const Unit &unit, const double &compareTo) const |
| Equality test with double. More... | |
| virtual bool | equals (const Unit &unit, const int &compareTo) const |
| Equality test with int. More... | |
| virtual bool | equals (const DataValue &compareTo) const |
| Equality test with another DataValue. More... | |
| virtual bool | setFrom (const Unit &unit, unsigned char value) |
| set from unsigned char value More... | |
| virtual bool | setFrom (const Unit &unit, double value) |
| set from double value More... | |
| virtual bool | setFrom (const Unit &unit, float value) |
| set from float value More... | |
| virtual bool | setFrom (const Unit &unit, int value) |
| set int value More... | |
| virtual bool | setFrom (const DataValue &value) |
| set DataValue value More... | |
| virtual const Str & | asString () const |
| void | setString (const Str &str) |
| virtual Str | toString () const |
| virtual Str | toString (const Unit &unit) const |
| virtual unsigned int | toStream (OutStream &outStream) const |
| Send the data value to the indicated stream. More... | |
| virtual void | fromBinary (const void *buffer, unsigned short typeSize) |
| Load the data from the a binary representation in the buffer Typically just a memcopy of the variable, though endianness may come into it. More... | |
| virtual void | fromBinary (const void *buffer) |
| Load the data from the a binary representation in the buffer Typically just a memcopy of the variable, though endianness may come into it. More... | |
Public Member Functions inherited from DataValue | |
| virtual | ~DataValue () |
| Destructor. More... | |
| void | operator delete (void *p) |
| Override delete. More... | |
| virtual bool | copyTo (const Unit &unit, bool &assignTo) const |
| Copy value to bool. More... | |
| virtual bool | copyTo (DataValue &assignTo) const |
| Copy value to another dataValue. More... | |
| virtual int | compare (const Unit &unit, const bool &compareTo) const |
| Comparison with bool. More... | |
| virtual bool | equals (const Unit &unit, const bool &compareTo) const |
| Equality test with with bool. More... | |
| virtual bool | isNaN () |
| Returns true if the number is not a number. More... | |
| virtual bool | setFrom (const Unit &unit, bool value) |
| set from bool value More... | |
| virtual size_t | getTypeSize () const |
| Returns the size of the internal storage type (i.e. sizeof(type)) More... | |
| virtual BinaryDataType | getBinaryType (void) const |
| Returns a constant (defined in BinaryDataType.h) representing the internal storage type. More... | |
| const Unit & | getUnit () const |
| const Unit & | getBaseUnit () const |
| void | setUnit (const Unit &unit) |
| void | clearType () |
Protected Attributes | |
| Str | value_ |
Protected Attributes inherited from DataValue | |
| const Unit * | unit_ |
| size_t | typeSize_ |
| size of the internal storage type (i.e. sizeof(type)) More... | |
| BinaryDataType | binaryType_ |
| constant (defined in BinaryDataType.h) representing the internal storage type More... | |
Additional Inherited Members | |
Protected Member Functions inherited from DataValue | |
| DataValue (const Unit &unit, const size_t &typeSize, const BinaryDataType &binaryType) | |
| Protected Constructor for abstract base class. More... | |
| DataValue (const size_t &typeSize, const BinaryDataType &binaryType) | |
| Protected unitless constructor for use via DataEntry class. More... | |
Wraps a string (see Str) as a DataValue, so strings can be written to and read from the slate.
Also accommodates serialization of strings.
StrValues always have units of Units::NONE
Note: since these DataValues are created and destructed frequently, the new and delete operators have been overridden, so that objects can be re-used as needed.
StrValue::MallocRing_ stores deleted objects.
| StrValue::StrValue | ( | ) |
Default constructior.
Referenced by copy().
| StrValue::StrValue | ( | const char * | value, |
| size_t | length = Str::NO_POS, |
||
| const Unit & | unit = Units::NONE |
||
| ) |
Two value constructior.
Two or three value constructior.
| StrValue::StrValue | ( | const Str | value | ) |
Single value constructior.
| StrValue::StrValue | ( | const StrValue & | value | ) |
Copy Constructor.
| StrValue::StrValue | ( | const void * | binary | ) |
Constructor from binary.
|
inlinevirtual |
Destructor.
|
virtual |
|
virtual |
References value_.
Referenced by Aanderaa_O2::Aanderaa_O2(), ESPComponent::createESPComm(), DataOverHttps::dataWriting(), DeviceIOStream::GetFilename(), CommandLine::getLines(), NavChartDb::initialize(), PeakDetectVsDepth::initialize(), MissionManager::initialize(), SimulatorUtils::LoadInit(), DataOverHttps::loadParams(), UartStream::LookupFilename(), Reporter::ReportItem::needsReporting(), WetLabsBB2FL::readConfig(), BPC1::readConfig(), Reporter::ReportItem::report(), NAL9602::retrieveAndQueueIncoming(), Rowe_600LCM::starting(), ESPComponent::startPPP(), DataOverHttps::tcpConnect(), and StrValue_Test::testSetFrom().
|
inlinevirtual |
Comparison with unsigned char.
Implements DataValue.
|
inlinevirtual |
Comparison with double.
Implements DataValue.
|
inlinevirtual |
Comparison with float.
Implements DataValue.
|
inlinevirtual |
Comparison with int.
Implements DataValue.
|
virtual |
Comparison with another DataValue.
Implements DataValue.
References DataValue::binaryType_, Str::compare(), DataValue::getBinaryType(), and value_.
|
virtual |
Return a pointer to a new copy.
Implements DataValue.
References StrValue(), and value_.
Referenced by Config::ParseLine().
|
inlinevirtual |
Copy value to unsigned char.
Implements DataValue.
|
virtual |
Copy n-dimensional value to double.
References Str::cStr(), Str::length(), and value_.
|
inlinevirtual |
Copy value to double.
Implements DataValue.
|
inlinevirtual |
Copy value to float.
Implements DataValue.
|
inlinevirtual |
Copy value to unsigned int.
Implements DataValue.
|
inlinevirtual |
Equality test with with unsigned char.
Implements DataValue.
|
inlinevirtual |
Equality test with float.
Implements DataValue.
|
inlinevirtual |
Equality test with double.
Implements DataValue.
|
inlinevirtual |
Equality test with int.
Implements DataValue.
|
virtual |
Equality test with another DataValue.
Implements DataValue.
References DataValue::binaryType_, DataValue::getBinaryType(), DataValue::getTypeSize(), DataValue::typeSize_, and value_.
|
virtual |
Load the data from the a binary representation in the buffer Typically just a memcopy of the variable, though endianness may come into it.
References DataValue::typeSize_.
|
virtual |
Load the data from the a binary representation in the buffer Typically just a memcopy of the variable, though endianness may come into it.
Implements DataValue.
References DataValue::typeSize_, and value_.
| void StrValue::operator delete | ( | void * | p | ) |
Override delete.
| void * StrValue::operator new | ( | size_t | size | ) |
Override new.
|
inlinevirtual |
|
inlinevirtual |
set from double value
Implements DataValue.
|
inlinevirtual |
set from float value
Implements DataValue.
|
inlinevirtual |
set int value
Implements DataValue.
|
virtual |
set DataValue value
Implements DataValue.
References DOUBLE4, DOUBLE6, DOUBLE8, DataValue::equals(), FLOAT2, FLOAT3, FLOAT4, DataValue::getBinaryType(), INT4, Str::length(), MULTIVALUE, NO_TYPE, SHORT2, DataValue::toString(), DataValue::typeSize_, UCHAR1, USHORT2, and value_.
| void StrValue::setString | ( | const Str & | str | ) |
References value_.
Referenced by Supervisor::initialize(), and NavChartDb::setChartsCfg().
|
inlinevirtual |
|
virtual |
Send the data value to the indicated stream.
Return the number of bytes written. For now, assume little-endian.
Implements DataValue.
References Str::cStr(), Str::length(), value_, OutStream::write(), and OutStream::writeShort().
|
virtual |
Reimplemented from DataValue.
References value_.
Referenced by Supervisor::initialize(), JsonLogWriter::writeData(), and NetCdfWriter::writeVarRecord().
|
protected |
Referenced by asString(), compare(), copy(), copyTo(), BlobValue::copyTo(), equals(), fromBinary(), BlobValue::getByteLength(), BlobValue::getBytes(), BlobValue::getElement(), BlobValue::getElements(), BlobValue::setElement(), BlobValue::setFrom(), setFrom(), BlobValue::setFromRaw(), setString(), toStream(), toString(), and BlobValue::toString().