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
LocalBlackBoard(size_t memsize)
Heap Memory Constructor.
Definition: local.cpp:74
static void cleanup(const char *magic_token, bool use_lister=false)
Cleanup orphaned BlackBoard segments.
Definition: local.cpp:177
virtual InterfaceInfoList * list_all()
Get list of all currently existing interfaces.
Definition: local.cpp:143
BlackBoard memory manager.
virtual Interface * open_for_writing(const char *interface_type, const char *identifier)
Open interface for writing.
Definition: local.cpp:113
Local BlackBoard.
Definition: local.h:45
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:80
virtual bool is_alive() const
Check if the BlackBoard is still alive.
Definition: local.cpp:157
const BlackBoardMemoryManager * memory_manager() const
Get memory manager.
Definition: local.cpp:198
Fawkes Network Hub.
Definition: hub.h:33
virtual void start_nethandler(FawkesNetworkHub *hub)
Start network handler.
Definition: local.cpp:209
Interface information list.
virtual InterfaceInfoList * list(const char *type_pattern, const char *id_pattern)
Get list of interfaces matching type and ID patterns.
Definition: local.cpp:150
virtual Interface * open_for_reading(const char *interface_type, const char *identifier)
Open interface for reading.
Definition: local.cpp:102
virtual void close(Interface *interface)
Close interface.
Definition: local.cpp:136
BlackBoard message manager.
The BlackBoard abstract class.
Definition: blackboard.h:49
BlackBoard Network Handler.
Definition: handler.h:45
virtual ~LocalBlackBoard()
Destructor.
Definition: local.cpp:88
virtual std::list< Interface * > open_multiple_for_reading(const char *type_pattern, const char *id_pattern="*")
Open multiple interfaces for reading.
Definition: local.cpp:124
BlackBoard interface manager.
virtual bool try_aliveness_restore()
Try to restore the aliveness of the BlackBoard instance.
Definition: local.cpp:164