#include <secondary.h>
Public Types | |
using | endpoint = boost::asio::ip::tcp::endpoint |
using | protocol_type = endpoint::protocol_type |
Public Member Functions | |
void | AsyncRun (size_t worker_threads) |
void | Connect () |
SecondaryCommands & | GetCommander () |
Secondary (boost::asio::ip::tcp::endpoint ep, SecondaryCommands::callback_type callback) | |
Secondary (std::string ip, uint16_t port, SecondaryCommands::callback_type callback) | |
void | Stop () |
void | Write (std::shared_ptr< const carla::streaming::detail::tcp::Message > message) |
void | Write (Buffer buffer) |
void | Write (std::string text) |
~Secondary () | |
Static Public Member Functions | |
template<typename... Buffers> | |
static auto | MakeMessage (Buffers... buffers) |
Private Member Functions | |
void | ReadData () |
void | Reconnect () |
Private Member Functions inherited from carla::profiler::LifetimeProfiled | |
LifetimeProfiled ()=default | |
Private Member Functions inherited from carla::NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable (NonCopyable &&)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
NonCopyable & | operator= (NonCopyable &&)=delete |
Private Attributes | |
std::shared_ptr< BufferPool > | _buffer_pool |
SecondaryCommands | _commander |
boost::asio::deadline_timer | _connection_timer |
std::atomic_bool | _done {false} |
boost::asio::ip::tcp::endpoint | _endpoint |
ThreadPool | _pool |
boost::asio::ip::tcp::socket | _socket |
boost::asio::io_context::strand | _strand |
Definition at line 34 of file secondary.h.
using carla::multigpu::Secondary::endpoint = boost::asio::ip::tcp::endpoint |
Definition at line 40 of file secondary.h.
using carla::multigpu::Secondary::protocol_type = endpoint::protocol_type |
Definition at line 41 of file secondary.h.
carla::multigpu::Secondary::Secondary | ( | boost::asio::ip::tcp::endpoint | ep, |
SecondaryCommands::callback_type | callback | ||
) |
Definition at line 27 of file secondary.cpp.
References _commander, and carla::multigpu::SecondaryCommands::set_callback().
carla::multigpu::Secondary::Secondary | ( | std::string | ip, |
uint16_t | port, | ||
SecondaryCommands::callback_type | callback | ||
) |
Definition at line 41 of file secondary.cpp.
References _commander, _endpoint, and carla::multigpu::SecondaryCommands::set_callback().
carla::multigpu::Secondary::~Secondary | ( | ) |
Definition at line 56 of file secondary.cpp.
References _pool, and carla::ThreadPool::Stop().
void carla::multigpu::Secondary::AsyncRun | ( | size_t | worker_threads | ) |
Definition at line 130 of file secondary.cpp.
References _pool, and carla::ThreadPool::AsyncRun().
Referenced by Connect().
void carla::multigpu::Secondary::Connect | ( | ) |
Definition at line 60 of file secondary.cpp.
References _commander, _strand, AsyncRun(), carla::log_error(), carla::log_info(), and carla::multigpu::SecondaryCommands::set_secondary().
|
inline |
Definition at line 57 of file secondary.h.
References _commander.
|
inlinestatic |
Definition at line 62 of file secondary.h.
References ReadData(), and Reconnect().
Referenced by Write().
|
private |
Definition at line 224 of file secondary.cpp.
References _strand, DEBUG_ASSERT_EQ, DEBUG_ASSERT_NE, DEBUG_ONLY, and carla::log_error().
Referenced by MakeMessage().
|
private |
Definition at line 118 of file secondary.cpp.
References _connection_timer, and carla::time_duration::seconds().
Referenced by MakeMessage().
void carla::multigpu::Secondary::Stop | ( | void | ) |
Definition at line 105 of file secondary.cpp.
References _connection_timer, and _strand.
void carla::multigpu::Secondary::Write | ( | std::shared_ptr< const carla::streaming::detail::tcp::Message > | message | ) |
Definition at line 134 of file secondary.cpp.
References _strand, DEBUG_ASSERT, DEBUG_ONLY, and carla::log_error().
void carla::multigpu::Secondary::Write | ( | Buffer | buffer | ) |
Definition at line 161 of file secondary.cpp.
References _strand, carla::BufferView::CreateFrom(), DEBUG_ASSERT, DEBUG_ONLY, carla::log_error(), and MakeMessage().
void carla::multigpu::Secondary::Write | ( | std::string | text | ) |
Definition at line 191 of file secondary.cpp.
References _strand, DEBUG_ONLY, and carla::log_error().
|
private |
Definition at line 80 of file secondary.h.
|
private |
Definition at line 82 of file secondary.h.
Referenced by Connect(), GetCommander(), and Secondary().
|
private |
Definition at line 79 of file secondary.h.
Referenced by Reconnect(), and Stop().
|
private |
Definition at line 81 of file secondary.h.
|
private |
Definition at line 77 of file secondary.h.
Referenced by Secondary().
|
private |
Definition at line 75 of file secondary.h.
Referenced by AsyncRun(), and ~Secondary().
|
private |
Definition at line 76 of file secondary.h.
|
private |
Definition at line 78 of file secondary.h.
Referenced by Connect(), ReadData(), Stop(), and Write().