aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-01-13 10:39:30 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-01-13 10:39:30 +0100
commit14b43be3fbf6fd6e21de1924e77cb1bc94ec2aa6 (patch)
tree29d73d60a605f8e35e93f4ec3d3a811b0250778a /src
parentc76de2b69d2fce16e6ccb2e2ef5ee5e858f84e5b (diff)
downloaddabmux-14b43be3fbf6fd6e21de1924e77cb1bc94ec2aa6.tar.gz
dabmux-14b43be3fbf6fd6e21de1924e77cb1bc94ec2aa6.tar.bz2
dabmux-14b43be3fbf6fd6e21de1924e77cb1bc94ec2aa6.zip
Make UdpPacket copyable, add API to get buffer
Diffstat (limited to 'src')
-rw-r--r--src/UdpSocket.cpp2
-rw-r--r--src/UdpSocket.h15
2 files changed, 8 insertions, 9 deletions
diff --git a/src/UdpSocket.cpp b/src/UdpSocket.cpp
index ccdd7ed..981d713 100644
--- a/src/UdpSocket.cpp
+++ b/src/UdpSocket.cpp
@@ -2,7 +2,7 @@
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the
Queen in Right of Canada (Communications Research Center Canada)
- Copyright (C) 2016
+ Copyright (C) 2017
Matthias P. Braendli, matthias.braendli@mpb.li
http://www.opendigitalradio.org
diff --git a/src/UdpSocket.h b/src/UdpSocket.h
index dfeaac1..f51e87c 100644
--- a/src/UdpSocket.h
+++ b/src/UdpSocket.h
@@ -2,7 +2,7 @@
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the
Queen in Right of Canada (Communications Research Center Canada)
- Copyright (C) 2016
+ Copyright (C) 2017
Matthias P. Braendli, matthias.braendli@mpb.li
http://www.opendigitalradio.org
@@ -24,8 +24,7 @@
along with ODR-DabMux. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _UDPSOCKET
-#define _UDPSOCKET
+#pragma once
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -140,10 +139,6 @@ class UdpPacket
*/
UdpPacket();
UdpPacket(size_t initSize);
- UdpPacket(const UdpPacket& packet) = delete;
- const UdpPacket& operator=(const UdpPacket&) = delete;
- UdpPacket(const UdpPacket&& packet) = delete;
- const UdpPacket& operator=(const UdpPacket&&) = delete;
/** Give the pointer to data.
* @return The pointer
@@ -167,9 +162,13 @@ class UdpPacket
*/
InetAddress getAddress(void);
+ const std::vector<uint8_t>& getBuffer(void) const {
+ return m_buffer;
+ }
+
+
private:
std::vector<uint8_t> m_buffer;
InetAddress address;
};
-#endif // _UDPSOCKET