Project

General

Profile

Actions

Task #1983

closed

Ensure Element::Error inherits from tlv::Error

Added by Junxiao Shi over 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Base
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
2.00 h

Description

Most decoding procedure assumes that Element::Error inherits from tlv::Error.

Such decoding procedure looks like:

try {
  interest.wireDecode(block);
}
catch (tlv::Error&) {
  // handle error
}

This Task is to add BOOST_STATIC_ASSERT to each TLV elememt abstraction type, so that Element::Error is guaranteed to inherit from tlv::Error.

One such assert looks like:

static_assert(std::is_base_of<tlv::Error, Data::Error>::value,
              "Data::Error must inherit from tlv::Error");

This line should appear in .cpp for the implementation (not in .hpp or unit testing).


Related issues 1 (0 open1 closed)

Blocked by ndn-cxx - Task #2132: code-style: assertClosedJunxiao Shi

Actions
Actions

Also available in: Atom PDF