Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

EventProxy.h

Go to the documentation of this file.
00001 #ifndef EVENTPROXY_H_
00002 #define EVENTPROXY_H_
00003 #include "Wireless/Socket.h"
00004 #include "Wireless/Wireless.h"
00005 #include "Events/EventListener.h"
00006 #include "Shared/RemoteState.h"
00007 #include "Events/RemoteEvents.h"
00008 
00009 /*! This class serves as the host for subscribing to remote events. It
00010  *  should never be directly manipulated by the user; all interaction
00011  *  with this class is handled by EventRouter
00012  */
00013 class EventProxy : public EventListener, public RemoteEvents {
00014   public:
00015   EventProxy(int port); //!< EventProxy constructor, takes a port to listen on
00016   virtual ~EventProxy(); //!< EventProxy destructor
00017 
00018   //! Returns true if the EventProxy is still waiting for a connection or is connected
00019   bool isActive();
00020 
00021   //! Sends the requested state information to the client robot
00022   void sendState(RemoteState::StateType dtype);
00023 
00024   //! Forwards any recieved events on to the client robot
00025   void processEvent(const EventBase& event);
00026 
00027   //! Handles any incoming requests from the client robot
00028   int processData(char *data, int bytes);
00029 
00030   protected:
00031 
00032   //! Called by processData, handles an oncoming data request packet
00033   void handleRemoteRequest(RemoteRequest *info);
00034   
00035   
00036   bool listening;
00037   
00038   EventProxy(EventProxy&);
00039   EventProxy &operator=(const EventProxy&);
00040 };
00041 
00042 #endif /*EVENTPROXY_H_*/

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:38 2016 by Doxygen 1.6.3