22 #include "ns3/string.h" 23 #include "ns3/names.h" 29 #include "ns3/mpi-interface.h" 32 NS_LOG_COMPONENT_DEFINE(
"ndn.AppHelper");
39 m_factory.SetTypeId(app);
45 m_factory.Set(
"Prefix", StringValue(prefix));
51 m_factory.Set(
name, value);
57 ApplicationContainer apps;
58 Ptr<Application> app = InstallPriv(node);
68 Ptr<Node> node = Names::Find<Node>(nodeName);
75 ApplicationContainer apps;
76 for (NodeContainer::Iterator i = c.Begin(); i != c.End(); ++i) {
77 Ptr<Application> app = InstallPriv(*i);
86 AppHelper::InstallPriv(Ptr<Node> node)
89 Simulator::ScheduleWithContext(node->GetId(), Seconds(0), MakeEvent([=, &app] {
91 if (MpiInterface::IsEnabled() && node->GetSystemId() != MpiInterface::GetSystemId()) {
97 app = m_factory.Create<Application>();
98 node->AddApplication(app);
115 ApplicationContainer apps;
116 auto app = CreateObject<FactoryCallbackApp>(factory);
117 node->AddApplication(app);
125 m_impl = m_factory();
FactoryCallbackApp(const FactoryCallback &factory)
Copyright (c) 2011-2015 Regents of the University of California.
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
static void ProcessWarmupEvents()
AppHelper(const std::string &prefix)
Create an NdnAppHelper to make it easier to work with Ndn apps.
virtual void StopApplication()
ApplicationContainer Install(NodeContainer c)
Install an ns3::NdnConsumer on each node of the input container configured with all the attributes se...
Copyright (c) 2011-2015 Regents of the University of California.
static ApplicationContainer Install(Ptr< Node > node, const FactoryCallback &factory)
void SetPrefix(const std::string &prefix)
Set the prefix consumer will be requesting.
virtual void StartApplication()
std::function< shared_ptr< void >)> FactoryCallback