26 #ifndef NFD_DAEMON_FW_UNSOLICITED_DATA_POLICY_HPP 27 #define NFD_DAEMON_FW_UNSOLICITED_DATA_POLICY_HPP 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;
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 UnsolicitedDataDecision decide(const Face &inFace, const Data &data) const final
admits all unsolicited Data
static const std::string POLICY_NAME
generalization of a network interface
UnsolicitedDataDecision decide(const Face &inFace, const Data &data) const final
determines how to process an unsolicited Data
UnsolicitedDataDecision decide(const Face &inFace, const Data &data) const final
static const std::string POLICY_NAME
admits unsolicited Data from local faces
DropAllUnsolicitedDataPolicy DefaultUnsolicitedDataPolicy
the default UnsolicitedDataPolicy
static const std::string POLICY_NAME
static const std::string POLICY_NAME
admits unsolicited Data from non-local faces
the Data should be dropped
static void registerPolicy(const std::string &policyName=P::POLICY_NAME)
Copyright (c) 2011-2015 Regents of the University of California.
static unique_ptr< UnsolicitedDataPolicy > create(const std::string &policyName)
virtual ~UnsolicitedDataPolicy()=default
UnsolicitedDataDecision
a decision made by UnsolicitedDataPolicy
static std::set< std::string > getPolicyNames()
the Data should be cached in the ContentStore
drops all unsolicited Data
virtual UnsolicitedDataDecision decide(const Face &inFace, const Data &data) const =0
std::ostream & operator<<(std::ostream &os, UnsolicitedDataDecision d)
Represents a Data packet.
UnsolicitedDataDecision decide(const Face &inFace, const Data &data) const final