Go to the documentation of this file.
25 #ifndef GOBY_ACOMMS_AMAC_MAC_MANAGER_H
26 #define GOBY_ACOMMS_AMAC_MAC_MANAGER_H
28 #include <boost/signals2/signal.hpp>
29 #include <boost/smart_ptr/shared_ptr.hpp>
50 class MACManager :
public std::list<protobuf::ModemTransmission>
101 unsigned cycle_count() {
return std::list<protobuf::ModemTransmission>::size(); }
110 void increment_slot();
112 void restart_timer();
115 unsigned cycle_sum();
116 void position_blank();
126 protobuf::MACConfig cfg_;
133 std::list<protobuf::ModemTransmission>::iterator current_slot_;
135 unsigned cycles_since_reference_;
137 bool started_up_{
false};
139 std::string glog_mac_group_;
151 std::ostream&
operator<<(std::ostream& os,
const MACManager& mac);
boost::signals2::signal< void(const protobuf::ModemTransmission &m)> signal_initiate_transmission
Signals when it is time for this platform to begin transmission of an acoustic message at the start o...
The global namespace for the Goby project.
void update()
You must call this after any change to the underlying list that would invalidate iterators or change ...
const std::string & glog_mac_group() const
time::SystemClock::duration cycle_duration()
void shutdown()
Shutdown the MAC.
provides an API to the goby-acomms MAC library. MACManager is essentially a std::list<protobuf::Modem...
std::chrono::microseconds duration
Duration type.
boost::signals2::signal< void(const protobuf::ModemTransmission &m)> signal_slot_start
Signals the start of all transmissions (even when we don't transmit)
std::ostream & operator<<(std::ostream &os, const MACManager &mac)
void restart()
Restarts the MAC with original configuration.
std::chrono::time_point< SystemClock > time_point
void do_work()
Allows the MAC timer to do its work. Does not block.
void startup(const protobuf::MACConfig &cfg)
Starts the MAC with given configuration.
string SerializeAsString() const
MACManager()
Default constructor.
bool operator==(const ModemTransmission &a, const ModemTransmission &b)