Statistics
| Branch: | Revision:

urtware / doc / statediagrams / subscriber / urtSubscriberSubscribe.uml @ 056e40d2

History | View | Annotate | Download (1.732 KB)

1 6ebd2388 Thomas Schöpping
/'
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 509d44c4 Thomas Schöpping
Copyright (C) 2018..2019  Thomas Schöpping et al.
7 6ebd2388 Thomas Schöpping
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
@startuml
23
24
title **µRtWare**\nurtSubscriberSubscribe()\n
25
26
27
28
start
29
fork
30
  if (Was rtclass specified?) then (yes)
31
    :set rtclass member;
32
  else (no)
33
  endif
34
fork again
35
  :set topic;
36
endfork
37
:lock topic;
38
fork
39 35c9457f Thomas Schöpping
  if (Messages specified to contribute?) then (yes)
40 6ebd2388 Thomas Schöpping
    partition "contribute messages" {
41
      :set ""next"" pointer of topic's latest message to first message to contribute;
42
      :set ""next"" pointer of last message to contribute to message formerly after the topic's latest message;
43
    }
44
  else (no)
45
  endif
46
fork again
47
  :set message pointer to topic's latest message;
48
endfork
49
if (Is HRT subscriber?) then (yes)
50
  fork
51
    :increase topic HRT counter;
52
  fork again
53
    :insert subscriber to topic list of HRT subscribers;
54
  endfork
55
else (no)
56
endif
57
:register to topic event source;
58
note
59
  Must be within lock because of HRT counter.
60
endnote
61
:unlock topic;
62
stop
63
64
@enduml