rogue
Loading...
Searching...
No Matches
module.cpp
Go to the documentation of this file.
1
18#include "rogue/Directives.h"
19
21
22#include <boost/python.hpp>
23
35
36namespace bp = boost::python;
38
40 // map the IO namespace to a sub-module
41 bp::object module(bp::handle<>(bp::borrowed(PyImport_AddModule("rogue.interfaces.memory"))));
42
43 // make "from mypackage import class1" work
44 bp::scope().attr("memory") = module;
45
46 // set the current scope to the new sub-module
47 bp::scope io_scope = module;
48
49 // Transaction constants
50 bp::scope().attr("Read") = rim::Read;
51 bp::scope().attr("Write") = rim::Write;
52 bp::scope().attr("Post") = rim::Post;
53 bp::scope().attr("Verify") = rim::Verify;
54
55 // Processing constants
56 bp::scope().attr("PyFunc") = rim::PyFunc;
57 bp::scope().attr("Bytes") = rim::Bytes;
58 bp::scope().attr("UInt") = rim::UInt;
59 bp::scope().attr("Int") = rim::Int;
60 bp::scope().attr("Bool") = rim::Bool;
61 bp::scope().attr("String") = rim::String;
62 bp::scope().attr("Float") = rim::Float;
63 bp::scope().attr("Double") = rim::Double;
64 bp::scope().attr("Fixed") = rim::Fixed;
65 bp::scope().attr("Custom") = rim::Custom;
66
67 rim::Master::setup_python();
68 rim::Slave::setup_python();
69 rim::Hub::setup_python();
70 rim::Transaction::setup_python();
71 rim::TransactionLock::setup_python();
72 rim::TcpClient::setup_python();
73 rim::TcpServer::setup_python();
74 rim::Block::setup_python();
75 rim::Variable::setup_python();
76 rim::Emulate::setup_python();
77}
static const uint8_t Fixed
Block access type for fixed-point numeric data.
Definition Constants.h:134
static const uint8_t Double
Block access type for double-precision (double) data.
Definition Constants.h:127
static const uint8_t Bytes
Block access type for raw byte data.
Definition Constants.h:85
static const uint32_t Read
Memory read transaction type.
Definition Constants.h:36
static const uint8_t UInt
Block access type for unsigned integer data.
Definition Constants.h:92
static const uint8_t String
Block access type for string data.
Definition Constants.h:113
static const uint8_t PyFunc
Block access type for Python callback functions.
Definition Constants.h:78
static const uint8_t Bool
Block access type for boolean data.
Definition Constants.h:106
static const uint32_t Write
Memory write transaction type.
Definition Constants.h:43
static const uint32_t Verify
Memory verify readback transaction type.
Definition Constants.h:57
static const uint8_t Custom
Block access type for custom handlers.
Definition Constants.h:141
static const uint8_t Float
Block access type for floating-point (float) data.
Definition Constants.h:120
static const uint32_t Post
Memory posted write transaction type.
Definition Constants.h:50
static const uint8_t Int
Block access type for signed integer data.
Definition Constants.h:99