The MAUVE Toolchain
Deployer.hpp
1 /*
2  * Copyright 2017 ONERA
3  *
4  * This file is part of the MAUVE Runtime project.
5  *
6  * MAUVE Runtime is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License version 3 as
8  * published by the Free Software Foundation.
9  *
10  * MAUVE Runtime is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with MAUVE. If not, see <https://www.gnu.org/licenses/lgpl-3.0>.
17  */
18 #ifndef MAUVE_RUNTIME_DEPLOYER_HPP
19 #define MAUVE_RUNTIME_DEPLOYER_HPP
20 
21 #include <signal.h>
22 #include <vector>
23 #include <string>
24 
25 #include "AbstractDeployer.hpp"
26 
27 namespace mauve {
28  namespace runtime {
29 
34  template <typename ARCHI>
35  class Deployer final : public AbstractDeployer {
36  public:
37 
38  // ---------- Architecture ----------
39 
40  Architecture* get_architecture() override;
41 
46  inline ARCHI & architecture() const { return *_architecture; };
47 
48  // ---------- Manager ----------
49 
50  std::vector<std::string> manager_actions() const override;
51  bool manager_apply(std::string name) override;
52 
53  private:
54  template <typename A>
55  friend AbstractDeployer* mk_abstract_deployer(A* a, Manager<A>* m);
56 
57  template <typename A>
58  friend Deployer<A>* mk_deployer(A* a, Manager<A>* m);
59 
60  Deployer(ARCHI * architecture, Manager<ARCHI> * manager = nullptr);
61  ~Deployer() noexcept;
62 
63  ARCHI * _architecture;
64  Manager<ARCHI> * manager;
65  };
66 
67  template <typename ARCHI>
68  Deployer<ARCHI>* mk_deployer(ARCHI * architecture, Manager<ARCHI> * manager = nullptr);
69 
70  }
71 } // namespace
72 
73 #include "ipp/Deployer.ipp"
74 
75 #endif
Architecture class.
Definition: Architecture.hpp:41
std::vector< std::string > manager_actions() const override
Get the list of Manager actions.
Definition: Deployer.ipp:62
Abstract Deployer class.
Definition: AbstractDeployer.hpp:55
Architecture * get_architecture() override
Get the deployer architecture.
Definition: Deployer.ipp:55
The MAUVE namespace.
Definition: tracing.hpp:24
bool manager_apply(std::string name) override
Apply a Manager action.
Definition: Deployer.ipp:69
Deployer class deploying a specific architecture.
Definition: Deployer.hpp:35
Definition: AbstractDeployer.hpp:40
ARCHI & architecture() const
Get the deployer architecture.
Definition: Deployer.hpp:46