gusimplewhiteboard
iOSWhiteboard.h
Go to the documentation of this file.
1/*
2 * iOSWhiteboard.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_iOSWhiteboard_h
59#define gusimplewhiteboard_iOSWhiteboard_h
60
61#define NO_WARN_WBMSG_H
62
63#include <string>
64#include <vector>
65#include <iostream>
66#include "guudpbridge/guudpbridgenetworkconfig.h"
67#include <guudpBridgeBroadcaster.h>
68#include <gusimplewhiteboard.h>
69#include "WBMsg.h"
70
71
72namespace guWhiteboard
73{
78 {
79 int playerNum;
80 std::list<gsw_injection_message> dynamic_messages_to_inject;
81 pthread_mutex_t injection_mutex;
82
83 void convWBMsgToSimpleMsg(WBMsg *value, gsw_simple_message *m);
84
85 public:
91
97
102 typedef enum remote_wb_id
103 {
108 Global
110
115 typedef enum wb_method_result
116 {
120
121
129 void injectRemoteMessage(const std::string &type, const WBMsg &msg, RWBMachine machine);
130
131
138 void addReplicationType(const std::string &type, RWBMachine machine);
139
148 WBMsg getMessage(std::string type, RWBMachine machine, WBResult *result = NULL);
149
156 std::vector<std::string> getKnownTypesForMachine(RWBMachine machine);
157 };
158}
159
160#endif
Old WB class for storing shared data.
Definition: WBMsg.h:86
compatibility API for accessing the remote whiteboard
Definition: iOSWhiteboard.h:78
WBMsg getMessage(std::string type, RWBMachine machine, WBResult *result=NULL)
Get Message Gets a message from a remote simple whiteboard.
void addReplicationType(const std::string &type, RWBMachine machine)
Add Message Adds a message to the whiteboard that the API is connected to.
void injectRemoteMessage(const std::string &type, const WBMsg &msg, RWBMachine machine)
Inject Message Adds a message to a remote whiteboard that the API is connected to.
wb_method_result
Return Type Enum.
@ METHOD_FAIL
Errors detected.
@ METHOD_OK
No errors detected.
std::vector< std::string > getKnownTypesForMachine(RWBMachine machine)
Get Known Types For Machine Gets all the currently known types for a machine.
iOSWhiteboard()
API Constructor This sets up the API.
enum guWhiteboard::iOSWhiteboard::wb_method_result WBResult
Return Type Enum.
enum guWhiteboard::iOSWhiteboard::remote_wb_id RWBMachine
Remote WB enum.
/file APM_Interface.h
enum guWhiteboard::remote_wb_id RWBMachine
Remote WB enum.
union type that is used to store data in shared memory