Fawkes API Fawkes Development Version
blackboard.h
1
2/***************************************************************************
3 * blackboard.h - External predicates to remotely access the Fawkes
4 * blackboard
5 *
6 * Created: Wed Mar 09 16:57:03 2011
7 * Copyright 2011 Daniel Beck
8 *
9 ****************************************************************************/
10
11/* This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
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 file in the doc directory.
22 */
23
24#ifndef _ECLIPSE_EXTERNALS_BLACKBOARD_H_
25#define _ECLIPSE_EXTERNALS_BLACKBOARD_H_
26
27#include <blackboard/remote.h>
28#include <logging/logger.h>
29
30#include <cstdio>
31#include <vector>
32
33/** @class fawkes::EclExternalBlackBoard
34 * Wrapper class for using the blackboard in the implementation of the external
35 * predicates.
36 * @author Daniel Beck
37 */
38namespace fawkes {
40{
41private:
42 /** Constructor.
43 * @param blackboard blackboard to use to open interfaces
44 */
46
47public:
48 /** Destructor. */
50
52 static void cleanup_instance();
54
56 std::map<std::string, Interface *> &interfaces();
57
58 /**
59 * @return A pointer to the plugin-central logger
60 */
61 static Logger *
63 {
64 return m_logger;
65 }
66
67 /**
68 * @return Name for logging
69 */
70 static const char *
72 {
73 return "EclExternalBlackBoard";
74 }
75
76private:
77 static EclExternalBlackBoard * m_instance;
78 std::map<std::string, Interface *> m_interfaces;
79 static BlackBoard * m_blackboard;
80 static Logger * m_logger;
81};
82} // namespace fawkes
83
84extern "C" int p_bb_open_interface();
85extern "C" int p_bb_close_interface();
86
87extern "C" int p_bb_has_writer();
88extern "C" int p_bb_instance_serial();
89
90extern "C" int p_bb_read_interfaces();
91extern "C" int p_bb_read_interface();
92extern "C" int p_bb_write_interfaces();
93extern "C" int p_bb_write_interface();
94extern "C" int p_bb_interface_changed();
95
96extern "C" int p_bb_get();
97extern "C" int p_bb_set();
98
99extern "C" int p_bb_send_message();
100extern "C" int p_bb_recv_messages();
101
102extern "C" int p_bb_observe_pattern();
103extern "C" int p_bb_listen_for_change();
104
105#endif
The BlackBoard abstract class.
Definition: blackboard.h:46
Wrapper class for using the blackboard in the implementation of the external predicates.
Definition: blackboard.h:40
static const char * name()
Definition: blackboard.h:71
std::map< std::string, Interface * > & interfaces()
Obtain the list of opened interfaces.
Definition: blackboard.cpp:101
static void create_initial_object(BlackBoard *bb, Logger *logger)
Creates the initial EclExternalBlackBoard object.
Definition: blackboard.cpp:64
~EclExternalBlackBoard()
Destructor.
Definition: blackboard.cpp:55
static Logger * logger()
Definition: blackboard.h:62
static BlackBoard * blackboard_instance()
Access the BlackBoard instance.
Definition: blackboard.cpp:92
static void cleanup_instance()
Delete the current EclExternalBlackBoard instance and set it to NULL.
Definition: blackboard.cpp:71
static EclExternalBlackBoard * instance()
Get the EclExternalBlackBoard instance.
Definition: blackboard.cpp:83
Interface for logging.
Definition: logger.h:42
Fawkes library namespace.