A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
one-shot-sender-helper.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 University of Padova
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Davide Magrin <magrinda@dei.unipd.it>
7 */
8
10
11#include "ns3/one-shot-sender.h"
12
13namespace ns3
14{
15namespace lorawan
16{
17
18NS_LOG_COMPONENT_DEFINE("OneShotSenderHelper");
19
21{
22 m_factory.SetTypeId("ns3::OneShotSender");
23}
24
28
29void
31{
32 m_sendTime = sendTime;
33}
34
35void
37{
38 m_factory.Set(name, value);
39}
40
46
49{
51 for (auto i = c.Begin(); i != c.End(); ++i)
52 {
53 apps.Add(InstallPriv(*i));
54 }
55
56 return apps;
57}
58
61{
62 NS_LOG_FUNCTION(this << node->GetId());
63
65
66 app->SetSendTime(m_sendTime);
67
68 app->SetNode(node);
69 node->AddApplication(app);
70
71 return app;
72}
73
74} // namespace lorawan
75} // namespace ns3
holds a vector of ns3::Application pointers.
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container.
Hold a value for an Attribute.
Definition attribute.h:59
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.
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
Simulation virtual time values and global simulation resolution.
Definition nstime.h:95
void SetSendTime(Time sendTime)
Set the send time of the applications.
ObjectFactory m_factory
The object factory.
Time m_sendTime
Time at which the OneShotSender applications will be configured to send the packet.
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
ApplicationContainer Install(NodeContainer c) const
Install a OneShotSender application on each node of the input container configured with all the attri...
Ptr< Application > InstallPriv(Ptr< Node > node) const
Install a OneShotSender application on the input Node configured with all the attributes set with Set...
Packet sender application to send a single packet.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:194
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Every class exported by the ns3 library is enclosed in the ns3 namespace.