20 #include "on-off-helper.h"
21 #include "ns3/inet-socket-address.h"
22 #include "ns3/packet-socket-address.h"
23 #include "ns3/string.h"
24 #include "ns3/data-rate.h"
25 #include "ns3/uinteger.h"
26 #include "ns3/names.h"
27 #include "ns3/random-variable-stream.h"
28 #include "ns3/onoff-application.h"
34 m_factory.
SetTypeId (
"ns3::OnOffApplication");
42 m_factory.
Set (name, value);
54 Ptr<Node> node = Names::Find<Node> (nodeName);
62 for (NodeContainer::Iterator i = c.
Begin (); i != c.
End (); ++i)
82 int64_t currentStream = stream;
84 for (NodeContainer::Iterator i = c.
Begin (); i != c.
End (); ++i)
92 currentStream += onoff->AssignStreams (currentStream);
96 return (currentStream - stream);
102 m_factory.
Set (
"OnTime",
StringValue (
"ns3::ConstantRandomVariable[Constant=1000]"));
103 m_factory.
Set (
"OffTime",
StringValue (
"ns3::ConstantRandomVariable[Constant=0]"));
holds a vector of ns3::Application pointers.
uint32_t AddApplication(Ptr< Application > application)
uint32_t GetNApplications(void) const
hold variables of type string
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container. ...
Hold a value for an Attribute.
void SetTypeId(TypeId tid)
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
int64_t AssignStreams(NodeContainer c, int64_t stream)
a polymophic address class
Class for representing data rates.
Ptr< Application > GetApplication(uint32_t index) const
The base class for all ns3 applications.
Ptr< Object > Create(void) const
Hold an unsigned integer type.
OnOffHelper(std::string protocol, Address address)
void SetConstantRate(DataRate dataRate, uint32_t packetSize=512)
keep track of a set of node pointers.
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.
void Set(std::string name, const AttributeValue &value)
hold objects of type ns3::Address
hold objects of type ns3::DataRate
Ptr< Application > InstallPriv(Ptr< Node > node) const
ApplicationContainer Install(NodeContainer c) const
void SetAttribute(std::string name, const AttributeValue &value)