Fawkes API Fawkes Development Version
openprs.h
1
2/***************************************************************************
3 * openprs.h - OpenPRS aspect for Fawkes
4 *
5 * Created: Mon Aug 18 14:33:35 2014
6 * Copyright 2014 Tim Niemueller [www.niemueller.de]
7 *
8 ****************************************************************************/
9
10/* This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. A runtime exception applies to
14 * this software (see LICENSE.GPL_WRE file mentioned below for details).
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Library General Public License for more details.
20 *
21 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22 */
23
24#ifndef _PLUGINS_OPENPRS_ASPECT_OPENPRS_H_
25#define _PLUGINS_OPENPRS_ASPECT_OPENPRS_H_
26
27#include <aspect/aspect.h>
28#include <core/utils/lockptr.h>
29
30#include <list>
31#include <string>
32
33namespace fawkes {
34
35class OpenPRSComm;
36class OpenPRSAspectIniFin;
37
38class OpenPRSAspect : public virtual Aspect
39{
41
42public:
43 /** OPRS kernel operation mode. */
44 typedef enum {
45 OPRS, ///< command line mode
46 XOPRS ///< graphical mode
48
49 OpenPRSAspect(const char *kernel_name, Mode mode = OPRS, const char *local_name = NULL);
50 virtual ~OpenPRSAspect();
51
52 void add_openprs_data_path(const std::string &path);
53 void set_openprs_gdb_delay(const bool enable_gdb_delay);
54
55protected:
57 const std::string openprs_kernel_name;
59 const std::string openprs_local_name;
60
61private:
62 void init_OpenPRSAspect(LockPtr<OpenPRSComm> oprs_comm);
63 void finalize_OpenPRSAspect();
64
65 std::list<std::string> openprs_data_paths_;
66 bool openprs_gdb_delay_;
67};
68
69} // end namespace fawkes
70
71#endif
Fawkes aspect base class.
Definition: aspect.h:32
LockPtr<> is a reference-counting shared lockable smartpointer.
Definition: lockptr.h:55
OpenPRSAspect initializer/finalizer.
OpenPRS kernel creation and communication aspect.
Definition: openprs.h:39
LockPtr< OpenPRSComm > openprs
OpenPRS kernel communication wrapper.
Definition: openprs.h:56
void add_openprs_data_path(const std::string &path)
Add an OpenPRS data path.
Definition: openprs.cpp:92
const Mode openprs_kernel_mode
The kernel mode, can be OPRS or XOPRS (with graphical interface).
Definition: openprs.h:58
Mode
OPRS kernel operation mode.
Definition: openprs.h:44
@ XOPRS
graphical mode
Definition: openprs.h:46
@ OPRS
command line mode
Definition: openprs.h:45
const std::string openprs_local_name
The local message passer name for communication.
Definition: openprs.h:59
void set_openprs_gdb_delay(const bool enable_gdb_delay)
Enable/disable GDB delay.
Definition: openprs.cpp:106
virtual ~OpenPRSAspect()
Virtual empty destructor.
Definition: openprs.cpp:80
OpenPRSAspect(const char *kernel_name, Mode mode=OPRS, const char *local_name=NULL)
Constructor.
Definition: openprs.cpp:65
const std::string openprs_kernel_name
The name of the kernel created for this thread.
Definition: openprs.h:57
Fawkes library namespace.