VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
DtRwPropertyWithThreshold< _RwType > Class Template Reference

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. isUpdatedNeeded() will return false until the threshold is met. The threshold is defined as a percentage of the current value.

Inheritance diagram for DtRwPropertyWithThreshold< _RwType >:
Inheritance graph
[legend]

Public Member Functions

 DtRwPropertyWithThreshold (const DtString &name, DtReaderWriterRegistry *parentRegistry=0)
 
 DtRwPropertyWithThreshold (const DtString &name, const DtRwPropertyWithThreshold &orig, DtReaderWriterRegistry *parentRegistry=0)
 
DtRwPropertyWithThresholdoperator= (const DtRwPropertyWithThreshold &orig)
 
virtual ~DtRwPropertyWithThreshold ()
 
virtual charencode (char *) const
 
virtual bool isUpdateNeeded (DtTime t) const
 
virtual void setThresholdAlgorithm (DtThresholdAlgorithm alg)
 
virtual DtThresholdAlgorithm thresholdAlgorithm () const
 
virtual void setDefaultThresholdAlgorithm (DtThresholdAlgorithm alg)
 
virtual void setThreshold (double value)
 
virtual double threshold () const
 
virtual void setMaxUpdateInterval (DtTime interval)
 
virtual DtTime maxUpdateInterval () const
 
virtual void setMaxUnchangedUpdateInterval (DtTime interval)
 
virtual DtTime maxUnchangedUpdateInterval () const
 
virtual void processPublicationArg (DtlObjPtr arg)
 
virtual void copyPublishingSettings (const DtPropertyInterface &prop)
 
virtual double percentChanged () const
 
virtual double amountChanged () const
 
virtual bool merge (const DtPropertyInterface &target, DtPropertyInterface::MergeFlags, const DtMergePath &path=DtMergePath(), const std::set< DtString > &ignore=std::set< DtString >())
 
- Public Member Functions inherited from DtRwProperty< _RwType >
 DtRwProperty (const DtString &name, DtReaderWriterRegistry *parentRegistry=0)
 
 DtRwProperty (const DtString &name, const DtRwProperty &orig, DtReaderWriterRegistry *parentRegistry=0)
 
DtRwPropertyoperator= (const DtRwProperty &orig)
 
virtual ~DtRwProperty ()
 
virtual void copy (const DtPropertyInterface &rhs)
 
virtual DtString stringRep (const DtString &root="") const
 
virtual const charpropertyType () const
 
virtual DtSymbolString propertyName () const
 
virtual void setPropertyName (const DtString &propertyName)
 
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)
 
virtual void recordUpdateTime () const
 
virtual bool hasReceivedUpdateSince (DtTime t) const
 
virtual DtTime updateClockTime () const
 
virtual void reset ()
 
virtual void setKeepPublishingSettings (bool keep)
 
virtual bool keepPublishingSettings () const
 
virtual const chardecode (const char *)
 
virtual void getSize (int &size) const
 
virtual int hlaAlignment () const
 
virtual DtReaderWriterreaderWriter ()
 
virtual const DtReaderWriterreaderWriter () const
 
virtual DtPropertyInterfaceproperty ()
 
virtual const DtPropertyInterfaceproperty () const
 
virtual bool isPublished () const
 
virtual void setIsPublished (bool isPub)
 
virtual unsigned disRecordType () const
 
virtual void setDisRecordType (unsigned recType)
 
virtual bool isDebugEnabled () const
 
virtual void setDebugEnabled (bool en)
 
- Public Member Functions inherited from DtPropertyInterface
virtual ~DtPropertyInterface ()
 
virtual bool isSimilarProperty (const DtPropertyInterface *rhs, bool strict=true) const
 
virtual bool isPublishedArg (DtlObjPtr arg, unsigned &disVarRecType)
 
virtual void processPublicationArgs (DtlObjPtr arg)
 
template<typename ValueType >
boost::optional< ValueType > propertyValue () const
 
template<typename ValueType >
bool setPropertyValue (ValueType val)
 
virtual const DtPropertyInterfacefindPropertyInterface (const DtString &propertyName) const
 
virtual DtPropertyInterfacefindPropertyInterface (const DtString &propertyName)
 
template<typename SpecificPropType >
const SpecificPropType * findProperty (const DtString &propertyName) const
 
template<typename SpecificPropType >
SpecificPropType * findProperty (const DtString &propertyName)
 
template<typename ValueType >
boost::optional< ValueType > findPropertyValue (const DtString &propertyName) const
 
