Statistics
| Branch: | Revision:

urtware / inc / urt_basesubscriber.h @ 982056f7

History | View | Annotate | Download (3.127 KB)

1 982056f7 Svenja
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7

8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21
22
#ifndef URTWARE_BASESUBSCRIBER_H
23
#define URTWARE_BASESUBSCRIBER_H
24
25
#include <urt_osal.h>
26
#include <urt_confcheck.h>
27
28
/******************************************************************************/
29
/* CONSTANTS                                                                  */
30
/******************************************************************************/
31
32
/******************************************************************************/
33
/* SETTINGS                                                                   */
34
/******************************************************************************/
35
36
/******************************************************************************/
37
/* CHECKS                                                                     */
38
/******************************************************************************/
39
40
/******************************************************************************/
41
/* DATA STRUCTURES AND TYPES                                                  */
42
/******************************************************************************/
43
44
struct urt_topic;
45
46
/**
47
 * @brief  Base subscriber
48
 * @details The base subscriber is included in each specialized subscriber
49
 */
50
typedef struct urt_basesubscriber
51
{
52
  struct urt_topic* topic;
53
  urt_osEventListener_t evtListener;
54
  urt_message_t* lastMessage;
55
  urt_osTime_t lastMessageTime;
56
  #if (URT_CFG_PUBSUB_PROFILING)
57
    uint64_t sumLatencies;
58
    uint64_t numMessagesReceived;
59
  #endif /* URT_CFG_PUBSUB_PROFILING */
60
}urt_basesubscriber_t;
61
62
/******************************************************************************/
63
/* MACROS                                                                     */
64
/******************************************************************************/
65
66
/******************************************************************************/
67
/* EXTERN DECLARATIONS                                                        */
68
/******************************************************************************/
69
70
/******************************************************************************/
71
/* INLINE FUNCTIONS                                                           */
72
/******************************************************************************/
73
74
#endif /* URTWARE_BASESUBSCRIBER_H */