src/helper/csma-helper.h
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--
doxygen
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    13
/**
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    14
 * \brief build a set of CsmaNetDevice objects
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    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
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    21
  /**
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    22
   * \param type the type of queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    23
   * \param n1 the name of the attribute to set on the queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    24
   * \param v1 the value of the attribute to set on the queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    25
   * \param n2 the name of the attribute to set on the queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    26
   * \param v2 the value of the attribute to set on the queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    27
   * \param n3 the name of the attribute to set on the queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    28
   * \param v3 the value of the attribute to set on the queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    29
   * \param n4 the name of the attribute to set on the queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    30
   * \param v4 the value of the attribute to set on the queue
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    31
   *
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    32
   * Set the type of queue to create and associated to each
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    33
   * CsmaNetDevice created through CsmaHelper::Build.
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    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
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    42
   * \param n1 the name of the attribute to set
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    43
   * \param v1 the value of the attribute to set
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    44
   *
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    45
   * Set these parameters on each CsmaNetDevice created
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    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
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    50
  /**
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    51
   * \param n1 the name of the attribute to set
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    52
   * \param v1 the value of the attribute to set
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    53
   *
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    54
   * Set these parameters on each CsmaChannel created
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    55
   * by CsmaHelper::Build
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    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
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    59
  /**
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    60
   * \param c a set of nodes
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    61
   *
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    62
   * This method creates a simple ns3::CsmaChannel with the
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    63
   * attributes configured by CsmaHelper::SetChannelParameter and
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    64
   * then calls CsmaHelper::Build.
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    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
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    68
  /**
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    69
   * \param c a set of nodes
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    70
   * \param channel the channel to use as a backbone.
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    71
   *
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    72
   * For each node in the input container, we create a ns::CsmaNetDevice with
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    73
   * the requested parameters, a queue for this NetDevice, and associate
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    74
   * the resulting ns3::NetDevice with the ns3::Node and ns3::CsmaChannel.
183585d224b4 doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    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 */