A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
flent-helper.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 INRIA
3 * Copyright (c) 2022 NITK Surathkal
4 *
5 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 * This file is adapted from bulk-send-helper.cc.
8 *
9 * Author: Ameya Deshpande <ameyanrd@outlook.com>
10 */
11
12#include "flent-helper.h"
13
14#include "ns3/names.h"
15#include "ns3/string.h"
16
17namespace ns3
18{
19
20FlentHelper::FlentHelper(std::string testname, Address address)
21{
22 m_factory.SetTypeId("ns3::FlentApplication");
23 m_factory.Set("TestName", StringValue(testname));
24 m_factory.Set("HostAddress", AddressValue(address));
25}
26
27void
28FlentHelper::SetAttribute(std::string name, const AttributeValue& value)
29{
30 m_factory.Set(name, value);
31}
32
33void
35{
36 m_startTime = start;
37
38 m_factory.Set("StartTime", TimeValue(m_startTime));
39}
40
41void
43{
44 m_length = length;
45
46 m_factory.Set("Length", TimeValue(length));
47}
48
49Time
51{
52 return m_startTime + m_length + Seconds(10);
53}
54
57{
59}
60
62FlentHelper::Install(std::string nodeName) const
63{
64 Ptr<Node> node = Names::Find<Node>(nodeName);
66}
67
70{
72 node->AddApplication(app);
73
74 return app;
75}
76
77} // namespace ns3
a polymophic address class
Definition address.h:114
holds a vector of ns3::Application pointers.
The base class for all ns3 applications.
Definition application.h:51
Hold a value for an Attribute.
Definition attribute.h:59
Ptr< Application > InstallPriv(Ptr< Node > node) const
Install an ns3::FlentApplication on the node configured with all the attributes set with SetAttribute...
void SetTestLength(Time length)
Set the length of the Flent test.
Time m_length
The duration of the Flent test.
Time m_startTime
The start time of the Flent test.
void SetTestStartTime(Time start)
Set the test start time.
FlentHelper(std::string testname, Address address)
Create an FlentHelper to make it easier to work with FlentApplication.
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
Time GetStopTime() const
Get the overall stop time of the simulation.
ObjectFactory m_factory
Object factory.
ApplicationContainer Install(Ptr< Node > node) const
Install an ns3::FlentApplication on the node configured with all the attributes set with SetAttribute...
static Ptr< T > Find(std::string path)
Given a name path string, look to see if there's an object in the system with that associated to it.
Definition names.h:445
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
Hold variables of type string.
Definition string.h:45
Simulation virtual time values and global simulation resolution.
Definition nstime.h:95
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1313
Every class exported by the ns3 library is enclosed in the ns3 namespace.