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 #include <string>
30 #include <list>
31 
32 namespace fawkes {
33 #if 0 /* just to make Emacs auto-indent happy */
34 }
35 #endif
36 
37 class OpenPRSComm;
38 
39 class OpenPRSAspect : public virtual Aspect
40 {
41  friend class OpenPRSAspectIniFin;
42 
43  public:
44  /** OPRS kernel operation mode. */
45  typedef enum {
46  OPRS, ///< command line mode
47  XOPRS ///< graphical mode
48  } Mode;
49 
50  OpenPRSAspect(const char *kernel_name, Mode mode = OPRS, const char *local_name = NULL);
51  virtual ~OpenPRSAspect();
52 
53  void add_openprs_data_path(const std::string &path);
54  void set_openprs_gdb_delay(const bool enable_gdb_delay);
55 
56  protected:
58  const std::string openprs_kernel_name;
59  const Mode openprs_kernel_mode;
60  const std::string openprs_local_name;
61 
62  private:
63  void init_OpenPRSAspect(LockPtr<OpenPRSComm> oprs_comm);
64  void finalize_OpenPRSAspect();
65 
66  std::list<std::string> openprs_data_paths_;
67  bool openprs_gdb_delay_;
68 
69 };
70 
71 } // end namespace fawkes
72 
73 #endif
const std::string openprs_local_name
The local message passer name for communication.
Definition: openprs.h:60
Mode
OPRS kernel operation mode.
Definition: openprs.h:45
Fawkes aspect base class.
Definition: aspect.h:34
Fawkes library namespace.
const std::string openprs_kernel_name
The name of the kernel created for this thread.
Definition: openprs.h:58
OpenPRS kernel creation and communication aspect.
Definition: openprs.h:39
LockPtr<> is a reference-counting shared lockable smartpointer.
Definition: lockptr.h:57
void set_openprs_gdb_delay(const bool enable_gdb_delay)
Enable/disable GDB delay.
Definition: openprs.cpp:109
graphical mode
Definition: openprs.h:47
void add_openprs_data_path(const std::string &path)
Add an OpenPRS data path.
Definition: openprs.cpp:94
virtual ~OpenPRSAspect()
Virtual empty destructor.
Definition: openprs.cpp:81
command line mode
Definition: openprs.h:46
LockPtr< OpenPRSComm > openprs
OpenPRS kernel communication wrapper.
Definition: openprs.h:57
OpenPRSAspect(const char *kernel_name, Mode mode=OPRS, const char *local_name=NULL)
Constructor.
Definition: openprs.cpp:68
const Mode openprs_kernel_mode
The kernel mode, can be OPRS or XOPRS (with graphical interface).
Definition: openprs.h:59
OpenPRSAspect initializer/finalizer.