OpenCPN Partial API docs
Loading...
Searching...
No Matches
comm_appmsg_bus.h
1
2/***************************************************************************
3 *
4 * Project: OpenCPN
5 * Purpose: Decoded messages send/receive support. *
6 * Author: David Register, Alec Leamas
7 *
8 ***************************************************************************
9 * Copyright (C) 2022 by David Register, Alec Leamas *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * GNU General Public License for more details. *
20 * *
21 * You should have received a copy of the GNU General Public License *
22 * along with this program; if not, write to the *
23 * Free Software Foundation, Inc., *
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
25 **************************************************************************/
26
27#ifndef _APP_MSG_BUS_H
28#define _APP_MSG_BUS_H
29
30#include <memory>
31
32#include <wx/event.h>
33
34#include "comm_appmsg.h"
35
44 class AppMsgBus {
45public:
47 void Notify(std::shared_ptr<const AppMsg> msg);
48
53 void set_priority(AppMsg::Type data, const NavAddr& src, unsigned prio);
54
55 static AppMsgBus& GetInstance();
56};
57
58#endif // APP_MSG_BUS_H
Application layer messaging, a singleton.
void set_priority(AppMsg::Type data, const NavAddr &src, unsigned prio)
Set the priority for a given data source providing data.
void Notify(std::shared_ptr< const AppMsg > msg)
Send message to everyone listening to given message type.
Where messages are sent to or received from.
Definition: comm_navmsg.h:136