mock_psen_scan_udp_interface.h
Go to the documentation of this file.
1 // Copyright (c) 2019-2020 Pilz GmbH & Co. KG
2 //
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU Lesser General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public License
14 // along with this program. If not, see <https://www.gnu.org/licenses/>.
15 
16 #ifndef PSEN_SCAN_TEST_MOCK_PSEN_SCAN_UDP_INTERFACE_H
17 #define PSEN_SCAN_TEST_MOCK_PSEN_SCAN_UDP_INTERFACE_H
18 
19 #include <boost/asio.hpp>
20 
21 #include <gmock/gmock.h>
22 
24 
25 namespace psen_scan_test
26 {
28 {
29 public:
30  MOCK_METHOD0(open, void());
31  MOCK_METHOD0(close, void());
32 
33  MOCK_METHOD1(write, void(const boost::asio::mutable_buffers_1& buffer));
34  MOCK_METHOD2(read, std::size_t(boost::asio::mutable_buffers_1& buffer, const std::chrono::steady_clock::duration));
35 
36 private:
37  boost::asio::ip::udp::udp::endpoint udp_endpoint_read_;
38 };
39 } // namespace psen_scan_test
40 
41 #endif // PSEN_SCAN_TEST_MOCK_PSEN_SCAN_UDP_INTERFACE_H
virtual std::size_t read(boost::asio::mutable_buffers_1 &buffer, const std::chrono::steady_clock::duration timeout)=0
Receive data from the scanner.
virtual void close()=0
Closes the connection to the scanner device.
virtual void write(const boost::asio::mutable_buffers_1 &buffer)=0
Sends data to the scanner device.
Abstract base class for the communication interface with the PSENscan scanner.
MOCK_METHOD2(read, std::size_t(boost::asio::mutable_buffers_1 &buffer, const std::chrono::steady_clock::duration))
boost::asio::ip::udp::udp::endpoint udp_endpoint_read_
MOCK_METHOD1(write, void(const boost::asio::mutable_buffers_1 &buffer))
virtual void open()=0
Opens the connection to the scanner device.


psen_scan
Author(s):
autogenerated on Mon Feb 28 2022 23:16:20