author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Mon, 04 Jun 2007 16:17:01 +0200 | |
changeset 728 | 95c426b1cb60 |
parent 607 | 1b7abeccfcda |
child 1195 | 53f1175dbe94 |
child 1227 | 268a9fc6f4a2 |
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 |
* All rights reserved. |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
5 |
* |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
6 |
* 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
|
7 |
* 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
|
8 |
* 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
|
9 |
* |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
10 |
* 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
|
11 |
* 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
|
12 |
* 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
|
13 |
* 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
|
14 |
* |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
15 |
* 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
|
16 |
* 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
|
17 |
* 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
|
18 |
* |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
19 |
* Authors: |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
20 |
* 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
|
21 |
*/ |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
22 |
#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
|
23 |
#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
|
24 |
|
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
25 |
#include <vector> |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
26 |
#include "ns3/array-trace-resolver.h" |
546
0b652c3eef96
Hacked arraytraceresolver to compile, but segfaults upon running simple-p2p
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
485
diff
changeset
|
27 |
#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
|
28 |
|
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
29 |
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
|
30 |
|
728
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
607
diff
changeset
|
31 |
class Node; |
345
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
32 |
class TraceResolver; |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
33 |
class TraceContext; |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
34 |
|
596
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
35 |
/** |
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: |
728
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
607
diff
changeset
|
43 |
typedef ArrayTraceResolver<Node>::Index NodeIndex; |
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
607
diff
changeset
|
44 |
typedef std::vector< Ptr<Node> >::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
|
45 |
|
596
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
46 |
/** |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
47 |
* \param node node to add |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
48 |
* \returns index of node in list. |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
49 |
* |
728
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
607
diff
changeset
|
50 |
* 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
|
51 |
* the user has little reason to call it himself. |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
52 |
*/ |
728
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
607
diff
changeset
|
53 |
static uint32_t Add (Ptr<Node> node); |
596
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
54 |
/** |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
55 |
* \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
|
56 |
* list. |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
57 |
*/ |
345
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
58 |
static Iterator Begin (void); |
596
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
59 |
/** |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
60 |
* \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
|
61 |
* list. |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
62 |
*/ |
345
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
63 |
static Iterator End (void); |
596
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
64 |
/** |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
65 |
* \param context trace context to use for trace resolver |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
66 |
* to create. |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
67 |
* \returns the requested trace resolver. The caller |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
68 |
* takes ownership of the returned pointer. |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
69 |
*/ |
345
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
70 |
static TraceResolver *CreateTraceResolver (TraceContext const &context); |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
71 |
|
596
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
72 |
/** |
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
73 |
* \param n index of requested node. |
728
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
607
diff
changeset
|
74 |
* \returns the Node associated to index n. |
596
06839d2fbaa0
add dox documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
562
diff
changeset
|
75 |
*/ |
728
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
607
diff
changeset
|
76 |
static Ptr<Node> GetNode (uint32_t n); |
345
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
77 |
}; |
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
78 |
|
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
79 |
}//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
|
80 |
|
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
81 |
|
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
82 |
#endif /* NODE_LIST_H */ |