MicroModelicaCCompiler  4.5.3
MicroModelica::IR::Event Class Reference

#include <event.hpp>

Collaboration diagram for MicroModelica::IR::Event:

Public Member Functions

 Event ()
 
 Event (AST_Expression cond, int id, int offset, Option< Range > range, std::string event_id)
 
 ~Event ()=default
 
Equation zeroCrossing ()
 
StatementTable positiveHandler ()
 
StatementTable negativeHandler ()
 
std::string handler (EVENT::Type type) const
 
void add (AST_Statement)
 
bool compare (AST_Expression zc)
 
bool hasRange ()
 
std::string macro () const
 
int id () const
 
Expression exp ()
 This method returns the range expression of the event. More...
 
bool isValid () const
 
std::string config () const
 
Option< Rangerange () const
 
bool compareEventID (std::string event_id)
 

Private Member Functions

AST_Expression getExpression (AST_Expression zc)
 

Private Attributes

Equation _zero_crossing
 
StatementTable _positive_handler
 
StatementTable _negative_handler
 
EVENT::Type _type
 
EVENT::Type _current
 
EVENT::Relation _zc_relation
 
Option< Range_range
 
int _positive_handler_id
 
int _negative_handler_id
 
int _id
 
int _offset
 
std::string _event_id
 

Detailed Description

Definition at line 84 of file event.hpp.

Constructor & Destructor Documentation

◆ Event() [1/2]

MicroModelica::IR::Event::Event ( )

Definition at line 52 of file event.cpp.

References MicroModelica::IR::EQUATION::ZeroCrossing.

◆ Event() [2/2]

MicroModelica::IR::Event::Event ( AST_Expression  cond,
int  id,
int  offset,
Option< Range range,
std::string  event_id 
)

◆ ~Event()

MicroModelica::IR::Event::~Event ( )
default

Member Function Documentation

◆ add()

void MicroModelica::IR::Event::add ( AST_Statement  stm)

◆ compare()

bool MicroModelica::IR::Event::compare ( AST_Expression  zc)

Definition at line 99 of file event.cpp.

References AST_ListFirst(), exp(), EXPOUTPUT, and getExpression().

Referenced by MicroModelica::IR::Model::addEvent().

Here is the call graph for this function:

◆ compareEventID()

bool MicroModelica::IR::Event::compareEventID ( std::string  event_id)

Definition at line 180 of file event.cpp.

◆ config()

string MicroModelica::IR::Event::config ( ) const

Definition at line 162 of file event.cpp.

References _event_id.

◆ exp()

Expression MicroModelica::IR::Event::exp ( )

This method returns the range expression of the event.

        The range is computed from the LHS of the zero crossing
        function associated with the event.
Returns
Expression with the LHS used in graph builders.

Definition at line 156 of file event.cpp.

References _range.

Referenced by compare().

◆ getExpression()

AST_Expression MicroModelica::IR::Event::getExpression ( AST_Expression  zc)
private

Definition at line 117 of file event.cpp.

References _range, and block.

Referenced by compare().

◆ handler()

string MicroModelica::IR::Event::handler ( EVENT::Type  type) const

Definition at line 125 of file event.cpp.

References block.

◆ hasRange()

bool MicroModelica::IR::Event::hasRange ( )
inline

Definition at line 96 of file event.hpp.

◆ id()

int MicroModelica::IR::Event::id ( ) const
inline

Definition at line 98 of file event.hpp.

◆ isValid()

bool MicroModelica::IR::Event::isValid ( ) const
inline

Definition at line 108 of file event.hpp.

◆ macro()

string MicroModelica::IR::Event::macro ( ) const

Definition at line 154 of file event.cpp.

◆ negativeHandler()

StatementTable MicroModelica::IR::Event::negativeHandler ( )
inline

Definition at line 92 of file event.hpp.

◆ positiveHandler()

StatementTable MicroModelica::IR::Event::positiveHandler ( )
inline

Definition at line 91 of file event.hpp.

◆ range()

Option<Range> MicroModelica::IR::Event::range ( ) const
inline

Definition at line 110 of file event.hpp.

◆ zeroCrossing()

Equation MicroModelica::IR::Event::zeroCrossing ( )
inline

Definition at line 90 of file event.hpp.

Referenced by MicroModelica::Deps::EVSelector::isAlgebraic().

Member Data Documentation

◆ _current

EVENT::Type MicroModelica::IR::Event::_current
private

Definition at line 119 of file event.hpp.

Referenced by add().

◆ _event_id

std::string MicroModelica::IR::Event::_event_id
private

Definition at line 126 of file event.hpp.

Referenced by config().

◆ _id

int MicroModelica::IR::Event::_id
private

Definition at line 124 of file event.hpp.

◆ _negative_handler

StatementTable MicroModelica::IR::Event::_negative_handler
private

Definition at line 117 of file event.hpp.

◆ _negative_handler_id

int MicroModelica::IR::Event::_negative_handler_id
private

Definition at line 123 of file event.hpp.

◆ _offset

int MicroModelica::IR::Event::_offset
private

Definition at line 125 of file event.hpp.

◆ _positive_handler

StatementTable MicroModelica::IR::Event::_positive_handler
private

Definition at line 116 of file event.hpp.

◆ _positive_handler_id

int MicroModelica::IR::Event::_positive_handler_id
private

Definition at line 122 of file event.hpp.

◆ _range

Option<Range> MicroModelica::IR::Event::_range
private

Definition at line 121 of file event.hpp.

Referenced by exp(), and getExpression().

◆ _type

EVENT::Type MicroModelica::IR::Event::_type
private

Definition at line 118 of file event.hpp.

Referenced by add().

◆ _zc_relation

EVENT::Relation MicroModelica::IR::Event::_zc_relation
private

Definition at line 120 of file event.hpp.

◆ _zero_crossing

Equation MicroModelica::IR::Event::_zero_crossing
private

Definition at line 115 of file event.hpp.


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