blob: 7d898d07e54c96ffb27a645eda6c6ba7e87ca8a8 [file] [log] [blame]
Eric Newberry261dbc22015-07-22 23:18:18 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Eric Newberry4d261b62016-11-10 13:40:09 -07003 * Copyright (c) 2013-2016 Regents of the University of California.
Eric Newberry261dbc22015-07-22 23:18:18 -07004 *
5 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6 *
7 * ndn-cxx library is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License as published by the Free Software
9 * Foundation, either version 3 of the License, or (at your option) any later version.
10 *
11 * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14 *
15 * You should have received copies of the GNU General Public License and GNU Lesser
16 * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20 */
21
22#ifndef NDN_CXX_LP_FIELDS_HPP
23#define NDN_CXX_LP_FIELDS_HPP
24
Eric Newberry261dbc22015-07-22 23:18:18 -070025#include "detail/field-decl.hpp"
Junxiao Shi4b469982015-12-03 18:20:19 +000026
27#include "sequence.hpp"
28#include "cache-policy.hpp"
29#include "nack-header.hpp"
Eric Newberry261dbc22015-07-22 23:18:18 -070030
31#include <boost/mpl/set.hpp>
32
33namespace ndn {
34namespace lp {
35
36typedef detail::FieldDecl<field_location_tags::Header,
37 Sequence,
38 tlv::Sequence> SequenceField;
39BOOST_CONCEPT_ASSERT((Field<SequenceField>));
40
41typedef detail::FieldDecl<field_location_tags::Header,
42 uint64_t,
43 tlv::FragIndex> FragIndexField;
44BOOST_CONCEPT_ASSERT((Field<FragIndexField>));
45
46typedef detail::FieldDecl<field_location_tags::Header,
47 uint64_t,
48 tlv::FragCount> FragCountField;
49BOOST_CONCEPT_ASSERT((Field<FragCountField>));
50
51typedef detail::FieldDecl<field_location_tags::Header,
52 NackHeader,
53 tlv::Nack> NackField;
54BOOST_CONCEPT_ASSERT((Field<NackField>));
55
56typedef detail::FieldDecl<field_location_tags::Header,
57 uint64_t,
58 tlv::NextHopFaceId> NextHopFaceIdField;
59BOOST_CONCEPT_ASSERT((Field<NextHopFaceIdField>));
60
61typedef detail::FieldDecl<field_location_tags::Header,
62 CachePolicy,
63 tlv::CachePolicy> CachePolicyField;
64BOOST_CONCEPT_ASSERT((Field<CachePolicyField>));
65
66typedef detail::FieldDecl<field_location_tags::Header,
67 uint64_t,
68 tlv::IncomingFaceId> IncomingFaceIdField;
69BOOST_CONCEPT_ASSERT((Field<IncomingFaceIdField>));
70
Eric Newberry4d261b62016-11-10 13:40:09 -070071typedef detail::FieldDecl<field_location_tags::Header,
72 uint64_t,
73 tlv::CongestionMark> CongestionMarkField;
74BOOST_CONCEPT_ASSERT((Field<CongestionMarkField>));
75
Eric Newberry261dbc22015-07-22 23:18:18 -070076/**
77 * The value of the wire encoded field is the data between the provided iterators. During
78 * encoding, the data is copied from the Buffer into the wire buffer.
79 */
80typedef detail::FieldDecl<field_location_tags::Fragment,
81 std::pair<Buffer::const_iterator, Buffer::const_iterator>,
82 tlv::Fragment> FragmentField;
83BOOST_CONCEPT_ASSERT((Field<FragmentField>));
84
85/**
86 * \brief set of all field declarations
87 */
88typedef boost::mpl::set<
89 FragmentField,
90 SequenceField,
91 FragIndexField,
92 FragCountField,
93 NackField,
94 NextHopFaceIdField,
95 CachePolicyField,
Eric Newberry4d261b62016-11-10 13:40:09 -070096 IncomingFaceIdField,
97 CongestionMarkField
Eric Newberry261dbc22015-07-22 23:18:18 -070098 > FieldSet;
99
100} // namespace lp
101} // namespace ndn
102
Junxiao Shi4b469982015-12-03 18:20:19 +0000103#endif // NDN_CXX_LP_FIELDS_HPP