A Discrete-Event Network Simulator
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/application-container.h"
13#include "ns3/node-container.h"
14#include "ns3/object-factory.h"
15
16namespace ns3
17{
18namespace lorawan
19{
20
21/**
22 * @ingroup lorawan
23 *
24 * This class can be used to install OneShotSender applications on multiple nodes at once.
25 */
27{
28 public:
29 OneShotSenderHelper(); //!< Default constructor
30 ~OneShotSenderHelper(); //!< Destructor
31
32 /**
33 * Helper function used to set the underlying application attributes.
34 *
35 * @param name The name of the application attribute to set.
36 * @param value The value of the application attribute to set.
37 */
38 void SetAttribute(std::string name, const AttributeValue& value);
39
40 /**
41 * Install a OneShotSender application on each node of the input container
42 * configured with all the attributes set with SetAttribute or other functions of this class.
43 *
44 * @param c NodeContainer of the set of nodes on which an OneShotSender will be installed.
45 * @return Container of Ptr to the applications installed.
46 */
48
49 /**
50 * Install a OneShotSender application on the input Node configured with all the attributes set
51 * with SetAttribute or other functions of this class.
52 *
53 * @param node The node on which a OneShotSender will be installed.
54 * @return Container of the Ptr to the application installed.
55 */
57
58 /**
59 * Set the send time of the applications.
60 *
61 * @param sendTime The Time to set.
62 *
63 * @todo It does not make sense that all applications send at the exact same time.
64 */
65 void SetSendTime(Time sendTime);
66
67 private:
68 /**
69 * Install a OneShotSender application on the input Node configured with all the attributes set
70 * with SetAttribute or other functions of this class.
71 *
72 * @param node The node on which a OneShotSender will be installed.
73 * @return A pointer to the applications installed.
74 */
76
77 ObjectFactory m_factory; //!< The object factory
78 Time m_sendTime; //!< Time at which the OneShotSender applications will be configured to send
79 //!< the packet
80};
81
82} // namespace lorawan
83} // namespace ns3
84
85#endif /* ONE_SHOT_SENDER_HELPER_H */
holds a vector of ns3::Application pointers.
Hold a value for an Attribute.
Definition attribute.h:59
keep track of a set of node pointers.
Instantiate subclasses of ns3::Object.
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...
Every class exported by the ns3 library is enclosed in the ns3 namespace.