CARMA C++
|
A class to encapsulate message types for a generic task. More...
#include <carma/szautil/GenericMasterTaskMsg.h>
Public Types | |
enum | GenericMasterMsgType { ADD_HANDLER = GenericTaskMsg::LAST+1, ENABLE_TIMER, INSTALL_TIMER, INSTALL_SIGNAL, TASK_SPECIFIC } |
Enumerate supported generic message types. More... | |
![]() | |
enum | CarmaSeqNoType { NONE, DRIVE, RX, CAL, OPTICS, OPTICALTEL } |
enum | GenericMsgType { HEARTBEAT, STOP, RESTART, TASK_SPECIFIC, LAST } |
Enumerate supported generic message types. More... | |
Public Member Functions | |
void | packAddHandlerMsg (std::string name, void(*handler)(int sigNo, void *args), bool add) |
Pack a message to enable/disable a timer. More... | |
void | packEnableTimerMsg (std::string name, bool enable) |
Pack a message to enable/disable a timer. More... | |
void | packInstallSignalMsg (int sigNo, void(*handler)(int sigNo, void *args)) |
Pack a message to install a signal. More... | |
void | packInstallTimerMsg (std::string name, int sigNo, unsigned long initSec, unsigned long initNsec, unsigned long intervalSec, unsigned long intervalNsec, void(*handler)(int sigNo, void *args)) |
Pack a message to install a timer. More... | |
void | packInstallTimerMsg (std::string name, int sigNo, unsigned long intervalSec, unsigned long intervalNsec, void(*handler)(int sigNo, void *args)) |
Pack a message to install a timer. More... | |
![]() | |
void | setCarmaCalSequenceNumber (unsigned long seq) |
void | setCarmaDriveSequenceNumber (unsigned long seq) |
void | setCarmaOpticsSequenceNumber (unsigned long seq) |
void | setCarmaRxSequenceNumber (unsigned long seq) |
void | setCarmaSequenceNumber (unsigned long seq=0, CarmaSeqNoType type=NONE) |
Public Attributes | |
union { | |
struct { | |
bool add | |
void * args | |
void(* handler )(int sigNo, void *args) | |
char name [10+1] | |
} addHandler | |
struct { | |
bool enable | |
char name [10+1] | |
} enableTimer | |
struct { | |
void * args | |
void(* handler )(int sigNo, void *args) | |
int sigNo | |
} installSignal | |
struct { | |
void(* handler )(int sigNo, void *args) | |
unsigned long initNsec | |
unsigned long initSec | |
unsigned long intervalNsec | |
unsigned long intervalSec | |
char name [10+1] | |
int sigNo | |
} installTimer | |
} | genericMasterBody |
A message body. More... | |
![]() | |
unsigned long | carmaSeqNo_ |
CarmaSeqNoType | carmaSeqNoType_ |
GenericMsgType | genericMsgType_ |
A type for this message. More... | |
A class to encapsulate message types for a generic task.
Classes which extend from this class should simply add whatever members are required to process additional task-specific messages, for instance a union of task-specific messages.
NB: There is no explicit constructor for this class, since the compiler won't allow classes with constructors to be included as members of unions. This means that we cannot construct unions using objects which inherit from GenericMasterTaskMsg unless they also don't have constructors.
Definition at line 34 of file GenericMasterTaskMsg.h.
Enumerate supported generic message types.
Definition at line 41 of file GenericMasterTaskMsg.h.
void sza::util::GenericMasterTaskMsg::packAddHandlerMsg | ( | std::string | name, |
void(*)(int sigNo, void *args) | handler, | ||
bool | add | ||
) |
Pack a message to enable/disable a timer.
Definition at line 171 of file GenericMasterTaskMsg.h.
void sza::util::GenericMasterTaskMsg::packEnableTimerMsg | ( | std::string | name, |
bool | enable | ||
) |
Pack a message to enable/disable a timer.
Definition at line 153 of file GenericMasterTaskMsg.h.
void sza::util::GenericMasterTaskMsg::packInstallSignalMsg | ( | int | sigNo, |
void(*)(int sigNo, void *args) | handler | ||
) |
Pack a message to install a signal.
Definition at line 140 of file GenericMasterTaskMsg.h.
void sza::util::GenericMasterTaskMsg::packInstallTimerMsg | ( | std::string | name, |
int | sigNo, | ||
unsigned long | initSec, | ||
unsigned long | initNsec, | ||
unsigned long | intervalSec, | ||
unsigned long | intervalNsec, | ||
void(*)(int sigNo, void *args) | handler | ||
) |
Pack a message to install a timer.
Allows separately setting the initial delay and the interval
Definition at line 87 of file GenericMasterTaskMsg.h.
void sza::util::GenericMasterTaskMsg::packInstallTimerMsg | ( | std::string | name, |
int | sigNo, | ||
unsigned long | intervalSec, | ||
unsigned long | intervalNsec, | ||
void(*)(int sigNo, void *args) | handler | ||
) |
Pack a message to install a timer.
Sets the initial delay and the interval to the same.
Definition at line 115 of file GenericMasterTaskMsg.h.
union { ... } sza::util::GenericMasterTaskMsg::genericMasterBody |
A message body.