vrpn 07.35
Virtual Reality Peripheral Network
Loading...
Searching...
No Matches
vrpn_Shared_float64 Class Reference

#include <vrpn_SharedObject.h>

Inheritance diagram for vrpn_Shared_float64:
Collaboration diagram for vrpn_Shared_float64:

Classes

struct  callbackEntry
 
struct  timedCallbackEntry
 

Public Member Functions

 vrpn_Shared_float64 (const char *name, vrpn_float64 defaultValue=0.0, vrpn_int32 mode=VRPN_SO_DEFAULT)
 
virtual ~vrpn_Shared_float64 (void)
 
vrpn_float64 value (void) const
 
 operator vrpn_float64 () const
 
vrpn_Shared_float64operator= (vrpn_float64 newValue)
 
virtual vrpn_Shared_float64set (vrpn_float64 newValue, timeval when)
 
void register_handler (vrpnSharedFloatCallback, void *)
 
void unregister_handler (vrpnSharedFloatCallback, void *)
 
void register_handler (vrpnTimedSharedFloatCallback, void *)
 
void unregister_handler (vrpnTimedSharedFloatCallback, void *)
 
void setSerializerPolicy (vrpn_SerializerPolicy policy=vrpn_ACCEPT, vrpnSharedFloatSerializerPolicy f=NULL, void *userdata=NULL)
 
- Public Member Functions inherited from vrpn_SharedObject
 vrpn_SharedObject (const char *name, const char *tname, vrpn_int32 mode)
 
virtual ~vrpn_SharedObject (void)
 
const char * name (void) const
 
vrpn_bool isSerializer (void) const
 
virtual void bindConnection (vrpn_Connection *)
 Every derived class should call this, do what it needs to, and ALSO call {server,remote}PostBindCleanup() to get myId and peerId set up and to get standard handlers registered.
 
void useLamportClock (vrpn_LamportClock *)
 Lamport Clocks are NOT currently integrated. They should provide serialization (virtual timestamps) that work even when the clocks of the computers communicating are not roughly synchronized.
 
void becomeSerializer (void)
 Requests that this instance of the shared object becomes the serializer (i.e. lock-arbitrator), and we can then use setSerializerPolicy to imitate a complete lock. Does nothing if we already are the serializer (isSerializer() returns true); otherwise initiates a 3-phase request protocol with the current serializer. There currently isn't any provision for notification of success (or failure).
 
vrpn_bool registerDeferredUpdateCallback (vrpnDeferredUpdateCallback, void *userdata)
 The specified function will be passed userdata when this particular shared object defers an update (receives a local update but is not the serializer and so sends the update off to the serializer). Intended to allow insertion of timing code for those times when you really want to know how long every little thing is taking.
 

Protected Member Functions

vrpn_Shared_float64set (vrpn_float64, timeval, vrpn_bool isLocalSet)
 
virtual vrpn_bool shouldAcceptUpdate (vrpn_float64 newValue, timeval when, vrpn_bool isLocalSet)
 
virtual void sendUpdate (void)
 Should invoke default sendUpdate() for this derived type.
 
void sendUpdate (vrpn_float64 newValue, timeval when)
 
void encode (char **buffer, vrpn_int32 *len, vrpn_float64 newValue, timeval when) const
 
void decode (const char **buffer, vrpn_int32 *len, vrpn_float64 *newValue, timeval *when) const
 
int yankCallbacks (vrpn_bool isLocal)
 
int handleUpdate (vrpn_HANDLERPARAM)
 
- Protected Member Functions inherited from vrpn_SharedObject
virtual vrpn_bool shouldSendUpdate (vrpn_bool isLocalSet, vrpn_bool acceptedUpdate)
 
int yankCallbacks (vrpn_bool isLocal)
 must set d_lastUpdate BEFORE calling yankCallbacks()
 
int yankDeferredUpdateCallbacks (void)
 returns -1 on error (i.e. nonzero return by a callback)
 
void serverPostBindCleanup (void)
 
void remotePostBindCleanup (void)
 

Static Protected Member Functions

static int VRPN_CALLBACK handle_lamportUpdate (void *, vrpn_HANDLERPARAM)
 
- Static Protected Member Functions inherited from vrpn_SharedObject
static int VRPN_CALLBACK handle_requestSerializer (void *, vrpn_HANDLERPARAM)
 
static int VRPN_CALLBACK handle_grantSerializer (void *, vrpn_HANDLERPARAM)
 
