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 
34 class Logger;
35 class OpenPRSKernelManager;
36 class OpenPRSServerProxy;
37 class OpenPRSMessagePasserProxy;
38 
40 {
41 public:
44 
45  virtual void init(Thread *thread);
46  virtual void finalize(Thread *thread);
47 
48  void prepare(const std::string & fawkes_host,
49  unsigned short fawkes_port,
50  LockPtr<OpenPRSKernelManager> &openprs_kernel_mgr,
51  OpenPRSServerProxy * openprs_server_proxy,
52  OpenPRSMessagePasserProxy * openprs_mp_proxy);
53 
54  void set_kernel_timeout(float timeout_sec);
55 
56 private:
57  std::string fawkes_host_;
58  unsigned short fawkes_port_;
59  LockPtr<OpenPRSKernelManager> openprs_kernel_mgr_;
60  OpenPRSComm * openprs_comm_;
61  OpenPRSServerProxy * openprs_server_proxy_;
62  OpenPRSMessagePasserProxy * openprs_mp_proxy_;
63 
64  float kernel_timeout_sec_;
65 };
66 
67 } // end namespace fawkes
68 
69 #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:37
Fawkes library namespace.
Thread class encapsulation of pthreads.
Definition: thread.h:45
LockPtr<> is a reference-counting shared lockable smartpointer.
Definition: lockptr.h:54
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:33