RMM API 2.0.0
Loading...
Searching...
No Matches
RingId.h
1#pragma once
2#include <cstddef>
3#include <cstdio>
4
10class RingId {
11 public:
15 static constexpr std::size_t MAX_NUM_RINGS = 12;
16
22 explicit RingId(std::size_t idx) : idx_(idx) {
23 if (idx >= MAX_NUM_RINGS) {
24 throw std::out_of_range("Invalid ring index");
25 }
26 }
27
32 std::size_t index() const noexcept { return idx_; }
33
34 private:
35 std::size_t idx_;
36};
RingId(std::size_t idx)
Constructs a RingId and validates the index.
Definition RingId.h:22
static constexpr std::size_t MAX_NUM_RINGS
Maximum number of rings supported by the RMM system.
Definition RingId.h:15
std::size_t index() const noexcept
Gets the raw numeric index of the ring.
Definition RingId.h:32