author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Mon, 24 Mar 2008 11:43:49 -0700 | |
changeset 2704 | 183585d224b4 |
parent 2603 | 1308da4cb3bf |
child 2705 | a90b71c2afae |
permissions | -rw-r--r-- |
2418
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
1 |
#ifndef CSMA_HELPER_H |
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
#define CSMA_HELPER_H |
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
|
2603
1308da4cb3bf
move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2433
diff
changeset
|
4 |
#include <string> |
1308da4cb3bf
move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2433
diff
changeset
|
5 |
#include "ns3/attribute.h" |
1308da4cb3bf
move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2433
diff
changeset
|
6 |
#include "ns3/object-factory.h" |
1308da4cb3bf
move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2433
diff
changeset
|
7 |
#include "ns3/net-device-container.h" |
1308da4cb3bf
move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2433
diff
changeset
|
8 |
#include "ns3/node-container.h" |
1308da4cb3bf
move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2433
diff
changeset
|
9 |
#include "ns3/csma-channel.h" |
1308da4cb3bf
move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2433
diff
changeset
|
10 |
|
2418
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
namespace ns3 { |
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
|
2704 | 13 |
/** |
14 |
* \brief build a set of CsmaNetDevice objects |
|
15 |
*/ |
|
2418
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
class CsmaHelper |
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
{ |
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
public: |
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
CsmaHelper (); |
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
|
2704 | 21 |
/** |
22 |
* \param type the type of queue |
|
23 |
* \param n1 the name of the attribute to set on the queue |
|
24 |
* \param v1 the value of the attribute to set on the queue |
|
25 |
* \param n2 the name of the attribute to set on the queue |
|
26 |
* \param v2 the value of the attribute to set on the queue |
|
27 |
* \param n3 the name of the attribute to set on the queue |
|
28 |
* \param v3 the value of the attribute to set on the queue |
|
29 |
* \param n4 the name of the attribute to set on the queue |
|
30 |
* \param v4 the value of the attribute to set on the queue |
|
31 |
* |
|
32 |
* Set the type of queue to create and associated to each |
|
33 |
* CsmaNetDevice created through CsmaHelper::Build. |
|
34 |
*/ |
|
2418
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
35 |
void SetQueue (std::string type, |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2418
diff
changeset
|
36 |
std::string n1 = "", Attribute v1 = Attribute (), |
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2418
diff
changeset
|
37 |
std::string n2 = "", Attribute v2 = Attribute (), |
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2418
diff
changeset
|
38 |
std::string n3 = "", Attribute v3 = Attribute (), |
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2418
diff
changeset
|
39 |
std::string n4 = "", Attribute v4 = Attribute ()); |
2418
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
40 |
|
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
41 |
/** |
2704 | 42 |
* \param n1 the name of the attribute to set |
43 |
* \param v1 the value of the attribute to set |
|
44 |
* |
|
45 |
* Set these parameters on each CsmaNetDevice created |
|
46 |
* by CsmaHelper::Build |
|
2418
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
47 |
*/ |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2418
diff
changeset
|
48 |
void SetDeviceParameter (std::string n1, Attribute v1); |
2418
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
49 |
|
2704 | 50 |
/** |
51 |
* \param n1 the name of the attribute to set |
|
52 |
* \param v1 the value of the attribute to set |
|
53 |
* |
|
54 |
* Set these parameters on each CsmaChannel created |
|
55 |
* by CsmaHelper::Build |
|
56 |
*/ |
|
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2418
diff
changeset
|
57 |
void SetChannelParameter (std::string n1, Attribute v1); |
2418
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
58 |
|
2704 | 59 |
/** |
60 |
* \param c a set of nodes |
|
61 |
* |
|
62 |
* This method creates a simple ns3::CsmaChannel with the |
|
63 |
* attributes configured by CsmaHelper::SetChannelParameter and |
|
64 |
* then calls CsmaHelper::Build. |
|
65 |
*/ |
|
2418
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
66 |
NetDeviceContainer Build (const NodeContainer &c); |
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
67 |
|
2704 | 68 |
/** |
69 |
* \param c a set of nodes |
|
70 |
* \param channel the channel to use as a backbone. |
|
71 |
* |
|
72 |
* For each node in the input container, we create a ns::CsmaNetDevice with |
|
73 |
* the requested parameters, a queue for this NetDevice, and associate |
|
74 |
* the resulting ns3::NetDevice with the ns3::Node and ns3::CsmaChannel. |
|
75 |
*/ |
|
2418
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
76 |
NetDeviceContainer Build (const NodeContainer &c, Ptr<CsmaChannel> channel); |
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
77 |
|
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
78 |
private: |
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
79 |
ObjectFactory m_queueFactory; |
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
80 |
ObjectFactory m_deviceFactory; |
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
81 |
ObjectFactory m_channelFactory; |
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
82 |
}; |
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
83 |
|
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
84 |
|
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
85 |
} // namespace ns3 |
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
86 |
|
4ff45fa08781
an initial draft of helper classes. don't work yet.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
87 |
#endif /* CSMA_HELPER_H */ |