26 #if !LELY_NO_COAPP_MASTER 39 struct LoopDriver::Impl_ {
41 explicit Impl_(LoopDriver*
self);
46 LoopDriver*
self{
nullptr};
53 : master(master_), loop_(loop), exec_(exec), id_(id) {
57 BasicDriver::~BasicDriver() {
master.
Erase(*
this); }
66 LoopDriver::LoopDriver(
BasicMaster& master, uint8_t
id)
67 :
BasicDriver(loop, exec, master, id), impl_(new Impl_(this)) {}
69 LoopDriver::~LoopDriver() =
default;
71 LoopDriver::Impl_::Impl_(LoopDriver* self_)
72 : self(self_), thread(&Impl_::Start, this) {}
74 LoopDriver::Impl_::~Impl_() {
75 self->GetLoop().Stop();
80 LoopDriver::Impl_::Start() {
81 auto loop =
self->GetLoop();
82 auto exec =
self->GetExecutor();
88 exec.OnTaskFinished();
95 #endif // !LELY_NO_THREADS 101 #endif // !LELY_NO_COAPP_MASTER
The base class for drivers for remote CANopen nodes.
uint8_t netid() const noexcept
Returns the network-ID.
This header file is part of the C++ CANopen application library; it contains the remote node driver i...
uint8_t netid() const noexcept final override
Returns the network-ID.
This is the internal header file of the C++ CANopen application library.
void Insert(DriverBase &driver)
Registers a driver for a remote CANopen node.
BasicMaster & master
A reference to the master with which this driver is registered.
Global namespace for the Lely Industries N.V. libraries.
BasicDriver(aio::LoopBase &loop, aio::ExecutorBase &exec, BasicMaster &master, uint8_t id)
Creates a new driver for a remote CANopen node and registers it with the master.
void Erase(DriverBase &driver)
Unregisters a driver for a remote CANopen node.