![]() |
Dune-Fufem 2.11-git
|
Loading...
Searching...
No Matches
module.hh
Go to the documentation of this file.
201 handlePythonError("Module::run()", Dune::formatString("failed to execute the following code '%s'", code.c_str()));
static std::string formatString(const std::string &s, const T &... args)
void message(const std::string &msg)
#define DUNE_THROW(E,...)
Definition callable.hh:34
void run(const std::string &code)
Run python code given as string.
Definition common.hh:223
void handlePythonError(const std::string &origin, const std::string &message)
If a python error occurred throw an exception and clear python error indicator.
Definition common.hh:589
virtual void run(const std::string &code)
Run python code given as string.
Definition module.hh:197
virtual Module & operator=(const Reference &other)
Assignment.
Definition module.hh:180
Module importAs(Module module, const std::string &importedName)
Import another module into this one.
Definition module.hh:261
Reference evaluate(const std::string &expression)
Evaluate python expression given as string.
Definition module.hh:245
Module importAs(const std::string &moduleName, const std::string &importedName)
Import another module into this one.
Definition module.hh:279
AutoRunCodeStream runStream()
Obtain a stream to feed the code with multiple lines of python code.
Definition module.hh:213
Module(const Reference &other)
Construct Module from Reference.
Definition module.hh:160
void runFile(const std::string &fileName)
Run python code in file given by name.
Definition module.hh:228
static void assertModule(PyObject *p, const std::string &origin)
Assert that internal PyObject* is not NULL and module and raise exception otherwise.
Definition module.hh:323
A stream that executed all python code it is fed with on destruction.
Definition module.hh:61
AutoRunCodeStream()
Default constructor.
Definition module.hh:80
AutoRunCodeStream(const AutoRunCodeStream &other)
Copy constructor.
Definition module.hh:97
AutoRunCodeStream(Reference &module)
Default constructor.
Definition module.hh:86
~AutoRunCodeStream()
Destructor.
Definition module.hh:69
void set(const std::string &name, const V &value)
Set attribute of given name.
Definition reference.hh:258
Reference get(const std::string &name) const
Query attribute of given name.
Definition reference.hh:236
virtual Reference & operator=(const Reference &other)
Assignment.
Definition reference.hh:145
void assertPyObject(const std::string &origin) const
Assert that internal PyObject* is not NULL and raise exception otherwise.
Definition reference.hh:288
std::string str() const
String representation of this object.
Definition reference.hh:268
T c_str(T... args)
T endl(T... args)
