Goby3  3.1.5a
2024.05.23
goby::middleware::NullTransporter Class Reference

A do-nothing transporter that is always inside the last real transporter level. You will never directly instantiate a NullTransporter if you want it to do anything. More...

#include <goby/middleware/transport/null.h>

Inheritance diagram for goby::middleware::NullTransporter:
goby::middleware::StaticTransporterInterface< NullTransporter, NullTransporter > goby::middleware::Poller< Transporter > goby::middleware::InnerTransporterInterface< NullTransporter, NullTransporter > goby::middleware::PollerInterface

Public Member Functions

 NullTransporter ()=default
 
virtual ~NullTransporter ()=default
 
template<const Group & group>
void check_validity ()
 
template<typename Data , int scheme = scheme<Data>()>
void publish_dynamic (const Data &data, const Group &group, const Publisher< Data > &publisher=Publisher< Data >())
 
template<typename Data , int scheme = scheme<Data>()>
void publish_dynamic (std::shared_ptr< Data > data, const Group &group, const Publisher< Data > &publisher=Publisher< Data >())
 
template<typename Data , int scheme = scheme<Data>()>
void publish_dynamic (std::shared_ptr< const Data > data, const Group &group, const Publisher< Data > &publisher=Publisher< Data >())
 
template<typename Data , int scheme = scheme<Data>()>
void subscribe_dynamic (std::function< void(const Data &)> f, const Group &group, const Subscriber< Data > &subscriber=Subscriber< Data >())
 
template<typename Data , int scheme = scheme<Data>()>
void subscribe_dynamic (std::function< void(std::shared_ptr< const Data >)> f, const Group &group, const Subscriber< Data > &subscriber=Subscriber< Data >())
 
template<typename Data , int scheme = scheme<Data>()>
void unsubscribe_dynamic (const Group &group)
 
- Public Member Functions inherited from goby::middleware::StaticTransporterInterface< NullTransporter, NullTransporter >
void publish (const Data &data, const Publisher< Data > &publisher=Publisher< Data >())
 Publish a message (const reference variant) More...
 
void publish (std::shared_ptr< const Data > data, const Publisher< Data > &publisher=Publisher< Data >())
 Publish a message (shared pointer to const data variant) More...
 
void publish (std::shared_ptr< Data > data, const Publisher< Data > &publisher=Publisher< Data >())
 Publish a message (shared pointer to mutable data variant) More...
 
void subscribe (std::function< void(const Data &)> f, const Subscriber< Data > &subscriber=Subscriber< Data >())
 Subscribe to a specific group and data type (const reference variant) More...
 
void subscribe (std::function< void(std::shared_ptr< const Data >)> f, const Subscriber< Data > &subscriber=Subscriber< Data >())
 Subscribe to a specific group and data type (shared pointer variant) More...
 
void subscribe (Func f)
 Simplified version of subscribe() that can deduce Data from the first argument of the function (lambda, function pointer, etc.) passed to it. More...
 
void unsubscribe (const Subscriber< Data > &subscriber=Subscriber< Data >())
 Unsubscribe to a specific group and data type. More...
 
void unsubscribe_all ()
 Unsubscribe to all messages that this transporter has subscribed to. More...
 
- Public Member Functions inherited from goby::middleware::InnerTransporterInterface< NullTransporter, NullTransporter >
NullTransporterinner ()
 
auto innermost ()
 
- Public Member Functions inherited from goby::middleware::PollerInterface
template<class Clock = std::chrono::system_clock, class Duration = typename Clock::duration>
int poll (const std::chrono::time_point< Clock, Duration > &timeout=std::chrono::time_point< Clock, Duration >::max())
 poll for data. Blocks until a data event occurs or a timeout when a particular time has been reached More...
 
template<class Clock = std::chrono::system_clock, class Duration = typename Clock::duration>
int poll (Duration wait_for)
 poll for data. Blocks until a data event occurs or a certain duration of time elapses (timeout) More...
 
