Statistics
| Branch: | Revision:

urtware / doc / classdiagrams / urtware.uml @ e7056e1b

History | View | Annotate | Download (6.721 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**
27

    
28
!include ./functions.iuml
29

    
30
/'### ENTITIES ###############################################################'/
31

    
32
!startsub ENTITIES
33

    
34
/' µRtWare core structure. '/
35
$structure("urt_core_t") {
36
    'List of nodes ordered by their (initial) priority.
37
  - {field} {static} _nodes : urt_node_t*
38
    'Event source for control events.
39
  - {field} {static} _evtSource : urt_osEventSource_t
40
    'Mutex used for synchronization.
41
  - {field} {static} _lock : urt_osMutex_t
42
    'System execution/health status.
43
  - {field} {static} _status : urt_status_t
44
  .. URT_CFG_PUBSUB_ENABLED == true ..
45
    'List of topics ordered by their identifiers.
46
  - {field} {static} _topics : urt_topic_t*
47
  .. URT_CFG_RPC_ENABLED == true ..
48
    'List of services ordered by their identifiers.
49
  - {field} {static} _services : urt_service_t*
50
  __
51
    'Initializes the urt_core_t object.
52
  + {method} urtCoreInit (void) : void
53
    'Retrieves the current system status.
54
  + {method} urtCoreGetStatus (void) : urt_status_t
55
    'Starts all node threads (nodes will block before the loop).
56
  + {method} urtCoreGetEventMask (void) : urt_osEventMask_t
57
    'Retrieve the core event mask.
58
  + {method} urtCoreGetEvtSource (void) : urt_osEventSource_t*
59
    'Retrieve the core event source.
60
  + {method} urtCoreStartNodes (void) : void
61
    'Nodes can use this function to synchronize.
62
  + {method} urtCoreSynchronizeNodes (node : urt_node_t*) : urt_status_t
63
    'Stops all nodes and propagates a specified reason.
64
  + {method} urtCoreStopNodes (reason : urt_status_t) : urt_status_t
65
    'Retrieve the core event source.
66
  + {method} urtCoreGetEventSource (void) : urt_osEventSource_t*
67
    'Retrieve the core mutex lock.
68
  + {method} urtCoreGetMutex (void) : urt_osMutex_t*
69
  + {method} urtCoreGetNodes (void) : urt_node_t*
70
    'Retrieve node of the core.
71
  + {method} urtCoreAddNode (node : urt_node_t*) : urt_status_t
72
    'Prepend node to core's list of nodes..
73
  .. URT_CFG_PUBSUB_ENABLED == true ..
74
    'Retrieves a topic given an identifier.
75
  + {method} urtCoreGetTopic (id : urt_topicid_t) : urt_topic_t*
76
    'Append topic to core's list of topics.
77
  + {method} urtCoreAddTopic (topic : urt_topic_t*) : urt_status_t
78
  .. URT_CFG_RPC_ENABLED == true ..
79
    'Retrieves a service given an identifier.
80
  + {method} urtCoreGetService (id : urt_serviceid_t) : urt_service_t*
81
  + {method} urtCoreAddService (service : urt_service_t*) : urt_status_t
82
}
83

    
84
$group("node") {
85
  /' Function type to be called during setup phase of node threads. '/
86
  $type("urt_nodeSetupCallback_t") {
87
      'Takes the node and optional parameters as arguments and returns a event mask for the next iteration.
88
    urt_nodeSetupCallback_t (node : urt_node_t*, arg : void*) : urt_osEventMask_t
89
  }
90

    
91
  /' Function type to be called during loop phase of node threads. '/
92
  $type("urt_nodeLoopCallback_t") {
93
      'Takes the node, a mask of occurred events and optional parameters as arguments and returns a event mask for the next iteration.
94
    urt_nodeLoopCallback_t (node : urt_node_t*, events : urt_osEventMask_t, arg : void*) : urt_osEventMask_t
95
  }
96

    
97
  /' Function type to be called during shutdown phase of node threads. '/
98
  $type("urt_nodeShutdownCallback_t") {
99
      'Takes the node, an error code defining the cause of the shutdown and optional parameters as argumnets.
100
    urt_nodeShutdownCallback_t (node : urt_node_t*, cause : urt_status_t, arg : void*) : void
101
  }
102

    
103
  /' Node structure. '/
104
  $structure("urt_node_t") {
105
      'Pointer to the next node in a list.
106
    + {field} next : urt_node_t*
107
      'Pointer to the node thread.
108
    + {field} thread : urt_osThread_t*
109
      'Optional callback function to be called during the setup phase.
110
    + {field} setupcallback : urt_nodeSetupCallback_t*
111
      'Optional parameters for the setup callback function.
112
    + {field} setupparams : void*
113
      'Callback function to be called in each loop iteration.
114
    + {field} loopcallback : urt_nodeLoopCallback_t*
115
      'Optional parameters for the loop callback function.
116
    + {field} loopparams : void*
117
      'Optional callback function to be called during the shutdown phase.
118
    + {field} shutdowncallback : urt_nodeShutdownCallback_t*
119
      'Optional parameters for the shutdown callback function.
120
    + {field} shutdownparams : void*
121
      'Execution stage of the node.
122
    + {field} stage : urt_nodestage_t
123
      'Event listener for middleware-wide control events.
124
    + {field} listener : urt_osEventListener_t
125
    .. URT_CFG_PUBSUB_PROFILING == true || URT_CFG_RPC_PROFILING = true ..
126
      'Counter of executed loops.
127
    + {field} loops : uint64_t
128
    __
129
    'The main() function of the node thread.
130
    - {method} {static} _main : urt_osThreadFunction_t
131
      'Initializes an urt_node_t object.
132
    + {method} urtNodeInit (node : urt_node_t*, thread : urt_osThread_t*, setupcallback : urt_nodeSetupCallback_t*, setupparams : void*, loopcallback : urt_nodeLoopCallback_t*, loopparams : void*, shutdowncallback : urt_nodeShutdownCallback_t*, shutodwnparams : void*) : void
133
  }
134
} /'node'/
135

    
136
$module("Publish-Subscribe System") {
137
  !includesub pubsub.uml!ENTITIES
138
}
139

    
140
$module("Remote Procedure Call System") {
141
  !includesub rpc.uml!ENTITIES
142
}
143

    
144
!endsub
145

    
146
/'### DEPENDENCIES & LAYOUT ##################################################'/
147

    
148
!startsub DEPENDENCIES
149

    
150
urt_node_t "1" o-- "0,1" urt_node_t
151
urt_node_t "1" o-- "0,1" urt_nodeSetupCallback_t
152
urt_node_t <.. urt_nodeSetupCallback_t
153
urt_node_t "1" o-- "1" urt_nodeLoopCallback_t
154
urt_node_t <.. urt_nodeLoopCallback_t
155
urt_node_t "1" o-- "0,1" urt_nodeShutdownCallback_t
156
urt_node_t <.. urt_nodeShutdownCallback_t
157

    
158
!includesub pubsub.uml!DEPENDENCIES
159

    
160
!includesub rpc.uml!DEPENDENCIES
161

    
162
urt_core_t "1" o-- "0,1" urt_node_t
163
urt_core_t "1" o-- "0,1" urt_topic_t
164
urt_core_t "1" o-- "0,1" urt_service_t
165

    
166
!endsub
167

    
168
/'### OUTRO ##################################################################'/
169

    
170
@enduml