9#ifndef GENERIC_WB_OBJ_H
10#define GENERIC_WB_OBJ_H
14#pragma clang diagnostic push
15#pragma clang diagnostic ignored "-Wweak-vtables"
16#pragma clang diagnostic ignored "-Wpadded"
17#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
18#pragma clang diagnostic ignored "-Wdeprecated"
19#pragma clang diagnostic ignored "-Wreserved-id-macro"
94 init(toffs, wbd, want_atomic, do_notify_subscribers);
110 init(toffs, wbd, want_atomic);
132 void set(
const object_type &msg);
151 void post(
const object_type &msg) {
set(msg); }
196 operator object_type()
220 this->isFirst =
false;
221 this->last_count = newCount;
224 const bool isNew = newCount != this->
last_count;
225 this->last_count = newCount;
254template <
typename object_type>
257 return *
reinterpret_cast<object_type *
>(msg);
280template <
class object_type>
292 object_type *wbobj =
reinterpret_cast<object_type*
>(m);
301#pragma clang diagnostic pop
This class allows you to set and get data directly into or out of the local whiteboard in shared memo...
void post(const object_type &msg)
post method (calls set())
generic_whiteboard_object< object_type > & operator>>(object_type &value)
shift right operator (calls get())
gu_simple_whiteboard_descriptor * _wbd
generic_whiteboard_object(gu_simple_whiteboard_descriptor *wbd, uint16_t toffs, bool want_atomic=true, bool do_notify_subscribers=true)
designated constructor
void init(uint16_t toffs, gu_simple_whiteboard_descriptor *wbd=NULLPTR, bool want_atomic=true, bool do_notify_subscribers=true)
intialiser (called from constructors)
void set(const object_type &msg)
designated setter for posting whiteboard messages
object_type operator=(object_type value)
assignment copy operator (calls set())
generic_whiteboard_object(const generic_whiteboard_object< object_type > &source)
copy constructor
void operator()(object_type value)
function operator with object_type copy parameter (calls set())
object_type get()
designated getter for getting a whiteboard message
object_type operator()()
empty function operator (calls get())
const object_type & operator<<(const object_type &value)
shift left operator (calls set())
const object_type & operator=(const object_type &value)
assignment operator (calls set())
object_type get_from(gu_simple_message *msg)
access method to get data from an existing, low-level message
generic_whiteboard_object(const object_type &value, uint16_t toffs, gu_simple_whiteboard_descriptor *wbd=NULLPTR, bool want_atomic=true)
value conversion reference constructor (needs to be overridden by subclasses to set toffs to be usefu...
gu_simple_whiteboard_descriptor * local_whiteboard_descriptor
gu_simple_message * gsw_next_message(gu_simple_whiteboard *wb, int i)
get the next shared memory location for the given whiteboard message type i
void gsw_increment(gu_simple_whiteboard *wb, int i)
get the next shared memory location for the given whiteboard message type i
void gsw_increment_event_counter(gu_simple_whiteboard *wb, int i)
add to a messages event counter on the wb
gu_simple_whiteboard_descriptor * get_local_singleton_whiteboard(void)
create a simple whiteboard for the local singleton wb pointer
gu_simple_message * gsw_current_message(gu_simple_whiteboard *wb, int i)
get the current shared memory location for the given whiteboard message type i
int gsw_procure(gsw_sema_t sem, enum gsw_semaphores s)
grab a whiteboard semaphore
int gsw_vacate(gsw_sema_t sem, enum gsw_semaphores s)
release a whiteboard semaphore
void gsw_signal_subscribers(gu_simple_whiteboard *wb)
signal all subscribing processes
@ GSW_SEM_PUTMSG
semaphore for adding to the whiteboard
#define GU_SIMPLE_WHITEBOARD_BUFSIZE
message len (max)
the actual whiteboard in shared mem
uint16_t event_counters[512]
event counter loops
uint16_t subscribed
subscribed processes
the underlying whiteboard object
gu_simple_whiteboard * wb
the actual whiteboard in shared mem
union type that is used to store data in shared memory