#include <H3DNetworkingUtils/RemoteSF.h>
Public Member Functions | |
virtual void | initialize () |
Initialize. | |
Public Attributes | |
auto_ptr< SFSender > | toBeSent |
The value to be sent Value will be sent when it changes or on a timer, depending on the value of the containing server or client's periodicSend field access type: inputOnly basic type: S default value:. | |
auto_ptr< BufferedSField< S > > | received |
The value received from the network This needs to be a BufferedSField field because it gets changed in a thread that is not the graphics thread, and also may need to be buffered access type: outputOnly basic type: S default value:. | |
Static Public Attributes | |
static H3D::H3DNodeDatabase | database |
The X3D interface. | |
Protected Member Functions | |
RemoteSF (H3D::X3DTypes::X3DType t, H3D::Inst< SFSender > _toBeSent=0, H3D::Inst< BufferedSField< S > > _received=0) | |
Constructor is protected so that it can not explicitly be called: rather it should be implicely called from an inheriting class's constructor. | |
virtual | ~RemoteSF () |
Destructor. | |
virtual void | setSendOnChange (bool val) |
Start or stop the field being sent each time it is changed. | |
virtual void | checkForChange () |
Called from traverseSG in the graphics loop to check for any changes in the received field and to update the field appropriately. | |
void | writeField () |
Write a field to the packet. | |
virtual void | writeValue (const typename S::value_type &val)=0 |
Must be supplied for specific instantiations, to send the correct parts of the value. | |
double | readDouble () |
Read a double from the socket or packet. | |
H3D::H3DFloat | readH3DFloat () |
Read a H3DFloat from the socket or packet. | |
void | writeDouble (const double &val) |
Write a double to the socket or packet. | |
void | writeH3DFloat (const H3D::H3DFloat &val) |
Write a H3DFloat to the socket or packet. | |
Classes | |
class | SFSender |
Sends the field value across the network. More... |
This node operates in stand-alone mode as a member of a RemoteClient or RemoteServer remoteFields field. It is, however, an abstract class. In order to work, the inheriting classes, RemoteSFVec3f, RemoteSFBool, RemoteSFRotation, need to be instantiated. They only differ from each other in the work that they do in reading and writing values.
Examples:
H3DNetworkingUtils::RemoteSF< S >::RemoteSF | ( | H3D::X3DTypes::X3DType | t, | |
H3D::Inst< SFSender > | _toBeSent = 0 , |
|||
H3D::Inst< BufferedSField< S > > | _received = 0 | |||
) | [protected] |
Constructor is protected so that it can not explicitly be called: rather it should be implicely called from an inheriting class's constructor.
This is since it is an abstract class.
void RemoteSF::initialize | ( | ) | [inline, virtual] |
Initialize.
Can't do this as we can't put in the 'typename S::value_type' namespace RemoteSFInternals { FIELDDB_ELEMENT( RemoteSF<typename S::value_type>, toBeSent, INPUT_ONLY ); FIELDDB_ELEMENT( RemoteSF<typename S::value_type>, received, OUTPUT_ONLY ); }.
Reimplemented from H3DNetworkingUtils::RemoteField.
References H3DNetworkingUtils::RemoteField::bufferStrategy, and H3DNetworkingUtils::RemoteSF< S >::received.
virtual void H3DNetworkingUtils::RemoteSF< S >::checkForChange | ( | ) | [inline, protected, virtual] |
Called from traverseSG in the graphics loop to check for any changes in the received field and to update the field appropriately.
Alternatively called from a dummy force function in the haptics loop to check for any changes in the received field and to update the field appropriately.
Implements H3DNetworkingUtils::RemoteField.
virtual void H3DNetworkingUtils::RemoteSF< S >::writeValue | ( | const typename S::value_type & | val | ) | [protected, pure virtual] |
Must be supplied for specific instantiations, to send the correct parts of the value.
Referenced by H3DNetworkingUtils::RemoteSF< S >::writeField().