Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
iv::logics::LogicExpression Class Reference

#include <LogicExpression.hpp>

Classes

struct  DefaultValues
 
struct  Keys
 
struct  Sections
 

Public Member Functions

 LogicExpression ()=default
 
 LogicExpression (const std::string &expression, const std::map< std::string, std::weak_ptr< iv::channels::AbstractChannel > > &variables)
 
 LogicExpression (const LogicExpression &other)
 
 LogicExpression (LogicExpression &&other) noexcept
 
 ~LogicExpression ()=default
 
LogicExpressionoperator= (const LogicExpression &other)
 
LogicExpressionoperator= (LogicExpression &&other) noexcept
 
bool operator== (const LogicExpression &) const
 
bool load (const iv::file::xml::node &nodeLogicExpression)
 
bool save (iv::file::xml::node &nodeLogicExpression) const
 
bool compile (std::string &errorMessage)
 
std::optional< iv::types::channelValueevaluate ()
 
std::string getStrExpression () const
 
std::map< std::string, std::weak_ptr< iv::channels::AbstractChannel > > getVariables () const
 
bool setVariableChannel (const std::string &variableName, const std::weak_ptr< iv::channels::AbstractChannel > &channel)
 

Static Public Member Functions

static bool getErrorAndVariables (const std::string &expr, std::string &errorMessage, std::set< std::string > &variables)
 

Private Types

typedef exprtk::symbol_table< iv::types::channelValuesymbol_table_t
 
typedef exprtk::expression< iv::types::channelValueexpression_t
 
typedef exprtk::parser< iv::types::channelValueparser_t
 

Private Attributes

std::string strExpression
 
std::map< std::string, std::weak_ptr< iv::channels::AbstractChannel > > m_variables
 
expression_t expression
 
symbol_table_t symbolTable
 

Member Typedef Documentation

◆ expression_t

◆ parser_t

◆ symbol_table_t

Constructor & Destructor Documentation

◆ LogicExpression() [1/4]

iv::logics::LogicExpression::LogicExpression ( )
default

◆ LogicExpression() [2/4]

iv::logics::LogicExpression::LogicExpression ( const std::string & expression,
const std::map< std::string, std::weak_ptr< iv::channels::AbstractChannel > > & variables )

◆ LogicExpression() [3/4]

iv::logics::LogicExpression::LogicExpression ( const LogicExpression & other)

◆ LogicExpression() [4/4]

iv::logics::LogicExpression::LogicExpression ( LogicExpression && other)
noexcept

◆ ~LogicExpression()

iv::logics::LogicExpression::~LogicExpression ( )
default

Member Function Documentation

◆ compile()

bool iv::logics::LogicExpression::compile ( std::string & errorMessage)

◆ evaluate()

std::optional< iv::types::channelValue > iv::logics::LogicExpression::evaluate ( )
nodiscard

◆ getErrorAndVariables()

bool iv::logics::LogicExpression::getErrorAndVariables ( const std::string & expr,
std::string & errorMessage,
std::set< std::string > & variables )
static

◆ getStrExpression()

std::string iv::logics::LogicExpression::getStrExpression ( ) const
nodiscard

◆ getVariables()

std::map< std::string, std::weak_ptr< iv::channels::AbstractChannel > > iv::logics::LogicExpression::getVariables ( ) const
nodiscard

◆ load()

bool iv::logics::LogicExpression::load ( const iv::file::xml::node & nodeLogicExpression)

◆ operator=() [1/2]

LogicExpression & iv::logics::LogicExpression::operator= ( const LogicExpression & other)

◆ operator=() [2/2]

LogicExpression & iv::logics::LogicExpression::operator= ( LogicExpression && other)
noexcept

◆ operator==()

bool iv::logics::LogicExpression::operator== ( const LogicExpression & other) const

◆ save()

bool iv::logics::LogicExpression::save ( iv::file::xml::node & nodeLogicExpression) const

◆ setVariableChannel()

bool iv::logics::LogicExpression::setVariableChannel ( const std::string & variableName,
const std::weak_ptr< iv::channels::AbstractChannel > & channel )

Member Data Documentation

◆ expression

expression_t iv::logics::LogicExpression::expression
private

◆ m_variables

std::map<std::string, std::weak_ptr<iv::channels::AbstractChannel> > iv::logics::LogicExpression::m_variables
private

◆ strExpression

std::string iv::logics::LogicExpression::strExpression
private

◆ symbolTable

symbol_table_t iv::logics::LogicExpression::symbolTable
private

The documentation for this class was generated from the following files: