User Manual, Developers Guide and API Documentation

wns::probe::bus::PythonProbeBus Class Reference
[ProbeBusses]

Filter Measurements by calling back a PythonObject. More...

#include <probe/bus/PythonProbeBus.hpp>

Inheritance diagram for wns::probe::bus::PythonProbeBus:

Inheritance graph
[legend]
Collaboration diagram for wns::probe::bus::PythonProbeBus:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual bool accepts (const wns::simulator::Time &, const IContext &)
 Called to determine if the ProbeBus would accept the measurement.
virtual void onMeasurement (const wns::simulator::Time &, const double &, const IContext &)
 Called to actually process the measurement.
virtual void output ()
 Called by the simulator to trigger periodical storage of measurement data.
 PythonProbeBus (const wns::pyconfig::View &pyco)
virtual ~PythonProbeBus ()

Private Member Functions

void showdown (const std::string &reason) const

Private Attributes

wns::pyconfig::Object pyAcceptsMethod_
wns::pyconfig::View pyco_
wns::pyconfig::Object pyOnMeasurementMethod_
wns::pyconfig::Object pyOutputMethod_
bool reportErrors_


Detailed Description

Use this ProbeBus for rapid deployment if individual filter rules. The wns::pyconfig::View passed to the constructor must contain a callable named accepts. This callable must accept two parameters. The first is the ProbeID which is mapped to a Python string and the second is a Dict of Python strings to Python ints. Based on this information the Python method must return wether the PythonProbeBus accepts the measurement or not.

PythonProbeBus does not do anything in its onMeasurement method. It is simply a gate that determines wether measurements are forwarded to its Observers or not.

If you only want to evaluate measurements for certain IDs plug the PythonProbeBus between the MasterProbeBus and a StatEvalProbeBus and provide the filtering criteria from within your configuration file.

Author:
Daniel Bültmann <me@daniel-bueltmann.de>
Todo:
dbn: Documentation is outdated. Rewrite.

Definition at line 60 of file PythonProbeBus.hpp.


Constructor & Destructor Documentation

PythonProbeBus::PythonProbeBus ( const wns::pyconfig::View pyco  ) 

Definition at line 41 of file PythonProbeBus.cpp.

PythonProbeBus::~PythonProbeBus (  )  [virtual]

Definition at line 52 of file PythonProbeBus.cpp.


Member Function Documentation

bool PythonProbeBus::accepts ( const wns::simulator::Time time,
const IContext context 
) [virtual]

Parameters:
time The current timestamp of the simulation
context The context of your measurement.

Implements wns::probe::bus::ProbeBus.

Definition at line 89 of file PythonProbeBus.cpp.

void PythonProbeBus::onMeasurement ( const wns::simulator::Time time,
const double measurement,
const IContext context 
) [virtual]

Parameters:
time The current timestamp of the simulation
measurement The measured value.
context The context of your measurement.

Implements wns::probe::bus::ProbeBus.

Definition at line 57 of file PythonProbeBus.cpp.

void PythonProbeBus::output (  )  [virtual]

Implements wns::probe::bus::ProbeBus.

Definition at line 121 of file PythonProbeBus.cpp.

void PythonProbeBus::showdown ( const std::string &  reason  )  const [private]

Definition at line 138 of file PythonProbeBus.cpp.


Member Data Documentation

Definition at line 86 of file PythonProbeBus.hpp.

Definition at line 84 of file PythonProbeBus.hpp.

Definition at line 88 of file PythonProbeBus.hpp.

Definition at line 90 of file PythonProbeBus.hpp.

Definition at line 92 of file PythonProbeBus.hpp.


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

Generated on Sun May 27 03:33:02 2012 for openWNS by  doxygen 1.5.5