Fawkes API
Fawkes Development Version
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
#include <list>
28
#include <string>
29
30
namespace
fawkes
{
31
32
class
Interface;
33
34
/** Interface mediator interface.
35
* An interface mediator is used by interfaces to communicate events and to query
36
* status information which need interaction with the BlackBoard.
37
* @author Tim Niemueller
38
*/
39
class
InterfaceMediator
40
{
41
public
:
42
/** Virtual destructor */
43
virtual
~InterfaceMediator
()
44
{
45
}
46
47
/** Check if a writer exists for the given interface.
48
* @param interface interface to check
49
* @return true, if there is any writer for the given interface, false otherwise
50
*/
51
virtual
bool
exists_writer
(
const
Interface
*interface)
const
= 0;
52
53
/** Get number of readers.
54
* Get the number of readers that the given interface has.
55
* @param interface interface to check
56
* @return number of readers currently registered for the given interface.
57
*/
58
virtual
unsigned
int
num_readers
(
const
Interface
*interface)
const
= 0;
59
60
/** Get owners of interfaces who opened for reading.
61
* @param interface an interface to query for the UID
62
* @return list of readers for this interface
63
*/
64
virtual
std::list<std::string>
readers
(
const
Interface
*interface)
const
= 0;
65
66
/** Get writer of interface.
67
* @param interface an interface to query for the UID
68
* @return owner name of writing interface instance, or empty string of no writer exists
69
*/
70
virtual
std::string
writer
(
const
Interface
*interface)
const
= 0;
71
72
/** Notify of data change.
73
* Notify all subscribers of the given interface of a data change.
74
* This also influences logging and sending data over the network so it is
75
* mandatory to call this function! The interface base class write method does
76
* that for you.
77
* @param interface interface whose subscribers to notify
78
* @param has_changed whether the current data is different from the last time write()
79
* was called on the interface
80
* @see Interface::write()
81
*/
82
virtual
void
notify_of_data_refresh
(
const
Interface
*interface,
bool
has_changed) = 0;
83
};
84
85
}
// end namespace fawkes
86
87
#endif
fawkes::InterfaceMediator
Interface mediator interface.
Definition:
interface_mediator.h:40
fawkes::InterfaceMediator::num_readers
virtual unsigned int num_readers(const Interface *interface) const =0
Get number of readers.
fawkes::InterfaceMediator::readers
virtual std::list< std::string > readers(const Interface *interface) const =0
Get owners of interfaces who opened for reading.
fawkes::InterfaceMediator::notify_of_data_refresh
virtual void notify_of_data_refresh(const Interface *interface, bool has_changed)=0
Notify of data change.
fawkes::InterfaceMediator::~InterfaceMediator
virtual ~InterfaceMediator()
Virtual destructor.
Definition:
interface_mediator.h:43
fawkes::InterfaceMediator::writer
virtual std::string writer(const Interface *interface) const =0
Get writer of interface.
fawkes::InterfaceMediator::exists_writer
virtual bool exists_writer(const Interface *interface) const =0
Check if a writer exists for the given interface.
fawkes::Interface
Base class for all Fawkes BlackBoard interfaces.
Definition:
interface.h:80
fawkes
Fawkes library namespace.
src
libs
interface
mediators
interface_mediator.h
Generated by
1.9.4