1 /**
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 
20 namespace phosphor::power::regulators
21 {
22 
23 /**
24  * @class Rail
25  *
26  * A voltage rail produced by a voltage regulator.
27  *
28  * Voltage regulators produce one or more rails.  Each rail typically provides a
29  * different output voltage level, such as 1.1V.
30  */
31 class Rail
32 {
33   public:
34     // Specify which compiler-generated methods we want
35     Rail() = delete;
36     Rail(const Rail&) = delete;
37     Rail(Rail&&) = delete;
38     Rail& operator=(const Rail&) = delete;
39     Rail& operator=(Rail&&) = delete;
40     ~Rail() = default;
41 
42     /**
43      * Constructor.
44      *
45      * @param id unique rail ID
46      */
47     explicit Rail(const std::string& id) : id{id}
48     {
49     }
50 
51     /**
52      * Returns the unique ID of this rail.
53      *
54      * @return rail ID
55      */
56     const std::string& getID() const
57     {
58         return id;
59     }
60 
61   private:
62     /**
63      * Unique ID of this rail.
64      */
65     const std::string id{};
66 };
67 
68 } // namespace phosphor::power::regulators
69