Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

RemoteRouter Class Reference

#include <RemoteRouter.h>

Inheritance diagram for RemoteRouter:

Detailed Description

Definition at line 21 of file RemoteRouter.h.

List of all members.

Public Member Functions

 RemoteRouter (int host)
 constructor
virtual ~RemoteRouter ()
 destructor
void requestStateUpdates (RemoteState::StateType type, unsigned int interval)
 Request state data from a remote robot every 'interval' amount of time. Use EventRouter::requestRemoteStateUpdates() rather than calling this directly.
void stopStateUpdates (RemoteState::StateType type)
 Cancels state data updates from a remote dog for the given StateType. Use EventRouter::stopRemoteStateUpdates() rather than calling this directly.
void addListener (EventBase::EventGeneratorID_t egid)
 Add remote listener by EGID. Use EventRouter::addRemoteListener() rather than calling this directly.
void addListener (EventBase::EventGeneratorID_t egid, size_t sid)
 Add remote listener by EGID and SID. Use EventRouter::addRemoteListener() rather than calling this directly.
void addListener (EventBase::EventGeneratorID_t egid, size_t sid, EventBase::EventTypeID_t etid)
 Add remote listener by EGID, SID, and ETID. Use EventRouter::addRemoteListener() rather than calling this directly.
void removeListener (EventBase::EventGeneratorID_t egid)
 Remove remote listener by EGID. Use EventRouter::removeRemoteListener() rather than calling this directly.
void removeListener (EventBase::EventGeneratorID_t egid, size_t sid)
 Remove remote listener by EGID and SID. Use EventRouter::removeRemoteListener() rather than calling this directly.
void removeListener (EventBase::EventGeneratorID_t egid, size_t sid, EventBase::EventTypeID_t etid)
 Remove remote listener by EGID, SID, and ETID. Use EventRouter::removeRemoteListener() rather than calling this directly.
void processEvent (const EventBase &event)
 Processes timer events which wait for connections to remote EventProxy.
int processData (char *data, int bytes)
 Receives data from remote EventProxy and forwards it to the correct function according to the data type (Event or State).

Public Attributes

RemoteStaterstate

Protected Member Functions

bool isReady ()
 Returns true when robot is connected to remote robot.
void connect (int port)
 Connect robot on specified port.
void sendRemoteRequest (RemoteRequest &info)
 Add a remote request to the request queue.
void forwardEvent (std::vector< char > &event)
 Decode the event from the buffer and post it locally.
 RemoteRouter (RemoteRouter &)
RemoteRouteroperator= (const RemoteRouter &)

Protected Attributes

bool waitingForPort
std::list< RemoteRequestrequestQueue
bool timerActive
int waitTime
int remoteHost

Constructor & Destructor Documentation

RemoteRouter::RemoteRouter ( int  host  ) 

constructor

Definition at line 16 of file RemoteRouter.cc.

RemoteRouter::~RemoteRouter (  )  [virtual]

destructor

Definition at line 29 of file RemoteRouter.cc.

RemoteRouter::RemoteRouter ( RemoteRouter  )  [protected]

Member Function Documentation

void RemoteRouter::addListener ( EventBase::EventGeneratorID_t  egid,
size_t  sid,
EventBase::EventTypeID_t  etid 
)

Add remote listener by EGID, SID, and ETID. Use EventRouter::addRemoteListener() rather than calling this directly.

Definition at line 187 of file RemoteRouter.cc.

void RemoteRouter::addListener ( EventBase::EventGeneratorID_t  egid,
size_t  sid 
)

Add remote listener by EGID and SID. Use EventRouter::addRemoteListener() rather than calling this directly.

Definition at line 177 of file RemoteRouter.cc.

void RemoteRouter::addListener ( EventBase::EventGeneratorID_t  egid  ) 

Add remote listener by EGID. Use EventRouter::addRemoteListener() rather than calling this directly.

Definition at line 169 of file RemoteRouter.cc.

Referenced by EventRouter::addRemoteListener().

