Fawkes API Fawkes Development Version
openprs_kernel_manager.h
1
2/***************************************************************************
3 * openprs_kernel_manager.h - OpenPRS kernel manager
4 *
5 * Created: Mon Aug 18 15:12:57 2014
6 * Copyright 2006-2014 Tim Niemueller [www.niemueller.de]
7 ****************************************************************************/
8
9/* This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version. A runtime exception applies to
13 * this software (see LICENSE.GPL_WRE file mentioned below for details).
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Library General Public License for more details.
19 *
20 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
21 */
22
23#ifndef _PLUGINS_OPENPRS_ASPECT_OPENPRS_ENV_MANAGER_H_
24#define _PLUGINS_OPENPRS_ASPECT_OPENPRS_ENV_MANAGER_H_
25
26#include <core/utils/lockptr.h>
27
28#include <list>
29#include <map>
30#include <string>
31
32namespace fawkes {
33
34class Logger;
35class Clock;
36class Configuration;
37class SubProcess;
38
40{
41public:
42 OpenPRSKernelManager(const std::string &server_host,
43 unsigned short server_tcp_port,
44 const std::string &mp_host,
45 unsigned short mp_tcp_port,
46 Logger * logger,
47 Clock * clock,
48 Configuration * config);
49 virtual ~OpenPRSKernelManager();
50
51 void create_kernel(const std::string & kernel_name,
52 bool use_xoprs,
53 std::list<std::string> &extra_data_path,
54 bool utils_gdb_delay);
55 void destroy_kernel(const std::string &kernel_name);
56
57 std::list<std::string> kernels() const;
58
59 /** Get oprs-server hostname.
60 * @return hostname where oprs-server is running */
61 const std::string &
63 {
64 return server_host_;
65 }
66
67 /** Get oprs-server TCP port.
68 * @return TCP port where oprs-server is listening */
69 unsigned short
71 {
72 return server_port_;
73 }
74
75 /** Get mp-oprs hostname.
76 * @return hostname where mp-oprs is running */
77 const std::string &
78 mp_host() const
79 {
80 return mp_host_;
81 }
82
83 /** Get mp-oprs TCP port.
84 * @return TCP port where mp-oprs is listening */
85 unsigned short
86 mp_port() const
87 {
88 return mp_port_;
89 }
90
91private:
92 const std::string server_host_;
93 const unsigned short server_port_;
94 const std::string mp_host_;
95 const unsigned short mp_port_;
96
97 Logger * logger_;
98 Clock * clock_;
99 Configuration *config_;
100
101 std::map<std::string, fawkes::SubProcess *> kernels_;
102};
103
104} // end namespace fawkes
105
106#endif
This is supposed to be the central clock in Fawkes.
Definition: clock.h:35
Interface for configuration handling.
Definition: config.h:68
Interface for logging.
Definition: logger.h:42
unsigned short mp_port() const
Get mp-oprs TCP port.
virtual ~OpenPRSKernelManager()
Destructor.
OpenPRSKernelManager(const std::string &server_host, unsigned short server_tcp_port, const std::string &mp_host, unsigned short mp_tcp_port, Logger *logger, Clock *clock, Configuration *config)
Constructor.
std::list< std::string > kernels() const
Get map of kernels.
const std::string & server_host() const
Get oprs-server hostname.
void destroy_kernel(const std::string &kernel_name)
Destroy the named kernel.
void create_kernel(const std::string &kernel_name, bool use_xoprs, std::list< std::string > &extra_data_path, bool utils_gdb_delay)
Create a new kernel.
unsigned short server_port() const
Get oprs-server TCP port.
const std::string & mp_host() const
Get mp-oprs hostname.
Fawkes library namespace.