Goby3 3.5.1
2026.06.04
Loading...
Searching...
No Matches
null.h
Go to the documentation of this file.
1// Copyright 2019-2026:
2// GobySoft, LLC (2013-)
3// Community contributors (see AUTHORS file)
4// File authors:
5// Toby Schneider <toby@gobysoft.org>
6// Copilot <198982749+Copilot@users.noreply.github.com>
7//
8//
9// This file is part of the Goby Underwater Autonomy Project Libraries
10// ("The Goby Libraries").
11//
12// The Goby Libraries are free software: you can redistribute them and/or modify
13// them under the terms of the GNU Lesser General Public License as published by
14// the Free Software Foundation, either version 2.1 of the License, or
15// (at your option) any later version.
16//
17// The Goby Libraries are distributed in the hope that they will be useful,
18// but WITHOUT ANY WARRANTY; without even the implied warranty of
19// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20// GNU Lesser General Public License for more details.
21//
22// You should have received a copy of the GNU Lesser General Public License
23// along with Goby. If not, see <http://www.gnu.org/licenses/>.
24
25#ifndef GOBY_MIDDLEWARE_TRANSPORT_NULL_H
26#define GOBY_MIDDLEWARE_TRANSPORT_NULL_H
27
29
30#include "interface.h"
31
32namespace goby
33{
34namespace middleware
35{
37class NullTransporter : public StaticTransporterInterface<NullTransporter, NullTransporter>,
38 public Poller<NullTransporter>
39{
40 public:
41 NullTransporter() = default;
42 virtual ~NullTransporter() = default;
43
44 template <typename Data> static constexpr int scheme()
45 {
47 }
48
49 template <const Group& group> void check_validity() {}
50
51 template <typename Data, int scheme = scheme<Data>()>
52 void publish_dynamic(const Data& data, const Group& group,
53 const Publisher<Data>& publisher = Publisher<Data>())
54 {
55 }
56
57 template <typename Data, int scheme = scheme<Data>()>
58 void publish_dynamic(std::shared_ptr<Data> data, const Group& group,
59 const Publisher<Data>& publisher = Publisher<Data>())
60 {
61 }
62
63 template <typename Data, int scheme = scheme<Data>()>
64 void publish_dynamic(std::shared_ptr<const Data> data, const Group& group,
65 const Publisher<Data>& publisher = Publisher<Data>())
66 {
67 }
68
69 template <typename Data, int scheme = scheme<Data>()>
70 void subscribe_dynamic(std::function<void(const Data&)> f, const Group& group,
71 const Subscriber<Data>& subscriber = Subscriber<Data>())
72 {
73 }
74
75 template <typename Data, int scheme = scheme<Data>()>
76 void subscribe_dynamic(std::function<void(std::shared_ptr<const Data>)> f, const Group& group,
77 const Subscriber<Data>& subscriber = Subscriber<Data>())
78 {
79 }
80
81 template <typename Data, int scheme = scheme<Data>()>
83 {
84 }
85
86 private:
88 int _poll(std::unique_ptr<std::unique_lock<std::mutex> >& lock) { return 0; }
89};
90} // namespace middleware
91} // namespace goby
92
93#endif
Class for grouping publications in the Goby middleware. Analogous to "topics" in ROS,...
Definition group.h:61
A do-nothing transporter that is always inside the last real transporter level. You will never direct...
Definition null.h:39
void publish_dynamic(std::shared_ptr< Data > data, const Group &group, const Publisher< Data > &publisher=Publisher< Data >())
Definition null.h:58
void publish_dynamic(std::shared_ptr< const Data > data, const Group &group, const Publisher< Data > &publisher=Publisher< Data >())
Definition null.h:64
void unsubscribe_dynamic(const Group &group)
Definition null.h:82
void publish_dynamic(const Data &data, const Group &group, const Publisher< Data > &publisher=Publisher< Data >())
Definition null.h:52
virtual ~NullTransporter()=default
void subscribe_dynamic(std::function< void(std::shared_ptr< const Data >)> f, const Group &group, const Subscriber< Data > &subscriber=Subscriber< Data >())
Definition null.h:76
void subscribe_dynamic(std::function< void(const Data &)> f, const Group &group, const Subscriber< Data > &subscriber=Subscriber< Data >())
Definition null.h:70
static constexpr int scheme()
Definition null.h:44
Utility class for allowing the various Goby middleware transporters to poll the underlying transport ...
Definition poller.h:39
Class that holds additional metadata and callback functions related to a publication (and is optional...
Definition publisher.h:40
Defines the common interface for publishing and subscribing data using static (constexpr) groups on G...
Definition interface.h:235
Class that holds additional metadata and callback functions related to a subscription (and is optiona...
Definition subscriber.h:37
goby::util::logger::GroupSetter group(std::string n)
The global namespace for the Goby project.