Fawkes API Fawkes Development Version
hub.h
1
2/***************************************************************************
3 * hub.h - Fawkes network hub
4 *
5 * Created: Mon May 07 19:06:30 2007
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 _NETCOMM_FAWKES_HUB_H_
25#define _NETCOMM_FAWKES_HUB_H_
26
27namespace fawkes {
28
29class FawkesNetworkMessage;
30class FawkesNetworkHandler;
31class FawkesNetworkMessageContent;
32
34{
35public:
36 virtual ~FawkesNetworkHub();
37
38 virtual void broadcast(FawkesNetworkMessage *msg) = 0;
39
40 virtual void broadcast(unsigned short int component_id,
41 unsigned short int msg_id,
42 void * payload,
43 unsigned int payload_size) = 0;
44
45 virtual void broadcast(unsigned short int component_id, unsigned short int msg_id) = 0;
46
47 virtual void send(FawkesNetworkMessage *msg) = 0;
48
49 virtual void
50 send(unsigned int to_clid, unsigned short int component_id, unsigned short int msg_id) = 0;
51
52 virtual void send(unsigned int to_clid,
53 unsigned short int component_id,
54 unsigned short int msg_id,
55 void * payload,
56 unsigned int payload_size) = 0;
57
58 virtual void send(unsigned int to_clid,
59 unsigned short int component_id,
60 unsigned short int msg_id,
61 FawkesNetworkMessageContent *content) = 0;
62
63 virtual void add_handler(FawkesNetworkHandler *handler) = 0;
64 virtual void remove_handler(FawkesNetworkHandler *handler) = 0;
65
66 virtual void force_send() = 0;
67};
68
69} // end namespace fawkes
70
71#endif
Network handler abstract base class.
Definition: handler.h:32
Fawkes Network Hub.
Definition: hub.h:34
virtual void send(unsigned int to_clid, unsigned short int component_id, unsigned short int msg_id, FawkesNetworkMessageContent *content)=0
This is an overloaded member function, provided for convenience.
virtual void send(unsigned int to_clid, unsigned short int component_id, unsigned short int msg_id, void *payload, unsigned int payload_size)=0
This is an overloaded member function, provided for convenience.
virtual void send(FawkesNetworkMessage *msg)=0
Method to send a message to a specific client.
virtual void remove_handler(FawkesNetworkHandler *handler)=0
Remove a message handler.
virtual ~FawkesNetworkHub()
Virtual empty destructor.
Definition: hub.cpp:119
virtual void force_send()=0
Force sending of all pending messages.
virtual void broadcast(unsigned short int component_id, unsigned short int msg_id)=0
This is an overloaded member function, provided for convenience.
virtual void send(unsigned int to_clid, unsigned short int component_id, unsigned short int msg_id)=0
This is an overloaded member function, provided for convenience.
virtual void broadcast(FawkesNetworkMessage *msg)=0
Method to broadcast a message to all connected clients.
virtual void broadcast(unsigned short int component_id, unsigned short int msg_id, void *payload, unsigned int payload_size)=0
This is an overloaded member function, provided for convenience.
virtual void add_handler(FawkesNetworkHandler *handler)=0
Add a message handler.
Fawkes network message content.
Representation of a message that is sent over the network.
Definition: message.h:77
Fawkes library namespace.