1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Added constructors to RawPDU.

This commit is contained in:
Matias Fontanini
2014-09-19 08:55:23 -03:00
parent 1ba203d742
commit ad5e0614d4

View File

@@ -33,6 +33,7 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include "pdu.h" #include "pdu.h"
#include "cxxstd.h"
namespace Tins { namespace Tins {
@@ -81,6 +82,31 @@ namespace Tins {
*/ */
RawPDU(const uint8_t *pload, uint32_t size); RawPDU(const uint8_t *pload, uint32_t size);
/**
* \brief Constructs a RawPDU from an iterator range.
*
* The data in the iterator range is copied into the RawPDU
* internal buffer.
*
* \param start The beginning of the iterator range.
* \param end The end of the iterator range.
*/
template<typename ForwardIterator>
RawPDU(ForwardIterator start, ForwardIterator end)
: _payload(start, end) { }
#if TINS_IS_CXX11
/**
* \brief Creates an instance of RawPDU from a payload_type.
*
* The payload is moved into the RawPDU's internal buffer.
*
* \param data The payload to use.
*/
RawPDU(payload_type&& data)
: _payload(move(data)) { }
#endif // TINS_IS_CXX11
/** /**
* \brief Creates an instance of RawPDU from an input string. * \brief Creates an instance of RawPDU from an input string.
* *