gusimplewhiteboard
WBFunctor< C > Class Template Reference

WBFunctor callback manager class. More...

#include <WBFunctor.h>

Inheritance diagram for WBFunctor< C >:
Collaboration diagram for WBFunctor< C >:

Public Types

typedef void(C::* s_func) (guWhiteboard::wb_types, gu_simple_message *)
 function prototype for the new 'simple whiteboard' callbacks More...
 

Public Member Functions

 WBFunctor (C *obj, void(C::*pFunc)(std::string, WBMsg *))
 WBFunctor Constructor. More...
 
 WBFunctor (C *obj, void(C::*pFunc)(guWhiteboard::wb_types, gu_simple_message *), guWhiteboard::wb_types t)
 WBFunctor Constructor. More...
 
void call (std::string s, WBMsg *m) OVERRIDE
 Call method for the OLD whiteboard callbacks that used WBMsg - Deprecated. More...
 
void call (gu_simple_message *m) OVERRIDE
 Call method for the 'simple' whiteboard aka 'typed whiteboard' callbacks that passes data around in a union. More...
 
void call (guWhiteboard::wb_types t, gu_simple_message *m) OVERRIDE
 Call method for the 'simple' whiteboard aka 'typed whiteboard' callbacks that passes data around in a union. More...
 
guWhiteboard::wb_types type () OVERRIDE
 getter for the WB type More...
 
uint16_t get_event_count () OVERRIDE
 getter for the WB event counter More...
 
void set_event_count (uint16_t e) OVERRIDE
 setter for the WB event counter More...
 
bool is_simple_wb_version () OVERRIDE
 is this being used by the 'simple whiteboard' or the OLD whiteboard (which is now Deprecated) More...
 
s_func get_s_func_ptr ()
 getter More...
 
- Public Member Functions inherited from WBFunctorBase
virtual ~WBFunctorBase ()
 destructor More...
 

Protected Types

typedef void(C::* func) (std::string, WBMsg *)
 OLD function prototype (which is now Deprecated) More...
 

Protected Attributes

C * fObject
 ptr to call containing the callback method More...
 
func fFunction
 OLD function object. More...
 
s_func s_fFunction
 'simple' function object More...
 
guWhiteboard::wb_types type_enum
 'simple' whiteboard types More...
 
uint16_t event_count
 the event counter More...
 
bool simple_wb_version
 flag, is this a 'simple' whiteboard usage of WBFunctor More...
 

Detailed Description

template<typename C>
class WBFunctor< C >

WBFunctor callback manager class.

This class allows you to pass a function pointer for callbacks

Definition at line 88 of file WBFunctor.h.

Member Typedef Documentation

◆ func

template<typename C >
typedef void(C::* WBFunctor< C >::func) (std::string, WBMsg *)
protected

OLD function prototype (which is now Deprecated)

Definition at line 155 of file WBFunctor.h.

◆ s_func

template<typename C >
typedef void(C::* WBFunctor< C >::s_func) (guWhiteboard::wb_types, gu_simple_message *)

function prototype for the new 'simple whiteboard' callbacks

Definition at line 148 of file WBFunctor.h.

Constructor & Destructor Documentation

◆ WBFunctor() [1/2]

template<typename C >
WBFunctor< C >::WBFunctor ( C *  obj,
void(C::*)(std::string, WBMsg *)  pFunc 
)
inline

WBFunctor Constructor.

Definition at line 94 of file WBFunctor.h.

◆ WBFunctor() [2/2]

template<typename C >
WBFunctor< C >::WBFunctor ( C *  obj,
void(C::*)(guWhiteboard::wb_types, gu_simple_message *)  pFunc,
guWhiteboard::wb_types  t 
)
inline

WBFunctor Constructor.

Definition at line 100 of file WBFunctor.h.

Member Function Documentation

◆ call() [1/3]

template<typename C >
void WBFunctor< C >::call ( gu_simple_message m)
inlinevirtual

Call method for the 'simple' whiteboard aka 'typed whiteboard' callbacks that passes data around in a union.

Parameters
mdata value

Implements WBFunctorBase.

Definition at line 117 of file WBFunctor.h.

