summaryrefslogtreecommitdiff
path: root/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h')
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h48
1 files changed, 26 insertions, 22 deletions
diff --git a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
index f1f29471e6..62fc10cf7f 100644
--- a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
+++ b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
@@ -10,37 +10,41 @@
namespace app_launch {
class AppLaunchCtrlImpl;
-class DeviceAppsLauncherImpl;
+class DeviceAppsLauncher;
class AppsLauncher;
class AppLaunchSettings;
-/**
- * @brief The MultipleAppsLauncher struct
- * should manage launching applications and gaps between launching application
- * on one device
- * When all apps launched it will notify AppLaunchCtrlImpl that all apps
- * launched
- */
-class DeviceAppsLauncher {
+class Launcher;
+class LauncherGenerator;
+
+// impl class must be defined for unique_ptr in DeviceAppsLauncher
+class DeviceAppsLauncherImpl {
public:
- DeviceAppsLauncher(application_manager::ApplicationManager& app_mngr,
- app_launch::AppsLauncher& apps_launcher,
- const AppLaunchSettings& settings);
+ DeviceAppsLauncherImpl(DeviceAppsLauncher& interface,
+ AppsLauncher& apps_launcher);
bool LaunchAppsOnDevice(
const std::string& device_mac,
const std::vector<ApplicationDataPtr>& applications_to_launch);
- bool StopLaunchingAppsOnDevice(const std::string& device_mac);
- const AppLaunchSettings& settings() const;
+ struct LauncherFinder {
+ LauncherFinder(const std::string& device_mac) : device_mac_(device_mac) {}
+
+ bool operator()(const utils::SharedPtr<Launcher>& launcher) const;
+
+ std::string device_mac_;
+ };
+
+ bool StopLaunchingAppsOnDevice(const std::string& device_mac);
private:
- application_manager::ApplicationManager& app_mngr_;
- const AppLaunchSettings& settings_;
- std::auto_ptr<DeviceAppsLauncherImpl> impl_;
- friend class DeviceAppsLauncherImpl;
- DISALLOW_COPY_AND_ASSIGN(DeviceAppsLauncher);
+ sync_primitives::Lock launchers_lock_;
+ std::vector<utils::SharedPtr<Launcher> > free_launchers_;
+ std::vector<utils::SharedPtr<Launcher> > works_launchers_;
+ DeviceAppsLauncher& interface_;
};
-} // namespace app_launch
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_DEVICE_APPS_LAUNCHER_H_
+/**
+ * @brief The MultipleAppsLauncher struct
+ * should manage launching applications and gaps between launching application
+ * on one device
+ * When all apps launched it will notify AppLaunchCtrlImpl \ No newline at end of file