Warning, file /include/Gaudi/Decays/iNode.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #pragma once
0012
0013 #include <GaudiKernel/Kernel.h>
0014 #include <GaudiKernel/StatusCode.h>
0015 #include <functional>
0016 #include <iosfwd>
0017 #include <memory>
0018
0019 namespace Gaudi {
0020 namespace Interfaces {
0021 class IParticlePropertySvc;
0022 }
0023 class ParticleID;
0024 }
0025
0026 namespace Gaudi::Decays {
0027
0028
0029
0030
0031
0032
0033
0034
0035 class GAUDI_API iNode {
0036 public:
0037
0038
0039
0040
0041 virtual bool operator()( const Gaudi::ParticleID& pid ) const = 0;
0042
0043
0044 virtual iNode* clone() const = 0;
0045
0046
0047
0048
0049
0050 virtual std::ostream& fillStream( std::ostream& s ) const = 0;
0051
0052 virtual bool valid() const = 0;
0053
0054 virtual bool operator!() const;
0055
0056
0057
0058
0059
0060 virtual StatusCode validate( const Gaudi::Interfaces::IParticlePropertySvc* svc ) const = 0;
0061
0062
0063 virtual std::string toString() const;
0064
0065
0066 virtual ~iNode() = default;
0067 };
0068
0069
0070
0071
0072
0073
0074 class GAUDI_API Node : public iNode {
0075 public:
0076
0077 Node( const Decays::iNode& node );
0078
0079 Node( const Decays::Node& right );
0080
0081 Node* clone() const override;
0082
0083 bool operator()( const Gaudi::ParticleID& p ) const override;
0084
0085 std::ostream& fillStream( std::ostream& s ) const override;
0086
0087 bool valid() const override;
0088
0089 StatusCode validate( const Gaudi::Interfaces::IParticlePropertySvc* svc ) const override;
0090
0091 public:
0092 Node& operator&=( const iNode& right ) { return op_and( right ); }
0093 Node& operator|=( const iNode& right ) { return op_or( right ); }
0094
0095
0096 inline const iNode& node() const { return *m_node; }
0097
0098
0099 inline bool node( const Gaudi::ParticleID& pid ) const { return node()( pid ); }
0100
0101
0102 Node& operator=( const Node& right );
0103
0104 Node& operator=( const iNode& right );
0105
0106 private:
0107 Node& op_and( const iNode& right );
0108 Node& op_or( const iNode& right );
0109
0110
0111 std::unique_ptr<iNode> m_node;
0112 };
0113
0114
0115
0116
0117
0118
0119
0120
0121 inline std::ostream& operator<<( std::ostream& s, const iNode& n ) { return n.fillStream( s ); }
0122
0123
0124
0125
0126
0127
0128 inline bool operator==( const Decays::iNode& node, const Gaudi::ParticleID& pid ) { return node( pid ); }
0129
0130
0131
0132
0133
0134
0135 inline bool operator==( const Gaudi::ParticleID& pid, const Decays::iNode& node ) { return node == pid; }
0136
0137
0138
0139
0140
0141
0142 inline bool operator!=( const Decays::iNode& node, const Gaudi::ParticleID& pid ) { return !( node == pid ); }
0143
0144
0145
0146
0147
0148
0149 inline bool operator!=( const Gaudi::ParticleID& pid, const Decays::iNode& node ) { return node != pid; }
0150
0151
0152
0153
0154
0155
0156
0157
0158 inline StatusCode operator+( const Decays::iNode& n, const Gaudi::Interfaces::IParticlePropertySvc* svc ) {
0159 return n.validate( svc );
0160 }
0161
0162
0163
0164
0165
0166
0167
0168
0169 inline StatusCode operator*( const Decays::iNode& n, const Gaudi::Interfaces::IParticlePropertySvc* svc ) {
0170 return n.validate( svc );
0171 }
0172 }