ot::NetworkSourceModule Class Reference
[Network Classes]

#include <NetworkSourceModule.h>

Inheritance diagram for ot::NetworkSourceModule:

Inheritance graph
[legend]
Collaboration diagram for ot::NetworkSourceModule:

Collaboration graph
[legend]
List of all members.

Detailed Description

The module and factory to drive the reception of network event updates. It builds NetworkSource nodes that insert data from the network into the tracker tree. It uses a thread per multicast group or unicast port to receive and send (if necessary) data.

Author:
Gerhard Reitmayr, Mathis Csisinko, Jochen von Spiczak


Public Member Functions

 NetworkSourceModule ()
virtual ~NetworkSourceModule ()
virtual NodecreateNode (const std::string &name, StringTable &attributes)
virtual void start ()
virtual void close ()
virtual void pushEvent ()

Static Protected Member Functions

static void convertFloatsNToHl (float *floats, float *result, int num)
static void runMulticastReceiver (void *data)
static void runUnicastTransceiver (void *data)
static bool processRecord (NetworkReceiver *receiver)

Protected Attributes

MulticastReceiverVector multicasts
 list of multicast groups to listen for
UnicastReceiverVector unicasts
 list of unicast receivers to listen for


Constructor & Destructor Documentation

ot::NetworkSourceModule::NetworkSourceModule  ) 
 

basic constructor

ot::NetworkSourceModule::~NetworkSourceModule  )  [virtual]
 

destructor


Member Function Documentation

void ot::NetworkSourceModule::close  )  [virtual]
 

closes the module and closes any communication sockets and stops thread.

Reimplemented from ot::Module.

void ot::NetworkSourceModule::convertFloatsNToHl float *  floats,
float *  result,
int  num
[static, protected]
 

Converts num floats from network byte order.

Parameters:
floats pointer to source data
result pointer to result array
num number of floats to convert

Node * ot::NetworkSourceModule::createNode const std::string &  name,
StringTable attributes
[virtual]
 

This method is called to construct a new Node. It compares name to the NetworkSource element name, and if it matches creates a new NetworkSource node.

Parameters:
name reference to string containing element name refenrence to StringTable containing attribute values
Returns:
pointer to new Node or NULL. The new Node must be allocated with new !

Implements ot::NodeFactory.

bool ot::NetworkSourceModule::processRecord NetworkReceiver *  receiver  )  [static, protected]
 

Processes the received data buffer and writes the decoded data the event of the station defined by the station number.

Parameters:
receiver the network receiver
Returns:
whether the record could be successfully processed

void ot::NetworkSourceModule::pushEvent  )  [virtual]
 

pushes event information into the tree. It checks whether there is new data for any NetworkSource node, copies it into the nodes and calls push on them.

Reimplemented from ot::Module.

void ot::NetworkSourceModule::runMulticastReceiver void *  data  )  [static, protected]
 

Runs the multicast receiver thread. The function reads from the network and parses network packages.

Parameters:
data the multicast receiver

void ot::NetworkSourceModule::runUnicastTransceiver void *  data  )  [static, protected]
 

Runs the unicast transceiver thread. The function reads from and writes to the network and parses network packages.

Parameters:
data the unicast receiver

void ot::NetworkSourceModule::start  )  [virtual]
 

opens the sockets needed for communication and starts the receive thread. It is called after initialisation is done.

Reimplemented from ot::Module.


Member Data Documentation

MulticastReceiverVector ot::NetworkSourceModule::multicasts [protected]
 

list of multicast groups to listen for

UnicastReceiverVector ot::NetworkSourceModule::unicasts [protected]
 

list of unicast receivers to listen for


The documentation for this class was generated from the following files:
Generated on Wed Feb 28 15:33:35 2007 for NaviTrack by  doxygen 1.4.6