Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * interface_mediator.h - BlackBoard Interface Mediator 00004 * 00005 * Generated: Tue Oct 17 15:35:45 2006 00006 * Copyright 2006-2007 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 __INTERFACE_MEDIATOR_H_ 00025 #define __INTERFACE_MEDIATOR_H_ 00026 00027 namespace fawkes { 00028 00029 class Interface; 00030 00031 /** Interface mediator interface. 00032 * An interface mediator is used by interfaces to communicate events and to query 00033 * status information which need interaction with the BlackBoard. 00034 * @author Tim Niemueller 00035 */ 00036 class InterfaceMediator 00037 { 00038 public: 00039 /** Virtual destructor */ 00040 virtual ~InterfaceMediator() {} 00041 00042 /** Check if a writer exists for the given interface. 00043 * @param interface interface to check 00044 * @return true, if there is any writer for the given interface, false otherwise 00045 */ 00046 virtual bool exists_writer(const Interface *interface) const = 0; 00047 00048 /** Get number of readers. 00049 * Get the number of readers that the given interface has. 00050 * @param interface interface to check 00051 * @return number of readers currently registered for the given interface. 00052 */ 00053 virtual unsigned int num_readers(const Interface *interface) const = 0; 00054 00055 /** Notify of data change. 00056 * Notify all subscribers of the given interface of a data change. 00057 * This also influences logging and sending data over the network so it is 00058 * mandatory to call this function! The interface base class write method does 00059 * that for you. 00060 * @param interface interface whose subscribers to notify 00061 * @see Interface::write() 00062 */ 00063 virtual void notify_of_data_change(const Interface *interface) = 0; 00064 }; 00065 00066 } // end namespace fawkes 00067 00068 #endif