DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
InputStream.hpp
Go to the documentation of this file.
1/*
2 * DUNE DAQ modification notice:
3 * This file has been modified from the original ATLAS ers source for the DUNE DAQ project.
4 * Fork baseline commit: 8267df82a4f6fe6bf02c4014923eba19eddc4614 (2020-04-14).
5 * Renamed since fork: yes (from ers/InputStream.h to include/ers/InputStream.hpp).
6 *
7 * Original copyright:
8 * Copyright (C) 2001-2020 CERN for the benefit of the ATLAS collaboration.
9 * Licensed under the Apache License, Version 2.0.
10 */
11
12/*
13 * InputStream.h
14 * ers
15 *
16 * Created by Serguei Kolos on 02.08.05.
17 * Copyright 2004 CERN. All rights reserved.
18 *
19 */
20
21#ifndef ERS_INPUT_STREAM_H
22#define ERS_INPUT_STREAM_H
23
24#include <ers/Issue.hpp>
25#include <ers/IssueReceiver.hpp>
26#include <string>
27
32namespace ers {
33class Issue;
34
41{
42 friend class StreamManager;
43
44public:
45 virtual ~InputStream() { ; }
46
47protected:
49
51 void receive(const Issue& issue);
52
53private:
54 InputStream(const InputStream& other) = delete;
56
57 void set_receiver(IssueReceiver* receiver) { m_receiver = receiver; }
58
60};
61}
62
63#include <ers/StreamFactory.hpp>
64
65#define ERS_REGISTER_INPUT_STREAM(class, name, params) \
66 namespace { \
67 struct InputStreamRegistrator \
68 { \
69 static ers::InputStream* create(const std::initializer_list<std::string>& params) \
70 { \
71 return new class(params); \
72 } \
73 InputStreamRegistrator() \
74 { \
75 ers::StreamFactory::instance().register_in_stream(name, create); \
76 } \
77 } registrator_mp; \
78 }
79
80#endif
InputStream & operator=(const InputStream &)=delete
InputStream(const InputStream &other)=delete
virtual ~InputStream()
void set_receiver(IssueReceiver *receiver)
friend class StreamManager
IssueReceiver * m_receiver
InputStream()
Will be called when a new issue is received.
void receive(const Issue &issue)
ERS Issue receiver interface.
Base class for any user define issue.
Definition Issue.hpp:76