base: ensure Element::Error inherits from tlv::Error
Adding static asserts to ensure (Name|name::Component|Interest|
Selectors|Exclude|KeyLocator|Data|MetaInfo|Signature|SignatureInfo)
::Error are subclasses of tlv::Error.
This commit also adds WireEncodable and WireDecodable concept checks
to Name,name::Component,Interest,Selectors,Exclude,KeyLocator,Data,
MetaInfo,SignatureInfo types.
This commit also moves definition of Selectors method into .cpp.
refs #1983
Change-Id: I15220b93437d4a624ae09df66defc91ceac2386c
diff --git a/src/data.cpp b/src/data.cpp
index 0a2e3fb..7954cf7 100644
--- a/src/data.cpp
+++ b/src/data.cpp
@@ -22,9 +22,16 @@
#include "data.hpp"
#include "encoding/block-helpers.hpp"
#include "util/crypto.hpp"
+#include "util/concepts.hpp"
namespace ndn {
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Data>));
+BOOST_CONCEPT_ASSERT((WireEncodable<Data>));
+BOOST_CONCEPT_ASSERT((WireDecodable<Data>));
+static_assert(std::is_base_of<tlv::Error, Data::Error>::value,
+ "Data::Error must inherit from tlv::Error");
+
Data::Data()
: m_content(tlv::Content) // empty content
{