template<typename ValueType >
bool findAndSetPropertyValue (const DtString &propertyName, ValueType val)
 
virtual bool addProperty (DtPropertyInterface *property)
 
template<typename SpecificPropType >
SpecificPropType * addNewProperty (const DtString &propertyName)
 
virtual bool removeProperty (const DtString &propertyName)
 
virtual bool removeProperty (const DtPropertyInterface *property)
 
int getSize () const
 

Static Public Member Functions

static void setDefaultThreshold (double value)
 
static void setDefaultMaxUpdateInterval (DtTime interval)
 
static void setDefaultMaxUnchangedUpdateInterval (DtTime interval)
 

Protected Attributes

_RwType myLastEncodedValue
 
DtTime myLastEncodeTime
 
DtThresholdAlgorithm myThresholdAlgorithm
 
double myThreshold
 
DtTime myMaxUpdateInterval
 
DtTime myMaxUnchangedUpdateInterval
 
- Protected Attributes inherited from DtRwProperty< _RwType >
DtClock myClock
 
DtTime myUpdateTime
 
unsigned myDisRecordType
 
bool myIsPublished
 
bool myKeepPublishingSettingsOnCopy
 
bool myDebugEnabled
 

Static Protected Attributes

static DtThresholdAlgorithm myDefaultThresholdAlgorithm
 
static double myDefaultThreshold
 
static DtTime myDefaultMaxUpdateInterval
 
static DtTime myDefaultMaxUnchangedUpdateInterval
 

Private Member Functions

 DtRwPropertyWithThreshold ()
 

Additional Inherited Members

- Public Types inherited from DtPropertyInterface
enum  MergeFlags {
  Replace = 0x00000001, MinimalSimilarityCheck = 0x00000002, RollUp = 0x00000004, AddMissing = 0x00000008,
  KeepPublishedSettings = 0x00000010
}
 

Constructor & Destructor Documentation

template<typename _RwType>
DtRwPropertyWithThreshold< _RwType >::DtRwPropertyWithThreshold ( )
private

Not implemented.

template<typename _RwType>
DtRwPropertyWithThreshold< _RwType >::DtRwPropertyWithThreshold ( const DtString name,
DtReaderWriterRegistry parentRegistry = 0 
)
template<typename _RwType>
DtRwPropertyWithThreshold< _RwType >::DtRwPropertyWithThreshold ( const DtString name,
const DtRwPropertyWithThreshold< _RwType > &  orig,
DtReaderWriterRegistry parentRegistry = 0 
)
template<typename _RwType>
virtual DtRwPropertyWithThreshold< _RwType >::~DtRwPropertyWithThreshold ( )
virtual

Member Function Documentation

template<typename _RwType>
DtRwPropertyWithThreshold& DtRwPropertyWithThreshold< _RwType >::operator= ( const DtRwPropertyWithThreshold< _RwType > &  orig)
template<typename _RwType>
virtual char* DtRwPropertyWithThreshold< _RwType >::encode ( char ) const
virtual

These methods are for network encoding/decoding for Hla encoding decoding reasons. Implemented at templated rw level. Encodes the variable bindings into the supplied buffer. In addition, stores the value in myLastEncodedValue for threshold testing.

Reimplemented from DtRwProperty< _RwType >.

template<typename _RwType>
virtual bool DtRwPropertyWithThreshold< _RwType >::isUpdateNeeded ( DtTime  t) const
virtual

Returns true if the value has been updated since the specified time and needs to be sent on the network.

Reimplemented from DtRwProperty< _RwType >.

template<typename _RwType>
virtual void DtRwPropertyWithThreshold< _RwType >::setThresholdAlgorithm ( DtThresholdAlgorithm  alg)
virtual

Sets the threshold algorithm to use.

template<typename _RwType>
virtual DtThresholdAlgorithm DtRwPropertyWithThreshold< _RwType >::thresholdAlgorithm ( ) const
virtual
template<typename _RwType>
virtual void DtRwPropertyWithThreshold< _RwType >::setDefaultThresholdAlgorithm ( DtThresholdAlgorithm  alg)
virtual

Sets the default threshold algorithm to use for cases when setThresholdAlgorithm() has not been set.

template<typename _RwType>
virtual void DtRwPropertyWithThreshold< _RwType >::setThreshold ( double  value)
virtual

Sets the threshold for when an update should be sent. If, based on the chosen threshold algorithm, the change in the value exceeds this threshold, isUpdateNeeded() will return true.

