26 #ifndef NFD_DAEMON_FW_UNSOLICITED_DATA_POLICY_HPP 27 #define NFD_DAEMON_FW_UNSOLICITED_DATA_POLICY_HPP 57 decide(
const Face& inFace,
const Data& data)
const = 0;
64 Registry& registry = getRegistry();
65 BOOST_ASSERT(registry.count(policyName) == 0);
66 registry[policyName] = [] {
return make_unique<P>(); };
72 static unique_ptr<UnsolicitedDataPolicy>
73 create(
const std::string& policyName);
77 static std::set<std::string>
81 typedef std::function<unique_ptr<UnsolicitedDataPolicy>()> CreateFunc;
82 typedef std::map<std::string, CreateFunc> Registry;
94 decide(
const Face& inFace,
const Data& data)
const final;
106 decide(
const Face& inFace,
const Data& data)
const final;
118 decide(
const Face& inFace,
const Data& data)
const final;
130 decide(
const Face& inFace,
const Data& data)
const final;
147 #define NFD_REGISTER_UNSOLICITED_DATA_POLICY(P) \ 148 static class NfdAuto ## P ## UnsolicitedDataPolicyRegistrationClass \ 151 NfdAuto ## P ## UnsolicitedDataPolicyRegistrationClass() \ 153 ::nfd::fw::UnsolicitedDataPolicy::registerPolicy<P>(); \ 155 } g_nfdAuto ## P ## UnsolicitedDataPolicyRegistrationVariable 157 #endif // NFD_DAEMON_FW_UNSOLICITED_DATA_POLICY_HPP static const std::string POLICY_NAME
static void registerPolicy(const std::string &policyName=P::POLICY_NAME)
drops all unsolicited Data
admits all unsolicited Data
static const std::string POLICY_NAME
admits unsolicited Data from non-local faces
DropAllUnsolicitedDataPolicy DefaultUnsolicitedDataPolicy
the default UnsolicitedDataPolicy
the Data should be dropped
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
determines how to process an unsolicited Data
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)
static const std::string POLICY_NAME