DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
This class manages and provides access to ERS streams. More...
#include <StreamManager.hpp>
Public Member Functions | |
~StreamManager () | |
void | debug (const Issue &issue, int level) |
sends an Issue to the debug stream | |
void | error (const Issue &issue) |
sends an issue to the error stream | |
void | fatal (const Issue &issue) |
sends an issue to the fatal stream | |
void | information (const Issue &issue) |
sends an issue to the information stream | |
void | log (const Issue &issue) |
sends an issue to the log stream | |
void | warning (const Issue &issue) |
sends an issue to the warning stream | |
void | add_receiver (const std::string &stream, const std::string &filter, ers::IssueReceiver *receiver) |
void | add_receiver (const std::string &stream, const std::initializer_list< std::string > ¶ms, ers::IssueReceiver *receiver) |
void | remove_receiver (ers::IssueReceiver *receiver) |
void | add_output_stream (ers::severity severity, ers::OutputStream *new_stream) |
void | report_issue (ers::severity type, const Issue &issue) |
Static Public Member Functions | |
static StreamManager & | instance () |
return the singleton | |
Private Member Functions | |
StreamManager () | |
OutputStream * | setup_stream (ers::severity severity) |
OutputStream * | setup_stream (const std::vector< std::string > &streams) |
Private Attributes | |
PluginManager | m_plugin_manager |
std::mutex | m_mutex |
std::list< std::shared_ptr< InputStream > > | m_in_streams |
std::shared_ptr< OutputStream > | m_init_streams [ers::Fatal+1] |
array of pointers to streams per severity | |
std::shared_ptr< OutputStream > | m_out_streams [ers::Fatal+1] |
array of pointers to streams per severity | |
Friends | |
class | StreamInitializer |
class | ers::LocalStream |
class | ers::ErrorHandler |
template<class > | |
class | SingletonCreator |
This class manages and provides access to ERS streams.
The StreamManager
class is responsible for creating and handling all the ERS streams used by an application. It implements the singleton pattern and handles a table of the different stream attached to each severity. When issues occur they are dispatched to an appropriate stream by the singleton instance of this class. Users should not use this class directly. In order to report issues users should use global functions declared in the ers
namespace.
Definition at line 58 of file StreamManager.hpp.
ers::StreamManager::~StreamManager | ( | ) |
|
private |
Private constructor - can not be called by user code, use the instance()
method instead
Definition at line 163 of file StreamManager.cpp.
void ers::StreamManager::add_output_stream | ( | ers::severity | severity, |
ers::OutputStream * | new_stream ) |
Definition at line 178 of file StreamManager.cpp.
void ers::StreamManager::add_receiver | ( | const std::string & | stream, |
const std::initializer_list< std::string > & | params, | ||
ers::IssueReceiver * | receiver ) |
Definition at line 209 of file StreamManager.cpp.
void ers::StreamManager::add_receiver | ( | const std::string & | stream, |
const std::string & | filter, | ||
ers::IssueReceiver * | receiver ) |
Definition at line 197 of file StreamManager.cpp.
void ers::StreamManager::debug | ( | const Issue & | issue, |
int | level ) |
sends an Issue to the debug stream
Sends an issue to the debug stream
issue | the Issue to send |
level | the debug level. |
Definition at line 326 of file StreamManager.cpp.
void ers::StreamManager::error | ( | const Issue & | issue | ) |
sends an issue to the error stream
Sends an Issue to the error stream
issue |
Definition at line 316 of file StreamManager.cpp.
void ers::StreamManager::fatal | ( | const Issue & | issue | ) |
sends an issue to the fatal stream
Sends an Issue to the fatal error stream
issue |
Definition at line 340 of file StreamManager.cpp.
void ers::StreamManager::information | ( | const Issue & | issue | ) |
sends an issue to the information stream
Sends an issue to the info stream
issue | the Issue to send |
Definition at line 358 of file StreamManager.cpp.
|
static |
return the singleton
This method returns the singleton instance. It should be used for every operation on the factory.
Singleton instance
Definition at line 151 of file StreamManager.cpp.
void ers::StreamManager::log | ( | const Issue & | issue | ) |
sends an issue to the log stream
Sends an issue to the log stream
issue | the Issue to send |
Definition at line 367 of file StreamManager.cpp.
void ers::StreamManager::remove_receiver | ( | ers::IssueReceiver * | receiver | ) |
Definition at line 221 of file StreamManager.cpp.
void ers::StreamManager::report_issue | ( | ers::severity | type, |
const Issue & | issue ) |
Sends an Issue to an appropriate stream
type | |
issue |
Definition at line 305 of file StreamManager.cpp.
|
private |
Definition at line 269 of file StreamManager.cpp.
|
private |
Definition at line 235 of file StreamManager.cpp.
void ers::StreamManager::warning | ( | const Issue & | issue | ) |
sends an issue to the warning stream
Sends an Issue to the warning stream
issue | the issue to send |
Definition at line 349 of file StreamManager.cpp.
|
friend |
Definition at line 62 of file StreamManager.hpp.
|
friend |
Definition at line 61 of file StreamManager.hpp.
|
friend |
Definition at line 63 of file StreamManager.hpp.
|
friend |
Definition at line 60 of file StreamManager.hpp.
|
private |
Definition at line 105 of file StreamManager.hpp.
|
private |
array of pointers to streams per severity
Definition at line 106 of file StreamManager.hpp.
|
private |
Definition at line 104 of file StreamManager.hpp.
|
private |
array of pointers to streams per severity
Definition at line 107 of file StreamManager.hpp.
|
private |
Definition at line 103 of file StreamManager.hpp.