template<typename _RwType>
virtual double DtRwPropertyWithThreshold< _RwType >::threshold ( ) const
virtual
template<typename _RwType>
static void DtRwPropertyWithThreshold< _RwType >::setDefaultThreshold ( double  value)
static

Changes the default threshold for cases when setThreshold() has not been called.

template<typename _RwType>
virtual void DtRwPropertyWithThreshold< _RwType >::setMaxUpdateInterval ( DtTime  interval)
virtual

Changes the maximum time between updates if data has changed but has not crossed the threshold for an update. This ensures that periodically subscribers receive current data, even if the value has only changed a small amount.

template<typename _RwType>
virtual DtTime DtRwPropertyWithThreshold< _RwType >::maxUpdateInterval ( ) const
virtual
template<typename _RwType>
static void DtRwPropertyWithThreshold< _RwType >::setDefaultMaxUpdateInterval ( DtTime  interval)
static

Changes the default max update interval for cases when setMaxUpdateInterval() has not been called.

template<typename _RwType>
virtual void DtRwPropertyWithThreshold< _RwType >::setMaxUnchangedUpdateInterval ( DtTime  interval)
virtual

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.

template<typename _RwType>
virtual DtTime DtRwPropertyWithThreshold< _RwType >::maxUnchangedUpdateInterval ( ) const
virtual
template<typename _RwType>
static void DtRwPropertyWithThreshold< _RwType >::setDefaultMaxUnchangedUpdateInterval ( DtTime  interval)
static

Changes the default max unchanged update interval for cases when setMaxUnchangedUpdateInterval() has not been called.

template<typename _RwType>
virtual void DtRwPropertyWithThreshold< _RwType >::processPublicationArg ( DtlObjPtr  arg)
virtual

Processes publication a publication argument specified in the SMS for this property. Overloaded to handle "thresholdPercent", "maxUnchangedInterval", and "maxInterval" arguments.

Reimplemented from DtPropertyInterface.

template<typename _RwType>
virtual void DtRwPropertyWithThreshold< _RwType >::copyPublishingSettings ( const DtPropertyInterface prop)
virtual

Copies the publishing settings from another property to use for this one.

Reimplemented from DtPropertyInterface.

template<typename _RwType>
virtual double DtRwPropertyWithThreshold< _RwType >::percentChanged ( ) const
virtual

Returns the percentage the value has changed since the last update.

template<typename _RwType>
virtual double DtRwPropertyWithThreshold< _RwType >::amountChanged ( ) const
virtual

Returns the amount the value has changed since the last update.

template<typename _RwType>
virtual bool DtRwPropertyWithThreshold< _RwType >::merge ( const DtPropertyInterface target,
DtPropertyInterface::MergeFlags  ,
const DtMergePath path = DtMergePath(),
const std::set< DtString > &  ignore = std::set< DtString >() 
)
virtual

In this case replace does not matter – will replace value regardless.

Reimplemented from DtRwProperty< _RwType >.

Member Data Documentation

template<typename _RwType>
_RwType DtRwPropertyWithThreshold< _RwType >::myLastEncodedValue
mutableprotected

The value at the last time the value was encoded.

template<typename _RwType>
DtTime DtRwPropertyWithThreshold< _RwType >::myLastEncodeTime
mutableprotected

The time the value was last encoded.

template<typename _RwType>
DtThresholdAlgorithm DtRwPropertyWithThreshold< _RwType >::myDefaultThresholdAlgorithm
staticprotected
template<typename _RwType>
DtThresholdAlgorithm DtRwPropertyWithThreshold< _RwType >::myThresholdAlgorithm
protected
template<typename _RwType>
double DtRwPropertyWithThreshold< _RwType >::myDefaultThreshold
staticprotected
template<typename _RwType>
double DtRwPropertyWithThreshold< _RwType >::myThreshold
protected
template<typename _RwType>
DtTime DtRwPropertyWithThreshold< _RwType >::myDefaultMaxUpdateInterval
staticprotected
template<typename _RwType>
DtTime DtRwPropertyWithThreshold< _RwType >::myMaxUpdateInterval
protected
template<typename _RwType>
DtTime DtRwPropertyWithThreshold< _RwType >::myDefaultMaxUnchangedUpdateInterval
staticprotected
template<typename _RwType>
DtTime DtRwPropertyWithThreshold< _RwType >::myMaxUnchangedUpdateInterval
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)