DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
erskafka::ProtoBufStream Class Reference

ERS stream implementation. More...

#include <ProtoBufStream.hpp>

Inheritance diagram for erskafka::ProtoBufStream:
[legend]
Collaboration diagram for erskafka::ProtoBufStream:
[legend]

Public Member Functions

 ProtoBufStream (const std::string &param)
 
void write (const ers::Issue &issue) override
 
- Public Member Functions inherited from ers::OutputStream
virtual ~OutputStream ()
 Sends the issue into this stream.
 

Private Attributes

std::unique_ptr< dunedaq::erskafka::ERSPublisherm_publisher
 
std::string m_session
 
std::string m_application
 

Additional Inherited Members

- Protected Member Functions inherited from ers::OutputStream
 OutputStream ()
 
OutputStreamchained ()
 
virtual bool isNull () const
 

Detailed Description

ERS stream implementation.

This stream offers capability of publishing Issues to a data stream, So that other services can subscribe to the stream. A stream configuration is composed of the stream name, that is "protobufstream". Messages are transported using the ERS schema defined in ers

Definition at line 31 of file ProtoBufStream.hpp.

Constructor & Destructor Documentation

◆ ProtoBufStream()

erskafka::ProtoBufStream::ProtoBufStream ( const std::string & param)
explicit

Definition at line 24 of file ProtoBufStream.cpp.

25 : m_session("Uknown")
26 , m_application("Uknown") {
27
28 nlohmann::json conf;
29 conf["bootstrap"] = param;
30
31 m_publisher = std::make_unique<dunedaq::erskafka::ERSPublisher>(conf);
32
33 if(auto env_p = std::getenv("DUNEDAQ_SESSION"))
34 m_session = env_p;
35
36 if (auto app_p = std::getenv("DUNEDAQ_APPLICATION_NAME"))
37 m_application = app_p;
38 }
std::unique_ptr< dunedaq::erskafka::ERSPublisher > m_publisher

Member Function Documentation

◆ write()

void erskafka::ProtoBufStream::write ( const ers::Issue & issue)
overridevirtual

Implements ers::OutputStream.

Member Data Documentation

◆ m_application

std::string erskafka::ProtoBufStream::m_application
private

Definition at line 39 of file ProtoBufStream.hpp.

◆ m_publisher

std::unique_ptr<dunedaq::erskafka::ERSPublisher> erskafka::ProtoBufStream::m_publisher
private

Definition at line 37 of file ProtoBufStream.hpp.

◆ m_session

std::string erskafka::ProtoBufStream::m_session
private

Definition at line 38 of file ProtoBufStream.hpp.


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