static int VRPN_CALLBACK handle_assumeSerializer (void *, vrpn_HANDLERPARAM)
 
static int VRPN_CALLBACK handle_gotConnection (void *, vrpn_HANDLERPARAM)
 Register this handler in postBindCleanup(); it calls sendUpdate() to make sure the remote has the correct value on first connection.
 
static int VRPN_CALLBACK handle_update (void *, vrpn_HANDLERPARAM)
 Passes arguments to handleUpdate() for this type; registered in postBindCleanup();.
 

Protected Attributes

vrpn_float64 d_value
 
callbackEntryd_callbacks
 
timedCallbackEntryd_timedCallbacks
 
vrpn_SerializerPolicy d_policy
 
vrpnSharedFloatSerializerPolicy d_policyCallback
 
void * d_policyUserdata
 
- Protected Attributes inherited from vrpn_SharedObject
char * d_name
 
vrpn_int32 d_mode
 
timeval d_lastUpdate
 
char * d_typename
 
vrpn_Connectiond_connection
 
vrpn_int32 d_serverId
 
vrpn_int32 d_remoteId
 
vrpn_int32 d_myId
 
vrpn_int32 d_peerId
 
vrpn_int32 d_update_type
 
vrpn_int32 d_requestSerializer_type
 Sent to the serializer to assume its duties.
 
vrpn_int32 d_grantSerializer_type
 Sent by the serializer to grant a request.
 
vrpn_int32 d_assumeSerializer_type
 Sent by a new serializer once it has been notified that its request has been granted.
 
vrpn_int32 d_lamportUpdate_type
 
vrpn_bool d_isSerializer
 default to vrpn_TRUE for servers, FALSE for remotes
 
vrpn_bool d_isNegotiatingSerializer
 As long as we have inorder delivery, this should be sufficient to keep us from getting many at once.
 
vrpn_bool d_queueSets
 If this is true, no set()s are processed; instead, they are queued for later execution. NOT IMPLEMENTED.
 
vrpn_LamportClockd_lClock
 
vrpn_LamportTimestampd_lastLamportUpdate
 
deferredUpdateCallbackEntryd_deferredUpdateCallbacks
 

Detailed Description

Definition at line 368 of file vrpn_SharedObject.h.

Constructor & Destructor Documentation

◆ vrpn_Shared_float64()

vrpn_Shared_float64::vrpn_Shared_float64 ( const char *  name,
vrpn_float64  defaultValue = 0.0,
vrpn_int32  mode = VRPN_SO_DEFAULT 
)

Definition at line 857 of file vrpn_SharedObject.C.

References vrpn_SharedObject::d_lastUpdate, vrpn_SharedObject::d_name, vrpn_SharedObject::name(), and vrpn_gettimeofday.

Here is the call graph for this function:

◆ ~vrpn_Shared_float64()

vrpn_Shared_float64::~vrpn_Shared_float64 ( void  )
virtual

Definition at line 876 of file vrpn_SharedObject.C.

Member Function Documentation

◆ decode()

void vrpn_Shared_float64::decode ( const char **  buffer,
vrpn_int32 *  len,
vrpn_float64 *  newValue,
timeval *  when 
) const
protected

Definition at line 1092 of file vrpn_SharedObject.C.

References vrpn_unbuffer().

Referenced by handleUpdate().

Here is the call graph for this function:

◆ encode()

void vrpn_Shared_float64::encode ( char **  buffer,
vrpn_int32 *  len,
vrpn_float64  newValue,
timeval  when 
) const
protected

Definition at line 1086 of file vrpn_SharedObject.C.

References vrpn_buffer().

Referenced by sendUpdate().

Here is the call graph for this function:

◆ handle_lamportUpdate()

static int VRPN_CALLBACK vrpn_Shared_float64::handle_lamportUpdate ( void *  ,
vrpn_HANDLERPARAM   
)
staticprotected

◆ handleUpdate()

int vrpn_Shared_float64::handleUpdate ( vrpn_HANDLERPARAM  p)
protectedvirtual

Implements vrpn_SharedObject.

Definition at line 1138 of file vrpn_SharedObject.C.

References vrpn_HANDLERPARAM::buffer, decode(), vrpn_HANDLERPARAM::payload_len, and set().

Here is the call graph for this function:

◆ operator vrpn_float64()

vrpn_Shared_float64::operator vrpn_float64 ( ) const

Definition at line 886 of file vrpn_SharedObject.C.

◆ operator=()

