Revision cd21e832 inc/urt_subscriber.h

View differences:

inc/urt_subscriber.h
47 47
 */
48 48
typedef struct urt_basesubscriber
49 49
{
50
    urt_topic_t* topic;
51
    urt_osEventListener_t evtListener;
52
    urt_message_t* lastMessage;
53
    urt_osTime_t lastMessageTime;
54
    #if (URT_CFG_PUBSUB_PROFILING)
55
        uint64_t sumLatencies;
56
        uint64_t numMessagesReceived;
57
    #endif /* URT_CFG_PUBSUB_PROFILING */
50
  urt_topic_t* topic;
51
  urt_osEventListener_t evtListener;
52
  urt_message_t* lastMessage;
53
  urt_osTime_t lastMessageTime;
54
  #if (URT_CFG_PUBSUB_PROFILING)
55
    uint64_t sumLatencies;
56
    uint64_t numMessagesReceived;
57
  #endif /* URT_CFG_PUBSUB_PROFILING */
58 58
}urt_basesubscriber_t;
59 59

  
60 60
/**
......
62 62
 */
63 63
typedef struct urt_nrtsubscriber
64 64
{
65
    urt_basesubscriber_t base;
66
    #if (URT_CFG_PUBSUB_PROFILING)
67
        urt_delay_t minLatency;
68
        urt_delay_t maxLatency;
69
    #endif /* URT_CFG_PUBSUB_PROFILING */
65
  urt_basesubscriber_t base;
66
  #if (URT_CFG_PUBSUB_PROFILING)
67
    urt_delay_t minLatency;
68
    urt_delay_t maxLatency;
69
  #endif /* URT_CFG_PUBSUB_PROFILING */
70 70
}urt_nrtsubscriber_t;
71 71

  
72 72
/**
......
74 74
 */
75 75
typedef struct urt_srtsubscriber
76 76
{
77
    urt_basesubscriber_t base;
78
    urt_srtusefulnessfunc_t* usefulnesscb;
79
    #if (URT_CFG_PUBSUB_PROFILING)
80
        urt_delay_t minLatency;
81
        urt_delay_t maxLatency;
82
    #endif /* URT_CFG_PUBSUB_PROFILING */
77
  urt_basesubscriber_t base;
78
  urt_srtusefulnessfunc_t* usefulnesscb;
79
  #if (URT_CFG_PUBSUB_PROFILING)
80
    urt_delay_t minLatency;
81
    urt_delay_t maxLatency;
82
  #endif /* URT_CFG_PUBSUB_PROFILING */
83 83
}urt_srtsubscriber_t;
84 84

  
85 85
/**
......
87 87
 */
88 88
typedef struct urt_frtsubscriber
89 89
{
90
    urt_basesubscriber_t base;
91
    #if (URT_CFG_PUBSUB_QOS_DEADLINECHECKS)
92
        urt_delay_t deadlineOffset;
93
    #endif /* URT_CFG_PUBSUB_QOS_DEADLINECHECKS */
94
    #if (URT_CFG_PUBSUB_QOS_JITTERCHECKS)
95
        urt_delay_t maxJitter;
96
    #endif /* URT_CFG_PUBSUB_QOS_JITTERCHECKS */
97
    #if (URT_CFG_PUBSUB_QOS_JITTERCHECKS || URT_CFG_PUBSUB_PROFILING)
98
        urt_delay_t minLatency;
99
        urt_delay_t maxLatency;
100
    #endif /* URT_CFG_PUBSUB_QOS_JITTERCHECKS || URT_CFG_PUBSUB_PROFILING */
90
  urt_basesubscriber_t base;
91
  #if (URT_CFG_PUBSUB_QOS_DEADLINECHECKS)
92
    urt_delay_t deadlineOffset;
93
  #endif /* URT_CFG_PUBSUB_QOS_DEADLINECHECKS */
94
  #if (URT_CFG_PUBSUB_QOS_JITTERCHECKS)
95
    urt_delay_t maxJitter;
96
  #endif /* URT_CFG_PUBSUB_QOS_JITTERCHECKS */
97
  #if (URT_CFG_PUBSUB_QOS_JITTERCHECKS || URT_CFG_PUBSUB_PROFILING)
98
    urt_delay_t minLatency;
99
    urt_delay_t maxLatency;
100
  #endif /* URT_CFG_PUBSUB_QOS_JITTERCHECKS || URT_CFG_PUBSUB_PROFILING */
101 101
}urt_frtsubscriber_t;
102 102

  
103 103
/**
......
105 105
 */
106 106
typedef struct urt_hrtsubscriber
107 107
{
108
    urt_basesubscriber_t base;
109
    urt_hrtsubscriber_t* next;
110
    #if (URT_CFG_PUBSUB_QOS_DEADLINECHECKS)
111
        urt_delay_t deadlineOffset;
112
        urt_osTimer_t qosDeadlineTimer;
113
    #endif /* URT_CFG_PUBSUB_QOS_DEADLINECHECKS */
114
    #if (URT_CFG_PUBSUB_QOS_JITTERCHECKS)
115
        urt_delay_t maxJitter;
116
    #endif /* URT_CFG_PUBSUB_QOS_JITTERCHECKS */
117
    #if (URT_CFG_PUBSUB_QOS_JITTERCHECKS || URT_CFG_PUBSUB_PROFILING)
118
        urt_delay_t minLatency;
119
        urt_delay_t maxLatency;
120
    #endif /* URT_CFG_PUBSUB_QOS_JITTERCHECKS || URT_CFG_PUBSUB_PROFILING */
121
    #if (URT_CFG_PUBSUB_QOS_RATECHECKS)
122
        urt_delay_t expectedRate;
123
    #endif /* URT_CFG_PUBSUB_QOS_RATECHECKS */
108
  urt_basesubscriber_t base;
109
  urt_hrtsubscriber_t* next;
110
  #if (URT_CFG_PUBSUB_QOS_DEADLINECHECKS)
111
    urt_delay_t deadlineOffset;
112
    urt_osTimer_t qosDeadlineTimer;
113
  #endif /* URT_CFG_PUBSUB_QOS_DEADLINECHECKS */
114
  #if (URT_CFG_PUBSUB_QOS_JITTERCHECKS)
115
    urt_delay_t maxJitter;
116
  #endif /* URT_CFG_PUBSUB_QOS_JITTERCHECKS */
117
  #if (URT_CFG_PUBSUB_QOS_JITTERCHECKS || URT_CFG_PUBSUB_PROFILING)
118
    urt_delay_t minLatency;
119
    urt_delay_t maxLatency;
120
  #endif /* URT_CFG_PUBSUB_QOS_JITTERCHECKS || URT_CFG_PUBSUB_PROFILING */
121
  #if (URT_CFG_PUBSUB_QOS_RATECHECKS)
122
    urt_delay_t expectedRate;
123
  #endif /* URT_CFG_PUBSUB_QOS_RATECHECKS */
124 124
}urt_hrtsubscriber_t;
125 125

  
126 126
/******************************************************************************/
......
135 135
extern "C" {
136 136
#endif /* defined(__cplusplus) */
137 137

  
138
    void urtNrtSubscriberInit(urt_nrtsubscriber_t* subscriber);
139
    urt_status_t urtNrtSubscriberSubscribe(urt_nrtsubscriber_t* subscriber, urt_topic_t* topic, urt_message_t* messages);
140
    urt_status_t urtNrtSubscriberFetchNextMessage(urt_nrtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency);
141
    urt_status_t urtNrtSubscriberFetchLatestMessage(urt_nrtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency);
142
    urt_status_t urtNrtSubscriberUnsubscribe(urt_nrtsubscriber_t* subscriber);
143

  
144
    void urtSrtSubscriberInit(urt_srtsubscriber_t* subscriber);
145
    urt_status_t urtSrtSubscriberSubscribe(urt_srtsubscriber_t* subscriber, urt_topic_t* topic, urt_message_t* message, urt_srtusefulnessfunc_t* usefulnesscb, void* cbparams);
146
    urt_status_t urtSrtSubscriberFetchNextMessage(urt_srtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency);
147
    urt_status_t urtSrtSubscriberFetchLatestMessage(urt_srtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency);
148
    urt_status_t urtSrtSubscriberCalculateUsefulness(urt_srtsubscriber_t* subscriber, urt_delay_t latency);
149
    urt_status_t urtSrtSubscriberUnsubscribe(urt_srtsubscriber_t* subscriber);
150

  
151
    void urtFrtSubscriberInit(urt_frtsubscriber_t* subscriber);
152
    urt_status_t urtFrtSubscriberSubscribe(urt_frtsubscriber_t* subscriber, urt_topic_t* topic, urt_message_t* messages, urt_delay_t deadline, urt_delay_t jitter);
153
    urt_status_t urtFrtSubscriberFetchNextMessage(urt_frtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency);
154
    urt_status_t urtFrtSubscriberFetchLatestMessage(urt_frtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency);
155
    bool urtFrtSubscriberCalculateValidity(urt_frtsubscriber_t* subscriber, urt_delay_t latency);
156
    urt_status_t urtFrtSubscriberUnsubscribe(urt_frtsubscriber_t* subscriber);
157

  
158
    void urtHrtSubscriberInit(urt_hrtsubscriber_t* subscriber);
159
    urt_status_t urtHrtSubscriberSubscribe(urt_hrtsubscriber_t* subscriber, urt_topic_t* topic, urt_message_t* message, urt_delay_t deadline, urt_delay_t rate, urt_delay_t jitter);
160
    urt_status_t urtHrtSubscriberFetchNextMessage(urt_hrtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency);
161
    urt_status_t urtHrtSubscriberFetchLatestMessage(urt_hrtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency);
162
    urt_status_t urtHrtSubscriberUnsubscribe(urt_hrtsubscriber_t* subscriber);
138
  void urtNrtSubscriberInit(urt_nrtsubscriber_t* subscriber);
139
  urt_status_t urtNrtSubscriberSubscribe(urt_nrtsubscriber_t* subscriber, urt_topic_t* topic, urt_message_t* messages);
140
  urt_status_t urtNrtSubscriberFetchNextMessage(urt_nrtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency);
141
  urt_status_t urtNrtSubscriberFetchLatestMessage(urt_nrtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency);
142
  urt_status_t urtNrtSubscriberUnsubscribe(urt_nrtsubscriber_t* subscriber);
143

  
144
  void urtSrtSubscriberInit(urt_srtsubscriber_t* subscriber);
145
  urt_status_t urtSrtSubscriberSubscribe(urt_srtsubscriber_t* subscriber, urt_topic_t* topic, urt_message_t* message, urt_srtusefulnessfunc_t* usefulnesscb, void* cbparams);
146
  urt_status_t urtSrtSubscriberFetchNextMessage(urt_srtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency);
147
  urt_status_t urtSrtSubscriberFetchLatestMessage(urt_srtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency);
148
  urt_status_t urtSrtSubscriberCalculateUsefulness(urt_srtsubscriber_t* subscriber, urt_delay_t latency);
149
  urt_status_t urtSrtSubscriberUnsubscribe(urt_srtsubscriber_t* subscriber);
150

  
151
  void urtFrtSubscriberInit(urt_frtsubscriber_t* subscriber);
152
  urt_status_t urtFrtSubscriberSubscribe(urt_frtsubscriber_t* subscriber, urt_topic_t* topic, urt_message_t* messages, urt_delay_t deadline, urt_delay_t jitter);
153
  urt_status_t urtFrtSubscriberFetchNextMessage(urt_frtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency);
154
  urt_status_t urtFrtSubscriberFetchLatestMessage(urt_frtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency);
155
  bool urtFrtSubscriberCalculateValidity(urt_frtsubscriber_t* subscriber, urt_delay_t latency);
156
  urt_status_t urtFrtSubscriberUnsubscribe(urt_frtsubscriber_t* subscriber);
157

  
158
  void urtHrtSubscriberInit(urt_hrtsubscriber_t* subscriber);
159
  urt_status_t urtHrtSubscriberSubscribe(urt_hrtsubscriber_t* subscriber, urt_topic_t* topic, urt_message_t* message, urt_delay_t deadline, urt_delay_t rate, urt_delay_t jitter);
160
  urt_status_t urtHrtSubscriberFetchNextMessage(urt_hrtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency);
161
  urt_status_t urtHrtSubscriberFetchLatestMessage(urt_hrtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency);
162
  urt_status_t urtHrtSubscriberUnsubscribe(urt_hrtsubscriber_t* subscriber);
163 163
#if defined(__cplusplus)
164 164
}
165 165
#endif /* defined(__cplusplus) */

Also available in: Unified diff