H3DNetworkingUtils::BufferedSField< S > Class Template Reference

The BufferedSField class is an H3D::SField, that has two extra capabilities: 1. More...

#include <H3DNetworkingUtils/BufferedSField.h>

List of all members.

Public Member Functions

 BufferedSField ()
 Contstructor.
virtual void initialiseValue (const typename S::value_type empty)
 Initialize to a given value.
void setBufferStrategy (BufferReleaseStrategy b)
 Call this if you want buffering on the values stored in the field.


Detailed Description

template<class S>
class H3DNetworkingUtils::BufferedSField< S >

The BufferedSField class is an H3D::SField, that has two extra capabilities: 1.

setValue() can be called from any thread, not just the graphics thread. For example, it can be called from a separate, network-reading thread. 2. It can buffer values that are input in setValue() or update(), and release them into getValue() in different ways. If bufferring, the field only passes the stored values on to the real field value when checkForChange() is called. The default method for releasing the values, is for no buffering, so the most recent value is released, just like a normal field. If bufferingMethod is SET_ONE_PER_CYCLE, they are buffered and fed into the field value at one per thread cycle. If bufferingMethod is SET_ALL, they are buffered and fed into the field value, one at a time, but all within the next thread cycle.
Examples:


Member Function Documentation

template<class S>
void H3DNetworkingUtils::BufferedSField< S >::setBufferStrategy ( BufferReleaseStrategy  b  )  [inline]

Call this if you want buffering on the values stored in the field.

i.e. if this is NONE, there is effectively no buffering, and only the most recently set value is set into the field value in the checkForChange() routine. Setting it to SET_ONE_PER_CYCLE, causes a first-in-first-out (FIFO) method of setting the field value with one buffered value per thread cycle. Setting it to SET_ALL is similar to SET_ONE_PER_CYCLE, except that the field is set repeatedly (using FIFO) until the buffer is empty, in a single checkForChange() routine. Note that buffering only occurs if we routing into the graphics thread.


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

Generated on Fri Mar 12 10:23:06 2010 for H3DNetworkingUtils by  doxygen 1.5.6