blob: 3fa516b45d0f6decbce4c197279194a4231cae37 [file] [log] [blame]
Shawn McCarneya2461b32019-10-24 18:53:01 -05001/**
2 * Copyright © 2019 IBM Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
18#include <string>
19
20namespace phosphor
21{
22namespace power
23{
24namespace regulators
25{
26
27/**
28 * @class Rail
29 *
30 * A voltage rail produced by a voltage regulator.
31 *
32 * Voltage regulators produce one or more rails. Each rail typically provides a
33 * different output voltage level, such as 1.1V.
34 */
35class Rail
36{
37 public:
38 // Specify which compiler-generated methods we want
39 Rail() = delete;
40 Rail(const Rail&) = delete;
41 Rail(Rail&&) = delete;
42 Rail& operator=(const Rail&) = delete;
43 Rail& operator=(Rail&&) = delete;
44 ~Rail() = default;
45
46 /**
47 * Constructor.
48 *
49 * @param id unique rail ID
50 */
51 Rail(const std::string& id) : id{id}
52 {
53 }
54
55 /**
56 * Returns the unique ID of this rail.
57 *
58 * @return rail ID
59 */
60 const std::string& getId() const
61 {
62 return id;
63 }
64
65 private:
66 /**
67 * Unique ID of this rail.
68 */
69 const std::string id{};
70};
71
72} // namespace regulators
73} // namespace power
74} // namespace phosphor