Remove unused directories and files in video_in_hal
[staging/basesystem.git] / service / system / power_service / server / include / ss_power_session.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR 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
17 ///////////////////////////////////////////////////////////////////////////////
18 /// \ingroup  tag_PowerService
19 /// \brief    This file supports power service session management.
20 ///
21 ///////////////////////////////////////////////////////////////////////////////
22 #ifndef POWER_SERVICE_SERVER_INCLUDE_SS_POWER_SESSION_H_
23 #define POWER_SERVICE_SERVER_INCLUDE_SS_POWER_SESSION_H_
24
25 #include <system_service/ss_power_service.h>
26 #include <native_service/frameworkunified_types.h>
27 #include <map>
28 #include <string>
29 #include "ss_power_config.h"
30
31 typedef std::string SubscriberName;  // The name of the module that is trying to open a session with Power
32
33 /*
34  *
35  */
36 class PowerSessionHandler {
37  public:
38   PowerSessionHandler();
39   virtual ~PowerSessionHandler();
40   EFrameworkunifiedStatus OpenSesion(HANDLE h_app);
41   EFrameworkunifiedStatus CloseSession(HANDLE h_app);
42   EFrameworkunifiedStatus StartComplete(HANDLE h_app);
43   EFrameworkunifiedStatus StopComplete(HANDLE h_app);
44
45   VOID Print();
46
47   // Methods that do the heavy lifting
48   BOOL WakeupComplete(RequiredModuleList & wakeup_modules);  // NOLINT (runtime/references)
49   BOOL ShutdownComplete(RequiredModuleList & shutdown_modules);  // NOLINT (runtime/references)
50   EFrameworkunifiedStatus SendToSupervisor(UI_32 cmd, UI_32 length, PVOID data);
51   BOOL AllClientsInGroupStarted(UI_32 f_ungrpid);
52   BOOL ClientPresent(PCSTR f_sclientname);
53
54  private:
55   struct PwSessionInfo {
56     std::string sz_name;
57     std::string sz_servicename;
58     HANDLE hsession;
59     BOOL frunning;
60     EPWR_SESSION_TYPE esessiontype;
61     UI_32 ui_groupid;
62   };
63
64   typedef std::map<SubscriberName, PwSessionInfo> PwSessionMap;
65   typedef PwSessionMap::iterator PwSessionIter;
66
67   PwSessionMap m_mapSessions;
68 };
69
70 #endif  // POWER_SERVICE_SERVER_INCLUDE_SS_POWER_SESSION_H_