HepMC event record
build/outputs/include/HepMC/Search/FilterList.h
1 // -*- C++ -*-
2 //
3 // This file is part of HepMC
4 // Copyright (C) 2014 The HepMC collaboration (see AUTHORS for details)
5 //
6 #ifndef HEPMC_SEARCH_FILTERLIST_H
7 #define HEPMC_SEARCH_FILTERLIST_H
8 /**
9  * @file FilterList.h
10  * @brief Definition of \b class FilterList
11  *
12  * @class HepMC::FilterList
13  * @brief List of filters for the search engine
14  *
15  * Constructs lists out of Filter objects
16  *
17  * @ingroup search_engine
18  *
19  */
20 #include "HepMC/Search/Filter.h"
21 #include "HepMC/Search/FilterAttribute.h"
22 
23 #include <vector>
24 using std::vector;
25 
26 namespace HepMC {
27 
28 class FilterList {
29 //
30 // Constructors
31 //
32 public:
33  /** @brief Default constructor
34  *
35  * Used when no filters were passed to search enginge
36  */
38 
39  /** @brief Single filter constructor
40  *
41  * Used as casting operator when just one filter
42  * was passed to search engine
43  */
44  FilterList(const Filter &f1);
45 
46  /** @brief Two filters constructor
47  *
48  * Used by global Filter AND operator to quickly join pair of filters
49  */
50  FilterList(const Filter &f1, const Filter &f2);
51 
52  /** @brief AND operator
53  *
54  * Used to join multiple filters
55  */
56  FilterList& operator&&(const Filter &f);
57 
58 //
59 // Accessors
60 //
61 public:
62  const vector<Filter>& filters() { return m_filters; } //!< Get list of filters
63 
64 //
65 // Fields
66 //
67 private:
68  vector<Filter> m_filters; //!< List of filters
69 };
70 
71 /** @brief Filter AND operator
72  *
73  * Defined so that FilterList can be constructed
74  * when there is more than one filter passed to search engine
75  */
76 FilterList operator&&(const Filter &f1, const Filter &f2);
77 
78 } // namespace HepMC
79 
80 #endif
vector< Filter > m_filters
List of filters.
List of filters for the search engine.
Class used to define filters for search engine.
const vector< Filter > & filters()
Get list of filters.
FilterList operator &&(const Filter &f1, const Filter &f2)
Filter AND operator.
Definition: FilterList.cc:29
FilterList & operator &&(const Filter &f)
AND operator.
Definition of template class SmartPointer.