Fawkes API  Fawkes Development Version
openprs_inifin.h
1 
2 /***************************************************************************
3  * openprs_inifin.h - Fawkes OpenPRSAspect initializer/finalizer
4  *
5  * Created: Mon Aug 18 15:32:11 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. 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_INIFIN_H_
24 #define __PLUGINS_OPENPRS_ASPECT_OPENPRS_INIFIN_H_
25 
26 #include <aspect/inifins/inifin.h>
27 #include <plugins/openprs/aspect/openprs.h>
28 
29 #include <map>
30 #include <string>
31 
32 namespace fawkes {
33 #if 0 /* just to make Emacs auto-indent happy */
34 }
35 #endif
36 
37 class Logger;
38 class OpenPRSKernelManager;
39 class OpenPRSServerProxy;
40 class OpenPRSMessagePasserProxy;
41 
43 {
44  public:
47 
48  virtual void init(Thread *thread);
49  virtual void finalize(Thread *thread);
50 
51  void prepare(const std::string &fawkes_host, unsigned short fawkes_port,
52  LockPtr<OpenPRSKernelManager> &openprs_kernel_mgr,
53  OpenPRSServerProxy *openprs_server_proxy,
54  OpenPRSMessagePasserProxy *openprs_mp_proxy);
55 
56  void set_kernel_timeout(float timeout_sec);
57 
58  private:
59  std::string fawkes_host_;
60  unsigned short fawkes_port_;
61  LockPtr<OpenPRSKernelManager> openprs_kernel_mgr_;
62  OpenPRSComm *openprs_comm_;
63  OpenPRSServerProxy *openprs_server_proxy_;
64  OpenPRSMessagePasserProxy *openprs_mp_proxy_;
65 
66  float kernel_timeout_sec_;
67 };
68 
69 } // end namespace fawkes
70 
71 #endif
virtual void init(Thread *thread)
Initialize thread.
Proxy for the OpenPRS server communication.
virtual void finalize(Thread *thread)
Finalize thread.
OpenPRS communication wrapper.
Definition: openprs_comm.h:41
Fawkes library namespace.
Thread class encapsulation of pthreads.
Definition: thread.h:42
OpenPRSAspectIniFin()
Constructor.
LockPtr<> is a reference-counting shared lockable smartpointer.
Definition: lockptr.h:57
void prepare(const std::string &fawkes_host, unsigned short fawkes_port, LockPtr< OpenPRSKernelManager > &openprs_kernel_mgr, OpenPRSServerProxy *openprs_server_proxy, OpenPRSMessagePasserProxy *openprs_mp_proxy)
Prepare OpenPRS aspect initializer.
void set_kernel_timeout(float timeout_sec)
Set timeout for kernel creation.
Proxy for the OpenPRS server communication.
OpenPRSAspect initializer/finalizer.
Aspect initializer/finalizer base class.
Definition: inifin.h:36