NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
field.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_CXX_LP_FIELD_HPP
23 #define NDN_CXX_LP_FIELD_HPP
24 
25 #include "../common.hpp"
26 #include "../encoding/encoding-buffer.hpp"
27 
28 #include <boost/concept/assert.hpp>
29 #include <boost/concept/usage.hpp>
30 #include <boost/type_traits.hpp>
31 
32 namespace ndn {
33 namespace lp {
34 
38 namespace field_location_tags {
39 
40 class Base
41 {
42 };
43 
47 class Header : public Base
48 {
49 };
50 
54 class Fragment : public Base
55 {
56 };
57 
58 } // namespace field_location_tags
59 
63 template<class X>
64 struct Field
65 {
66  BOOST_CONCEPT_ASSERT((boost::is_base_of<field_location_tags::Base, typename X::FieldLocation>));
67  BOOST_CONCEPT_ASSERT((boost::DefaultConstructible<typename X::ValueType>));
68  BOOST_CONCEPT_ASSERT((boost::CopyConstructible<typename X::ValueType>));
69  BOOST_CONCEPT_ASSERT((boost::is_same<typename X::TlvType::value_type, uint64_t>));
70  BOOST_CONCEPT_ASSERT((boost::is_same<typename X::IsRepeatable::value_type, bool>));
72  {
73  Block wire;
74  X j;
75  typename X::ValueType decoded = j.decode(wire);
76  EncodingBuffer enc;
77  j.encode(enc, decoded);
78  }
79 };
80 
81 } // namespace lp
82 } // namespace ndn
83 
84 #endif // NDN_CXX_LP_FIELD_HPP
Copyright (c) 2011-2015 Regents of the University of California.
Class representing a wire element of NDN-TLV packet format.
Definition: block.hpp:43
BOOST_CONCEPT_USAGE(Field)
Definition: field.hpp:71
EncodingImpl< EncoderTag > EncodingBuffer
concept check for fields
Definition: field.hpp:64