8 A group of gate pins made up of a name, the pins, a pin order, and a start index.
11 py_gate_pin_group.def(py::self == py::self, R"(
12 Check whether two gate pin groups are equal.
14 :returns: ``True`` if both gate pin groups are equal, ``False`` otherwise.
18 py_gate_pin_group.def(py::self != py::self, R"(
19 Check whether two gate pin groups are unequal.
21 :returns: ``True`` if both gate pin groups are unequal, ``False`` otherwise.
26 Python requires hash for set and dict container.
33 The ID of the gate pin group. The ID is unique within a gate type.
39 Get the ID of the gate pin group. The ID is unique within a gate type.
41 :returns: The ID of the pin group.
46 The name of the pin group.
52 Get the name of the pin group.
54 :returns: The name of the pin group.
59 The direction of the pin group.
61 :type: hal_py.PinDirection
65 Get the direction of the pin group.
67 :returns: The direction of the pin group.
68 :rtype: hal_py.PinDirection
72 The type of the pin group.
78 Get the type of the pin group.
80 :returns: The type of the pin group.
81 :rtype: hal_py.PinType
84 py_gate_pin_group.def_property_readonly("pins", [](
const PinGroup<GatePin>&
self) -> std::vector<GatePin*> {
return self.get_pins(
nullptr); }, R
"(
85 The (ordered) pins of the pin groups.
87 :type: list[hal_py.GatePin]
91 Get the (ordered) pins of the pin groups.
92 The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
94 :param lambda filter: An optional filter.
95 :returns: The ordered pins.
96 :rtype: list[hal_py.GatePin]
99 py_gate_pin_group.def(
102 auto res =
self.get_pin_at_index(
index);
109 log_error(
"python_context",
"{}", res.get_error().get());
115 Get the pin specified by the given index.
117 :param int index: The index of the pin within the pin group.
118 :returns: The pin on success, ``None`` otherwise.
119 :rtype: hal_py.GatePin or None
122 py_gate_pin_group.def(
125 auto res =
self.get_index(pin);
128 return (
i32)res.get();
132 log_error(
"python_context",
"{}", res.get_error().get());
138 Get the index within the pin group of the given pin.
140 :param hal_py.GatePin pin: The pin
141 :returns: The index of the pin on success, -1 otherwise.
146 Check whether the pin group contains the given pin.
148 :param hal_py.GatePin pin: The pin to check.
149 :returns: ``True`` if the pin group contains the pin, ``False`` otherwise.
154 ``True`` if the pin order of a pin group comprising n pins is ascending, e.g., from index ``0`` to ``n-1``, ``False`` otherwise.
160 Check whether the pin order of a pin group comprising n pins is ascending, e.g., from index ``0`` to ``n-1``.
162 :returns: ``True`` for ascending bit order, ``False`` otherwise.
167 ``True`` if the pin order of a pin group comprising n pins is descending, e.g., from index ``n-1`` to ``0``, ``False`` otherwise.
173 Check whether the pin order of a pin group comprising n pins is descending, e.g., from index ``n-1`` to ``0``.
175 :returns: ``True`` for descending bit order, ``False`` otherwise.
180 The numerically lowest index of the pin group.
186 Get the numerically lowest index of the pin group.
188 :returns: The lowest index.
193 The numerically highest index of the pin group.
199 Get the numerically highest index of the pin group.
201 :returns: The highest index.
206 The start index of the pin group.
207 For ascending pin groups, this index equals the lowest index of the pin group.
208 For descending pin groups, it is equal to the highest index of the pin group.
214 Get the start index of the pin group.
215 For ascending pin groups, this index equals the lowest index of the pin group.
216 For descending pin groups, it is equal to the highest index of the pin group.
218 :returns: The start index.
223 ``True`` if the pin group is inherently ordered, ``False`` otherwise.
229 Check whether the pin group features an inherent order.
231 :returns: ``True`` if the pin group is inherently ordered, ``False`` otherwise.
236 Check whether the pin group is empty, i.e., contains no pins.
238 :returns: ``True`` if the pin group is empty, ``False`` otherwise.
243 Get the size, i.e., the number of pins, of the pin group.
245 :returns: The size of the pin group.
void gate_pin_group_init(py::module &m)
std::unique_ptr< T, py::nodelete > RawPtrWrapper
#define log_error(channel,...)
const Module * module(const Gate *g, const NodeBoxes &boxes)