author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Sat, 04 Jul 2009 08:15:48 +0200 | |
changeset 4654 | 2eaebe77d66b |
parent 3290 | 3167a20f9cf0 |
permissions | -rw-r--r-- |
345
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
2 |
/* |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
3 |
* Copyright (c) 2007 INRIA |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
4 |
* |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
8 |
* |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
13 |
* |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
17 |
* |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
18 |
* Authors: |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
19 |
* Mathieu Lacage <mathieu.lacage@sophia.inria.fr>, |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
20 |
*/ |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
21 |
#ifndef NODE_LIST_H |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
22 |
#define NODE_LIST_H |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
23 |
|
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
24 |
#include <vector> |
546
0b652c3eef96
Hacked arraytraceresolver to compile, but segfaults upon running simple-p2p
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
485
diff
changeset
|
25 |
#include "ns3/ptr.h" |
345
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
26 |
|
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
27 |
namespace ns3 { |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
28 |
|
728
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
607
diff
changeset
|
29 |
class Node; |
1362
162bd608c970
remove TraceRoot
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1341
diff
changeset
|
30 |
class CallbackBase; |
1227
268a9fc6f4a2
work in progress towards a working trace context
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
728
diff
changeset
|
31 |
|
268a9fc6f4a2
work in progress towards a working trace context
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
728
diff
changeset
|
32 |
|
596
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
33 |
/** |
3183 | 34 |
* \ingroup node |
35 |
* |
|
596
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
36 |
* \brief the list of simulation nodes. |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
37 |
* |
728
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
607
diff
changeset
|
38 |
* Every Node created is automatically added to this list. |
596
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
39 |
*/ |
345
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
40 |
class NodeList |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
41 |
{ |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
42 |
public: |
1383 | 43 |
typedef std::vector< Ptr<Node> >::const_iterator Iterator; |
345
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
44 |
|
596
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
45 |
/** |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
46 |
* \param node node to add |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
47 |
* \returns index of node in list. |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
48 |
* |
728
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
607
diff
changeset
|
49 |
* This method is called automatically from Node::Node so |
596
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
50 |
* the user has little reason to call it himself. |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
51 |
*/ |
728
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
607
diff
changeset
|
52 |
static uint32_t Add (Ptr<Node> node); |
596
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
53 |
/** |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
54 |
* \returns a C++ iterator located at the beginning of this |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
55 |
* list. |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
56 |
*/ |
345
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
57 |
static Iterator Begin (void); |
596
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
58 |
/** |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
59 |
* \returns a C++ iterator located at the end of this |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
60 |
* list. |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
61 |
*/ |
345
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
62 |
static Iterator End (void); |
596
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
63 |
/** |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
64 |
* \param n index of requested node. |
728
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
607
diff
changeset
|
65 |
* \returns the Node associated to index n. |
596
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
66 |
*/ |
728
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
607
diff
changeset
|
67 |
static Ptr<Node> GetNode (uint32_t n); |
3290
3167a20f9cf0
GetNNodes() in NodeList fixes bug 225
craigdo@craig-dowells-imac.local
parents:
3183
diff
changeset
|
68 |
/** |
3167a20f9cf0
GetNNodes() in NodeList fixes bug 225
craigdo@craig-dowells-imac.local
parents:
3183
diff
changeset
|
69 |
* \returns the number of nodes currently in the list. |
3167a20f9cf0
GetNNodes() in NodeList fixes bug 225
craigdo@craig-dowells-imac.local
parents:
3183
diff
changeset
|
70 |
*/ |
3167a20f9cf0
GetNNodes() in NodeList fixes bug 225
craigdo@craig-dowells-imac.local
parents:
3183
diff
changeset
|
71 |
static uint32_t GetNNodes (void); |
345
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
72 |
}; |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
73 |
|
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
74 |
}//namespace ns3 |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
75 |
|
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
76 |
|
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
77 |
#endif /* NODE_LIST_H */ |