std::shared_ptr< std::timed_mutex > poll_mutex ()
 access the mutex used for poll synchronization More...
 
std::shared_ptr< std::condition_variable_any > cv ()
 access the condition variable used for poll synchronization More...
 

Static Public Member Functions

template<typename Data >
static constexpr int scheme ()
 

Additional Inherited Members

- Public Types inherited from goby::middleware::InnerTransporterInterface< NullTransporter, NullTransporter >
using InnerTransporterType = NullTransporter
 the InnerTransporter type (accessible for other uses) More...
 
- Protected Member Functions inherited from goby::middleware::StaticTransporterInterface< NullTransporter, NullTransporter >
 StaticTransporterInterface (NullTransporter &inner)
 
 StaticTransporterInterface ()
 
- Protected Member Functions inherited from goby::middleware::Poller< Transporter >
 Poller (PollerInterface *inner_poller=nullptr)
 Construct this Poller with a pointer to the inner Poller (unless this is the innermost Poller) More...
 
PollerInterfaceinner_poller ()
 
- Protected Member Functions inherited from goby::middleware::PollerInterface
 PollerInterface (std::shared_ptr< std::timed_mutex > poll_mutex, std::shared_ptr< std::condition_variable_any > cv)
 

Detailed Description

A do-nothing transporter that is always inside the last real transporter level. You will never directly instantiate a NullTransporter if you want it to do anything.

Definition at line 36 of file null.h.

Constructor & Destructor Documentation

◆ NullTransporter()

goby::middleware::NullTransporter::NullTransporter ( )
default

◆ ~NullTransporter()

virtual goby::middleware::NullTransporter::~NullTransporter ( )
virtualdefault

Member Function Documentation

◆ check_validity()

template<const Group & group>
void goby::middleware::NullTransporter::check_validity ( )
inline

Definition at line 48 of file null.h.

◆ publish_dynamic() [1/3]

template<typename Data , int scheme = scheme<Data>()>
void goby::middleware::NullTransporter::publish_dynamic ( const Data &  data,
const Group group,
const Publisher< Data > &  publisher = Publisher<Data>() 
)
inline

Definition at line 51 of file null.h.

◆ publish_dynamic() [2/3]

template<typename Data , int scheme = scheme<Data>()>
void goby::middleware::NullTransporter::publish_dynamic ( std::shared_ptr< const Data >  data,
const Group group,
const Publisher< Data > &  publisher = Publisher<Data>() 
)
inline

Definition at line 63 of file null.h.

◆ publish_dynamic() [3/3]

template<typename Data , int scheme = scheme<Data>()>
void goby::middleware::NullTransporter::publish_dynamic ( std::shared_ptr< Data >  data,
const Group group,
const Publisher< Data > &  publisher = Publisher<Data>() 
)
inline

Definition at line 57 of file null.h.

◆ scheme()

template<typename Data >
static constexpr int goby::middleware::NullTransporter::scheme ( )
inlinestaticconstexpr

Definition at line 43 of file null.h.

◆ subscribe_dynamic() [1/2]

template<typename Data , int scheme = scheme<Data>()>
void goby::middleware::NullTransporter::subscribe_dynamic ( std::function< void(const Data &)>  f,
const Group group,
const Subscriber< Data > &  subscriber = Subscriber<Data>() 
)
inline

Definition at line 69 of file null.h.

◆ subscribe_dynamic() [2/2]

template<typename Data , int scheme = scheme<Data>()>
void goby::middleware::NullTransporter::subscribe_dynamic ( std::function< void(std::shared_ptr< const Data >)>  f,
const Group group,
const Subscriber< Data > &  subscriber = Subscriber<Data>() 
)
inline

Definition at line 75 of file null.h.

◆ unsubscribe_dynamic()

template<typename Data , int scheme = scheme<Data>()>
void goby::middleware::NullTransporter::unsubscribe_dynamic ( const Group group)
inline

Definition at line 81 of file null.h.


The documentation for this class was generated from the following file: