diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-05-24 00:00:33 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-05-24 00:00:33 +0200 |
commit | d35da77dcd5273b54177f8bc8ae7e5992bb3ca09 (patch) | |
tree | 2782f53cefc3995283231b8ee306cac477232dba /CAN-binder/low-can-binding/utils | |
parent | 7747851ca010a3dfe9ffee808376dd5a7af68b91 (diff) |
Be able to copy active diagnostic request objects with their socket
Implement socket copy assignment operator on socketcan base class.
Change-Id: I75a2d3b96275b7ab83372d74ff7fe0a0b0535dc7
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/utils')
-rw-r--r-- | CAN-binder/low-can-binding/utils/socketcan.cpp | 6 | ||||
-rw-r--r-- | CAN-binder/low-can-binding/utils/socketcan.hpp | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/CAN-binder/low-can-binding/utils/socketcan.cpp b/CAN-binder/low-can-binding/utils/socketcan.cpp index d66822d..ffd4615 100644 --- a/CAN-binder/low-can-binding/utils/socketcan.cpp +++ b/CAN-binder/low-can-binding/utils/socketcan.cpp @@ -43,6 +43,12 @@ namespace utils s.socket_ = INVALID_SOCKET; } + socketcan_t& socketcan_t::operator=(const socketcan_t& s) + { + socket_ = std::move(s.socket_); + return *this; + } + socketcan_t::~socketcan_t() {} diff --git a/CAN-binder/low-can-binding/utils/socketcan.hpp b/CAN-binder/low-can-binding/utils/socketcan.hpp index c3abb2f..1e7cd3c 100644 --- a/CAN-binder/low-can-binding/utils/socketcan.hpp +++ b/CAN-binder/low-can-binding/utils/socketcan.hpp @@ -35,6 +35,7 @@ namespace utils socketcan_t(); socketcan_t(const socketcan_t& s); socketcan_t(socketcan_t&&); + socketcan_t& operator=(const socketcan_t& s); virtual ~socketcan_t(); const struct sockaddr_can& get_tx_address() const; |