Software router of messages on TCP and D-Bus.

Classes

class  Aseba::AsebaNetworkInterface
 DBus interface for aseba network. More...
class  Aseba::EventFilterInterface
 DBus interface for an event filter. More...
class  Aseba::Hub

Functions

 Aseba::AsebaNetworkInterface::AsebaNetworkInterface (Hub *hub, bool systemBus)
virtual void Aseba::Hub::connectionClosed (Dashel::Stream *stream, bool abnormal)
virtual void Aseba::Hub::connectionCreated (Dashel::Stream *stream)
QDBusConnection Aseba::AsebaNetworkInterface::DBusConnectionBus () const
void Aseba::EventFilterInterface::emitEvent (const quint16 id, const QString &name, const Values &data)
Values Aseba::fromAsebaVector (const std::vector< sint16 > &values)
 Aseba::Hub::Hub (unsigned port, bool verbose, bool dump, bool forward, bool rawTime, bool systemBus)
virtual void Aseba::Hub::incomingData (Dashel::Stream *stream)
virtual void Aseba::AsebaNetworkInterface::nodeDescriptionReceived (unsigned nodeId)
 Virtual function that is called when a node description has been fully received.
virtual void Aseba::Hub::run ()
void Aseba::Hub::sendMessage (Message &message, Dashel::Stream *sourceStream=0)
void Aseba::Hub::sendMessage (Message *message, Dashel::Stream *sourceStream=0)
std::vector< sint16Aseba::toAsebaVector (const Values &values)

Public Slots

QDBusObjectPath Aseba::AsebaNetworkInterface::CreateEventFilter ()
Q_SCRIPTABLE Q_NOREPLY void Aseba::EventFilterInterface::Free ()
qint16 Aseba::AsebaNetworkInterface::GetNodeId (const QString &node, const QDBusMessage &message) const
QStringList Aseba::AsebaNetworkInterface::GetNodesList () const
Values Aseba::AsebaNetworkInterface::GetVariable (const QString &node, const QString &variable, const QDBusMessage &message)
QStringList Aseba::AsebaNetworkInterface::GetVariablesList (const QString &node) const
Q_SCRIPTABLE Q_NOREPLY void Aseba::EventFilterInterface::IgnoreEvent (const quint16 event)
Q_SCRIPTABLE Q_NOREPLY void Aseba::EventFilterInterface::IgnoreEventName (const QString &name, const QDBusMessage &message)
Q_SCRIPTABLE Q_NOREPLY void Aseba::EventFilterInterface::ListenEvent (const quint16 event)
Q_SCRIPTABLE Q_NOREPLY void Aseba::EventFilterInterface::ListenEventName (const QString &name, const QDBusMessage &message)
Q_NOREPLY void Aseba::AsebaNetworkInterface::LoadScripts (const QString &fileName, const QDBusMessage &message)
Q_NOREPLY void Aseba::AsebaNetworkInterface::SendEvent (const quint16 event, const Values &data)
Q_NOREPLY void Aseba::AsebaNetworkInterface::SendEventName (const QString &name, const Values &data, const QDBusMessage &message)
Q_NOREPLY void Aseba::AsebaNetworkInterface::SetVariable (const QString &node, const QString &variable, const Values &data, const QDBusMessage &message) const

Protected Slots

void Aseba::Hub::firstConnectionAvailable ()
 If no description has been previously requested, requests one in 200 ms.
void Aseba::Hub::requestDescription ()
 Timer has elapsed, request a description.

Private Slots

void Aseba::AsebaNetworkInterface::filterDestroyed (EventFilterInterface *filter)
void Aseba::AsebaNetworkInterface::ignoreEvent (EventFilterInterface *filter, quint16 event)
void Aseba::AsebaNetworkInterface::listenEvent (EventFilterInterface *filter, quint16 event)
void Aseba::AsebaNetworkInterface::processMessage (Message *message, Dashel::Stream *sourceStream)
void Aseba::AsebaNetworkInterface::sendEventOnDBus (const quint16 event, const Values &data)

