Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
local.h
1 
2 /***************************************************************************
3  * blackboard.h - BlackBoard plugin
4  *
5  * Generated: Sat Sep 16 17:09:15 2006 (on train to Cologne)
6  * Copyright 2006 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 __BLACKBOARD_LOCAL_H_
25 #define __BLACKBOARD_LOCAL_H_
26 
27 #include <blackboard/blackboard.h>
28 #include <core/exceptions/software.h>
29 
30 #include <list>
31 
32 namespace fawkes {
33 
34 class BlackBoardInterfaceManager;
35 class BlackBoardMemoryManager;
36 class BlackBoardMessageManager;
37 class BlackBoardNetworkHandler;
38 class BlackBoardNotifier;
39 class Interface;
40 class InterfaceInfoList;
41 class BlackBoardInterfaceListener;
42 class BlackBoardInterfaceObserver;
43 class FawkesNetworkHub;
44 
46 {
47  public:
48  LocalBlackBoard(size_t memsize);
49  LocalBlackBoard(size_t memsize, const char *magic_token,
50  bool master = true);
51  virtual ~LocalBlackBoard();
52 
53  virtual Interface * open_for_reading(const char *interface_type,
54  const char *identifier);
55  virtual Interface * open_for_writing(const char *interface_type,
56  const char *identifier);
57  virtual void close(Interface *interface);
58 
59  virtual InterfaceInfoList * list_all();
60  virtual InterfaceInfoList * list(const char *type_pattern,
61  const char *id_pattern);
62  virtual bool is_alive() const throw();
63  virtual bool try_aliveness_restore() throw();
64 
65  virtual std::list<Interface *>
66  open_multiple_for_reading(const char *type_pattern,
67  const char *id_pattern = "*");
68 
69  virtual void start_nethandler(FawkesNetworkHub *hub);
70 
71  static void cleanup(const char *magic_token, bool use_lister = false);
72 
73  /* for debugging only */
75 
76  private: /* members */
78  BlackBoardMemoryManager *__memmgr;
79  BlackBoardMessageManager *__msgmgr;
80  BlackBoardNetworkHandler *__nethandler;
81 };
82 
83 
84 } // end namespace fawkes
85 
86 #endif