A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
uan-helper.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 University of Washington
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Leonard Tracy <lentracy@u.washington.edu>
18  */
19 
20 #ifndef UAN_HELPER_H
21 #define UAN_HELPER_H
22 
23 #include <string>
24 #include "ns3/attribute.h"
25 #include "ns3/object-factory.h"
26 #include "ns3/node-container.h"
27 #include "ns3/net-device-container.h"
28 #include "ns3/uan-net-device.h"
29 
30 namespace ns3 {
31 
32 class UanChannel;
33 
39 class UanHelper
40 {
41 public:
42  UanHelper ();
43  virtual ~UanHelper ();
44 
69  void SetMac (std::string type,
70  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
71  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
72  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
73  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
74  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
75  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
76  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
77  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
78 
79 
104  void SetPhy (std::string phyType,
105  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
106  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
107  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
108  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
109  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
110  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
111  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
112  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
113 
114 
139  void SetTransducer (std::string type,
140  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
141  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
142  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
143  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
144  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
145  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
146  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
147  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
157  static void EnableAscii (std::ostream &os, uint32_t nodeid, uint32_t deviceid);
167  static void EnableAscii (std::ostream &os, NetDeviceContainer d);
177  static void EnableAscii (std::ostream &os, NodeContainer n);
185  static void EnableAsciiAll (std::ostream &os);
186 
201 
215 
232  Ptr<UanNetDevice> Install (Ptr<Node> node, Ptr<UanChannel> channel) const;
233 
245  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
246 
247 private:
252 
253 };
254 
255 
256 } // end namespace ns3
257 
258 #endif /* UAN_HELPER_H */
UAN configuration helper.
Definition: uan-helper.h:39
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:60
virtual ~UanHelper()
Destructor.
Definition: uan-helper.cc:84
Hold a value for an Attribute.
Definition: attribute.h:56
UanHelper()
Defalt constructor.
Definition: uan-helper.cc:76
ObjectFactory m_transducer
The transducer.
Definition: uan-helper.h:251
void SetMac(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), 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(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
Set MAC attributes.
Definition: uan-helper.cc:91
A class for an empty attribute value.
Definition: attribute.h:222
void SetTransducer(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), 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(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
Set the transducer attributes.
Definition: uan-helper.cc:138
ObjectFactory m_mac
The MAC layer.
Definition: uan-helper.h:249
holds a vector of ns3::NetDevice pointers
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Definition: uan-helper.cc:255
static void EnableAscii(std::ostream &os, uint32_t nodeid, uint32_t deviceid)
Enable ascii output on the specified deviceid within the specified nodeid if it is of type ns3::UanNe...
Definition: uan-helper.cc:162
keep track of a set of node pointers.
ObjectFactory m_device
The device.
Definition: uan-helper.h:248
static void EnableAsciiAll(std::ostream &os)
Enable ascii output on each device which is of the ns3::UanNetDevice type and dump that to the specif...
Definition: uan-helper.cc:202
instantiate subclasses of ns3::Object.
NetDeviceContainer Install(NodeContainer c) const
This method creates a simple ns3::UanChannel (with a default ns3::UanNoiseModelDefault and ns3::UanPr...
Definition: uan-helper.cc:208
ObjectFactory m_phy
The PHY layer.
Definition: uan-helper.h:250
void SetPhy(std::string phyType, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), 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(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
Set PHY attributes.
Definition: uan-helper.cc:114