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/type_traits.hpp>
29 
30 namespace ndn {
31 namespace lp {
32 
36 namespace field_location_tags {
37 
38 class Base
39 {
40 };
41 
45 class Header : public Base
46 {
47 };
48 
52 class Fragment : public Base
53 {
54 };
55 
56 } // namespace field_location_tags
57 
61 template<class X>
62 struct Field
63 {
64  BOOST_CONCEPT_ASSERT((boost::is_base_of<field_location_tags::Base, typename X::FieldLocation>));
65  BOOST_CONCEPT_ASSERT((boost::DefaultConstructible<typename X::ValueType>));
66  BOOST_CONCEPT_ASSERT((boost::CopyConstructible<typename X::ValueType>));
67  BOOST_CONCEPT_ASSERT((boost::is_same<typename X::TlvType::value_type, uint64_t>));
68  BOOST_CONCEPT_ASSERT((boost::is_same<typename X::IsRepeatable::value_type, bool>));
70  {
71  Block wire;
72  X j;
73  typename X::ValueType decoded = j.decode(wire);
74  EncodingBuffer enc;
75  j.encode(enc, decoded);
76  }
77 };
78 
79 } // namespace lp
80 } // namespace ndn
81 
82 #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:69
EncodingImpl< EncoderTag > EncodingBuffer
concept check for fields
Definition: field.hpp:62