1
0
Fork 0

move constructor out of header

This commit is contained in:
Kevin Matz 2021-07-26 22:48:01 -04:00
parent 42022baecf
commit 8512da0b32
2 changed files with 14 additions and 7 deletions

View File

@ -26,6 +26,19 @@
namespace ACN {
namespace PDU {
/**
* @brief pdu_stream::pdu_stream
* @param p the packet buffer
* @param l buffer length
*/
pdu_stream::pdu_stream(uint8_t * p, std::streamsize l)
: std::basic_streambuf<uint8_t>()
, std::basic_iostream<uint8_t>(this)
{
setg(p, p, p + l);
setp(p, p + l);
}
/**
* @brief pdu_stream::operator >>
* @param val

View File

@ -37,13 +37,7 @@ class pdu_stream
, public std::basic_iostream<uint8_t>
{
public:
pdu_stream(uint8_t * p, std::streamsize l)
: std::basic_streambuf<uint8_t>()
, std::basic_iostream<uint8_t>(this)
{
setg(p, p, p + l);
setp(p, p + l);
}
pdu_stream(uint8_t * p, std::streamsize l);
uint32_t available() { return in_avail(); }
uint8_t * data() { return gptr(); };