Public Member Functions |
| | DtRwPropertyWithThreshold (const DtString &name, DtReaderWriterRegistry *parentRegistry=0) |
| | DtRwPropertyWithThreshold (const DtString &name, const DtRwPropertyWithThreshold &orig, DtReaderWriterRegistry *parentRegistry=0) |
| DtRwPropertyWithThreshold & | operator= (const DtRwPropertyWithThreshold &orig) |
| virtual | ~DtRwPropertyWithThreshold () |
| virtual char * | encode (char *) const |
| | These methods are for network encoding/decoding for Hla encoding decoding reasons.
|
| virtual bool | wasUpdatedSince (DtTime t) const |
| | Returns true if an update occurred since the specified time and the current value is at least _Threshold percent away from the previous encoded value.
|
| virtual void | enableThresholding (bool enable) |
| | Enables or disables thresholding of this property. Enabled by default.
|
| virtual void | setThreshold (double percentage) |
| | Changes the threshold for when an update should be sent.
|
| virtual void | setMaxUpdateInterval (DtTime interval) |
| | Changes the maximum time between updates if data has changed but has not crossed the threshold for an update.
|
| virtual void | setMaxUnchangedUpdateInterval (DtTime interval) |
| | Changes the maximum time between updates if data has changed but has not crossed the threshold for an update, but seems to have settled on a new value.
|
| | DtRwProperty (const DtString &name, DtReaderWriterRegistry *parentRegistry=0) |
| | DtRwProperty (const DtString &name, const DtRwProperty &orig, DtReaderWriterRegistry *parentRegistry=0) |
| DtRwProperty & | operator= (const DtRwProperty &orig) |
| virtual | ~DtRwProperty () |
| virtual const char * | decode (const char *) |
| | Decodes the variable bindings from the specified buffer.
|
| virtual DtString | stringRep (const DtString &root="") const |
| virtual void | getSize (int &size) const |
| | Returns the size of this item, iterating over all types.
|
| virtual int | hlaAlignment () const |
| | Returns hlaAlignment.
|
| virtual const char * | propertyType () const |
| | Typically returns reader/writer type.
|
| virtual void | getSelf (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=DtReaderWriter::SearchPaths(), const DtVariableBindingsList &variableBindings=DtReaderWriter::nullVariableReference()) |
| virtual DtlObjPtr | getData (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings) |
| | Override to allow a variable to be assigned to a property of derived type.
|
| virtual bool | merge (const DtPropertyInterface &target, MergeFlags, const DtMergePath &path=DtMergePath(), const std::set< DtString > &ignore=std::set< DtString >()) |
| | In this case replace does not matter – will replace value regardless.
|
| virtual void | recordUpdateTime () const |
| | Stamps the time when updated.
|
| virtual void | reset () |
| | Override to clear out variable value.
|
| virtual DtReaderWriter * | readerWriter () |
| virtual const DtReaderWriter * | readerWriter () const |
| virtual DtPropertyInterface * | property () |
| virtual const DtPropertyInterface * | property () const |
| virtual bool | isPublished () const |
| | Whether this property should be published.
|
| virtual void | setIsPublished (bool isPub) |
| virtual unsigned | disRecordType () const |
| | If this property is published, which DIS record type should it use.
|
| virtual void | setDisRecordType (unsigned recType) |
| virtual | ~DtPropertyInterface () |
| int | getSize () const |
| virtual bool | isSimilarProperty (const DtPropertyInterface *rhs) const |
| | Returns true if the readerWriterType is the same.
|
| virtual bool | isPublishedArg (DtlObjPtr arg, unsigned &disVarRecType) const |
| | Tests whether the argument specified indicates this property should be published.
|
template<typename _RwType>
class DtRwPropertyWithThreshold< _RwType >
This class is similar to DtRwProperty, but allows you to specify a threshold at which the value should be considered different enough to require an update.
wasUpdatedSince() will return false until the threshold is met. The threshold is defined as a percentage of the current value.
template<typename _RwType>
Changes the maximum time between updates if data has changed but has not crossed the threshold for an update, but seems to have settled on a new value.
For instance, if the threshold his 2%, and a value goes from 99 to 100 where it caps out, it will never hit the 2% mark, and therefore an update would otherwise not be sent for a full minute. This setting indicates how long a value should stabilize, remaining unchanged, before we send it. Should be greater than the tick rate but less than the max update interval.