File indexing completed on 2025-01-18 10:01:11
0001
0002
0003
0004
0005
0006 #ifndef HEPMC3_SEARCH_FILTEATTRIBUTE_H
0007 #define HEPMC3_SEARCH_FILTEATTRIBUTE_H
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <string>
0020 #include <memory>
0021 #include "HepMC3/Filter.h"
0022 #include "HepMC3/Attribute.h"
0023
0024 namespace HepMC3 {
0025
0026 using std::string;
0027
0028 class ATTRIBUTE : public Filter {
0029
0030
0031
0032 public:
0033
0034
0035
0036 ATTRIBUTE(const std::string &name):Filter(ATTRIBUTE_EXISTS, name) {}
0037
0038
0039
0040
0041 public:
0042
0043 Filter& operator==(std::shared_ptr<Attribute> &at) {
0044 m_attribute = ATTRIBUTE_IS_EQUAL;
0045 at->to_string(m_attribute_str);
0046 return *this;
0047 }
0048
0049
0050 Filter& operator!=(std::shared_ptr<Attribute> &at) {
0051 m_bool_value = !m_bool_value;
0052 m_attribute = ATTRIBUTE_IS_EQUAL;
0053 at->to_string(m_attribute_str);
0054 return *this;
0055 }
0056
0057
0058 Filter& operator==(const std::string &value) {
0059 m_attribute = ATTRIBUTE_IS_EQUAL;
0060 m_attribute_str = value;
0061 return *this;
0062 }
0063
0064
0065 Filter& operator!=(const std::string &value) {
0066 m_bool_value = !m_bool_value;
0067 m_attribute = ATTRIBUTE_IS_EQUAL;
0068 m_attribute_str = value;
0069 return *this;
0070 }
0071
0072
0073 Filter& operator!() {
0074 m_bool_value = !m_bool_value;
0075 return *this;
0076 }
0077 };
0078
0079 }
0080
0081 #endif