/' µRtWare is a lightweight publish/subscribe middleware for real-time applications. It was developed as part of the software habitat for the Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well. Copyright (C) 2018..2020 Thomas Schöpping et al. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . '/ /' Fetch a message and update/copy all data. '/ !procedure $fetch_message() partition "fetch message" { fork :update message pointer; fork again :copy message origin time; fork again :copy message payload; endfork } !endprocedure /' Find the latest message in the circular message buffer. '/ !procedure $find_latest_message() partition "find latest message" { :access ""lastMessage""; while (Timestamp of next message is younger?) is (yes) fork :proceed to next message; #EEEEEE:..//URT_CFG_PUBSUB_PROFILING == true//..\ndecrement counter of consumers left (@message); fork again #EEEEEE:..//URT_CFG_PUBSUB_PROFILING == true//..\nincrement counter of received messages; endfork endwhile (no) } !endprocedure /' Find the oldest message in the circular message buffer. '/ !procedure $find_oldest_message() partition "find oldest valid message" { if (Timestamp of last read message euqals local copy?) then (yes) else (no) while (Timestamp of next message is younger?) is (yes) #EEEEEE:..//URT_CFG_PUBSUB_PROFILING == true//..\ndecrement counter of consumers left (@message); :proceed to next message; endwhile (no) endif #EEEEEE:..//URT_CFG_PUBSUB_PROFILING == true//..\ndecrement counter of consumers left (@message); :proceed to next message; } !endprocedure