27 #include <boost/range/adaptor/map.hpp> 28 #include <boost/range/algorithm/copy.hpp> 42 return os << static_cast<int>(d);
45 UnsolicitedDataPolicy::Registry&
46 UnsolicitedDataPolicy::getRegistry()
48 static Registry registry;
52 unique_ptr<UnsolicitedDataPolicy>
55 Registry& registry = getRegistry();
56 auto i = registry.find(policyName);
57 return i == registry.end() ?
nullptr : i->second();
63 std::set<std::string> policyNames;
64 boost::copy(getRegistry() | boost::adaptors::map_keys,
65 std::inserter(policyNames, policyNames.end()));
84 if (inFace.getScope() == ndn::nfd::FACE_SCOPE_LOCAL) {
96 if (inFace.getScope() == ndn::nfd::FACE_SCOPE_NON_LOCAL) {
static const std::string POLICY_NAME
UnsolicitedDataDecision decide(const Face &inFace, const Data &data) const final
drops all unsolicited Data
admits all unsolicited Data
#define NFD_REGISTER_UNSOLICITED_DATA_POLICY(P)
registers an unsolicited data policy
static unique_ptr< UnsolicitedDataPolicy > create(const std::string &policyName)
static const std::string POLICY_NAME
admits unsolicited Data from non-local faces
the Data should be dropped
UnsolicitedDataDecision decide(const Face &inFace, const Data &data) const final
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
static const std::string POLICY_NAME
admits unsolicited Data from local faces
UnsolicitedDataDecision
a decision made by UnsolicitedDataPolicy
the Data should be cached in the ContentStore
std::ostream & operator<<(std::ostream &os, UnsolicitedDataDecision d)
UnsolicitedDataDecision decide(const Face &inFace, const Data &data) const final
static std::set< std::string > getPolicyNames()
static const std::string POLICY_NAME
UnsolicitedDataDecision decide(const Face &inFace, const Data &data) const final