Fawkes API
Fawkes Development Version
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
interface_proxy.h
1
2
/***************************************************************************
3
* interface_proxy.h - BlackBoard interface proxy for RemoteBlackBoard
4
*
5
* Created: Tue Mar 04 10:52:28 2008
6
* Copyright 2006-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_PROXY_H
25
#define __BLACKBOARD_INTERFACE_PROXY_H_
26
27
#include <interface/mediators/interface_mediator.h>
28
#include <interface/mediators/message_mediator.h>
29
#include <cstdlib>
30
31
namespace
fawkes {
32
33
class
FawkesNetworkClient;
34
class
FawkesNetworkMessage;
35
class
RefCountRWLock;
36
class
BlackBoardNotifier;
37
class
Interface;
38
39
class
BlackBoardInterfaceProxy
40
:
public
InterfaceMediator
,
41
public
MessageMediator
42
{
43
public
:
44
BlackBoardInterfaceProxy
(
FawkesNetworkClient
*client,
FawkesNetworkMessage
*msg,
45
BlackBoardNotifier
*notifier,
Interface
*
interface
,
46
bool
readwrite);
47
~BlackBoardInterfaceProxy
();
48
49
void
process_data_changed
(
FawkesNetworkMessage
*msg);
50
void
process_interface_message
(
FawkesNetworkMessage
*msg);
51
void
reader_added
(
unsigned
int
event_serial);
52
void
reader_removed
(
unsigned
int
event_serial);
53
void
writer_added
(
unsigned
int
event_serial);
54
void
writer_removed
(
unsigned
int
event_serial);
55
56
unsigned
int
serial
()
const
;
57
unsigned
int
clid
()
const
;
58
Interface
*
interface
()
const
;
59
60
/* InterfaceMediator */
61
virtual
bool
exists_writer
(
const
Interface
*interface)
const
;
62
virtual
unsigned
int
num_readers
(
const
Interface
*interface)
const
;
63
virtual
void
notify_of_data_change
(
const
Interface
*interface);
64
65
/* MessageMediator */
66
virtual
void
transmit
(
Message
*message);
67
68
private
:
69
inline
unsigned
int
next_msg_id()
70
{
71
return
((__instance_serial << 16) | __next_msg_id++);
72
}
73
74
private
:
75
FawkesNetworkClient
*__fnc;
76
77
RefCountRWLock
*__rwlock;
78
BlackBoardNotifier
*__notifier;
79
Interface
*__interface;
80
81
void
*__mem_chunk;
82
void
*__data_chunk;
83
size_t
__data_size;
84
85
unsigned
short
__instance_serial;
86
unsigned
short
__next_msg_id;
87
unsigned
int
__num_readers;
88
bool
__has_writer;
89
unsigned
int
__clid;
90
};
91
92
}
// end namespace fawkes
93
94
#endif
src
libs
blackboard
net
interface_proxy.h
Generated by
1.8.3.1