58#ifndef gusimplewhiteboard_Whiteboard_h
59#define gusimplewhiteboard_Whiteboard_h
61#include <dispatch/dispatch.h>
71#ifndef FROM_WHITEBOARD_CC_
73#pragma clang diagnostic push
74#pragma clang diagnostic ignored "-Wpedantic"
75#pragma clang diagnostic warning "-W#warnings"
77#pragma warning using deprecated whiteboard version
79#pragma clang diagnostic pop
81#pragma message "************************************************************"
82#pragma message "*** using deprecated whiteboard version " __FILE__ "***"
83#pragma message "************************************************************"
87#ifdef WHITEBOARD_OLD_H
88#error *** Error: attempt to mix old and simple Whiteboard!
90#ifdef _BOOST_WHITEBOARD_H_
91#error *** Error: attempt to mix boost and simple Whiteboard!
95#define GLOBAL_MSG_ID 0
128 dispatch_group_t callback_group;
129 dispatch_queue_t callback_queue;
130 std::vector<callback_descr> _sub;
134 int getTypeOffset_private(std::string type);
218 return WBMsg(
static_cast<bool>(m->
sint));
234 std::vector<int> *v =
new std::vector<int>();
235 for (
int i = 0; i < m->
wbmsg.
len; i++)
236 v->push_back(m->
ivec[i]);
237 return WBMsg(v,
true);
258 void addMessage(
const std::string &type,
const WBMsg &msg,
bool nonatomic=
false,
bool notifySubscribers=
true);
Base class for WBFunctor.
Old WB class for storing shared data.
compatibility API for accessing the whiteboard
WBMsg getMessage(gsw_hash_info *hashinfo, WBResult *result=NULLPTR)
Get Message Gets a message from a simple whiteboard.
void unsubscribeToMessage(gsw_hash_info *hashinfo, WBResult &result)
Unsubscribe To Message (sic!) Unsubscribes from a message type on a whiteboard or whiteboards.
gu_simple_whiteboard_descriptor * _wbd
underlying whiteboard
virtual void subscribeToMessage(gsw_hash_info *hashinfo, WBFunctorBase *func, WBResult &result)
Subscribe To Message Subscribes to a message type on a whiteboard or whiteboards.
Whiteboard(const char *sharedMemoryObjectName=gsw_global_whiteboard_name, bool checkVersion=true, int number=0)
API Constructor This sets up the API and the callback soap server.
static WBMsg getWBMsg(gu_simple_message *m)
convert the new 'simple' whiteboard data structure into the old WBMsg format
gsw_hash_info * getTypeOffset(std::string type)
create a hash offset from message type, needed for adding, getting from WB
wb_method_result
Return Type Enum.
@ METHOD_OK
No errors detected.
@ METHOD_FAIL
Errors detected.
void addMessage(gsw_hash_info *hashinfo, const WBMsg &msg, bool nonatomic=false, bool notifySubscribers=true)
Add Message Adds a message to the whiteboard that the API is connected to.
enum guWhiteboard::Whiteboard::wb_method_result WBResult
Return Type Enum.
void subscriptionCallback(void)
subscription callback: not really public!
virtual ~Whiteboard()
Destructor.
#define GSW_TOTAL_MESSAGE_TYPES
message types (max)
const char * gsw_global_whiteboard_name
global whiteboard name
struct guWhiteboard::gsw_hash_info gsw_hash_info
Message offset holder.
the underlying whiteboard object
WBFunctorBase * func
functor to call
int current
last message index
callback_descr(WBFunctorBase *f, int t=-1, int o=-1)
create callback descr
gsw_hash_info(int offset)
create with real index value
gsw_hash_info()
create object with default value for index
int msg_offset
the index value to store
union type that is used to store data in shared memory
int ivec[128/sizeof(int)]
int array
struct gsw_simple_message::@4 wbmsg
compatibility WBMsg type