A Discrete-Event Network Simulator
API
point-to-point-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2008 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 #ifndef POINT_TO_POINT_HELPER_H
21 #define POINT_TO_POINT_HELPER_H
22 
23 #include <string>
24 
25 #include "ns3/object-factory.h"
26 #include "ns3/net-device-container.h"
27 #include "ns3/node-container.h"
28 
29 #include "ns3/trace-helper.h"
30 
31 namespace ns3 {
32 
33 class Queue;
34 class NetDevice;
35 class Node;
36 
46 {
47 public:
53  virtual ~PointToPointHelper () {}
54 
73  void SetQueue (std::string type,
74  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
75  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
76  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
77  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue ());
78 
89  void SetDeviceAttribute (std::string name, const AttributeValue &value);
90 
101  void SetChannelAttribute (std::string name, const AttributeValue &value);
102 
115 
126 
134  NetDeviceContainer Install (Ptr<Node> a, std::string bName);
135 
143  NetDeviceContainer Install (std::string aName, Ptr<Node> b);
144 
152  NetDeviceContainer Install (std::string aNode, std::string bNode);
153 
154 private:
166  virtual void EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, bool promiscuous, bool explicitFilename);
167 
179  virtual void EnableAsciiInternal (
181  std::string prefix,
182  Ptr<NetDevice> nd,
183  bool explicitFilename);
184 
189 };
190 
191 } // namespace ns3
192 
193 #endif /* POINT_TO_POINT_HELPER_H */
Base class providing common user-level ascii trace operations for helpers representing net devices...
Definition: trace-helper.h:641
virtual void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename)
Enable pcap output the indicated net device.
NetDeviceContainer Install(NodeContainer c)
Hold a value for an Attribute.
Definition: attribute.h:68
void SetQueue(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue())
Each point to point net device must have a queue to pass packets through.
Base class providing common user-level pcap operations for helpers representing net devices...
Definition: trace-helper.h:552
Build a set of PointToPointNetDevice objects.
ObjectFactory m_channelFactory
Channel Factory.
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
PointToPointHelper()
Create a PointToPointHelper to make life easier when creating point to point networks.
A class for an empty attribute value.
Definition: attribute.h:232
virtual void EnableAsciiInternal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename)
Enable ascii trace output on the indicated net device.
holds a vector of ns3::NetDevice pointers
ObjectFactory m_deviceFactory
Device Factory.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
ObjectFactory m_remoteChannelFactory
Remote Channel Factory.
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
Instantiate subclasses of ns3::Object.
ObjectFactory m_queueFactory
Queue Factory.