Detailed Description


Function Documentation

Aseba::AsebaNetworkInterface::AsebaNetworkInterface ( Hub hub,
bool  systemBus 
) [inherited]

Definition at line 97 of file medulla.cpp.

void Aseba::Hub::connectionClosed ( Dashel::Stream ,
bool   
) [private, virtual, inherited]

Called when target closes connection. The only valid method to call on the stream is getTargetName(), input/output operations are forbidden. You must not call closeStream(stream) from within this method for the same stream as the one passed as parameter. Subclass can implement this method. Called with the stream lock held.

Parameters:
stream stream to the target.
abnormal whether the connection was closed during step (abnormal == false) or when an operation was performed (abnormal == true)

Reimplemented from Dashel::Hub.

Reimplemented in Aseba::Dump, EventLogger, and Aseba::Player.

Definition at line 597 of file medulla.cpp.

void Aseba::Hub::connectionCreated ( Dashel::Stream  )  [private, virtual, inherited]

Called when any data connection is created. It is not called when a listening connection (eg tcpin:) is created. If the stream is closed during this method, an exception occurs: the caller is responsible to handle it. The stream is already inserted in the stream list when this function is called. Subclass can implement this method. Called with the stream lock held.

Parameters:
stream stream to the target

Reimplemented from Dashel::Hub.

Reimplemented in Aseba::Dump, and Aseba::Player.

Definition at line 583 of file medulla.cpp.

QDBusConnection Aseba::AsebaNetworkInterface::DBusConnectionBus (  )  const [inline, protected, inherited]

Definition at line 476 of file medulla.cpp.

void Aseba::EventFilterInterface::emitEvent ( const quint16  id,
const QString &  name,
const Values data 
) [inherited]

Definition at line 58 of file medulla.cpp.

Values Aseba::fromAsebaVector ( const std::vector< sint16 > &  values  ) 

Definition at line 50 of file medulla.cpp.

Aseba::Hub::Hub ( unsigned  port,
bool  verbose,
bool  dump,
bool  forward,
bool  rawTime,
bool  systemBus 
) [inherited]

Creates the hub, listen to TCP on port, and creates a DBus interace.

Parameters:
verbose should we print a notification on each message
dump should we dump content of each message
forward should we only forward messages instead of transmit them back to the sender
rawTime should the time be printed as integer

Definition at line 486 of file medulla.cpp.

void Aseba::Hub::incomingData ( Dashel::Stream  )  [private, virtual, inherited]

Called when data is available for reading on the stream. If the stream is closed during this method, an exception occurs: Hub stops the execution of this method and calls connectionClosed(); objects dynamically allocated must thus be handled with auto_ptr. If step() is used, subclass must implement this method and call read at least once. Called with the stream lock held.

Parameters:
stream stream to the target

Reimplemented from Dashel::Hub.

Reimplemented in Aseba::Dump, EventLogger, Aseba::Player, and Aseba::Recorder.

Definition at line 565 of file medulla.cpp.

void Aseba::AsebaNetworkInterface::nodeDescriptionReceived ( unsigned  nodeId  )  [protected, virtual, inherited]

Virtual function that is called when a node description has been fully received.

Reimplemented from Aseba::DescriptionsManager.

Definition at line 471 of file medulla.cpp.

void Aseba::Hub::run (  )  [private, virtual, inherited]

Runs and returns only when an external event requests the application to stop.

Reimplemented from Dashel::Hub.

Definition at line 558 of file medulla.cpp.

void Aseba::Hub::sendMessage ( Message message,
Dashel::Stream sourceStream = 0 
) [inherited]

Sends a message to Dashel peers. Convenience overload

Definition at line 540 of file medulla.cpp.

void Aseba::Hub::sendMessage ( Message message,
Dashel::Stream sourceStream = 0 
) [inherited]

Sends a message to Dashel peers. Does not delete the message, should be called by the main thread.

Parameters:
message aseba message to send
sourceStream originate of the message, if from Dashel.

Definition at line 504 of file medulla.cpp.

