Goby3  3.1.5a
2024.05.23
thread_stub.h
Go to the documentation of this file.
1 // Copyright 2011-2021:
2 // GobySoft, LLC (2013-)
3 // Massachusetts Institute of Technology (2007-2014)
4 // Community contributors (see AUTHORS file)
5 // File authors:
6 // Toby Schneider <toby@gobysoft.org>
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_UTIL_LINEBASEDCOMMS_THREAD_STUB
26 #define GOBY_UTIL_LINEBASEDCOMMS_THREAD_STUB
27 
30 
31 namespace goby
32 {
33 namespace util
34 {
35 template <typename Config>
37  : public middleware::Thread<Config, middleware::InterThreadTransporter>
38 {
39  public:
40  LineBasedCommsThreadStub(const Config& cfg, double loop_freq_hertz, int index)
41  : middleware::Thread<Config, middleware::InterThreadTransporter>(
42  cfg, &interthread_, loop_freq_hertz * boost::units::si::hertz, index)
43  {
44  }
45  ~LineBasedCommsThreadStub() = default;
46 
47  middleware::InterThreadTransporter& interthread() { return interthread_; }
48 
49  private:
51 };
52 } // namespace util
53 } // namespace goby
54 
55 #endif
goby::util::LineBasedCommsThreadStub::interthread
middleware::InterThreadTransporter & interthread()
Definition: thread_stub.h:47
goby
The global namespace for the Goby project.
Definition: acomms_constants.h:33
goby::middleware::Thread< Config, middleware::InterThreadTransporter >::cfg
const Config & cfg() const
Definition: thread.h:201
goby::middleware::Thread< Config, middleware::InterThreadTransporter >::index
int index() const
Definition: thread.h:145
boost
Definition: udp_driver.h:41
goby::middleware::InterThreadTransporter
A transporter for the interthread layer.
Definition: interthread.h:56
goby::middleware::Thread< Config, middleware::InterThreadTransporter >::Thread
Thread(const Config &cfg, middleware::InterThreadTransporter *transporter, int index)
Construct a thread with a given configuration, underlying transporter, and index (for multiple instan...
Definition: thread.h:96
interthread.h
goby::middleware::Thread
Represents a thread of execution within the Goby middleware, interleaving periodic events (loop()) wi...
Definition: thread.h:60
goby::util::LineBasedCommsThreadStub::LineBasedCommsThreadStub
LineBasedCommsThreadStub(const Config &cfg, double loop_freq_hertz, int index)
Definition: thread_stub.h:40
goby::util::LineBasedCommsThreadStub
Definition: thread_stub.h:36
goby::util::LineBasedCommsThreadStub::~LineBasedCommsThreadStub
~LineBasedCommsThreadStub()=default
thread.h