|
| 1 | +/* |
| 2 | + * Copyright (C) 2025 EPAM Systems, Inc. |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + */ |
| 6 | + |
| 7 | +#ifndef AOS_CORE_SM_LAUNCHER_ITF_RUNTIME_HPP_ |
| 8 | +#define AOS_CORE_SM_LAUNCHER_ITF_RUNTIME_HPP_ |
| 9 | + |
| 10 | +#include <core/common/monitoring/itf/instancemonitoringprovider.hpp> |
| 11 | + |
| 12 | +namespace aos::sm::launcher { |
| 13 | + |
| 14 | +/** @addtogroup sm Service Manager |
| 15 | + * @{ |
| 16 | + */ |
| 17 | + |
| 18 | +/** |
| 19 | + * Runtime interface. |
| 20 | + */ |
| 21 | +class RuntimeItf : public monitoring::InstanceMonitoringProviderItf { |
| 22 | +public: |
| 23 | + /** |
| 24 | + * Destructor. |
| 25 | + */ |
| 26 | + virtual ~RuntimeItf() = default; |
| 27 | + |
| 28 | + /** |
| 29 | + * Starts runtime. |
| 30 | + * |
| 31 | + * @return Error. |
| 32 | + */ |
| 33 | + virtual Error Start() = 0; |
| 34 | + |
| 35 | + /** |
| 36 | + * Stops runtime. |
| 37 | + * |
| 38 | + * @return Error. |
| 39 | + */ |
| 40 | + virtual Error Stop() = 0; |
| 41 | + |
| 42 | + /** |
| 43 | + * Returns runtime info. |
| 44 | + * |
| 45 | + * @param[out] runtimeInfo runtime info. |
| 46 | + * @return Error. |
| 47 | + */ |
| 48 | + virtual Error GetInfo(RuntimeInfo& runtimeInfo) const = 0; |
| 49 | + |
| 50 | + /** |
| 51 | + * Start instance. |
| 52 | + * |
| 53 | + * @param instance instance to start. |
| 54 | + * @param[out] status instance status. |
| 55 | + * @return Error. |
| 56 | + */ |
| 57 | + virtual Error StartInstance(const InstanceInfo& instance, InstanceStatus& status) = 0; |
| 58 | + |
| 59 | + /** |
| 60 | + * Stop instance. |
| 61 | + * |
| 62 | + * @param instance instance to stop. |
| 63 | + * @param[out] status instance status. |
| 64 | + * @return Error. |
| 65 | + */ |
| 66 | + virtual Error StopInstance(const InstanceIdent& instance, InstanceStatus& status) = 0; |
| 67 | +}; |
| 68 | + |
| 69 | +/** |
| 70 | + * Runtime factory interface. |
| 71 | + */ |
| 72 | +class RuntimeFactoryItf { |
| 73 | +public: |
| 74 | + /** |
| 75 | + * Destructor. |
| 76 | + */ |
| 77 | + virtual ~RuntimeFactoryItf() = default; |
| 78 | + |
| 79 | + /** |
| 80 | + * Creates runtime from runtime info. |
| 81 | + * |
| 82 | + * @param runtimeInfo runtime info. |
| 83 | + * @param[out] runtime created runtime. |
| 84 | + * @return Error. |
| 85 | + */ |
| 86 | + virtual Error CreateRuntime(const RuntimeInfo& runtimeInfo, RuntimeItf& runtime) = 0; |
| 87 | +}; |
| 88 | + |
| 89 | +/** @} */ |
| 90 | + |
| 91 | +} // namespace aos::sm::launcher |
| 92 | + |
| 93 | +#endif |
0 commit comments