23 py::gil_scoped_release release;
30 auto teAbstractor = acc.
getTE();
31 _impl.add(teAbstractor);
37 auto te = acc.
getTE();
38 py::gil_scoped_release release;
45 std::vector<TransferElementID> ids(args.size());
46 std::transform(args.begin(), args.end(), ids.begin(),
47 [](
const py::handle& acc) { return acc.cast<PyTransferElementBase&>().getTE().getId(); });
48 py::gil_scoped_release release;
49 _impl.readUntilAll(ids);
55 py::gil_scoped_release release;
56 return _impl.readAny();
62 return _impl.readAnyNonBlocking();
68 py::class_<PyReadAnyGroup>(mod,
"ReadAnyGroup")
70 .def(py::init<py::args>())
72 "Add register to group.\n\n Note that calling this function is only allowed before finalise() has been "
73 "called. The given register may not yet be part of a ReadAnyGroup or a TransferGroup, otherwise an "
74 "exception is thrown.\n\nThe register must be must be readable.",
77 "Wait until one of the elements in this group has received an update.\n\nThe function will return the "
78 "TransferElementID of the element which has received the update. If multiple updates are received at the "
79 "same time or if multiple updates were already present before the call to this function, the ID of the "
80 "first element receiving an update will be returned.\n\nOnly elements with AccessMode::wait_for_new_data "
81 "are used for waiting. Once an update has been received for one of these elements, the function will call "
82 "readLatest() on all elements without AccessMode::wait_for_new_data (this is equivalent to calling "
83 "processPolled()).\n\nBefore returning, the postRead action will be called on the TransferElement whose ID "
84 "is returned, so the read data will already be present in the user buffer. All other TransferElements in "
85 "this group will not be altered.\n\nBefore calling this function, finalise() must have been called, "
86 "otherwise the behaviour is undefined.")
88 "Read the next available update in the group, but do not block if no update is available.\n\nIf no update "
89 "is available, a default-constructed TransferElementID is returned after all poll-type elements in the "
90 "group have been updated.\n\nBefore calling this function, finalise() must have been called, otherwise the "
91 "behaviour is undefined.")
94 "Wait until the given TransferElement has received an update and store it to its user buffer.\n\nAll "
95 "updates of other elements which are received before the update of the given element will be processed and "
96 "are thus visible in the user buffers when this function returns.\n\nThe specified TransferElement must be "
97 "part of this ReadAnyGroup, otherwise the behaviour is undefined.\n\nThis is merely a convenience function "
98 "calling waitAny() in a loop until the ID of the given element is returned.\n\nBefore calling this "
99 "function, finalise() must have been called, otherwise the behaviour is undefined.",
102 "Wait until all of the given TransferElements has received an update and store it to its user "
103 "buffer.\n\nAll updates of other elements which are received before the update of the given element will "
104 "be processed and are thus visible in the user buffers when this function returns.\n\nThe specified "
105 "TransferElement must be part of this ReadAnyGroup, otherwise the behaviour is undefined.\n\nThis is "
106 "merely a convenience function calling waitAny() in a loop until the ID of the given element is "
107 "returned.\n\nBefore calling this function, finalise() must have been called, otherwise the behaviour is "
110 "Finalise the group.\n\nFrom this point on, add() may no longer be called. Only after the group has been "
111 "finalised the read functions of this group may be called. Also, after the group has been finalised, read "
112 "functions may no longer be called directly on the participating elements (including other copies of the "
113 "same element).\n\nThe order of update notifications will only be well-defined for updates which happen "
114 "after the call to finalise(). Any unread values which are present in the TransferElements when this "
115 "function is called will not be processed in the correct sequence. Only the sequence within each "
116 "TransferElement can be guaranteed. For any updates which arrive after the call to finalise() the correct "
117 "sequence will be guaranteed even accross TransferElements.\n\nThis function will call readAsync() on all "
118 "elements with AccessMode::wait_for_new_data in the group. There must be at least one transfer element "
119 "with AccessMode::wait_for_new_data in the group, otherwise an exception is thrown.")
121 "Convenience function to interrupt any running readAny/waitAny by calling interrupt on one of the "
122 "push-type TransferElements in the group.");
void readUntil(const TransferElementID &tid)
void readUntilAll(py::args args)
void readUntilAccessor(PyTransferElementBase &acc)
void add(PyTransferElementBase &acc)
TransferElementID readAny()
TransferElementID readAnyNonBlocking()
static void bind(py::module &mod)
virtual const TransferElementAbstractor & getTE() const =0
InvalidityTracer application module.