Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * blackboard.h - BlackBoard plugin 00004 * 00005 * Generated: Sat Sep 16 17:09:15 2006 (on train to Cologne) 00006 * Copyright 2006 Tim Niemueller [www.niemueller.de] 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. A runtime exception applies to 00014 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Library General Public License for more details. 00020 * 00021 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00022 */ 00023 00024 #ifndef __BLACKBOARD_LOCAL_H_ 00025 #define __BLACKBOARD_LOCAL_H_ 00026 00027 #include <blackboard/blackboard.h> 00028 #include <core/exceptions/software.h> 00029 00030 #include <list> 00031 00032 namespace fawkes { 00033 00034 class BlackBoardInterfaceManager; 00035 class BlackBoardMemoryManager; 00036 class BlackBoardMessageManager; 00037 class BlackBoardNetworkHandler; 00038 class BlackBoardNotifier; 00039 class Interface; 00040 class InterfaceInfoList; 00041 class BlackBoardInterfaceListener; 00042 class BlackBoardInterfaceObserver; 00043 class FawkesNetworkHub; 00044 00045 class LocalBlackBoard : public BlackBoard 00046 { 00047 public: 00048 LocalBlackBoard(size_t memsize); 00049 LocalBlackBoard(size_t memsize, const char *magic_token, 00050 bool master = true); 00051 virtual ~LocalBlackBoard(); 00052 00053 virtual Interface * open_for_reading(const char *interface_type, const char *identifier); 00054 virtual Interface * open_for_writing(const char *interface_type, const char *identifier); 00055 virtual void close(Interface *interface); 00056 00057 virtual InterfaceInfoList * list_all(); 00058 virtual bool is_alive() const throw(); 00059 virtual bool try_aliveness_restore() throw(); 00060 00061 virtual std::list<Interface *> open_multiple_for_reading(const char *interface_type, 00062 const char *id_pattern = "*"); 00063 virtual void register_listener(BlackBoardInterfaceListener *listener, 00064 unsigned int flags); 00065 virtual void unregister_listener(BlackBoardInterfaceListener *listener); 00066 00067 virtual void register_observer(BlackBoardInterfaceObserver *observer, 00068 unsigned int flags); 00069 virtual void unregister_observer(BlackBoardInterfaceObserver *observer); 00070 00071 virtual void start_nethandler(FawkesNetworkHub *hub); 00072 00073 static void cleanup(const char *magic_token, bool use_lister = false); 00074 00075 /* for debugging only */ 00076 const BlackBoardMemoryManager * memory_manager() const; 00077 00078 private: /* members */ 00079 BlackBoardInterfaceManager *__im; 00080 BlackBoardMemoryManager *__memmgr; 00081 BlackBoardMessageManager *__msgmgr; 00082 BlackBoardNetworkHandler *__nethandler; 00083 BlackBoardNotifier *__notifier; 00084 }; 00085 00086 00087 } // end namespace fawkes 00088 00089 #endif