gusimplewhiteboard
RemoteWhiteboard.h
Go to the documentation of this file.
1/*
2 * RemoteWhiteboard.h
3 *
4 * Created by Carl Lusty on 21/12/11.
5 * Copyright (c) 2011 Carl Lusty.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer in the documentation and/or other materials
18 * provided with the distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgement:
22 *
23 * This product includes software developed by Rene Hexel.
24 *
25 * 4. Neither the name of the author nor the names of contributors
26 * may be used to endorse or promote products derived from this
27 * software without specific prior written permission.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
33 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
34 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
35 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
36 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
37 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
38 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
39 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 *
41 * -----------------------------------------------------------------------
42 * This program is free software; you can redistribute it and/or
43 * modify it under the above terms or under the terms of the GNU
44 * General Public License as published by the Free Software Foundation;
45 * either version 2 of the License, or (at your option) any later version.
46 *
47 * This program is distributed in the hope that it will be useful,
48 * but WITHOUT ANY WARRANTY; without even the implied warranty of
49 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50 * GNU General Public License for more details.
51 *
52 * You should have received a copy of the GNU General Public License
53 * along with this program; if not, see http://www.gnu.org/licenses/
54 * or write to the Free Software Foundation, Inc., 51 Franklin Street,
55 * Fifth Floor, Boston, MA 02110-1301, USA.
56 *
57 */
58#ifndef gusimplewhiteboard_RemoteWhiteboard_h
59#define gusimplewhiteboard_RemoteWhiteboard_h
60
61#define NO_WARN_WBMSG_H
62
63#include <string>
64#include <vector>
65#include <iostream>
66#include <sstream>
67#include "guudpbridge/guudpConfig.h"
68#include "gusimplewhiteboard.h"
69#include "WhiteboardConstants.h"
70#include "Whiteboard.h"
71#include "WBFunctor.h"
72#include "WBMsg.h"
73
74#ifdef bool
75#undef bool
76#endif
77
78#ifdef true
79#undef true
80#undef false
81#endif
82
83#pragma clang diagnostic push
84#pragma clang diagnostic ignored "-Wpadded"
85#pragma clang diagnostic ignored "-Wunused-function"
86
87namespace guWhiteboard
88{
89
94 typedef enum remote_wb_id
95 {
102
103 static std::string nameForMachine(RWBMachine machine)
104 {
105 const char *base_wb_name = REMOTE_WHITEBOARD_BASENAME;
106 std::stringstream ss;
107 ss << base_wb_name << (machine+1);
108 return ss.str();
109 }
110
115 {
116 RWBMachine _machine;
117 Whiteboard *local_wb;
118 bool local_wb_needs_free;
119 public:
127 RemoteWhiteboard(const char *wbName, RWBMachine n, Whiteboard *local_whiteboard = NULL);
128
133 virtual ~RemoteWhiteboard();
134
136 RWBMachine machine() const { return _machine; }
137
143 void addReplicationType(const std::string &type);
144
150 std::vector<std::string> getKnownTypesForMachine();
151
159 virtual void subscribeToMessage(const std::string &type, WBFunctorBase *func, WBResult &result);
160 };
161}
162
163#pragma clang diagnostic pop
164
165#endif
Base class for WBFunctor.
Definition: WBFunctor.h:41
compatibility API for accessing the remote whiteboard
void addReplicationType(const std::string &type)
virtual ~RemoteWhiteboard()
Destructor.
virtual void subscribeToMessage(const std::string &type, WBFunctorBase *func, WBResult &result)
Subscribe To Message Subscribes to a message type on a whiteboard or whiteboards.
RemoteWhiteboard(const char *wbName, RWBMachine n, Whiteboard *local_whiteboard=NULL)
API Constructor This sets up the API and the callback soap server.
RWBMachine machine() const
machine getter
std::vector< std::string > getKnownTypesForMachine()
Get Known Types For Machine Gets all the currently known types for a machine.
compatibility API for accessing the whiteboard
Definition: Whiteboard.h:116
enum guWhiteboard::Whiteboard::wb_method_result WBResult
Return Type Enum.
/file APM_Interface.h
remote_wb_id
Remote WB enum.
enum guWhiteboard::remote_wb_id RWBMachine
Remote WB enum.