Revision 35c9457f doc/classdiagrams/overview.uml
| doc/classdiagrams/overview.uml | ||
|---|---|---|
| 54 | 54 |
uint64_t |
| 55 | 55 |
} |
| 56 | 56 |
|
| 57 |
/' Just a function for debugging. '/ |
|
| 58 |
class urt_debug <<(F,white)>> {
|
|
| 59 |
'Checks the condition in debug mode. |
|
| 60 |
+ urtDebugAssert(condition : bool) : void |
|
| 61 |
} |
|
| 62 |
|
|
| 63 |
/' Node synchronization type. '/ |
|
| 64 |
class urt_nodesync_t <<T,lightblue>> {
|
|
| 65 |
'configurable |
|
| 66 |
uin8_t |
|
| 67 |
.. or .. |
|
| 68 |
int8_t |
|
| 69 |
.. or .. |
|
| 70 |
uint16_t |
|
| 71 |
.. or .. |
|
| 72 |
int16_t |
|
| 73 |
.. or .. |
|
| 74 |
uint32_t |
|
| 75 |
.. or .. |
|
| 76 |
int32_t |
|
| 77 |
.. or .. |
|
| 78 |
uint64_t |
|
| 79 |
.. or .. |
|
| 80 |
int64_t |
|
| 81 |
} |
|
| 82 |
|
|
| 57 | 83 |
} /' package "primitives" '/ |
| 58 | 84 |
|
| 59 | 85 |
|
| 60 | 86 |
|
| 61 | 87 |
package "interfaces" {
|
| 62 | 88 |
|
| 89 |
/' Not a type but a set of configuration macros. '/ |
|
| 90 |
class urt_config <<(C,grey)>> {
|
|
| 91 |
'Selection to en-/disable debug checks. |
|
| 92 |
+ URT_CONFIG_DEBUG : bool |
|
| 93 |
} |
|
| 94 |
|
|
| 63 | 95 |
/' OS time type with arbitrary resolution. '/ |
| 64 | 96 |
class urt_osTime_t <<(T,lightblue)>> {
|
| 65 | 97 |
'Converts an OS time to 64 bit microsecond precise value. |
| ... | ... | |
| 151 | 183 |
URT_THREAD_TERMINATE_KILL = 9 |
| 152 | 184 |
} |
| 153 | 185 |
|
| 186 |
/' Thread execution states. '/ |
|
| 187 |
enum urt_osThreadState_t {
|
|
| 188 |
'Thread is currently being executed. |
|
| 189 |
URT_THREAD_STATE_RUNNING = 0 |
|
| 190 |
'Thread is ready but waiting to be scheduled. |
|
| 191 |
URT_THREAD_STATE_READY = 1 |
|
| 192 |
'Thread is actively sleeping. |
|
| 193 |
URT_THREAD_STATE_SLEEPING = 2 |
|
| 194 |
'Thread has ben suspended explicitely. |
|
| 195 |
URT_THREAD_STATE_SUSPENDED = 3 |
|
| 196 |
'Thread is waiting for something (e.g. Mutex, event, etc.). |
|
| 197 |
URT_THREAD_STATE_WAITING = 4 |
|
| 198 |
'Thread has terminated. |
|
| 199 |
URT_THREAD_STATE_TERMINATED = 5 |
|
| 200 |
} |
|
| 201 |
|
|
| 154 | 202 |
/' OS thread interface. '/ |
| 155 | 203 |
class urt_osThread_t <<(T,lightblue)>> {
|
| 156 | 204 |
'Minimum priority for low priority threads. |
| ... | ... | |
| 180 | 228 |
+ URT_THREAD_MAX_USLEEP : unsigned int |
| 181 | 229 |
__ |
| 182 | 230 |
'Macro to setup working area as static variable (handles alignment if required). |
| 183 |
+ URT_THREAD_WORKING_AREA (var : varname, stacksize : size_t)
|
|
| 231 |
+ URT_THREAD_WORKING_AREA (varname, stacksize)
|
|
| 184 | 232 |
.. |
| 185 | 233 |
'Initializes an urt_osThread_t object. |
| 186 | 234 |
+ urtThreadInit (wa : void*, wasize : size_t, func : urt_osThreadFunction_t*, arg : void*) : urt_osThread_t* |
| ... | ... | |
| 193 | 241 |
'Sets the priority of a thread. |
| 194 | 242 |
+ urtThreadSetPriority (thread : urt_osThread_t*, prio : urt_osThreadPrio_t) : void |
| 195 | 243 |
'Retrieves the first thread in the list of children. |
| 196 |
+ urtThreadGetChildren (thread : urt_osThread_t*) : urt_osThread_t* |
|
| 197 |
'Retrieves the parent thread. |
|
| 198 |
+ urtThreadGetParent (thread : urt_osThread_t*) : urt_osThread_t* |
|
| 199 |
'The calling threads suspends execution until it is woken up by calling urtTheadResume(). |
|
| 200 | 244 |
+ urtThreadSuspend (void) : void |
| 201 |
'Retrieves whether a thread is currently suspended. |
|
| 202 |
+ urtThreadIsSuspended (thread : urt_osThread_t*) : bool |
|
| 203 | 245 |
'Wakes a suspended thread. |
| 204 | 246 |
+ urtThreadResume (thread : urt_osThread_t*) : urt_status_t |
| 205 | 247 |
'Suspends the calling thread for the specified time. |
| ... | ... | |
| 218 | 260 |
+ urtThreadTerminate (thread : urt_osThread_t*, sig : urt_osThreadTerminateSignal_t) : void |
| 219 | 261 |
'Waits until the specified thread terminates. |
| 220 | 262 |
+ urtThreadJoin (thread : urt_osThread_t*) : void |
| 263 |
'Retrieves the execution state of the specified thread. |
|
| 264 |
+ urtThreadGetState (thread : urt_osThread_t*) : urt_osThreadState_t |
|
| 265 |
'Retrieves the first child of a thread (or ""NULL""). |
|
| 266 |
+ urtThreadGetChildren (thread : urt_osThread_t*) : urt_osThread_t* |
|
| 267 |
'Retrieves a sibling (next child in a list) of the thread or ""NULL"". |
|
| 268 |
+ urtThreadGetSibling (thread : urt_osThread_t*) : urt_psThread_t* |
|
| 221 | 269 |
} |
| 222 | 270 |
urt_osThread_t ..> urt_osThreadPrio_t |
| 223 | 271 |
urt_osThread_t ..> urt_osThreadFunction_t |
| 224 | 272 |
urt_osThread_t ..> urt_osTime_t |
| 225 | 273 |
urt_osThread_t ..> urt_osThreadTerminateSignal_t |
| 274 |
urt_osThread_t ..> urt_osThreadState_t |
|
| 226 | 275 |
|
| 227 | 276 |
} /' package "thread" '/ |
| 228 | 277 |
|
| 229 | 278 |
package "events" {
|
| 230 | 279 |
|
| 231 | 280 |
/' OS event mask type. '/ |
| 232 |
class urt_osEventMask_t <<(T,lightblue)>> |
|
| 281 |
class urt_osEventMask_t <<(T,lightblue)>> {
|
|
| 282 |
'The event mask, which will be handled with maximum priority by the event system. |
|
| 283 |
+ URT_EVENTMASK_MAXPRIO : urt_osEventMask_t |
|
| 284 |
} |
|
| 233 | 285 |
|
| 234 | 286 |
/' OS event flag type. '/ |
| 235 | 287 |
class urt_osEventFlags_t <<(T,lightblue)>> |
| ... | ... | |
| 278 | 330 |
|
| 279 | 331 |
} /' package "events" '/ |
| 280 | 332 |
|
| 333 |
/' Not a class/type but a set of output-related functions. '/ |
|
| 334 |
class urt_streams <<(F,white)>> {
|
|
| 335 |
'Prints a formatted string to the standard output stream (stdout). |
|
| 336 |
+ urtPrintf(fmt : char*, ... ) : int |
|
| 337 |
'Prints a formatted string to the standard error stream (stderr). |
|
| 338 |
+ urtErrPrintf(fmt : char*, ... ) : int |
|
| 339 |
} |
|
| 340 |
|
|
| 281 | 341 |
} /' package "interfaces" '/ |
| 282 | 342 |
|
| 283 | 343 |
package "middleware" {
|
| ... | ... | |
| 464 | 524 |
'Pointer to the next topic in a list. |
| 465 | 525 |
+ next : urt_topic_t* |
| 466 | 526 |
'Mutex lock for exclusive access. |
| 467 |
+ mutex : urt_osMutex_t
|
|
| 527 |
+ lock : urt_osMutex_t
|
|
| 468 | 528 |
'Event source to inform all subscribers when a new message is published. |
| 469 | 529 |
+ evtSource : urt_osEventSource_t |
| 470 | 530 |
'Number of HRT subscribers. |
| ... | ... | |
| 487 | 547 |
__ |
| 488 | 548 |
'Initializes an urt_topic_t object. |
| 489 | 549 |
+ urtTopicInit (topic : urt_topic_t*, id : urt_topicid_t) : urt_status_t |
| 490 |
'Appends the given list of messages to the topic's buffer. |
|
| 491 |
+ urtTopicContributeMessages (topic : urt_topic_t*, messages : urt_message_t*) : void |
|
| 492 | 550 |
} |
| 493 | 551 |
urt_topic_t "1" o-- "0..1" urt_topic_t |
| 494 | 552 |
urt_topic_t "1" *-- "1" urt_osMutex_t |
| ... | ... | |
| 507 | 565 |
- {static} _nodes : urt_node_t*
|
| 508 | 566 |
'List of topics ordered by their identifiers. |
| 509 | 567 |
- {static} _topics : urt_topic_t*
|
| 568 |
'Event source for control events. |
|
| 569 |
- {static} _evtSource : urt_osEventSource_t
|
|
| 570 |
'Mutex used for synchronization. |
|
| 571 |
- {static} _lock : urt_osMutex_t
|
|
| 510 | 572 |
__ |
| 511 | 573 |
'Initializes the urt_core_t object. |
| 512 | 574 |
+ urtCoreInit (void) : urt_status_t |
| 513 |
'Starts all nodes. |
|
| 514 |
+ urtCoreStartAll (void) : urt_status_t |
|
| 575 |
'Starts all node threads (nodes will block before the loop). |
|
| 576 |
+ urtCoreStartNodes (void) : urt_status_t |
|
| 577 |
'Nodes can use this function to synchronize globally. |
|
| 578 |
+ urtCoreSynchronizeNodes (node : urt_node_t*, stage : urt_nodesync_t) : urt_status_t |
|
| 515 | 579 |
'Stops all nodes. |
| 516 |
+ urtCoreStopAll (void) : urt_status_t
|
|
| 580 |
+ urtCoreStopNodes (void) : urt_status_t
|
|
| 517 | 581 |
'Retrieves a topic given an identifier. |
| 518 | 582 |
+ urtCoreRetrieveTopic (id : urt_topicid_t) : urt_topic_t* |
| 519 | 583 |
} |
| 520 | 584 |
urt_core_t "1" o-- "0..*" urt_topic_t |
| 521 | 585 |
urt_core_t "1" o-- "0..*" urt_node_t |
| 586 |
urt_core_t "1" *-- "1" urt_osEventSource_t |
|
| 587 |
urt_core_t "1" *-- "1" urt_osMutex_t |
|
| 522 | 588 |
urt_core_t ..> urt_status_t |
| 589 |
urt_core_t --> urt_nodesync_t |
|
| 523 | 590 |
urt_core_t ..> urt_topicid_t |
| 524 | 591 |
|
| 525 | 592 |
package "node" {
|
| 526 | 593 |
|
| 527 | 594 |
/' Function type to be called during setup phase of node threads. '/ |
| 528 | 595 |
class urt_nodeSetupCallback_t <<(T,lightblue)>> {
|
| 529 |
'Takes the node and optional parameters as arguments. |
|
| 530 |
urt_nodeSetupCallback_t (node : urt_node_t*, arg : void*) : urt_status_t
|
|
| 596 |
'Takes the node and optional parameters as arguments and returns a event mask for the next iteration.
|
|
| 597 |
urt_nodeSetupCallback_t (node : urt_node_t*, arg : void*) : urt_osEventMask_t
|
|
| 531 | 598 |
} |
| 532 | 599 |
urt_nodeSetupCallback_t ..> urt_node_t |
| 533 | 600 |
urt_nodeSetupCallback_t ..> urt_status_t |
| 534 | 601 |
|
| 535 | 602 |
/' Function type to be called during loop phase of node threads. '/ |
| 536 | 603 |
class urt_nodeLoopCallback_t <<(T,lightblue)>> {
|
| 537 |
'Takes the node, a mask of occurred events and optional parameters as arguments. |
|
| 538 |
urt_nodeLoopCallback_t (node : urt_node_t*, events : urt_osEventMask_t, arg : void*) : urt_status_t
|
|
| 604 |
'Takes the node, a mask of occurred events and optional parameters as arguments and returns a event mask for the next iteration.
|
|
| 605 |
urt_nodeLoopCallback_t (node : urt_node_t*, events : urt_osEventMask_t, arg : void*) : urt_osEventMask_t
|
|
| 539 | 606 |
} |
| 540 | 607 |
urt_nodeLoopCallback_t ..> urt_node_t |
| 541 | 608 |
urt_nodeLoopCallback_t ..> urt_osEventMask_t |
| ... | ... | |
| 555 | 622 |
+ loopcallback : urt_nodeLoopCallback_t* |
| 556 | 623 |
'Optional parameters for the loop callback function. |
| 557 | 624 |
+ loopparams : void* |
| 558 |
'A mask for which events to wait.
|
|
| 559 |
+ waitmask : urt_osEventMask_t
|
|
| 560 |
'How the node will wait for events.
|
|
| 561 |
+ waittype : urt_osEventWaitType_t
|
|
| 625 |
'Execution stage of the node.
|
|
| 626 |
+ stage : urt_nodesync_t
|
|
| 627 |
'Event listener for middleware-wide control events.
|
|
| 628 |
+ listener : urt_osEventListener_t
|
|
| 562 | 629 |
__ |
| 563 | 630 |
'The main() function of the node thread. |
| 564 | 631 |
- {static} _main : urt_osThreadFunction_t
|
| 565 | 632 |
'Initializes an urt_node_t object. |
| 566 | 633 |
+ urtNodeInit (node : urt_node_t*, stacksize : size_t, setupcallback : urt_nodeSetupCallback_t*, setupparams : void*, loopcallback : urt_nodeLoopCallback_t*, loopparams : void*) : urt_status_t |
| 567 |
'Terminate a node thread and all its child threads (if any). |
|
| 568 |
+ urtNodeTerminateRecusively (node : urt_node_t*, sig : urt_osThreadTerminateSignal_t) : void |
|
| 569 |
'Wait for a node thread an all its child threads (if any) to terminate. |
|
| 570 |
+ urtNodeJoinRecursively (node : urt_node_t*) : void |
|
| 571 | 634 |
} |
| 572 | 635 |
urt_node_t "1" o-- "0..1" urt_node_t |
| 573 | 636 |
urt_node_t "1" o-- "1" urt_osThread_t |
| 574 | 637 |
urt_node_t "1" o-- "1" urt_nodeSetupCallback_t |
| 575 | 638 |
urt_node_t "1" o-- "1" urt_nodeLoopCallback_t |
| 639 |
urt_node_t "1" *-- "1" urt_nodesync_t |
|
| 576 | 640 |
urt_node_t "1" *-- "1" urt_osEventMask_t |
| 577 | 641 |
urt_node_t "1" *-- "1" urt_osEventWaitType_t |
| 642 |
urt_node_t "1" *-- "1" urt_osEventListener_t |
|
| 578 | 643 |
urt_node_t ..> urt_osThreadTerminateSignal_t |
| 579 | 644 |
|
| 580 | 645 |
} /' package "node" '/ |
Also available in: Unified diff