vrpn_Shared_float64 & vrpn_Shared_float64::operator= ( vrpn_float64  newValue)

Definition at line 888 of file vrpn_SharedObject.C.

References set(), and vrpn_gettimeofday.

Referenced by vrpn_Shared_float64_Server::operator=(), and vrpn_Shared_float64_Remote::operator=().

Here is the call graph for this function:

◆ register_handler() [1/2]

void vrpn_Shared_float64::register_handler ( vrpnSharedFloatCallback  cb,
void *  userdata 
)

◆ register_handler() [2/2]

◆ sendUpdate() [1/2]

void vrpn_Shared_float64::sendUpdate ( void  )
protectedvirtual

Should invoke default sendUpdate() for this derived type.

Implements vrpn_SharedObject.

Definition at line 1099 of file vrpn_SharedObject.C.

References vrpn_SharedObject::d_lastUpdate, d_value, and sendUpdate().

Referenced by sendUpdate(), and set().

Here is the call graph for this function:

◆ sendUpdate() [2/2]

void vrpn_Shared_float64::sendUpdate ( vrpn_float64  newValue,
timeval  when 
)
protected

◆ set() [1/2]

vrpn_Shared_float64 & vrpn_Shared_float64::set ( vrpn_float64  newValue,
timeval  when 
)
virtual

Definition at line 895 of file vrpn_SharedObject.C.

References set().

Referenced by handleUpdate(), operator=(), and set().

Here is the call graph for this function:

◆ set() [2/2]

vrpn_Shared_float64 & vrpn_Shared_float64::set ( vrpn_float64  newValue,
timeval  when,
vrpn_bool  isLocalSet 
)
protected

Definition at line 992 of file vrpn_SharedObject.C.

References vrpn_SharedObject::d_lastUpdate, d_value, sendUpdate(), shouldAcceptUpdate(), vrpn_SharedObject::shouldSendUpdate(), and yankCallbacks().

Here is the call graph for this function:

◆ setSerializerPolicy()

void vrpn_Shared_float64::setSerializerPolicy ( vrpn_SerializerPolicy  policy = vrpn_ACCEPT,
vrpnSharedFloatSerializerPolicy  f = NULL,
void *  userdata = NULL 
)

Definition at line 983 of file vrpn_SharedObject.C.

References d_policy, d_policyCallback, and d_policyUserdata.

◆ shouldAcceptUpdate()

vrpn_bool vrpn_Shared_float64::shouldAcceptUpdate ( vrpn_float64  newValue,
timeval  when,
vrpn_bool  isLocalSet 
)
protectedvirtual

◆ unregister_handler() [1/2]

void vrpn_Shared_float64::unregister_handler ( vrpnSharedFloatCallback  cb,
void *  userdata 
)

◆ unregister_handler() [2/2]

◆ value()

vrpn_float64 vrpn_Shared_float64::value ( void  ) const

Definition at line 884 of file vrpn_SharedObject.C.

References d_value.

◆ yankCallbacks()

Member Data Documentation

◆ d_callbacks

callbackEntry* vrpn_Shared_float64::d_callbacks
protected

Definition at line 413 of file vrpn_SharedObject.h.

Referenced by register_handler(), unregister_handler(), and yankCallbacks().

◆ d_policy

vrpn_SerializerPolicy vrpn_Shared_float64::d_policy
protected

Definition at line 421 of file vrpn_SharedObject.h.

Referenced by setSerializerPolicy(), and shouldAcceptUpdate().

◆ d_policyCallback

vrpnSharedFloatSerializerPolicy vrpn_Shared_float64::d_policyCallback
protected

Definition at line 422 of file vrpn_SharedObject.h.

Referenced by setSerializerPolicy(), and shouldAcceptUpdate().

◆ d_policyUserdata

void* vrpn_Shared_float64::d_policyUserdata
protected

Definition at line 423 of file vrpn_SharedObject.h.

Referenced by setSerializerPolicy(), and shouldAcceptUpdate().

◆ d_timedCallbacks

timedCallbackEntry* vrpn_Shared_float64::d_timedCallbacks
protected

Definition at line 419 of file vrpn_SharedObject.h.

Referenced by register_handler(), unregister_handler(), and yankCallbacks().

◆ d_value

vrpn_float64 vrpn_Shared_float64::d_value
protected

Definition at line 401 of file vrpn_SharedObject.h.

Referenced by sendUpdate(), set(), shouldAcceptUpdate(), value(), and yankCallbacks().


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