|
gtouchable
|
Represents an electronic module address (crate/slot/channel) with configurable comparison granularity. More...
#include <gelectronic.h>
Public Types | |
| enum class | ComparisonMode { crate , crate_slot , crate_slot_channel } |
| Selects which hardware-address fields participate in comparison. More... | |
Public Member Functions | |
| GElectronic (int c, int s, int ch, ComparisonMode comparison_mode) | |
| Constructs a GElectronic with a specific hardware address and comparison mode. | |
| void | setHAddress (int c, int s, int ch) |
| Sets the hardware address fields (crate/slot/channel). | |
| std::vector< int > | getHAddress () const |
| Returns the hardware address as a vector of three integers. | |
Friends | |
| std::ostream & | operator<< (std::ostream &stream, const GElectronic &ge) |
| Stream output helper for diagnostics and logging. | |
A GElectronic instance encapsulates:
The comparison mode defines which parts of the address are considered significant when comparing two addresses:
crate: compare crate onlycrate_slot: compare crate and slotcrate_slot_channel: compare crate, slot, and channelExample (mode == crate_slot):
crate_slot_channel, those two would be different.Typical usage:
Definition at line 35 of file gelectronic.h.
|
strong |
| Enumerator | |
|---|---|
| crate | |
| crate_slot | |
| crate_slot_channel | |
Definition at line 39 of file gelectronic.h.
| GElectronic::GElectronic | ( | int | c, |
| int | s, | ||
| int | ch, | ||
| ComparisonMode | comparison_mode ) |
| c | Crate number. |
| s | Slot number. |
| ch | Channel number. |
| comparison_mode | Hardware-address comparison granularity. |
Definition at line 7 of file gelectronic.cc.
|
nodiscard |
Definition at line 29 of file gelectronic.cc.
| void GElectronic::setHAddress | ( | int | c, |
| int | s, | ||
| int | ch ) |
The comparison mode is not changed by this call.
| c | Crate number. |
| s | Slot number. |
| ch | Channel number. |
Definition at line 21 of file gelectronic.cc.
|
friend |
Prints the address fields in a human-readable form.
Definition at line 45 of file gelectronic.cc.