|
gtouchable
|
Represents an electronic module address (crate/slot/channel) with configurable comparison granularity. More...
#include <gelectronic.h>
Public Member Functions | |
| GElectronic (int c, int s, int ch, int m) | |
| Constructs a GElectronic with a specific hardware address and comparison mode. | |
| GElectronic () | |
| Default constructor. | |
| void | setHAddress (int c, int s, int ch) |
| Sets the hardware address fields (crate/slot/channel). | |
| std::vector< int > | getHAddress () |
| 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:
Example (mode == 1):
Typical usage:
Definition at line 32 of file gelectronic.h.
| GElectronic::GElectronic | ( | int | c, |
| int | s, | ||
| int | ch, | ||
| int | m ) |
| c | Crate number. |
| s | Slot number. |
| ch | Channel number. |
| m | Comparison mode:
|
Definition at line 10 of file gelectronic.cc.
| GElectronic::GElectronic | ( | ) |
Initializes the address and mode to the "uninitialized" sentinel used by the framework. This constructor exists because some containers (e.g. maps used by translation tables) require default-constructible value types.
Definition at line 14 of file gelectronic.cc.
| std::vector< int > GElectronic::getHAddress | ( | ) |
Definition at line 27 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 20 of file gelectronic.cc.
|
friend |
Prints the address fields in a human-readable form.
Definition at line 46 of file gelectronic.cc.