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/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
23namespace ns3
24{
25namespace lorawan
26{
27
28/**
29 * \ingroup lorawan
30 *
31 * This class can be used to install OneShotSender applications on multiple nodes at once.
32 */
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 */
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 */
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 */
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 */
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.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
This class can be used to install OneShotSender applications on multiple nodes at once.
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.