#include <OHProvider.h>
Protected Member Functions | |
OHProvider (const IPCPartition &p, const std::string &server, const std::string &name, OHCommandListener *lst=0) throw ( daq::oh::RepositoryNotFound, daq::oh::ProviderAlreadyExist ) | |
Create a new histogram provider. | |
void | publish (ISInfo &object, const std::string &name, bool keep_history=false) const throw ( daq::oh::RepositoryNotFound, daq::oh::ObjectTypeMismatch ) |
Publish histogram. | |
Friends | |
class | oh::ProviderManager |
This class provides functionality to publish the OH internal histogram and graph types and thus acts as an abstraction layer to the underlying technology used to transport and buffer histograms/graphs. Derive a new class for each external package (or histogram format) which should export histograms/graphs to the OH.
Symbolic example:
class MyProvider : public OHProvider { public: MyProvider( const IPCPartition & p, const string & server, const string & name ) : OHProvider( p, server, name ) { } Status publish( const MyHistogram1D& h, const string & name, bool update ) { oh::HistogramData<bin type> data; // Copy content from h to data data.set_title( h.title( ) ); // More conversion stuff goes here... // Publish the histogram return OHProvider::publish( data, name, true ); } // Here some functions for other histogram types // could be added. };
For more information on how to convert to the OH internal histogram representations see oh::HistogramData<T> class. For the OH internal graphs there is an interface class called oh::GraphInterface which provides the same functionality.
void OHProvider::publish | ( | ISInfo & | object, | |
const std::string & | hn, | |||
bool | keep_history = false | |||
) | const throw ( daq::oh::RepositoryNotFound, daq::oh::ObjectTypeMismatch ) [protected] |
Publish histogram.
histogram | A valid non empty histogram | |
name | A name describing the histogram. Should only contain characters from [a-z], [A-Z], [0-9] and '_'. | |
keep_history | A flag which decides whether to keep the old histogram value (by default false) |