#include <asebaros.h>
Public Member Functions | |
AsebaDashelHub (AsebaROS *asebaROS, unsigned port, bool forward) | |
void | operator() () |
run the hub | |
void | sendMessage (Aseba::Message *message, bool doLock, Dashel::Stream *sourceStream=0) |
void | startThread () |
start the hub thread | |
void | stopThread () |
stop the hub thread and wait for its termination | |
Protected Member Functions | |
virtual void | connectionClosed (Dashel::Stream *stream, bool abnormal) |
virtual void | connectionCreated (Dashel::Stream *stream) |
virtual void | incomingData (Dashel::Stream *stream) |
Private Attributes | |
AsebaROS * | asebaROS |
thread for the hub | |
bool | forward |
should we only forward messages instead of transmit them back to the sender | |
boost::thread * | thread |
Definition at line 32 of file asebaros.h.
AsebaDashelHub::AsebaDashelHub | ( | AsebaROS * | asebaROS, |
unsigned | port, | ||
bool | forward | ||
) |
Creates the hub, listen to TCP on port, and creates a DBus interace.
port | port on which to listen for incoming connections |
forward | should we only forward messages instead of transmit them back to the sender |
Definition at line 50 of file asebaros.cpp.
void AsebaDashelHub::connectionClosed | ( | Dashel::Stream * | stream, |
bool | abnormal | ||
) | [protected, virtual] |
Reimplemented from Dashel::Hub.
Definition at line 161 of file asebaros.cpp.
void AsebaDashelHub::connectionCreated | ( | Dashel::Stream * | stream | ) | [protected, virtual] |
Reimplemented from Dashel::Hub.
Definition at line 147 of file asebaros.cpp.
void AsebaDashelHub::incomingData | ( | Dashel::Stream * | stream | ) | [protected, virtual] |
Reimplemented from Dashel::Hub.
Definition at line 123 of file asebaros.cpp.
void AsebaDashelHub::operator() | ( | ) |
run the hub
Definition at line 101 of file asebaros.cpp.
void AsebaDashelHub::sendMessage | ( | Aseba::Message * | message, |
bool | doLock, | ||
Dashel::Stream * | sourceStream = 0 |
||
) |
Sends a message to Dashel peers. Does not delete the message, should be called by the main thread.
message | aseba message to send |
sourceStream | originate of the message, if from Dashel. |
Definition at line 67 of file asebaros.cpp.
void AsebaDashelHub::startThread | ( | ) |
start the hub thread
Definition at line 108 of file asebaros.cpp.
void AsebaDashelHub::stopThread | ( | ) |
stop the hub thread and wait for its termination
Definition at line 113 of file asebaros.cpp.
AsebaROS* AsebaDashelHub::asebaROS [private] |
bool AsebaDashelHub::forward [private] |
should we only forward messages instead of transmit them back to the sender
Definition at line 37 of file asebaros.h.
boost::thread* AsebaDashelHub::thread [private] |
Definition at line 35 of file asebaros.h.