std::vector<sint16> Aseba::toAsebaVector ( const Values values  ) 

Definition at line 41 of file medulla.cpp.


Public Slots

QDBusObjectPath Aseba::AsebaNetworkInterface::CreateEventFilter (  )  [slot, inherited]

Definition at line 464 of file medulla.cpp.

void Aseba::EventFilterInterface::Free (  )  [slot, inherited]

Definition at line 91 of file medulla.cpp.

qint16 Aseba::AsebaNetworkInterface::GetNodeId ( const QString &  node,
const QDBusMessage &  message 
) const [slot, inherited]

Definition at line 302 of file medulla.cpp.

QStringList Aseba::AsebaNetworkInterface::GetNodesList (  )  const [slot, inherited]

Definition at line 292 of file medulla.cpp.

Values Aseba::AsebaNetworkInterface::GetVariable ( const QString &  node,
const QString &  variable,
const QDBusMessage &  message 
) [slot, inherited]

Definition at line 388 of file medulla.cpp.

QStringList Aseba::AsebaNetworkInterface::GetVariablesList ( const QString &  node  )  const [slot, inherited]

Definition at line 313 of file medulla.cpp.

void Aseba::EventFilterInterface::IgnoreEvent ( const quint16  event  )  [slot, inherited]

Definition at line 77 of file medulla.cpp.

void Aseba::EventFilterInterface::IgnoreEventName ( const QString &  name,
const QDBusMessage &  message 
) [slot, inherited]

Definition at line 82 of file medulla.cpp.

void Aseba::EventFilterInterface::ListenEvent ( const quint16  event  )  [slot, inherited]

Definition at line 63 of file medulla.cpp.

void Aseba::EventFilterInterface::ListenEventName ( const QString &  name,
const QDBusMessage &  message 
) [slot, inherited]

Definition at line 68 of file medulla.cpp.

void Aseba::AsebaNetworkInterface::LoadScripts ( const QString &  fileName,
const QDBusMessage &  message 
) [slot, inherited]

Definition at line 179 of file medulla.cpp.

void Aseba::AsebaNetworkInterface::SendEvent ( const quint16  event,
const Values data 
) [slot, inherited]

Definition at line 445 of file medulla.cpp.

void Aseba::AsebaNetworkInterface::SendEventName ( const QString &  name,
const Values data,
const QDBusMessage &  message 
) [slot, inherited]

Definition at line 455 of file medulla.cpp.

void Aseba::AsebaNetworkInterface::SetVariable ( const QString &  node,
const QString &  variable,
const Values data,
const QDBusMessage &  message 
) const [slot, inherited]

Definition at line 347 of file medulla.cpp.


Protected Slots

void Aseba::Hub::firstConnectionAvailable (  )  [protected, slot, inherited]

If no description has been previously requested, requests one in 200 ms.

Definition at line 545 of file medulla.cpp.

void Aseba::Hub::requestDescription (  )  [protected, slot, inherited]

Timer has elapsed, request a description.

Definition at line 550 of file medulla.cpp.


Private Slots

void Aseba::AsebaNetworkInterface::filterDestroyed ( EventFilterInterface filter  )  [private, slot, inherited]

Definition at line 172 of file medulla.cpp.

void Aseba::AsebaNetworkInterface::ignoreEvent ( EventFilterInterface filter,
quint16  event 
) [private, slot, inherited]

Definition at line 167 of file medulla.cpp.

void Aseba::AsebaNetworkInterface::listenEvent ( EventFilterInterface filter,
quint16  event 
) [private, slot, inherited]

Definition at line 162 of file medulla.cpp.

void Aseba::AsebaNetworkInterface::processMessage ( Message message,
Dashel::Stream sourceStream 
) [private, slot, inherited]

Definition at line 110 of file medulla.cpp.

void Aseba::AsebaNetworkInterface::sendEventOnDBus ( const quint16  event,
const Values data 
) [private, slot, inherited]

Definition at line 150 of file medulla.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


asebaros
Author(s): $author
autogenerated on Mon Sep 5 08:42:05 2011