blob: 4f9f6bb80e4647ed0f6899ff83db13050d2476c2 [file] [log] [blame]
Ilya Moiseenko9b273ce2011-08-05 20:24:12 -07001//
2// ndn_stupidinterestgenerator_helper.h
3// Abstraction
4//
5// Created by Ilya Moiseenko on 05.08.11.
6// Copyright 2011 UCLA. All rights reserved.
7//
8
9#include "ns3/object-factory.h"
10#include "ns3/ipv4-address.h"
11#include "ns3/node-container.h"
12#include "ns3/application-container.h"
13
14namespace ns3 {
15
16 /**
17 * \brief A helper to make it easier to instantiate an ns3::OnOffApplication
18 * on a set of nodes.
19 */
20 class StupidInterestGeneratorHelper
21 {
22 public:
23 /**
24 * Create an OnOffHelper to make it easier to work with OnOffApplications
25 *
26 * \param protocol the name of the protocol to use to send traffic
27 * by the applications. This string identifies the socket
28 * factory type used to create sockets for the applications.
29 * A typical value would be ns3::UdpSocketFactory.
30 * \param address the address of the remote node to send traffic
31 * to.
32 */
33 StupidInterestGeneratorHelper (std::string protocol, Address address);
34
35 /**
36 * Helper function used to set the underlying application attributes.
37 *
38 * \param name the name of the application attribute to set
39 * \param value the value of the application attribute to set
40 */
41 void SetAttribute (std::string name, const AttributeValue &value);
42
43 /**
44 * Install an ns3::OnOffApplication on each node of the input container
45 * configured with all the attributes set with SetAttribute.
46 *
47 * \param c NodeContainer of the set of nodes on which an OnOffApplication
48 * will be installed.
49 * \returns Container of Ptr to the applications installed.
50 */
51 ApplicationContainer Install (NodeContainer c) const;
52
53 /**
54 * Install an ns3::OnOffApplication on the node configured with all the
55 * attributes set with SetAttribute.
56 *
57 * \param node The node on which an OnOffApplication will be installed.
58 * \returns Container of Ptr to the applications installed.
59 */
60 ApplicationContainer Install (Ptr<Node> node) const;
61
62 /**
63 * Install an ns3::OnOffApplication on the node configured with all the
64 * attributes set with SetAttribute.
65 *
66 * \param nodeName The node on which an OnOffApplication will be installed.
67 * \returns Container of Ptr to the applications installed.
68 */
69 ApplicationContainer Install (std::string nodeName) const;
70
71 private:
72 /**
73 * \internal
74 * Install an ns3::OnOffApplication on the node configured with all the
75 * attributes set with SetAttribute.
76 *
77 * \param node The node on which an OnOffApplication will be installed.
78 * \returns Ptr to the application installed.
79 */
80 Ptr<Application> InstallPriv (Ptr<Node> node) const;
81 std::string m_protocol;
82 Address m_remote;
83 ObjectFactory m_factory;
84 };
85
86} // namespace ns3