#include <OHReceiver.h>
Public Types | |
typedef ISInfo::Reason | Reason |
Public Member Functions | |
virtual | ~OHReceiver () |
Destructor. | |
void | getHistogram (const IPCPartition &p, const std::string &server, const std::string &provider, const std::string &histoname, bool with_history=false, int how_many=-1) throw (daq::oh::ObjectNotFound,daq::oh::InvalidObject) |
Can be used to read a single histogram or profile from the OH. | |
void | getObject (const IPCPartition &p, const std::string &server, const std::string &provider, const std::string &histoname, bool with_history=false, int how_many=-1) throw (daq::oh::ObjectNotFound,daq::oh::InvalidObject) |
Can be used to read a single histogram, profile or graph from the OH. | |
virtual void | receive_ (const std::string &name, oh::HistogramData< char > &histogram)=0 |
Called when a histogram is received. | |
virtual void | receive_ (const std::string &name, oh::HistogramData< short > &histogram)=0 |
virtual void | receive_ (const std::string &name, oh::HistogramData< int > &histogram)=0 |
virtual void | receive_ (const std::string &name, oh::HistogramData< float > &histogram)=0 |
virtual void | receive_ (const std::string &name, oh::HistogramData< double > &histogram)=0 |
virtual void | receive_ (const std::string &name, oh::ProfileData &histogram)=0 |
virtual void | receive_ (const std::string &name, oh::GraphData &graph)=0 |
virtual void | receive_ (const std::string &name, oh::Graph2DData &graph)=0 |
virtual void | receive_ (const std::string &name, std::vector< oh::HistogramData< char > > &set)=0 |
Called when a set of histograms is received. | |
virtual void | receive_ (const std::string &name, std::vector< oh::HistogramData< short > > &set)=0 |
virtual void | receive_ (const std::string &name, std::vector< oh::HistogramData< int > > &set)=0 |
virtual void | receive_ (const std::string &name, std::vector< oh::HistogramData< float > > &set)=0 |
virtual void | receive_ (const std::string &name, std::vector< oh::HistogramData< double > > &set)=0 |
virtual void | receive_ (const std::string &name, std::vector< oh::ProfileData > &set)=0 |
virtual void | receive_ (const std::string &name, std::vector< oh::GraphData > &set)=0 |
virtual void | receive_ (const std::string &name, std::vector< oh::Graph2DData > &set)=0 |
virtual void | objectChanged (const std::string &name, const OWLTime &time, Reason reason) |
Static Public Attributes | |
static const Reason | Created = ISInfo::Created |
static const Reason | Updated = ISInfo::Updated |
static const Reason | Deleted = ISInfo::Deleted |
Friends | |
class | oh::iterator |
class | OHSubscriber |
This class provides functionality to receive histograms and graphs from an OHIterator or OHSubscriber in the OH internal formats and thus acts as an abstraction layer to the underlying technology used to transport and buffer histograms. Derive a new class for each external package (or histogram format) which should import histograms/graphs from the OH.
Example:
class MyReceiver : public OHReceiver { protected: // Histogram user tasks should override this function to // receive histograms virtual void receive( MyHistogram & histo ) = 0; private: void receive_( const std::string & name, oh::HistogramData<char> & histogram ) { // Need to create a new histogram and fill it with info // from the received histogram MyHistogram h( ... ); // Conversion stuff goes here... // Let the user receive the histogram receive( h ); } };
For more information on how to convert from the OH internal histogram representations see oh::OHHistogramData. For OH internal graphs see oh::GraphData.
Observe the possibility here to use multiple inheritance in order to access protected members in the non OH histograms.
void OHReceiver::getHistogram | ( | const IPCPartition & | partition, | |
const std::string & | server, | |||
const std::string & | provider, | |||
const std::string & | histoname, | |||
bool | with_history = false , |
|||
int | how_many = -1 | |||
) | throw (daq::oh::ObjectNotFound,daq::oh::InvalidObject) |
Can be used to read a single histogram or profile from the OH.
Call this function to get a particular histogram from the OH repository. One of the two "receive" functions will be called and requested histogram will be passed to it. If histogram is not found throws the daq::oh::ObjectNotFound exception. If object is not supported by the OH throws daq::oh::InvalidObject exception.
partition | TDAQ IPC partition | |
server | OH server name | |
provider | name of the histogram provider | |
histoname | name of the histogram | |
with_history | set it to true if you want to retrieve a vector of old values for this histogram. By default is set to false. | |
how_many | Used in combination with the with_history parameter. Tells how many history values to retrieve. Default value is -1, which means all values. |
void OHReceiver::getObject | ( | const IPCPartition & | partition, | |
const std::string & | server, | |||
const std::string & | provider, | |||
const std::string & | histoname, | |||
bool | with_history = false , |
|||
int | how_many = -1 | |||
) | throw (daq::oh::ObjectNotFound,daq::oh::InvalidObject) |
Can be used to read a single histogram, profile or graph from the OH.
Call this function to get a particular histogram or graph from the OH repository. One of the two "receive" functions will be called and requested histogram will be passed to it. If histogram is not found throws the daq::oh::ObjectNotFound exception. If object is not supported by the OH throws daq::oh::InvalidObject exception.
partition | TDAQ IPC partition | |
server | OH server name | |
provider | name of the object provider | |
histoname | name of the object | |
with_history | set it to true if you want to retrieve a vector of old values for this object. By default is set to false. | |
how_many | Used in combination with the with_history parameter. Tells how many history values to retrieve. Default value is -1, which means all values. |
void OHReceiver::objectChanged | ( | const std::string & | name, | |
const OWLTime & | time, | |||
Reason | reason | |||
) | [virtual] |
name | An object name. | |
time | Time when the hsitogram has been changed. | |
reason | Explains what has happened with the object. The possibilities are: Created, Updated, Removed. |
virtual void OHReceiver::receive_ | ( | const std::string & | name, | |
std::vector< oh::HistogramData< char > > & | set | |||
) | [pure virtual] |
Called when a set of histograms is received.
name | A histogram name. | |
set | A std::vector of recent values of this histogram. |
virtual void OHReceiver::receive_ | ( | const std::string & | name, | |
oh::HistogramData< char > & | histogram | |||
) | [pure virtual] |
Called when a histogram is received.
histogram | A histogram. | |
name | A histogram name. |