ethercatcpp
bus_device.h
Go to the documentation of this file.
1 /* File: bus_device.h
2  * This file is part of the program ethercatcpp-core
3  * Program description : EtherCAT driver libraries for UNIX
4  * Copyright (C) 2017-2024 - Robin Passama (LIRMM / CNRS) Arnaud Meline
5  * (LIRMM / CNRS) Benjamin Navarro (LIRMM / CNRS). All Right reserved.
6  *
7  * This software is free software: you can redistribute it and/or modify
8  * it under the terms of the CeCILL-C license as published by
9  * the CEA CNRS INRIA, either version 1
10  * of the License, or (at your option) any later version.
11  * This software is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * CeCILL-C License for more details.
15  *
16  * You should have received a copy of the CeCILL-C License
17  * along with this software. If not, it can be found on the official
18  * website of the CeCILL licenses family (http://www.cecill.info/index.en.html).
19  */
30 #pragma once
31 
32 #include <ethercatcpp/device.h>
33 #include <vector>
34 
39 namespace ethercatcpp {
40 
41 class Master;
42 
49 class BusDevice : public Device {
50 public:
54  BusDevice();
55  virtual ~BusDevice();
56 
62  void add(Device& device);
63 
64 private:
65  friend class Master;
73  std::vector<Device*> device_vector() final;
74 
75  /***
76  * @brief Get the device slave address
77  *
78  * @return dedicated slave address. Here, a nullptr address is always
79  * returned because a bus device doesn't have a dedicated slave.
80  */
81  SlaveInfo* slave_address() final;
82 
86  std::vector<Device*> device_bus_ptr_;
87 };
88 } // namespace ethercatcpp
ethercatcpp::BusDevice::add
void add(Device &device)
Add a device (slave or bus) in the bus.
ethercatcpp::BusDevice::device_bus_ptr_
std::vector< Device * > device_bus_ptr_
Definition: bus_device.h:86
device.h
Header file for Device class.
ethercatcpp::BusDevice::device_vector
std::vector< Device * > device_vector() final
Get the set of devices that compose the bus.
ethercatcpp::Master
This class define The EtherCAT Master.
Definition: master.h:50
ethercatcpp::BusDevice::slave_address
SlaveInfo * slave_address() final
Get the device corresponding physical slave address.
ethercatcpp::BusDevice::~BusDevice
virtual ~BusDevice()
ethercatcpp::BusDevice::BusDevice
BusDevice()
Constructor of BusDevice class.
ethercatcpp::BusDevice
This class define an EtherCAT bus device.
Definition: bus_device.h:49
ethercatcpp::Device
This abstract class define an EtherCAT device.
Definition: device.h:49
ethercatcpp