gtouchable
Loading...
Searching...
No Matches
gelectronic.h
Go to the documentation of this file.
1#pragma once
2
3#include <ostream>
4#include <stdexcept>
5#include <vector>
6
11
36{
37public:
44
53 GElectronic(int c, int s, int ch, ComparisonMode comparison_mode);
54
64 void setHAddress(int c, int s, int ch);
65
71 [[nodiscard]] std::vector<int> getHAddress() const;
72
73private:
74 static void validateHAddress(int crate, int slot, int channel);
75
76 int crate;
77 int slot;
78 int channel;
79 ComparisonMode mode;
80
89 bool operator==(const GElectronic& ge) const;
90
96 friend std::ostream& operator<<(std::ostream& stream, const GElectronic& ge);
97};
Represents an electronic module address (crate/slot/channel) with configurable comparison granularity...
Definition gelectronic.h:36
GElectronic(int c, int s, int ch, ComparisonMode comparison_mode)
Constructs a GElectronic with a specific hardware address and comparison mode.
Definition gelectronic.cc:7
void setHAddress(int c, int s, int ch)
Sets the hardware address fields (crate/slot/channel).
friend std::ostream & operator<<(std::ostream &stream, const GElectronic &ge)
Stream output helper for diagnostics and logging.
std::vector< int > getHAddress() const
Returns the hardware address as a vector of three integers.
ComparisonMode
Selects which hardware-address fields participate in comparison.
Definition gelectronic.h:39