H3D API
2.4.1
|
A field which ensure that getValue and only getValue can be called within haptic thread with thread safety. More...
#include <H3D/H3DFakeHapticsDevice.h>
Public Member Functions | |
GetValueSafeField () | |
Constructor. | |
virtual const BaseField::value_type & | getValue (int _id=0) |
Get the value of the field. | |
virtual void | update () |
update can not happens in non-main thread | |
virtual void | upToDate () |
Make sure that the field is up-to-date, but never in non-main thread. | |
virtual void | setValue (const typename BaseField::value_type &v, int _id=0) |
Set the value of the field, also only allowed in main thread. | |
![]() | |
PeriodicUpdate (H3DFloat _period=0, PeriodType _period_type=COUNT) | |
Constructor. | |
~PeriodicUpdate () | |
Destructor. | |
virtual bool | timeToUpdate () |
Determines if it is time to check that the field is updated. More... | |
void | setPeriodType (PeriodType type) |
Set the type of the period. | |
void | setPeriod (H3DFloat _period) |
Set the period for the update. | |
![]() | |
virtual | ~PeriodicUpdateField () |
Destructor. | |
Protected Attributes | |
BaseField::value_type | value_for_haptic |
value to be used for haptic thread | |
![]() | |
PeriodType | period_type |
The tye of the period. | |
H3DFloat | period |
The period of automatic updates/. | |
TimeStamp | last_up_to_date |
The time of the last call to upToDate. | |
unsigned int | counter |
The number of calls to timeToUpdate() since the last update. | |
Additional Inherited Members | |
![]() | |
enum | PeriodType |
Type defining how the period should be interpreted. | |
A field which ensure that getValue and only getValue can be called within haptic thread with thread safety.
Note: All other function such as setValue, upToDate is not allowed to called within haptic thread. The actual value update happens in main thread either through explicitly calling getValue or upToDate or wait until the end of the main thread loop let PeriodicUpdate update itself. Note2: getValue() can only be called within either in haptic thread or main thread. All other type of threads are not allowed