A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
one-shot-sender-helper.h
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
9
#ifndef ONE_SHOT_SENDER_HELPER_H
10
#define ONE_SHOT_SENDER_HELPER_H
11
12
#include "ns3/address.h"
13
#include "ns3/application-container.h"
14
#include "ns3/attribute.h"
15
#include "ns3/net-device.h"
16
#include "ns3/node-container.h"
17
#include "ns3/object-factory.h"
18
#include "ns3/one-shot-sender.h"
19
20
#include <stdint.h>
21
#include <string>
22
23
namespace
ns3
24
{
25
namespace
lorawan
26
{
27
28
/**
29
* \ingroup lorawan
30
*
31
* This class can be used to install OneShotSender applications on multiple nodes at once.
32
*/
33
class
OneShotSenderHelper
34
{
35
public
:
36
OneShotSenderHelper
();
//!< Default constructor
37
~OneShotSenderHelper
();
//!< Destructor
38
39
/**
40
* Helper function used to set the underlying application attributes.
41
*
42
* \param name The name of the application attribute to set.
43
* \param value The value of the application attribute to set.
44
*/
45
void
SetAttribute
(std::string name,
const
AttributeValue
& value);
46
47
/**
48
* Install a OneShotSender application on each node of the input container
49
* configured with all the attributes set with SetAttribute or other functions of this class.
50
*
51
* \param c NodeContainer of the set of nodes on which an OneShotSender will be installed.
52
* \return Container of Ptr to the applications installed.
53
*/
54
ApplicationContainer
Install
(
NodeContainer
c)
const
;
55
56
/**
57
* Install a OneShotSender application on the input Node configured with all the attributes set
58
* with SetAttribute or other functions of this class.
59
*
60
* \param node The node on which a OneShotSender will be installed.
61
* \return Container of the Ptr to the application installed.
62
*/
63
ApplicationContainer
Install
(
Ptr<Node>
node)
const
;
64
65
/**
66
* Set the send time of the applications.
67
*
68
* \param sendTime The Time to set.
69
*
70
* \todo It does not make sense that all applications send at the exact same time.
71
*/
72
void
SetSendTime
(
Time
sendTime);
73
74
private
:
75
/**
76
* Install a OneShotSender application on the input Node configured with all the attributes set
77
* with SetAttribute or other functions of this class.
78
*
79
* \param node The node on which a OneShotSender will be installed.
80
* \return A pointer to the applications installed.
81
*/
82
Ptr<Application>
InstallPriv
(
Ptr<Node>
node)
const
;
83
84
ObjectFactory
m_factory
;
//!< The object factory
85
Time
m_sendTime
;
//!< Time at which the OneShotSender applications will be configured to send
86
//!< the packet
87
};
88
89
}
// namespace lorawan
90
91
}
// namespace ns3
92
#endif
/* ONE_SHOT_SENDER_HELPER_H */
ns3::ApplicationContainer
holds a vector of ns3::Application pointers.
Definition
application-container.h:33
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
ns3::NodeContainer
keep track of a set of node pointers.
Definition
node-container.h:29
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition
object-factory.h:37
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::lorawan::OneShotSenderHelper
This class can be used to install OneShotSender applications on multiple nodes at once.
Definition
one-shot-sender-helper.h:34
ns3::lorawan::OneShotSenderHelper::SetSendTime
void SetSendTime(Time sendTime)
Set the send time of the applications.
Definition
one-shot-sender-helper.cc:35
ns3::lorawan::OneShotSenderHelper::m_factory
ObjectFactory m_factory
The object factory.
Definition
one-shot-sender-helper.h:84
ns3::lorawan::OneShotSenderHelper::m_sendTime
Time m_sendTime
Time at which the OneShotSender applications will be configured to send the packet.
Definition
one-shot-sender-helper.h:85
ns3::lorawan::OneShotSenderHelper::~OneShotSenderHelper
~OneShotSenderHelper()
Destructor.
Definition
one-shot-sender-helper.cc:30
ns3::lorawan::OneShotSenderHelper::SetAttribute
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
Definition
one-shot-sender-helper.cc:41
ns3::lorawan::OneShotSenderHelper::Install
ApplicationContainer Install(NodeContainer c) const
Install a OneShotSender application on each node of the input container configured with all the attri...
Definition
one-shot-sender-helper.cc:53
ns3::lorawan::OneShotSenderHelper::OneShotSenderHelper
OneShotSenderHelper()
Default constructor.
Definition
one-shot-sender-helper.cc:25
ns3::lorawan::OneShotSenderHelper::InstallPriv
Ptr< Application > InstallPriv(Ptr< Node > node) const
Install a OneShotSender application on the input Node configured with all the attributes set with Set...
Definition
one-shot-sender-helper.cc:65
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lorawan
helper
one-shot-sender-helper.h
Generated on Fri Nov 8 2024 13:59:02 for ns-3 by
1.11.0