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 <string>
25#include <ers/Issue.hpp>
26#include <ers/IssueReceiver.hpp>
27
32namespace ers {
33 class Issue;
34
41 friend class StreamManager;
42
43 public:
44 virtual ~InputStream() {
45 ;
46 }
47
48 protected:
50
52 void receive(const Issue &issue);
53
54 private:
55 InputStream(const InputStream &other) = delete;
57
58 void set_receiver(IssueReceiver *receiver) {
59 m_receiver = receiver;
60 }
61
63 };
64}
65
66#include <ers/StreamFactory.hpp>
67
68#define ERS_REGISTER_INPUT_STREAM( class, name, params ) \
69namespace { \
70 struct InputStreamRegistrator { \
71 static ers::InputStream * create( const std::initializer_list<std::string> & params ) \
72 { return new class( params ); } \
73 InputStreamRegistrator() \
74 { ers::StreamFactory::instance().register_in_stream( name, create ); } \
75 } registrator_mp; \
76}
77
78#endif
79
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:80