author | Gustavo J. A. M. Carneiro <gjc@inescporto.pt> |
Fri, 11 Jul 2008 18:39:19 +0100 | |
changeset 3416 | 926ccb845111 |
parent 2834 | 1aab57845b07 |
child 3615 | 8100abafd21d |
permissions | -rw-r--r-- |
2833
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
2 |
/* |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
3 |
* Copyright (c) 2008 INRIA |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
4 |
* |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
7 |
* published by the Free Software Foundation; |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
8 |
* |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
12 |
* GNU General Public License for more details. |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
13 |
* |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
17 |
* |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2698
diff
changeset
|
19 |
*/ |
2417
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
#ifndef NET_DEVICE_CONTAINER_H |
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
21 |
#define NET_DEVICE_CONTAINER_H |
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
|
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
#include <stdint.h> |
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
#include <vector> |
2603
1308da4cb3bf
move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2417
diff
changeset
|
25 |
#include "ns3/net-device.h" |
2417
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
|
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
namespace ns3 { |
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
28 |
|
2698 | 29 |
/** |
30 |
* \brief holds a vector of ns3::NetDevice pointers |
|
31 |
* |
|
32 |
*/ |
|
2417
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
33 |
class NetDeviceContainer |
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
34 |
{ |
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
35 |
public: |
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
36 |
typedef std::vector<Ptr<NetDevice> >::const_iterator Iterator; |
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
37 |
|
2698 | 38 |
/** |
39 |
* \returns an iterator which points to the start of the array of pointers. |
|
40 |
*/ |
|
2417
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
41 |
Iterator Begin (void) const; |
2698 | 42 |
/** |
43 |
* \returns an iterator which points to the end of the array of pointers. |
|
44 |
*/ |
|
2417
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
45 |
Iterator End (void) const; |
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
46 |
|
2698 | 47 |
/** |
48 |
* \returns the number of netdevice pointers stored in this container. |
|
49 |
*/ |
|
2417
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
50 |
uint32_t GetN (void) const; |
2698 | 51 |
/** |
52 |
* \param i the index of the requested netdevice pointer. |
|
53 |
* \returns the requested netdevice pointer. |
|
54 |
*/ |
|
2417
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
55 |
Ptr<NetDevice> Get (uint32_t i) const; |
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
56 |
|
2698 | 57 |
/** |
58 |
* \param other another netdevice container |
|
59 |
* |
|
60 |
* Append to the end of this container the other input container. |
|
61 |
*/ |
|
2417
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
62 |
void Add (NetDeviceContainer other); |
2698 | 63 |
/** |
64 |
* \param device another netdevice pointer. |
|
65 |
* |
|
66 |
* Append to the end of this container the input netdevice pointer. |
|
67 |
*/ |
|
68 |
void Add (Ptr<NetDevice> device); |
|
2417
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
69 |
|
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
70 |
private: |
2698 | 71 |
std::vector<Ptr<NetDevice> > m_devices; |
2417
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
72 |
}; |
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
73 |
|
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
74 |
} // namespace ns3 |
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
75 |
|
004ac83aca83
add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
76 |
#endif /* NET_DEVICE_CONTAINER_H */ |