A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
packet-socket-helper.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7 */
8
10
11#include "ns3/names.h"
12#include "ns3/packet-socket-factory.h"
13
14namespace ns3
15{
16
17void
19{
20 for (auto i = c.Begin(); i != c.End(); ++i)
21 {
22 Install(*i);
23 }
24}
25
26void
28{
30 node->AggregateObject(factory);
31}
32
33void
34PacketSocketHelper::Install(std::string nodeName) const
35{
36 Ptr<Node> node = Names::Find<Node>(nodeName);
37 Install(node);
38}
39
40} // namespace ns3
static Ptr< T > Find(std::string path)
Given a name path string, look to see if there's an object in the system with that associated to it.
Definition names.h:443
keep track of a set of node pointers.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
Iterator Begin() const
Get an iterator which refers to the first Node in the container.
void Install(std::string nodeName) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
Smart pointer class similar to boost::intrusive_ptr.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
Every class exported by the ns3 library is enclosed in the ns3 namespace.