A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
uan-helper.h
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 
34 class UanHelper
35 {
36 public:
37  UanHelper ();
38  virtual ~UanHelper ();
39 
62  void SetMac (std::string type,
63  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
64  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
65  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
66  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
67  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
68  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
69  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
70  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
71 
72 
95  void SetPhy (std::string phyType,
96  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
97  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
98  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
99  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
100  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
101  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
102  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
103  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
104 
105 
128  void SetTransducer (std::string type,
129  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
130  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
131  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
132  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
133  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
134  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
135  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
136  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
146  static void EnableAscii (std::ostream &os, uint32_t nodeid, uint32_t deviceid);
156  static void EnableAscii (std::ostream &os, NetDeviceContainer d);
166  static void EnableAscii (std::ostream &os, NodeContainer n);
174  static void EnableAsciiAll (std::ostream &os);
175 
202 
216  Ptr<UanNetDevice> Install (Ptr<Node> node, Ptr<UanChannel> channel) const;
217 
229  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
230 
231 private:
232  ObjectFactory m_device;
233  ObjectFactory m_mac;
234  ObjectFactory m_phy;
235  ObjectFactory m_transducer;
236 
237 };
238 
239 
240 } // end namespace ns3
241 
242 #endif /* UAN_HELPER_H */
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
Hold a value for an Attribute.
Definition: attribute.h:51
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())
Definition: uan-helper.cc:73
A class for an empty attribute value.
Definition: attribute.h:204
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())
Definition: uan-helper.cc:120
holds a vector of ns3::NetDevice pointers
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Definition: uan-helper.cc:237
static void EnableAscii(std::ostream &os, uint32_t nodeid, uint32_t deviceid)
Definition: uan-helper.cc:144
keep track of a set of node pointers.
static void EnableAsciiAll(std::ostream &os)
Definition: uan-helper.cc:184
instantiate subclasses of ns3::Object.
NetDeviceContainer Install(NodeContainer c) const
Definition: uan-helper.cc:190
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())
Definition: uan-helper.cc:96