MicroModelicaCCompiler
4.5.3
|
#include <macros.hpp>
Public Member Functions | |
Macros (IR::Model &model, Util::Variable &variable) | |
Macros () | |
~Macros ()=default | |
std::string | print () const |
std::string | parameters (MACROS::Offset offset=MACROS::Modelica) const |
std::string | engineIndex () const |
std::string | engineIndexArguments () const |
std::string | arguments (bool state=true) const |
std::string | usage (std::string token, Option< IR::Range > range, int id) const |
std::string | indexMacro (std::string token, Option< IR::Range > range, int id) const |
std::string | modelAccess (int discretes, int algebraics) |
std::string | coeffMultipliers (int order) |
Protected Member Functions | |
void | initialize () |
Private Attributes | |
IR::Model | _model |
Util::Variable | _variable |
bool | _is_qss |
std::stringstream | _macros |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Macros &m) |
Definition at line 71 of file macros.hpp.
MicroModelica::Generator::Macros::Macros | ( | IR::Model & | model, |
Util::Variable & | variable | ||
) |
Definition at line 33 of file macros.cpp.
References _is_qss, _model, _variable, MicroModelica::IR::Model::annotations(), initialize(), MicroModelica::Util::Variable::isAlgebraic(), MicroModelica::IR::ModelAnnotation::isClassic(), and MicroModelica::Util::Variable::isState().
|
inline |
Definition at line 74 of file macros.hpp.
|
default |
string MicroModelica::Generator::Macros::arguments | ( | bool | state = true | ) | const |
Definition at line 61 of file macros.cpp.
References _is_qss, _model, _variable, MicroModelica::IR::Model::annotations(), MicroModelica::Util::Variable::dimensions(), MicroModelica::Util::Variable::isAlgebraic(), MicroModelica::Util::Variable::isDiscrete(), MicroModelica::Util::Variable::isEqType(), MicroModelica::Util::Variable::isOutput(), MicroModelica::Util::Variable::isState(), MicroModelica::Util::Variable::offset(), MicroModelica::IR::ModelAnnotation::polyCoeffs(), MicroModelica::Util::Variable::rowSize(), and MicroModelica::Util::Variable::size().
Referenced by engineIndexArguments(), indexMacro(), and initialize().
string MicroModelica::Generator::Macros::coeffMultipliers | ( | int | order | ) |
Definition at line 255 of file macros.cpp.
Referenced by MicroModelica::Generator::ModelInstance::configEvents().
string MicroModelica::Generator::Macros::engineIndex | ( | ) | const |
Definition at line 111 of file macros.cpp.
References _variable, and MicroModelica::Util::Variable::dimensions().
string MicroModelica::Generator::Macros::engineIndexArguments | ( | ) | const |
Definition at line 90 of file macros.cpp.
References _variable, arguments(), MicroModelica::Util::Variable::dimensions(), MicroModelica::Util::Variable::offset(), and MicroModelica::Util::Variable::rowSize().
Referenced by initialize().
string MicroModelica::Generator::Macros::indexMacro | ( | std::string | token, |
Option< IR::Range > | range, | ||
int | id | ||
) | const |
Definition at line 208 of file macros.cpp.
References arguments(), ModelTable< Key, Value >::begin(), ModelTable< Key, Value >::end(), ModelTable< Key, Value >::key(), and ModelTable< Key, Value >::next().
|
protected |
Definition at line 124 of file macros.cpp.
References _is_qss, _macros, _variable, MicroModelica::IR::FunctionPrinter::accessMacros(), arguments(), MicroModelica::Util::Variable::dimensions(), engineIndexArguments(), IS_STATE, MicroModelica::Util::Variable::isAlgebraic(), MicroModelica::Util::Variable::isDiscrete(), MicroModelica::Util::Variable::isEqType(), MicroModelica::Util::Variable::isOutput(), MicroModelica::Util::Variable::isParameter(), MicroModelica::Util::Variable::isState(), MicroModelica::Util::Variable::name(), MicroModelica::Util::Variable::offset(), parameters(), and MicroModelica::Util::Variable::print().
Referenced by Macros().
string MicroModelica::Generator::Macros::modelAccess | ( | int | discretes, |
int | algebraics | ||
) |
Definition at line 234 of file macros.cpp.
string MicroModelica::Generator::Macros::parameters | ( | MACROS::Offset | offset = MACROS::Modelica | ) | const |
Definition at line 39 of file macros.cpp.
References _is_qss, _variable, MicroModelica::Util::Variable::dimensions(), and MicroModelica::Generator::MACROS::Engine.
Referenced by MicroModelica::Generator::QSSModelInstance::generate(), and initialize().
std::string MicroModelica::Generator::Macros::print | ( | ) | const |
Definition at line 287 of file macros.cpp.
References _macros.
Referenced by MicroModelica::Generator::operator<<().
string MicroModelica::Generator::Macros::usage | ( | std::string | token, |
Option< IR::Range > | range, | ||
int | id | ||
) | const |
Definition at line 198 of file macros.cpp.
Referenced by MicroModelica::IR::FunctionPrinter::jacMacrosAccess().
|
friend |
Definition at line 289 of file macros.cpp.
|
private |
Definition at line 93 of file macros.hpp.
Referenced by arguments(), initialize(), Macros(), and parameters().
|
private |
Definition at line 94 of file macros.hpp.
Referenced by initialize(), and print().
|
private |
Definition at line 91 of file macros.hpp.
Referenced by arguments(), and Macros().
|
private |
Definition at line 92 of file macros.hpp.
Referenced by arguments(), engineIndex(), engineIndexArguments(), initialize(), Macros(), and parameters().