References WBFunctor< C >::fObject, WBFunctor< C >::s_fFunction, and WBFunctor< C >::type_enum.

◆ call() [2/3]

template<typename C >
void WBFunctor< C >::call ( guWhiteboard::wb_types  t,
gu_simple_message m 
)
inlinevirtual

Call method for the 'simple' whiteboard aka 'typed whiteboard' callbacks that passes data around in a union.

This version allows a 'type' overwrite. This is mostly used by the 'whiteboard poster' to impersonate other message types.

Parameters
twhiteboard 'type'
mdata value

Implements WBFunctorBase.

Definition at line 127 of file WBFunctor.h.

References WBFunctor< C >::fObject, and WBFunctor< C >::s_fFunction.

◆ call() [3/3]

template<typename C >
void WBFunctor< C >::call ( std::string  s,
WBMsg m 
)
inlinevirtual

Call method for the OLD whiteboard callbacks that used WBMsg - Deprecated.

Parameters
stype string value
mWBMsg data value

Implements WBFunctorBase.

Definition at line 108 of file WBFunctor.h.

References WBFunctor< C >::fFunction, and WBFunctor< C >::fObject.

◆ get_event_count()

template<typename C >
uint16_t WBFunctor< C >::get_event_count ( )
inlinevirtual

getter for the WB event counter

Implements WBFunctorBase.

Definition at line 136 of file WBFunctor.h.

References WBFunctor< C >::event_count.

◆ get_s_func_ptr()

template<typename C >
s_func WBFunctor< C >::get_s_func_ptr ( )
inline

getter

Definition at line 151 of file WBFunctor.h.

References WBFunctor< C >::s_fFunction.

◆ is_simple_wb_version()

template<typename C >
bool WBFunctor< C >::is_simple_wb_version ( )
inlinevirtual

is this being used by the 'simple whiteboard' or the OLD whiteboard (which is now Deprecated)

Implements WBFunctorBase.

Definition at line 145 of file WBFunctor.h.

References WBFunctor< C >::simple_wb_version.

◆ set_event_count()

template<typename C >
void WBFunctor< C >::set_event_count ( uint16_t  e)
inlinevirtual

setter for the WB event counter

Parameters
enew event counter value

Implements WBFunctorBase.

Definition at line 142 of file WBFunctor.h.

References WBFunctor< C >::event_count.

◆ type()

template<typename C >
guWhiteboard::wb_types WBFunctor< C >::type ( )
inlinevirtual

getter for the WB type

Implements WBFunctorBase.

Definition at line 133 of file WBFunctor.h.

References WBFunctor< C >::type_enum.

Member Data Documentation

◆ event_count

template<typename C >
uint16_t WBFunctor< C >::event_count
protected

the event counter

Definition at line 159 of file WBFunctor.h.

Referenced by WBFunctor< C >::get_event_count(), and WBFunctor< C >::set_event_count().

◆ fFunction

template<typename C >
func WBFunctor< C >::fFunction
protected

OLD function object.

Definition at line 156 of file WBFunctor.h.

Referenced by WBFunctor< C >::call().

◆ fObject

template<typename C >
C* WBFunctor< C >::fObject
protected

ptr to call containing the callback method

Definition at line 154 of file WBFunctor.h.

Referenced by WBFunctor< C >::call().

◆ s_fFunction

template<typename C >
s_func WBFunctor< C >::s_fFunction
protected

'simple' function object

Definition at line 157 of file WBFunctor.h.

Referenced by WBFunctor< C >::call(), and WBFunctor< C >::get_s_func_ptr().

◆ simple_wb_version

template<typename C >
bool WBFunctor< C >::simple_wb_version
protected

flag, is this a 'simple' whiteboard usage of WBFunctor

Definition at line 160 of file WBFunctor.h.

Referenced by WBFunctor< C >::is_simple_wb_version().

◆ type_enum

template<typename C >
guWhiteboard::wb_types WBFunctor< C >::type_enum
protected

'simple' whiteboard types

Definition at line 158 of file WBFunctor.h.

Referenced by WBFunctor< C >::call(), and WBFunctor< C >::type().


The documentation for this class was generated from the following file: