NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
strategy-registry.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#ifndef NFD_DAEMON_FW_STRATEGY_REGISTRY_HPP
27
#define NFD_DAEMON_FW_STRATEGY_REGISTRY_HPP
28
29
#include "common.hpp"
30
31
namespace
nfd
{
32
33
class
Forwarder
;
34
35
namespace
fw {
36
37
class
Strategy
;
38
39
shared_ptr<Strategy>
40
makeDefaultStrategy
(
Forwarder
& forwarder);
41
42
void
43
installStrategies
(
Forwarder
& forwarder);
44
45
46
typedef
std::function<shared_ptr<Strategy>(
Forwarder
&)>
StrategyCreateFunc
;
47
48
void
49
registerStrategyImpl
(
const
Name
& strategyName,
const
StrategyCreateFunc
& createFunc);
50
53
template
<
typename
S>
54
void
55
registerStrategy
()
56
{
57
registerStrategyImpl
(S::STRATEGY_NAME,
58
[] (
Forwarder
& forwarder) {
return
make_shared<S>(ref(forwarder)); });
59
}
60
65
#define NFD_REGISTER_STRATEGY(StrategyType) \
66
static class NfdAuto ## StrategyType ## StrategyRegistrationClass \
67
{ \
68
public: \
69
NfdAuto ## StrategyType ## StrategyRegistrationClass() \
70
{ \
71
::nfd::fw::registerStrategy<StrategyType>(); \
72
} \
73
} g_nfdAuto ## StrategyType ## StrategyRegistrationVariable
74
75
}
// namespace fw
76
}
// namespace nfd
77
78
#endif // NFD_DAEMON_FW_STRATEGY_REGISTRY_HPP
nfd::fw::registerStrategyImpl
void registerStrategyImpl(const Name &strategyName, const StrategyCreateFunc &createFunc)
Definition:
strategy-registry.cpp:46
nfd::fw::installStrategies
void installStrategies(Forwarder &forwarder)
Definition:
strategy-registry.cpp:52
nfd::Forwarder
main class of NFD
Definition:
forwarder.hpp:54
nfd::fw::makeDefaultStrategy
shared_ptr< Strategy > makeDefaultStrategy(Forwarder &forwarder)
Definition:
strategy-registry.cpp:33
nfd::fw::StrategyCreateFunc
std::function< shared_ptr< Strategy >Forwarder &)> StrategyCreateFunc
Definition:
strategy-registry.hpp:46
nfd::fw::Strategy
Strategy
Definition:
strategy.cpp:33
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
ndn::Name
Name abstraction to represent an absolute name.
Definition:
name.hpp:46
nfd::Forwarder
Forwarder
Definition:
forwarder.cpp:38
nfd::fw::registerStrategy
void registerStrategy()
registers a strategy to be installed later
Definition:
strategy-registry.hpp:55
ndnSIM
NFD
daemon
fw
strategy-registry.hpp
Generated on Fri Feb 23 2018 12:30:55 for ndnSIM by
1.8.14