urtware / doc / activitydiagrams / core / urtCoreSynchronizeNodes.uml @ e87bd7c7
History | View | Annotate | Download (2.53 KB)
1 | e48e1ccf | 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 | 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**\nurtCoreSynchronizeNodes()\n |
||
27 | |||
28 | /'### PARAMETERS & RETURN ####################################################'/ |
||
29 | |||
30 | note |
||
31 | -- **node** : urt_node_t* -- |
||
32 | e87bd7c7 | Thomas Schöpping | Pointer to a node to synchronize. |
33 | e48e1ccf | Thomas Schöpping | Must not be ""NULL"". |
34 | ==== |
||
35 | -- **return** : urt_status_t -- |
||
36 | e87bd7c7 | Thomas Schöpping | Returns ""URT_STATUS_OK"" if all nodes are synchronized and proceed. |
37 | Returns ""URT_STATUS_ERROR"" if an exception occurred (faulty stage value detected). |
||
38 | Returns a value greater than ""URT_STATUS_OK"" but smaller than ""URT_STATUS_ERROR"" if there are nodes left to synchronize. |
||
39 | In the latter case, the node thread must still wait for the control event (proceed) to synchronize. |
||
40 | e48e1ccf | Thomas Schöpping | endnote |
41 | |||
42 | /'### PROCEDURE ##############################################################'/ |
||
43 | |||
44 | start |
||
45 | e87bd7c7 | Thomas Schöpping | :lock core; |
46 | :increment the node's stage value; |
||
47 | :access first node core's list of nodes; |
||
48 | while (Current node is not ""NULL""\nand stage of current node is equal to argument?) is (yes) |
||
49 | :proceed to next node; |
||
50 | endwhile (no) |
||
51 | if (The stage of a node was equal to the argument or 1 less than the argument?) then (yes) |
||
52 | :call ""urtCoreStopNodes(URT_STATUS_ERROR)""; |
||
53 | :unlock core; |
||
54 | stop |
||
55 | note |
||
56 | Returns ""URT_STATUS_ERROR"". |
||
57 | endnote |
||
58 | else (no) |
||
59 | endif |
||
60 | if (Stages of all nodes are equal to argument?) then (yes) |
||
61 | :broadcast control event (proceed); |
||
62 | :unlock core; |
||
63 | stop |
||
64 | note |
||
65 | Returns ""URT_STATUS_OK"". |
||
66 | endnote |
||
67 | else (no) |
||
68 | :unlock core; |
||
69 | stop |
||
70 | note |
||
71 | Returns a value greater than ""URT_STATUS_OK"" but smaller than ""URT_STATUS_ERROR"". |
||
72 | endnote |
||
73 | endif |
||
74 | e48e1ccf | Thomas Schöpping | |
75 | /'### OUTRO ##################################################################'/ |
||
76 | |||
77 | @enduml |