2 * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
10 * @brief CicoSCAppResourceController
11 * SystemController resource
12 * Application Resouce Controller
14 * @date Aug-05-2013 create start
17 #ifndef CICOSCAPPRESOURCECONTROLLER_H
18 #define CICOSCAPPRESOURCECONTROLLER_H
23 #include "CicoAilItems.h"
24 #include "CicoAulItems.h"
25 #include "CicoSCSysResourceController.h"
27 #define D_STRappResource "appResource.json"
28 #define DSTRcpu_shares "cpu_shares"
29 #define DSTRshare "share"
30 #define DSTRappid "appid"
32 * @brief System Controller Application Resource Controller class
34 class CicoSCAppResourceController : public CicoSCSysResourceController
37 CicoSCAppResourceController();
38 ~CicoSCAppResourceController();
40 bool initAppResource();
41 bool startAppResource(const std::string& un);
46 bool entryApp(const std::string& appid, int pid);
47 bool entryApps(std::vector<CicoAulItems>& vAulItem);
49 void getAppResourceFilePath(const std::string& un, std::string& fp) const;
50 void createAppResourceFile(const std::string& filepath);
52 bool orderApps(const std::string& filepath);
53 bool readApps(const std::string& filepath);
54 void init_cgroup_app_dir();
55 void init_cgroup_app_cpushare();
61 std::vector<std::string> m_vAppid;
62 std::vector<int> m_vShares;
63 std::string m_filepath;
66 inline bool CicoSCAppResourceController::isAppResource()
71 #endif // CICOSCAPPRESOURCECONTROLLER_H