src: Avoid use of detail folder for installable headers
This commit moves `lp/detail/*` to `lp/`, as `detail` folders should include only private APIs that are only used during the build and cannot be used (header files not installed) by external applications. Change-Id: I370592819c4bc5f4016689ef7c9c5bd2cdd0eaa2
This commit is contained in:
1 parent
b1a2a4b4b4
commit
e387423942
5 files changed
+57
-63
No files matched your search
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/**
|
||||
* Copyright (c) 2013-2016 Regents of the University of California.
|
||||
* Copyright (c) 2013-2017 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -19,19 +19,18 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#ifndef NDN_CXX_LP_DETAIL_FIELD_DECL_HPP
|
||||
#define NDN_CXX_LP_DETAIL_FIELD_DECL_HPP
|
||||
#ifndef NDN_CXX_LP_FIELD_DECL_HPP
|
||||
#define NDN_CXX_LP_FIELD_DECL_HPP
|
||||
|
||||
#include "../field.hpp"
|
||||
#include "../tlv.hpp"
|
||||
#include "field.hpp"
|
||||
#include "tlv.hpp"
|
||||
|
||||
#include "../../encoding/block-helpers.hpp"
|
||||
#include "../../util/concepts.hpp"
|
||||
#include "../encoding/block-helpers.hpp"
|
||||
#include "../util/concepts.hpp"
|
||||
#include <boost/concept/requires.hpp>
|
||||
|
||||
namespace ndn {
|
||||
namespace lp {
|
||||
namespace detail {
|
||||
|
||||
template<typename TlvType, typename T>
|
||||
struct DecodeHelper
|
||||
@@ -140,8 +139,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
} // namespace lp
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_CXX_LP_DETAIL_FIELD_DECL_HPP
|
||||
#endif // NDN_CXX_LP_FIELD_DECL_HPP
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/**
|
||||
* Copyright (c) 2013-2016 Regents of the University of California.
|
||||
* Copyright (c) 2013-2017 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -26,7 +26,6 @@
|
||||
|
||||
namespace ndn {
|
||||
namespace lp {
|
||||
namespace detail {
|
||||
|
||||
struct ExtractFieldInfo
|
||||
{
|
||||
@@ -69,6 +68,5 @@ FieldInfo::FieldInfo(uint64_t tlv)
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
} // namespace lp
|
||||
} // namespace ndn
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/**
|
||||
* Copyright (c) 2013-2015 Regents of the University of California.
|
||||
* Copyright (c) 2013-2017 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -19,16 +19,15 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#ifndef NDN_CXX_LP_DETAIL_FIELD_INFO_HPP
|
||||
#define NDN_CXX_LP_DETAIL_FIELD_INFO_HPP
|
||||
#ifndef NDN_CXX_LP_FIELD_INFO_HPP
|
||||
#define NDN_CXX_LP_FIELD_INFO_HPP
|
||||
|
||||
#include "../../common.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
#include "../fields.hpp"
|
||||
#include "fields.hpp"
|
||||
|
||||
namespace ndn {
|
||||
namespace lp {
|
||||
namespace detail {
|
||||
|
||||
class FieldInfo
|
||||
{
|
||||
@@ -90,8 +89,7 @@ compareFieldSortOrder(const FieldInfo& first, const FieldInfo& second)
|
||||
(first.locationSortOrder == second.locationSortOrder && first.tlvType < second.tlvType);
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
} // namespace lp
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_CXX_LP_DETAIL_FIELD_INFO_HPP
|
||||
#endif // NDN_CXX_LP_FIELD_INFO_HPP
|
||||
+35
-35
@@ -22,7 +22,7 @@
|
||||
#ifndef NDN_CXX_LP_FIELDS_HPP
|
||||
#define NDN_CXX_LP_FIELDS_HPP
|
||||
|
||||
#include "detail/field-decl.hpp"
|
||||
#include "field-decl.hpp"
|
||||
|
||||
#include "sequence.hpp"
|
||||
#include "cache-policy.hpp"
|
||||
@@ -33,64 +33,64 @@
|
||||
namespace ndn {
|
||||
namespace lp {
|
||||
|
||||
typedef detail::FieldDecl<field_location_tags::Header,
|
||||
Sequence,
|
||||
tlv::Sequence> SequenceField;
|
||||
typedef FieldDecl<field_location_tags::Header,
|
||||
Sequence,
|
||||
tlv::Sequence> SequenceField;
|
||||
BOOST_CONCEPT_ASSERT((Field<SequenceField>));
|
||||
|
||||
typedef detail::FieldDecl<field_location_tags::Header,
|
||||
uint64_t,
|
||||
tlv::FragIndex> FragIndexField;
|
||||
typedef FieldDecl<field_location_tags::Header,
|
||||
uint64_t,
|
||||
tlv::FragIndex> FragIndexField;
|
||||
BOOST_CONCEPT_ASSERT((Field<FragIndexField>));
|
||||
|
||||
typedef detail::FieldDecl<field_location_tags::Header,
|
||||
uint64_t,
|
||||
tlv::FragCount> FragCountField;
|
||||
typedef FieldDecl<field_location_tags::Header,
|
||||
uint64_t,
|
||||
tlv::FragCount> FragCountField;
|
||||
BOOST_CONCEPT_ASSERT((Field<FragCountField>));
|
||||
|
||||
typedef detail::FieldDecl<field_location_tags::Header,
|
||||
NackHeader,
|
||||
tlv::Nack> NackField;
|
||||
typedef FieldDecl<field_location_tags::Header,
|
||||
NackHeader,
|
||||
tlv::Nack> NackField;
|
||||
BOOST_CONCEPT_ASSERT((Field<NackField>));
|
||||
|
||||
typedef detail::FieldDecl<field_location_tags::Header,
|
||||
uint64_t,
|
||||
tlv::NextHopFaceId> NextHopFaceIdField;
|
||||
typedef FieldDecl<field_location_tags::Header,
|
||||
uint64_t,
|
||||
tlv::NextHopFaceId> NextHopFaceIdField;
|
||||
BOOST_CONCEPT_ASSERT((Field<NextHopFaceIdField>));
|
||||
|
||||
typedef detail::FieldDecl<field_location_tags::Header,
|
||||
CachePolicy,
|
||||
tlv::CachePolicy> CachePolicyField;
|
||||
typedef FieldDecl<field_location_tags::Header,
|
||||
CachePolicy,
|
||||
tlv::CachePolicy> CachePolicyField;
|
||||
BOOST_CONCEPT_ASSERT((Field<CachePolicyField>));
|
||||
|
||||
typedef detail::FieldDecl<field_location_tags::Header,
|
||||
uint64_t,
|
||||
tlv::IncomingFaceId> IncomingFaceIdField;
|
||||
typedef FieldDecl<field_location_tags::Header,
|
||||
uint64_t,
|
||||
tlv::IncomingFaceId> IncomingFaceIdField;
|
||||
BOOST_CONCEPT_ASSERT((Field<IncomingFaceIdField>));
|
||||
|
||||
typedef detail::FieldDecl<field_location_tags::Header,
|
||||
uint64_t,
|
||||
tlv::CongestionMark> CongestionMarkField;
|
||||
typedef FieldDecl<field_location_tags::Header,
|
||||
uint64_t,
|
||||
tlv::CongestionMark> CongestionMarkField;
|
||||
BOOST_CONCEPT_ASSERT((Field<CongestionMarkField>));
|
||||
|
||||
typedef detail::FieldDecl<field_location_tags::Header,
|
||||
Sequence,
|
||||
tlv::Ack,
|
||||
true> AckField;
|
||||
typedef FieldDecl<field_location_tags::Header,
|
||||
Sequence,
|
||||
tlv::Ack,
|
||||
true> AckField;
|
||||
BOOST_CONCEPT_ASSERT((Field<AckField>));
|
||||
|
||||
typedef detail::FieldDecl<field_location_tags::Header,
|
||||
Sequence,
|
||||
tlv::TxSequence> TxSequenceField;
|
||||
typedef FieldDecl<field_location_tags::Header,
|
||||
Sequence,
|
||||
tlv::TxSequence> TxSequenceField;
|
||||
BOOST_CONCEPT_ASSERT((Field<TxSequenceField>));
|
||||
|
||||
/**
|
||||
* The value of the wire encoded field is the data between the provided iterators. During
|
||||
* encoding, the data is copied from the Buffer into the wire buffer.
|
||||
*/
|
||||
typedef detail::FieldDecl<field_location_tags::Fragment,
|
||||
std::pair<Buffer::const_iterator, Buffer::const_iterator>,
|
||||
tlv::Fragment> FragmentField;
|
||||
typedef FieldDecl<field_location_tags::Fragment,
|
||||
std::pair<Buffer::const_iterator, Buffer::const_iterator>,
|
||||
tlv::Fragment> FragmentField;
|
||||
BOOST_CONCEPT_ASSERT((Field<FragmentField>));
|
||||
|
||||
/**
|
||||
|
||||
+7
-7
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "packet.hpp"
|
||||
#include "detail/field-info.hpp"
|
||||
#include "field-info.hpp"
|
||||
|
||||
#include <boost/range/adaptor/reversed.hpp>
|
||||
|
||||
@@ -104,9 +104,9 @@ Packet::wireDecode(const Block& wire)
|
||||
wire.parse();
|
||||
|
||||
bool isFirst = true;
|
||||
detail::FieldInfo prev;
|
||||
FieldInfo prev;
|
||||
for (const Block& element : wire.elements()) {
|
||||
detail::FieldInfo info(element.type());
|
||||
FieldInfo info(element.type());
|
||||
|
||||
if (!info.isRecognized && !info.canIgnore) {
|
||||
BOOST_THROW_EXCEPTION(Error("unrecognized field " + to_string(element.type()) + " cannot be ignored"));
|
||||
@@ -117,7 +117,7 @@ Packet::wireDecode(const Block& wire)
|
||||
BOOST_THROW_EXCEPTION(Error("non-repeatable field " + to_string(element.type()) + " cannot be repeated"));
|
||||
}
|
||||
|
||||
else if (info.tlvType != prev.tlvType && !detail::compareFieldSortOrder(prev, info)) {
|
||||
else if (info.tlvType != prev.tlvType && !compareFieldSortOrder(prev, info)) {
|
||||
BOOST_THROW_EXCEPTION(Error("fields are not in correct sort order"));
|
||||
}
|
||||
}
|
||||
@@ -132,9 +132,9 @@ Packet::wireDecode(const Block& wire)
|
||||
bool
|
||||
Packet::comparePos(uint64_t first, const Block& second)
|
||||
{
|
||||
detail::FieldInfo firstInfo(first);
|
||||
detail::FieldInfo secondInfo(second.type());
|
||||
return detail::compareFieldSortOrder(firstInfo, secondInfo);
|
||||
FieldInfo firstInfo(first);
|
||||
FieldInfo secondInfo(second.type());
|
||||
return compareFieldSortOrder(firstInfo, secondInfo);
|
||||
}
|
||||
|
||||
} // namespace lp
|
||||
|
||||
Reference in new issue
Block a user