QP/C
Data Structures | Defines | Typedefs
qevt.h File Reference

QEvt class and basic macros used by all QP components. More...

Go to the source code of this file.

Data Structures

struct  QEvt
 Event structure. More...

Defines

#define QP_VERSION   0x4504U
 The current QP version number.
#define Q_EVT_CAST(class_)   ((class_ const *)e)
 Perform downcast of an event onto a subclass of QEvt class_.
#define Q_DIM(array_)   (sizeof(array_) / sizeof(array_[0]))
#define Q_UINT2PTR_CAST(type_, uint_)   ((type_ *)(uint_))
 Perform cast from unsigned integer uint_ to pointer of type type_.

Typedefs

typedef uint16_t QSignal
 QSignal represents the signal of an event.
typedef char char_t
 typedef for character strings.
typedef float float32_t
typedef double float64_t
typedef int enum_t
typedef QEvt QEvent

Detailed Description

QEvt class and basic macros used by all QP components.

This header file must be included, perhaps indirectly, in all modules (*.c files) that use any component of QP/C (such as QEP, QF, or QK).

Definition in file qevt.h.


Define Documentation

#define Q_DIM (   array_)    (sizeof(array_) / sizeof(array_[0]))

helper macro to calculate static dimension of a 1-dim array array_

Definition at line 194 of file qevt.h.

Referenced by QF_poolInit(), and QF_publish().

#define Q_EVT_CAST (   class_)    ((class_ const *)e)

Perform downcast of an event onto a subclass of QEvt class_.

This macro encapsulates the downcast of QEvt pointers, which violates MISRA-C 2004 rule 11.4(advisory). This macro helps to localize this deviation.

Definition at line 191 of file qevt.h.

#define Q_UINT2PTR_CAST (   type_,
  uint_ 
)    ((type_ *)(uint_))

Perform cast from unsigned integer uint_ to pointer of type type_.

This macro encapsulates the cast to (type_ *), which QP ports or application might use to access embedded hardware registers. Such uses can trigger PC-Lint "Note 923: cast from int to pointer" and this macro helps to encapsulate this deviation.

Definition at line 204 of file qevt.h.

#define QP_VERSION   0x4504U

The current QP version number.

Returns:
version of the QP as a hex constant constant 0xXYZZ, where X is a 1-digit major version number, Y is a 1-digit minor version number, and ZZ is a 2-digit release number.

Definition at line 54 of file qevt.h.

Referenced by QEP_getVersion(), QF_getVersion(), and QS_getVersion().


Typedef Documentation

typedef char char_t

typedef for character strings.

This typedef specifies character type for exclusive use in character strings. Use of this type, rather than plain 'char', is in compliance with the MISRA-C 2004 Rules 6.1(req), 6.3(adv).

Definition at line 148 of file qevt.h.

typedef int enum_t

typedef for enumerations used for event signals

Definition at line 157 of file qevt.h.

typedef float float32_t

typedef for 32-bit IEEE 754 floating point numbers

Definition at line 151 of file qevt.h.

typedef double float64_t

typedef for 64-bit IEEE 754 floating point numbers

Definition at line 154 of file qevt.h.

typedef QEvt QEvent

typedef for backwards compatibility

Definition at line 208 of file qevt.h.

typedef uint16_t QSignal

QSignal represents the signal of an event.

The relationship between an event and a signal is as follows. A signal in UML is the specification of an asynchronous stimulus that triggers reactions [UML document ptc/03-08-02], and as such is an essential part of an event. (The signal conveys the type of the occurrence-what happened?) However, an event can also contain additional quantitative information about the occurrence in form of event parameters.

Definition at line 133 of file qevt.h.