BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
FilterStream.h
Go to the documentation of this file.
1/*
2 * FilterStream.h
3 * ERS
4 *
5 * Created by Matthias Wiesmann on 31.03.05.
6 * Copyright 2005 CERN. All rights reserved.
7 *
8 */
9
10#ifndef ERS_FILTERSTREAM
11#define ERS_FILTERSTREAM
12
13#include "ers/Stream.h"
14
15namespace ers {
16
17 /** This stream offers basic filtering capacities
18 * It basically hooks up in front of another stream and filters the data output.
19 * Filtering is based on two list and \e include list and and \e exclude list
20 * To be accepted an Issue needs two match two criteria
21 * \li No qualifier in the issue should match strings in the exclude list
22 * \li At least one qualifier in the issue should match a string in the include list
23 *
24 * If the include list is empty, the second condition is not applied.
25 * This stream should only be used for severity levels where filtering makes sense,
26 * i.e warning, debugs, etc...
27 * The syntax to request a filter stream is the following:<br>
28 * <code>filter:filter:?include_qualifier1,include_qualifier2!exclude_qualifier1,exclude_qualifier2\@stream_identifier</code>
29 * The stream_identifier can be any stream_key used by the ERS system (including a second filter).
30 *
31 * For more information on associating a stream to a severity level, see the documentation on the StreamFactory class.
32 * \see ers::StreamFactory
33 * \author Matthias Wiesmann
34 * \version 1.0
35 * \brief filtering stream
36 */
37
38 class FilterStream : public Stream {
39protected:
40 Stream *m_target_stream_ptr ; /**< \brief chained target stream */
41 std::vector<std::string> m_include ; /**< \brief include list */
42 std::vector<std::string> m_exclude ; /**< \brief exclude list */
43 FilterStream() ;
44 FilterStream(const FilterStream &other);
45public:
46 static const char *const FILTER_STREAM_TAG ; /**< \brief tag used to identity this stream */
47 static const char *const INCLUDE_TAG ; /**< \brief tag used to mark the start of the include list */
48 static const char *const EXCLUDE_TAG ; /**< \brief tag used to mark the start of the exclude list */
49 static const char *const TARGET_TAG ; /**< \brief tag used to mark the target stream */
50 static const char *const SEPARATORS ; /**< \brief separators between include and exclude qualifiers */
51 static FilterStream *factory(const std::string &include_str, const::std::string &exclude_str, const std::string &target_str) ;
52 static FilterStream *factory(const std::string &parameters);
53 FilterStream(Stream *target_ptr,
54 const std::vector<std::string> & include_list,
55 const std::vector<std::string> & exclude_list) ;
56 ~FilterStream() ; /**< \brief destructor */
57 virtual bool is_accept(const Issue* issue_ptr); /**< \brief filter method */
58 virtual void send(const Issue *issue_ptr) ; /**< \brief send method */
59 virtual void print_to(std::ostream& stream) const ;
60
61 } ; // FilterStream
62
63} // ers
64
65#endif
************Class m_ypar INTEGER m_KeyWgt INTEGER m_KeyIHVP INTEGER m_KeyGPS INTEGER m_IsBeamPolarized INTEGER m_EvtGenInterface DOUBLE PRECISION m_Emin DOUBLE PRECISION m_sphot DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_q2 DOUBLE PRECISION m_PolBeam2 DOUBLE PRECISION m_xErrPb *COMMON c_KK2f $ !CMS energy average $ !Spin Polarization vector first beam $ !Spin Polarization vector second beam $ !Beam energy spread[GeV] $ !minimum hadronization energy[GeV] $ !input parameters
Definition KK2f.h:46
filtering stream
std::vector< std::string > m_include
include list
virtual void print_to(std::ostream &stream) const
static const char *const FILTER_STREAM_TAG
tag used to identity this stream
static const char *const EXCLUDE_TAG
tag used to mark the start of the exclude list
virtual void send(const Issue *issue_ptr)
send method
static const char *const SEPARATORS
separators between include and exclude qualifiers
static const char *const INCLUDE_TAG
tag used to mark the start of the include list
~FilterStream()
destructor
std::vector< std::string > m_exclude
exclude list
virtual bool is_accept(const Issue *issue_ptr)
filter method
Stream * m_target_stream_ptr
chained target stream
static const char *const TARGET_TAG
tag used to mark the target stream
Root Issue class.
Root/Null issue stream.
Definition Stream.h:35
efhlt::Interface * factory(void)
Definition factory.cxx:17