1
0
Fork 0

enforce base classes on header and data segments

This commit is contained in:
Kevin Matz 2023-05-18 15:51:13 -04:00
parent bf5f9812aa
commit a41d8bfc87
1 changed files with 4 additions and 0 deletions

View File

@ -186,6 +186,8 @@ public:
template<class T>
void createHeader()
{
static_assert(std::is_base_of<pdu_header, T>::value,
"type parameter of PDU::createHeader must derive from ACN::pdu_header");
if (!flags_.hasHeader)
return; // doesn't get a header segment, inherits
if (header_)
@ -200,6 +202,8 @@ public:
template<class T>
void createData()
{
static_assert(std::is_base_of<pdu_data, T>::value,
"type parameter of PDU::createData must derive from ACN::pdu_data");
if (!flags_.hasData)
return; // doesn't get a data segment, inherits
if (data_)