Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
interface_mediator.h
1 
2 /***************************************************************************
3  * interface_mediator.h - BlackBoard Interface Mediator
4  *
5  * Generated: Tue Oct 17 15:35:45 2006
6  * Copyright 2006-2007 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 __INTERFACE_MEDIATOR_H_
25 #define __INTERFACE_MEDIATOR_H_
26 
27 namespace fawkes {
28 
29 class Interface;
30 
31 /** Interface mediator interface.
32  * An interface mediator is used by interfaces to communicate events and to query
33  * status information which need interaction with the BlackBoard.
34  * @author Tim Niemueller
35  */
37 {
38  public:
39  /** Virtual destructor */
40  virtual ~InterfaceMediator() {}
41 
42  /** Check if a writer exists for the given interface.
43  * @param interface interface to check
44  * @return true, if there is any writer for the given interface, false otherwise
45  */
46  virtual bool exists_writer(const Interface *interface) const = 0;
47 
48  /** Get number of readers.
49  * Get the number of readers that the given interface has.
50  * @param interface interface to check
51  * @return number of readers currently registered for the given interface.
52  */
53  virtual unsigned int num_readers(const Interface *interface) const = 0;
54 
55  /** Notify of data change.
56  * Notify all subscribers of the given interface of a data change.
57  * This also influences logging and sending data over the network so it is
58  * mandatory to call this function! The interface base class write method does
59  * that for you.
60  * @param interface interface whose subscribers to notify
61  * @see Interface::write()
62  */
63  virtual void notify_of_data_change(const Interface *interface) = 0;
64 };
65 
66 } // end namespace fawkes
67 
68 #endif