RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Endpoint类 参考abstract

Encapsulation of the data and methods for a single generic connection to take care of one part of many clients talking to a single server. 更多...

#include <vrpn_Connection.h>

+ 类 vrpn_Endpoint 继承关系图:
+ vrpn_Endpoint 的协作图:

Public 成员函数

 vrpn_Endpoint (vrpn_TypeDispatcher *dispatcher, vrpn_int32 *connectedEndpointCounter)
 
virtual int pack_message (vrpn_uint32 len, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char *buffer, vrpn_uint32 class_of_service)=0
 
virtual int send_pending_reports (void)=0
 
int pack_log_description (void)
 Packs the log description set by setup_new_connection().
 
virtual int setup_new_connection (void)=0
 
virtual void poll_for_cookie (const timeval *timeout=NULL)=0
 
virtual int finish_new_connection_setup (void)=0
 
virtual void drop_connection (void)=0
 
virtual void clearBuffers (void)=0
 
int pack_sender_description (vrpn_int32 which)
 Packs a sender description over our socket.
 
int pack_type_description (vrpn_int32 which)
 Packs a type description.
 
Accessors
int local_type_id (vrpn_int32 remote_type) const
 Returns the local mapping for the remote type (-1 if none).
 
int local_sender_id (vrpn_int32 remote_sender) const
 Returns the local mapping for the remote sender (-1 if none).
 
virtual vrpn_bool doing_okay (void) const =0
 
Manipulators
void init (void)
 
virtual int mainloop (timeval *timeout)=0
 
void clear_other_senders_and_types (void)
 
int newLocalSender (const char *name, vrpn_int32 which)
 
int newLocalType (const char *name, vrpn_int32 which)
 
int newRemoteType (vrpn_CNAME type_name, vrpn_int32 remote_id, vrpn_int32 local_id)
 
int newRemoteSender (vrpn_CNAME sender_name, vrpn_int32 remote_id, vrpn_int32 local_id)
 
Routines to inform the endpoint of the connection of

which it is a part.

void setConnection (vrpn_Connection *conn)
 
vrpn_ConnectiongetConnection ()
 

静态 Public 成员函数

Routines that handle system messages

Visible so that vrpn_Connection can pass them to the Dispatcher

static int VRPN_CALLBACK handle_sender_message (void *userdata, vrpn_HANDLERPARAM p)
 
static int VRPN_CALLBACK handle_type_message (void *userdata, vrpn_HANDLERPARAM p)
 

Public 属性

int status
 
long d_remoteLogMode
 Mode to put the remote logging in
 
char * d_remoteInLogName
 Name of the remote log file
 
char * d_remoteOutLogName
 Name of the remote log file
 
char rhostname [150]
 

Protected 成员函数

virtual int dispatch (vrpn_int32 type, vrpn_int32 sender, timeval time, vrpn_uint32 payload_len, char *bufptr)
 
int tryToMarshall (char *outbuf, vrpn_int32 &buflen, vrpn_int32 &numOut, vrpn_uint32 len, timeval time, vrpn_int32 type, vrpn_int32 sender, const char *buffer, vrpn_uint32 classOfService)
 
int marshall_message (char *outbuf, vrpn_uint32 outbuf_size, vrpn_uint32 initial_out, vrpn_uint32 len, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char *buffer, vrpn_uint32 sequenceNumber)
 

Protected 属性

vrpn_TranslationTable * d_senders
 
vrpn_TranslationTable * d_types
 
vrpn_TypeDispatcher * d_dispatcher
 
vrpn_int32 * d_connectionCounter
 
vrpn_Connectiond_parent
 

Logging

TCH 19 April 00; changed into two logs 16 Feb 01

vrpn_Logd_inLog
 
vrpn_Logd_outLog
 
void setLogNames (const char *inName, const char *outName)
 
int openLogs (void)
 

详细描述

Encapsulation of the data and methods for a single generic connection to take care of one part of many clients talking to a single server.

This will only be used from within the vrpn_Connection class; it should not be instantiated by users or devices. Should not be visible!

成员函数说明

◆ clear_other_senders_and_types()

void clear_other_senders_and_types ( void )

Clear out the remote mapping list. This is done when a connection is dropped and we want to try and re-establish it.

◆ clearBuffers()

virtual void clearBuffers ( void )
pure virtual

Empties out the TCP and UDP send buffers. Needed by vrpn_FileConnection to get at {udp,tcp}NumOut.

vrpn_Endpoint_IP 内被实现.

◆ drop_connection()

virtual void drop_connection ( void )
pure virtual

Should only be called by vrpn_Connection::drop_connection(), since there's more housecleaning to do at that level. I suppose that argues against separating this function out.

vrpn_Endpoint_IP 内被实现.

◆ local_sender_id()

int local_sender_id ( vrpn_int32 remote_sender) const

Returns the local mapping for the remote sender (-1 if none).

◆ local_type_id()

int local_type_id ( vrpn_int32 remote_type) const

Returns the local mapping for the remote type (-1 if none).

◆ newLocalSender()

int newLocalSender ( const char * name,
vrpn_int32 which )

A new local sender or type has been established; set the local type for it if the other side has declared it. Return 1 if the other side has one, 0 if not.

◆ newRemoteType()

int newRemoteType ( vrpn_CNAME type_name,
vrpn_int32 remote_id,
vrpn_int32 local_id )

Adds a new remote type/sender and returns its index. Returns -1 on error.

◆ pack_log_description()

int pack_log_description ( void )

Packs the log description set by setup_new_connection().

◆ pack_message()

virtual int pack_message ( vrpn_uint32 len,
struct timeval time,
vrpn_int32 type,
vrpn_int32 sender,
const char * buffer,
vrpn_uint32 class_of_service )
pure virtual

Pack a message that will be sent the next time mainloop() is called. Turn off the RELIABLE flag if you want low-latency (UDP) send.

vrpn_Endpoint_IP 内被实现.

◆ pack_sender_description()

int pack_sender_description ( vrpn_int32 which)

Packs a sender description over our socket.

◆ pack_type_description()

int pack_type_description ( vrpn_int32 which)

Packs a type description.

◆ send_pending_reports()

virtual int send_pending_reports ( void )
pure virtual

send pending report, clear the buffer. This function was protected, now is public, so we can use it to send out intermediate results without calling mainloop

vrpn_Endpoint_IP 内被实现.

◆ setup_new_connection()

virtual int setup_new_connection ( void )
pure virtual

Sends the magic cookie and other information to its peer. It is called by both the client and server setup routines.

vrpn_Endpoint_IP 内被实现.

◆ tryToMarshall()

int tryToMarshall ( char * outbuf,
vrpn_int32 & buflen,
vrpn_int32 & numOut,
vrpn_uint32 len,
timeval time,
vrpn_int32 type,
vrpn_int32 sender,
const char * buffer,
vrpn_uint32 classOfService )
protected

Calls marshall_message(); if that fails, calls send_pending_reports() and then marshalls again. Returns the number of characters successfully marshalled.

类成员变量说明

◆ d_remoteInLogName

char* d_remoteInLogName

Name of the remote log file

◆ d_remoteLogMode

long d_remoteLogMode

Mode to put the remote logging in

待办事项
XXX These should be protected; making them so will lead to making the code split the functions between Endpoint and Connection protected:

◆ d_remoteOutLogName

char* d_remoteOutLogName

Name of the remote log file

Name of the remote host we are connected to. This is kept for informational purposes. It is printed by the ceiling server, for example.


该类的文档由以下文件生成: