Fawkes API  Fawkes Development Version
openprs_agent_thread.h
1 
2 /***************************************************************************
3  * openprs_agent_thread.h - OpenPRS agent thread
4  *
5  * Created: Fri Aug 22 13:56:36 2014
6  * Copyright 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.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Library General Public License for more details.
18  *
19  * Read the full text in the LICENSE.GPL file in the doc directory.
20  */
21 
22 #ifndef _PLUGINS_OPENPRS_AGENT_OPENPRS_AGENT_THREAD_H_
23 #define _PLUGINS_OPENPRS_AGENT_OPENPRS_AGENT_THREAD_H_
24 
25 #include <aspect/blocked_timing.h>
26 #include <aspect/clock.h>
27 #include <aspect/configurable.h>
28 #include <aspect/logging.h>
29 #include <core/threading/thread.h>
30 #include <plugins/openprs/aspect/openprs.h>
31 
32 #include <string>
33 
34 class OpenPRSAgentThread : public fawkes::Thread,
35  public fawkes::LoggingAspect,
36  public fawkes::ClockAspect,
40 {
41 public:
42  OpenPRSAgentThread(OpenPRSAspect::Mode oprs_mode, bool gdb_delay);
43  virtual ~OpenPRSAgentThread();
44 
45  virtual void init();
46  virtual void loop();
47  virtual void finalize();
48 
49  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
50 protected:
51  virtual void
52  run()
53  {
54  Thread::run();
55  }
56 
57 private: // methods
58  void handle_message(std::string sender, std::string message);
59 
60 private: // members
61  std::string cfg_agent_;
62  bool agent_alive_;
63 };
64 
65 #endif
fawkes::OpenPRSAspect
Definition: openprs.h:42
fawkes::BlockedTimingAspect
Definition: blocked_timing.h:54
OpenPRSAgentThread::run
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition: openprs_agent_thread.h:55
OpenPRSAgentThread
Definition: openprs_agent_thread.h:33
OpenPRSAgentThread::~OpenPRSAgentThread
virtual ~OpenPRSAgentThread()
Destructor.
Definition: openprs_agent_thread.cpp:51
fawkes::LoggingAspect
Definition: logging.h:36
OpenPRSAgentThread::init
virtual void init()
Initialize the thread.
Definition: openprs_agent_thread.cpp:56
fawkes::Thread
Definition: thread.h:44
OpenPRSAgentThread::OpenPRSAgentThread
OpenPRSAgentThread(OpenPRSAspect::Mode oprs_mode, bool gdb_delay)
Constructor.
Definition: openprs_agent_thread.cpp:41
fawkes::ConfigurableAspect
Definition: configurable.h:36
OpenPRSAgentThread::finalize
virtual void finalize()
Finalize the thread.
Definition: openprs_agent_thread.cpp:71
fawkes::ClockAspect
Definition: clock.h:38
OpenPRSAgentThread::loop
virtual void loop()
Code to execute in the thread.
Definition: openprs_agent_thread.cpp:76