Loading...
Searching...
No Matches
bbm_embed_module.h
Go to the documentation of this file.
1#ifndef _BBM_EMBED_MODULE_H_
2#define _BBM_EMBED_MODULE_H_
3
4#include "bbm.h"
7
8
9/***********************************************************************/
10/*! \file bbm_embed_module.h
11 \brief Embed a static python module in the executable.
12
13 Requires BBM_NAME and BBM_CONFIG to be set. The module is automatically
14 embedded when included, and the bbm::embed namespace contains shorthand
15 for accessing the embedded bbm python module.
16
17************************************************************************/
18
19namespace detail {
21 {
23 #include "export/bbm_python.h"
24 #include "bbm_bsdfmodels.h"
25 #include "export/clear_export.h"
26 }
27} // end detail namespace
28
29
30namespace bbm {
31 namespace embed {
32
33 //! \brief Shorthand for the embedded config
34 using config = bbm::BBM_CONFIG;
35
36 //! \brief Shorthand for the interpreter operating on the embedded config
38
39 //! \brief Shorthand for the capture method on the embedded config
40 template<typename RET_TYPE>
41 inline RET_TYPE capture(const std::string& prog) { return bbm::python::capture<RET_TYPE, config>(prog); }
42
43 //! \brief Shorthand for the execute method on the embedded config
44 inline void execute(const std::string& prog) { bbm::python::execute<config>(prog); }
45
46 } // end embed namespace
47} // end bbm namespace
48
49#endif /* _BBM_EMBED_MODULE_H_ */
Include all modules and the backbone.
Python support for BBM.
Python interpreter for BBM modules.
Clears and defines the export macros.
void execute(const std::string &prog)
Shorthand for the execute method on the embedded config.
Definition: bbm_embed_module.h:44
RET_TYPE capture(const std::string &prog)
Shorthand for the capture method on the embedded config.
Definition: bbm_embed_module.h:41
bbm::BBM_CONFIG config
Shorthand for the embedded config.
Definition: bbm_embed_module.h:34
Definition: aggregatebsdf.h:29
Shorthand definitions for a python modules.
#define BBM_PYTHON_EMBED_MODULE
Create a python module (embedded in the object file) named BBN_PYTHON_MODULE_NAME.
Definition: python_macro.h:49
#define BBM_PYTHON_CORE
Import the core bbm python functionality.
Definition: python_macro.h:52
Python interpreter with BBM module imported.
Definition: bbm_python_interpreter.h:31