本文整理汇总了C++中NodeContainer::End方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeContainer::End方法的具体用法?C++ NodeContainer::End怎么用?C++ NodeContainer::End使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeContainer
的用法示例。
在下文中一共展示了NodeContainer::End方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoInstall
EnergySourceContainer
EnergySourceHelper::Install (NodeContainer c) const
{
EnergySourceContainer container;
for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i)
{
Ptr<EnergySource> src = DoInstall (*i);
container.Add (src);
/*
* Check if EnergySourceContainer is already aggregated to target node. If
* not, create a new EnergySourceContainer and aggregate it to node.
*/
Ptr<EnergySourceContainer> EnergySourceContrainerOnNode =
(*i)->GetObject<EnergySourceContainer> ();
if (EnergySourceContrainerOnNode == NULL)
{
ObjectFactory fac;
fac.SetTypeId ("ns3::EnergySourceContainer");
EnergySourceContrainerOnNode = fac.Create<EnergySourceContainer> ();
EnergySourceContrainerOnNode->Add (src);
(*i)->AggregateObject (EnergySourceContrainerOnNode);
}
else
{
EnergySourceContrainerOnNode->Add (src); // append new EnergySource
}
}
return container;
}
示例2: Install
void
StrategyChoiceHelper::Install(const NodeContainer& c, const Name& namePrefix, const Name& strategy)
{
for (NodeContainer::Iterator i = c.Begin(); i != c.End(); ++i) {
Install(*i, namePrefix, strategy);
}
}
示例3: Update
void
StackHelper::Update(const NodeContainer& c)
{
for (NodeContainer::Iterator i = c.Begin(); i != c.End(); ++i) {
Update(*i);
}
}
示例4:
Ptr<FaceContainer>
StackHelper::Install(const NodeContainer& c) const
{
Ptr<FaceContainer> faces = Create<FaceContainer>();
for (NodeContainer::Iterator i = c.Begin(); i != c.End(); ++i) {
faces->AddAll(Install(*i));
}
return faces;
}
示例5: Install
void
DsrMainHelper::Install (DsrHelper &dsrHelper, NodeContainer nodes)
{
NS_LOG_DEBUG ("Passed node container");
delete m_dsrHelper;
m_dsrHelper = dsrHelper.Copy ();
for (NodeContainer::Iterator i = nodes.Begin (); i != nodes.End (); ++i)
{
Install (*i);
}
}
示例6:
ApplicationContainer
BulkSendHelper::Install (NodeContainer c) const
{
ApplicationContainer apps;
for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i)
{
apps.Add (InstallPriv (*i));
}
return apps;
}
示例7: Install
Ptr<FlowMonitor>
FlowMonitorHelper::Install (NodeContainer nodes)
{
for (NodeContainer::Iterator i = nodes.Begin (); i != nodes.End (); ++i)
{
Ptr<Node> node = *i;
if (node->GetObject<Ipv4L3Protocol> ())
{
Install (node);
}
}
return m_flowMonitor;
}
示例8: return
int64_t
OnOffHelper::AssignStreams (NodeContainer c, int64_t stream)
{
int64_t currentStream = stream;
Ptr<Node> node;
for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i)
{
node = (*i);
for (uint32_t j = 0; j < node->GetNApplications (); j++)
{
Ptr<OnOffApplication> onoff = DynamicCast<OnOffApplication> (node->GetApplication (j));
if (onoff)
{
currentStream += onoff->AssignStreams (currentStream);
}
}
}
return (currentStream - stream);
}
示例9: return
int64_t
AodvHelper::AssignStreams (NodeContainer c, int64_t stream)
{
int64_t currentStream = stream;
Ptr<Node> node;
for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i)
{
node = (*i);
Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
NS_ASSERT_MSG (ipv4, "Ipv4 not installed on node");
Ptr<Ipv4RoutingProtocol> proto = ipv4->GetRoutingProtocol ();
NS_ASSERT_MSG (proto, "Ipv4 routing not installed on node");
Ptr<aodv::RoutingProtocol> aodv = DynamicCast<aodv::RoutingProtocol> (proto);
if (aodv)
{
currentStream += aodv->AssignStreams (currentStream);
continue;
}
// Aodv may also be in a list
Ptr<Ipv4ListRouting> list = DynamicCast<Ipv4ListRouting> (proto);
if (list)
{
int16_t priority;
Ptr<Ipv4RoutingProtocol> listProto;
Ptr<aodv::RoutingProtocol> listAodv;
for (uint32_t i = 0; i < list->GetNRoutingProtocols (); i++)
{
listProto = list->GetRoutingProtocol (i, priority);
listAodv = DynamicCast<aodv::RoutingProtocol> (listProto);
if (listAodv)
{
currentStream += listAodv->AssignStreams (currentStream);
break;
}
}
}
}
return (currentStream - stream);
}