xref: /openbmc/phosphor-power/phosphor-power-sequencer/src/system.hpp (revision f1845c0621324fc8435a8e29377f0b1306e636b7)
1*068f8073SShawn McCarney /**
2*068f8073SShawn McCarney  * Copyright © 2025 IBM Corporation
3*068f8073SShawn McCarney  *
4*068f8073SShawn McCarney  * Licensed under the Apache License, Version 2.0 (the "License");
5*068f8073SShawn McCarney  * you may not use this file except in compliance with the License.
6*068f8073SShawn McCarney  * You may obtain a copy of the License at
7*068f8073SShawn McCarney  *
8*068f8073SShawn McCarney  *     http://www.apache.org/licenses/LICENSE-2.0
9*068f8073SShawn McCarney  *
10*068f8073SShawn McCarney  * Unless required by applicable law or agreed to in writing, software
11*068f8073SShawn McCarney  * distributed under the License is distributed on an "AS IS" BASIS,
12*068f8073SShawn McCarney  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*068f8073SShawn McCarney  * See the License for the specific language governing permissions and
14*068f8073SShawn McCarney  * limitations under the License.
15*068f8073SShawn McCarney  */
16*068f8073SShawn McCarney #pragma once
17*068f8073SShawn McCarney 
18*068f8073SShawn McCarney #include "chassis.hpp"
19*068f8073SShawn McCarney 
20*068f8073SShawn McCarney #include <memory>
21*068f8073SShawn McCarney #include <utility>
22*068f8073SShawn McCarney #include <vector>
23*068f8073SShawn McCarney 
24*068f8073SShawn McCarney namespace phosphor::power::sequencer
25*068f8073SShawn McCarney {
26*068f8073SShawn McCarney 
27*068f8073SShawn McCarney /**
28*068f8073SShawn McCarney  * @class System
29*068f8073SShawn McCarney  *
30*068f8073SShawn McCarney  * The computer system being controlled and monitored by the BMC.
31*068f8073SShawn McCarney  *
32*068f8073SShawn McCarney  * The system contains one or more chassis.
33*068f8073SShawn McCarney  */
34*068f8073SShawn McCarney class System
35*068f8073SShawn McCarney {
36*068f8073SShawn McCarney   public:
37*068f8073SShawn McCarney     System() = delete;
38*068f8073SShawn McCarney     System(const System&) = delete;
39*068f8073SShawn McCarney     System(System&&) = delete;
40*068f8073SShawn McCarney     System& operator=(const System&) = delete;
41*068f8073SShawn McCarney     System& operator=(System&&) = delete;
42*068f8073SShawn McCarney     ~System() = default;
43*068f8073SShawn McCarney 
44*068f8073SShawn McCarney     /**
45*068f8073SShawn McCarney      * Constructor.
46*068f8073SShawn McCarney      *
47*068f8073SShawn McCarney      * @param chassis Chassis in the system
48*068f8073SShawn McCarney      */
System(std::vector<std::unique_ptr<Chassis>> chassis)49*068f8073SShawn McCarney     explicit System(std::vector<std::unique_ptr<Chassis>> chassis) :
50*068f8073SShawn McCarney         chassis{std::move(chassis)}
51*068f8073SShawn McCarney     {}
52*068f8073SShawn McCarney 
53*068f8073SShawn McCarney     /**
54*068f8073SShawn McCarney      * Returns the chassis in the system.
55*068f8073SShawn McCarney      *
56*068f8073SShawn McCarney      * @return chassis
57*068f8073SShawn McCarney      */
getChassis() const58*068f8073SShawn McCarney     const std::vector<std::unique_ptr<Chassis>>& getChassis() const
59*068f8073SShawn McCarney     {
60*068f8073SShawn McCarney         return chassis;
61*068f8073SShawn McCarney     }
62*068f8073SShawn McCarney 
63*068f8073SShawn McCarney   private:
64*068f8073SShawn McCarney     /**
65*068f8073SShawn McCarney      * Chassis in the system.
66*068f8073SShawn McCarney      */
67*068f8073SShawn McCarney     std::vector<std::unique_ptr<Chassis>> chassis{};
68*068f8073SShawn McCarney };
69*068f8073SShawn McCarney 
70*068f8073SShawn McCarney } // namespace phosphor::power::sequencer
71