#include <Logic.h>
|
| virtual void | print (std::ostream &, size_t indSize, size_t indLevel) const override |
Definition at line 65 of file Logic.h.
◆ NodeType
◆ LogicLeaf() [1/2]
| TrigConf::LogicLeaf::LogicLeaf |
( |
| ) |
|
|
delete |
◆ LogicLeaf() [2/2]
| TrigConf::LogicLeaf::LogicLeaf |
( |
const std::string & | content | ) |
|
Definition at line 46 of file Logic.cxx.
46 :
48{
50}
void setContent(const std::string &content)
◆ ~LogicLeaf()
| virtual TrigConf::LogicLeaf::~LogicLeaf |
( |
| ) |
|
|
overridevirtualdefault |
◆ elements()
| std::map< std::string, bool > TrigConf::LogicLeaf::elements |
( |
| ) |
const |
|
overridevirtual |
◆ elementsCount()
| std::map< std::string, unsigned int > TrigConf::LogicLeaf::elementsCount |
( |
| ) |
const |
|
overridevirtual |
◆ evaluate() [1/2]
| bool TrigConf::LogicLeaf::evaluate |
( |
const std::map< std::string, bool > & | elements | ) |
const |
|
overridevirtual |
Implements TrigConf::Logic.
Definition at line 66 of file Logic.cxx.
66 {
67 auto stateForThisLeaf = elementsState.find(
m_content);
68 if( stateForThisLeaf == elementsState.end() ) {
69 throw LogicParsingException(std::string(
"Can't evaluate logic ") +
m_content +
" as it is missing in the state map");
70 }
71 return negate() ? !stateForThisLeaf->second : stateForThisLeaf->second;
72}
◆ evaluate() [2/2]
| bool TrigConf::LogicLeaf::evaluate |
( |
const std::map< std::string, unsigned int > & | elementsCount | ) |
const |
|
overridevirtual |
Implements TrigConf::Logic.
Definition at line 76 of file Logic.cxx.
76 {
79 throw LogicParsingException(std::string(
"Can't evaluate logic ") +
m_content +
" as " +
m_name +
" is missing in the counts map");
80 }
81 bool pass = stateForThisLeaf->second >=
m_count;
82 return negate() ? !pass : pass;
83}
std::map< std::string, unsigned int > elementsCount() const override
◆ expression()
| const std::string & TrigConf::Logic::expression |
( |
| ) |
const |
|
inherited |
◆ negate()
| bool TrigConf::Logic::negate |
( |
| ) |
const |
|
inherited |
◆ nodeType()
| NodeType TrigConf::Logic::nodeType |
( |
| ) |
const |
|
inlineinherited |
◆ print() [1/2]
| void TrigConf::Logic::print |
( |
std::ostream & | o = std::cout | ) |
const |
|
inherited |
Definition at line 37 of file Logic.cxx.
37 {
41 }
43}
void print(std::ostream &=std::cout) const
◆ print() [2/2]
| void TrigConf::LogicLeaf::print |
( |
std::ostream & | o, |
|
|
size_t | indSize, |
|
|
size_t | indLevel ) const |
|
overrideprivatevirtual |
◆ setContent()
| void TrigConf::LogicLeaf::setContent |
( |
const std::string & | content | ) |
|
Definition at line 54 of file Logic.cxx.
54 {
56 std::smatch sm;
57 if(!std::regex_match(content, sm,
re)){
58 throw std::invalid_argument("LogicLeaf::setContent: Invalid content '" + content + "'");
59 }
61 m_count = sm[2].length() > 0 ?
static_cast<unsigned int>(std::stoul(sm[2])) : 1;
62}
const boost::regex re(r_e)
◆ setExpression()
| void TrigConf::Logic::setExpression |
( |
const std::string & | expr | ) |
|
|
inherited |
◆ setNegate()
| void TrigConf::Logic::setNegate |
( |
bool | negate = true | ) |
|
|
inherited |
◆ m_content
| std::string TrigConf::LogicLeaf::m_content { "" } |
|
private |
◆ m_count
| unsigned int TrigConf::LogicLeaf::m_count { 1 } |
|
private |
◆ m_expression
| std::string TrigConf::Logic::m_expression { "" } |
|
privateinherited |
◆ m_name
| std::string TrigConf::LogicLeaf::m_name { "" } |
|
private |
◆ m_negate
| bool TrigConf::Logic::m_negate { false } |
|
privateinherited |
◆ m_nodeType
The documentation for this class was generated from the following files: