Statistics
| Branch: | Revision:

urtware / doc / activitydiagrams / subscriber / urtHrtSubscriberUnsubscribe.uml @ e87bd7c7

History | View | Annotate | Download (3.084 KB)

1
/'
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
/'### INTRO ##################################################################'/
23

    
24
@startuml
25

    
26
title **µRtWare**\nurtHrtSubscriberUnsubscribe()\n
27

    
28
/'### PARAMETERS & RETURN ####################################################'/
29

    
30
start
31
note
32
  -- **subscriber** : urt_hrtsubscriber_t* --
33
  The HRT subscriber to be unsubscribed.
34
  Must not be ""NULL"".
35
  ====
36
  -- **return** : urt_status_t --
37
  Returns ""URT_STATUS_OK"" on sucess.
38
  Returns ""URT_STATUS_ERROR"" if the subscriber is not associated to a topic.
39
endnote
40

    
41
/'### PROCEDURE ##############################################################'/
42

    
43
if (Associated to a topic?) then (yes)
44
  :lock topic;
45
  fork
46
    :unregister event;
47
    note
48
      Must be within lock because of HRT counter.
49
    endnote
50
  fork again
51
    :decrement topic's HRT counter;
52
  fork again
53
    :remove self from topic's list of HRT subscribers;
54
    if (Was the most critical subscriber?) then (yes)
55
      :update QoS rate timer (@topic);
56
    else (no)
57
    endif
58
  fork again
59
    :access last read message;
60
    while (Timestamp of next message is younger?) is (yes)
61
      fork
62
        :proceed to next message;
63
      fork again
64
        :decrement next message's HRT counter;
65
      endfork
66
    endwhile (no)
67
    if (The HRT counter of any message became 0?) then (yes)
68
      :signal topic's condition variable;
69
    else (no)
70
    endif
71
  endfork
72
  :unlock topic;
73
  :reset members;
74
  note
75
    -- urt_basesubscriber_t --
76
    **topic** ← ""NULL""
77
    **lastMessage** ← ""NULL""
78
    **lastMessageTime** ← 0
79
    .. URT_CFG_PUBSUB_PROFILING == true ..
80
    **sumLatencies** ← 0
81
    **numMessagesReceived** ← 0
82
    -- urt_hrtsubscriber_t --
83
    .. URT_CFG_PUBSUB_QOS_DEADLINECHECKS == true ..
84
    **deadlineOffset** ← 0
85
    .. URT_CFG_PUBSUB_QOS_RATECHECKS == true ..
86
    **expectedRate** ← 0
87
    .. URT_CFG_PUBSUB_QOS_JITTERCHECKS == true ..
88
    **maxJitter** ← 0
89
    .. URT_CFG_PUBSUB_QOS_JITTERCHECKS == true || URT_CFG_PUBSUB_PROFILING == true ..
90
    **minLatency** ← 0xF..F
91
    **maxLatency** ← 0
92
  endnote
93
  stop
94
  note
95
    Returns ""URT_STATUS_OK"".
96
  endnote
97
else (no)
98
  stop
99
  note
100
    Returns ""URT_STATUS_ERROR"".
101
  endnote
102
endif
103

    
104
/'### OUTRO ##################################################################'/
105

    
106
@enduml