Fawkes API Fawkes Development Version
interface_observer.h
1
2/***************************************************************************
3 * interface_observer.h - BlackBoard interface observer
4 *
5 * Created: Fri Jan 25 18:19:00 2008 (Just back from Hacking with Fawkes talk)
6 * Copyright 2007-2008 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_INTERFACE_OBSERVER_H_
25#define _BLACKBOARD_INTERFACE_OBSERVER_H_
26
27#include <core/utils/lock_map.h>
28
29#include <list>
30#include <string>
31
32namespace fawkes {
33
34class BlackBoardNotifier;
35
37{
38 friend BlackBoardNotifier;
39
40public:
43
44 virtual void bb_interface_created(const char *type, const char *id) noexcept;
45 virtual void bb_interface_destroyed(const char *type, const char *id) noexcept;
46
47protected:
48 void bbio_add_observed_create(const char *type_pattern, const char *id_pattern = "*") noexcept;
49 void bbio_add_observed_destroy(const char *type_pattern, const char *id_pattern = "*") noexcept;
50
51 /** Type for lockable interface type hash sets. */
53
54 /** Type for iterator of lockable interface type hash sets. */
55 typedef ObservedInterfaceLockMap::iterator ObservedInterfaceLockMapIterator;
56
59
60private:
61 ObservedInterfaceLockMap bbio_observed_create_;
62 ObservedInterfaceLockMap bbio_observed_destroy_;
64};
65
66} // end namespace fawkes
67
68#endif
BlackBoard interface observer.
ObservedInterfaceLockMap::iterator ObservedInterfaceLockMapIterator
Type for iterator of lockable interface type hash sets.
ObservedInterfaceLockMap * bbio_get_observed_destroy() noexcept
Get interface destriction type watch list.
void bbio_add_observed_destroy(const char *type_pattern, const char *id_pattern="*") noexcept
Add interface destruction type to watch list.
LockMap< std::string, std::list< std::string > > ObservedInterfaceLockMap
Type for lockable interface type hash sets.
ObservedInterfaceLockMap * bbio_get_observed_create() noexcept
Get interface creation type watch list.
virtual void bb_interface_created(const char *type, const char *id) noexcept
BlackBoard interface created notification.
virtual void bb_interface_destroyed(const char *type, const char *id) noexcept
BlackBoard interface destroyed notification.
void bbio_add_observed_create(const char *type_pattern, const char *id_pattern="*") noexcept
Add interface creation type to watch list.
virtual ~BlackBoardInterfaceObserver()
Destructor.
BlackBoard notifier.
Definition: notifier.h:44
Map with a lock.
Definition: lock_map.h:36
Fawkes library namespace.