void RemoteRouter::connect ( int  port  )  [protected]

Connect robot on specified port.

Definition at line 90 of file RemoteRouter.cc.

Referenced by processData(), and RemoteRouter().

void RemoteRouter::forwardEvent ( std::vector< char > &  event  )  [protected]

Decode the event from the buffer and post it locally.

Definition at line 35 of file RemoteRouter.cc.

Referenced by processData().

bool RemoteRouter::isReady (  )  [protected]

Returns true when robot is connected to remote robot.

Definition at line 71 of file RemoteRouter.h.

Referenced by processEvent(), and sendRemoteRequest().

RemoteRouter& RemoteRouter::operator= ( const RemoteRouter  )  [protected]
int RemoteRouter::processData ( char *  data,
int  bytes 
) [virtual]

Receives data from remote EventProxy and forwards it to the correct function according to the data type (Event or State).

Implements SocketListener.

Definition at line 101 of file RemoteRouter.cc.

void RemoteRouter::processEvent ( const EventBase event  )  [virtual]

Processes timer events which wait for connections to remote EventProxy.

Implements EventListener.

Definition at line 229 of file RemoteRouter.cc.

void RemoteRouter::removeListener ( EventBase::EventGeneratorID_t  egid,
size_t  sid,
EventBase::EventTypeID_t  etid 
)

Remove remote listener by EGID, SID, and ETID. Use EventRouter::removeRemoteListener() rather than calling this directly.

Definition at line 217 of file RemoteRouter.cc.

void RemoteRouter::removeListener ( EventBase::EventGeneratorID_t  egid,
size_t  sid 
)

Remove remote listener by EGID and SID. Use EventRouter::removeRemoteListener() rather than calling this directly.

Definition at line 207 of file RemoteRouter.cc.

void RemoteRouter::removeListener ( EventBase::EventGeneratorID_t  egid  ) 

Remove remote listener by EGID. Use EventRouter::removeRemoteListener() rather than calling this directly.

Definition at line 199 of file RemoteRouter.cc.

Referenced by EventRouter::removeRemoteListener().

void RemoteRouter::requestStateUpdates ( RemoteState::StateType  type,
unsigned int  interval 
)

Request state data from a remote robot every 'interval' amount of time. Use EventRouter::requestRemoteStateUpdates() rather than calling this directly.

Definition at line 153 of file RemoteRouter.cc.

Referenced by EventRouter::requestRemoteStateUpdates().

void RemoteRouter::sendRemoteRequest ( RemoteRequest info  )  [protected]

Add a remote request to the request queue.

Definition at line 265 of file RemoteRouter.cc.

Referenced by addListener(), processEvent(), removeListener(), requestStateUpdates(), and stopStateUpdates().

void RemoteRouter::stopStateUpdates ( RemoteState::StateType  type  ) 

Cancels state data updates from a remote dog for the given StateType. Use EventRouter::stopRemoteStateUpdates() rather than calling this directly.

Definition at line 162 of file RemoteRouter.cc.

Referenced by EventRouter::stopRemoteStateUpdates().


Member Data Documentation

int RemoteRouter::remoteHost [protected]

Definition at line 83 of file RemoteRouter.h.

Referenced by connect(), forwardEvent(), and RemoteRouter().

std::list<RemoteRequest> RemoteRouter::requestQueue [protected]

Definition at line 79 of file RemoteRouter.h.

Referenced by processEvent(), and sendRemoteRequest().

bool RemoteRouter::timerActive [protected]

Definition at line 80 of file RemoteRouter.h.

Referenced by processEvent(), and sendRemoteRequest().

bool RemoteRouter::waitingForPort [protected]

Definition at line 78 of file RemoteRouter.h.

Referenced by isReady(), and processData().

int RemoteRouter::waitTime [protected]

Definition at line 81 of file RemoteRouter.h.

Referenced by processEvent(), and sendRemoteRequest().


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

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:15 2016 by Doxygen 1.6.3