author | Mathieu Lacage <mathieu.lacage@gmail.com> |
Wed, 03 Aug 2011 13:58:10 -0400 | |
changeset 7399 | 520706f801e8 |
parent 7169 | 358f71a624d8 |
child 11357 | be933ce19aa9 |
permissions | -rw-r--r-- |
2586
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
2 |
/* |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
3 |
* Copyright (c) 2008 INRIA |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
4 |
* |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
7 |
* published by the Free Software Foundation; |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
8 |
* |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
12 |
* GNU General Public License for more details. |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
13 |
* |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
17 |
* |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
18 |
* Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
50d78910a997
add missing copyright/license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2585
diff
changeset
|
19 |
*/ |
3763
e46e361a4262
give attribute power to Callback.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3752
diff
changeset
|
20 |
#ifndef CONFIG_H |
e46e361a4262
give attribute power to Callback.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3752
diff
changeset
|
21 |
#define CONFIG_H |
2474
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
|
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
#include "ptr.h" |
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
#include <string> |
3787
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
25 |
#include <vector> |
2474
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
|
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
namespace ns3 { |
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
28 |
|
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
29 |
class AttributeValue; |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
30 |
class Object; |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
31 |
class CallbackBase; |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
32 |
|
3190
51fe9001a679
add some doxygen, remove a couple of XXX
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
33 |
/** |
51fe9001a679
add some doxygen, remove a couple of XXX
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
34 |
* \brief Configuration of simulation parameters and tracing |
51fe9001a679
add some doxygen, remove a couple of XXX
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
35 |
* \ingroup core |
51fe9001a679
add some doxygen, remove a couple of XXX
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
36 |
*/ |
2474
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
37 |
namespace Config { |
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
38 |
|
2585 | 39 |
/** |
7399
520706f801e8
introduce Config::Reset
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
40 |
* Reset the initial value of every attribute as well as the value of every |
520706f801e8
introduce Config::Reset
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
41 |
* global to what they were before any call to SetDefault and SetGlobal. |
520706f801e8
introduce Config::Reset
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
42 |
*/ |
520706f801e8
introduce Config::Reset
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
43 |
void Reset (void); |
520706f801e8
introduce Config::Reset
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
44 |
|
520706f801e8
introduce Config::Reset
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
45 |
/** |
2585 | 46 |
* \param path a path to match attributes. |
47 |
* \param value the value to set in all matching attributes. |
|
48 |
* |
|
49 |
* This function will attempt to find attributes which |
|
50 |
* match the input path and will then set their value to the input |
|
51 |
* value. |
|
52 |
*/ |
|
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
53 |
void Set (std::string path, const AttributeValue &value); |
2585 | 54 |
/** |
55 |
* \param name the full name of the attribute |
|
56 |
* \param value the value to set. |
|
57 |
* |
|
58 |
* This method overrides the initial value of the |
|
59 |
* matching attribute. This method cannot fail: it will |
|
60 |
* crash if the input attribute name or value is invalid. |
|
61 |
*/ |
|
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
62 |
void SetDefault (std::string name, const AttributeValue &value); |
2585 | 63 |
/** |
64 |
* \param name the full name of the attribute |
|
65 |
* \param value the value to set. |
|
66 |
* \returns true if the value was set successfully, false otherwise. |
|
67 |
* |
|
68 |
* This method overrides the initial value of the |
|
69 |
* matching attribute. |
|
70 |
*/ |
|
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
71 |
bool SetDefaultFailSafe (std::string name, const AttributeValue &value); |
2585 | 72 |
/** |
73 |
* \param name the name of the requested GlobalValue. |
|
74 |
* \param value the value to set |
|
75 |
* |
|
76 |
* This method is equivalent to GlobalValue::Bind |
|
77 |
*/ |
|
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
78 |
void SetGlobal (std::string name, const AttributeValue &value); |
2585 | 79 |
/** |
80 |
* \param name the name of the requested GlobalValue. |
|
81 |
* \param value the value to set |
|
82 |
* |
|
83 |
* This method is equivalent to GlobalValue::BindFailSafe |
|
84 |
*/ |
|
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
85 |
bool SetGlobalFailSafe (std::string name, const AttributeValue &value); |
2585 | 86 |
/** |
87 |
* \param path a path to match trace sources. |
|
88 |
* \param cb the callback to connect to the matching trace sources. |
|
89 |
* |
|
90 |
* This function will attempt to find all trace sources which |
|
91 |
* match the input path and will then connect the input callback |
|
92 |
* to them. |
|
93 |
*/ |
|
2594
a8f89acd17a1
Config::Connect -> Config::ConnectWithoutContext && Config::ConnectWithContext -> Config::Connect
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2586
diff
changeset
|
94 |
void ConnectWithoutContext (std::string path, const CallbackBase &cb); |
2585 | 95 |
/** |
96 |
* \param path a path to match trace sources. |
|
97 |
* \param cb the callback to disconnect to the matching trace sources. |
|
98 |
* |
|
99 |
* This function undoes the work of Config::Connect. |
|
100 |
*/ |
|
2594
a8f89acd17a1
Config::Connect -> Config::ConnectWithoutContext && Config::ConnectWithContext -> Config::Connect
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2586
diff
changeset
|
101 |
void DisconnectWithoutContext (std::string path, const CallbackBase &cb); |
2585 | 102 |
/** |
103 |
* \param path a path to match trace sources. |
|
104 |
* \param cb the callback to connect to the matching trace sources. |
|
105 |
* |
|
106 |
* This function will attempt to find all trace sources which |
|
107 |
* match the input path and will then connect the input callback |
|
108 |
* to them in such a way that the callback will receive an extra |
|
109 |
* context string upon trace event notification. |
|
110 |
*/ |
|
2594
a8f89acd17a1
Config::Connect -> Config::ConnectWithoutContext && Config::ConnectWithContext -> Config::Connect
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2586
diff
changeset
|
111 |
void Connect (std::string path, const CallbackBase &cb); |
2585 | 112 |
/** |
113 |
* \param path a path to match trace sources. |
|
114 |
* \param cb the callback to connect to the matching trace sources. |
|
115 |
* |
|
116 |
* This function undoes the work of Config::ConnectWithContext. |
|
117 |
*/ |
|
2594
a8f89acd17a1
Config::Connect -> Config::ConnectWithoutContext && Config::ConnectWithContext -> Config::Connect
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2586
diff
changeset
|
118 |
void Disconnect (std::string path, const CallbackBase &cb); |
2474
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
119 |
|
3999
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
120 |
/** |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
121 |
* \brief hold a set of objects which match a specific search string. |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
122 |
* |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
123 |
* This class also allows you to perform a set of configuration operations |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
124 |
* on the set of matching objects stored in the container. Specifically, |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
125 |
* it is possible to perform bulk Connects and Sets. |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
126 |
*/ |
3787
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
127 |
class MatchContainer |
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
128 |
{ |
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
129 |
public: |
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
130 |
typedef std::vector<Ptr<Object> >::const_iterator Iterator; |
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
131 |
MatchContainer (); |
3999
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
132 |
// constructor used only by implementation. |
3787
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
133 |
MatchContainer (const std::vector<Ptr<Object> > &objects, |
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
134 |
const std::vector<std::string> &contexts, |
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
135 |
std::string path); |
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
136 |
|
3999
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
137 |
/** |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
138 |
* \returns an iterator which points to the first item in the container |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
139 |
*/ |
3787
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
140 |
MatchContainer::Iterator Begin (void) const; |
3999
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
141 |
/** |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
142 |
* \returns an iterator which points to the last item in the container |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
143 |
*/ |
3787
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
144 |
MatchContainer::Iterator End (void) const; |
3999
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
145 |
/** |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
146 |
* \returns the number of items in the container |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
147 |
*/ |
3787
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
148 |
uint32_t GetN (void) const; |
3999
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
149 |
/** |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
150 |
* \param i index of item to lookup ([0,n[) |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
151 |
* \returns the item requested. |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
152 |
*/ |
3787
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
153 |
Ptr<Object> Get (uint32_t i) const; |
3999
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
154 |
/** |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
155 |
* \param i index of item to lookup ([0,n[) |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
156 |
* \returns the fully-qualified matching path associated |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
157 |
* to the requested item. |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
158 |
* |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
159 |
* The matching patch uniquely identifies the requested object. |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
160 |
*/ |
3787
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
161 |
std::string GetMatchedPath (uint32_t i) const; |
3999
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
162 |
/** |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
163 |
* \returns the path used to perform the object matching. |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
164 |
*/ |
3787
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
165 |
std::string GetPath (void) const; |
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
166 |
|
3999
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
167 |
/** |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
168 |
* \param name name of attribute to set |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
169 |
* \param value value to set to the attribute |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
170 |
* |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
171 |
* Set the specified attribute value to all the objects stored in this |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
172 |
* container. |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
173 |
* \sa ns3::Config::Set |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
174 |
*/ |
3787
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
175 |
void Set (std::string name, const AttributeValue &value); |
3999
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
176 |
/** |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
177 |
* \param name the name of the trace source to connect to |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
178 |
* \param cb the sink to connect to the trace source |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
179 |
* |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
180 |
* Connect the specified sink to all the objects stored in this |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
181 |
* container. |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
182 |
* \sa ns3::Config::Connect |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
183 |
*/ |
3787
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
184 |
void Connect (std::string name, const CallbackBase &cb); |
3999
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
185 |
/** |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
186 |
* \param name the name of the trace source to connect to |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
187 |
* \param cb the sink to connect to the trace source |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
188 |
* |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
189 |
* Connect the specified sink to all the objects stored in this |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
190 |
* container. |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
191 |
* \sa ns3::Config::ConnectWithoutContext |
3999
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
192 |
*/ |
3787
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
193 |
void ConnectWithoutContext (std::string name, const CallbackBase &cb); |
3999
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
194 |
/** |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
195 |
* \param name the name of the trace source to disconnect from |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
196 |
* \param cb the sink to disconnect from the trace source |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
197 |
* |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
198 |
* Disconnect the specified sink from all the objects stored in this |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
199 |
* container. |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
200 |
* \sa ns3::Config::Disconnect |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
201 |
*/ |
3787
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
202 |
void Disconnect (std::string name, const CallbackBase &cb); |
3999
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
203 |
/** |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
204 |
* \param name the name of the trace source to disconnect from |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
205 |
* \param cb the sink to disconnect from the trace source |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
206 |
* |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
207 |
* Disconnect the specified sink from all the objects stored in this |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
208 |
* container. |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
209 |
* \sa ns3::Config::DisconnectWithoutContext |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
210 |
*/ |
3787
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
211 |
void DisconnectWithoutContext (std::string name, const CallbackBase &cb); |
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
212 |
private: |
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
213 |
std::vector<Ptr<Object> > m_objects; |
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
214 |
std::vector<std::string> m_contexts; |
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
215 |
std::string m_path; |
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
216 |
}; |
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
217 |
|
3999
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
218 |
/** |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
219 |
* \param path the path to perform a match against |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
220 |
* \returns a container which contains all the objects which match the input |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
221 |
* path. |
7a1a377c3900
bug 436: missing doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3787
diff
changeset
|
222 |
*/ |
3787
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
223 |
MatchContainer LookupMatches (std::string path); |
985324e2caaa
bug 284: cannot use config paths to get a handle on an object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3763
diff
changeset
|
224 |
|
2585 | 225 |
/** |
226 |
* \param obj a new root object |
|
227 |
* |
|
228 |
* Each root object is used during path matching as |
|
229 |
* the root of the path by Config::Connect, and Config::Set. |
|
230 |
*/ |
|
2474
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
231 |
void RegisterRootNamespaceObject (Ptr<Object> obj); |
2585 | 232 |
/** |
233 |
* \param obj a new root object |
|
234 |
* |
|
235 |
* This function undoes the work of Config::RegisterRootNamespaceObject. |
|
236 |
*/ |
|
2532
86a40c7cbfe9
register and unregister the NodeList as a config root namespace
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2531
diff
changeset
|
237 |
void UnregisterRootNamespaceObject (Ptr<Object> obj); |
2474
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
238 |
|
2941
e1ff74674f87
add functions to access list of root namespace objects
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2594
diff
changeset
|
239 |
/** |
e1ff74674f87
add functions to access list of root namespace objects
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2594
diff
changeset
|
240 |
* \returns the number of registered root namespace objects. |
e1ff74674f87
add functions to access list of root namespace objects
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2594
diff
changeset
|
241 |
*/ |
e1ff74674f87
add functions to access list of root namespace objects
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2594
diff
changeset
|
242 |
uint32_t GetRootNamespaceObjectN (void); |
e1ff74674f87
add functions to access list of root namespace objects
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2594
diff
changeset
|
243 |
|
e1ff74674f87
add functions to access list of root namespace objects
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2594
diff
changeset
|
244 |
/** |
e1ff74674f87
add functions to access list of root namespace objects
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2594
diff
changeset
|
245 |
* \param i the index of the requested object. |
e1ff74674f87
add functions to access list of root namespace objects
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2594
diff
changeset
|
246 |
* \returns the requested root namespace object |
e1ff74674f87
add functions to access list of root namespace objects
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2594
diff
changeset
|
247 |
*/ |
e1ff74674f87
add functions to access list of root namespace objects
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2594
diff
changeset
|
248 |
Ptr<Object> GetRootNamespaceObject (uint32_t i); |
e1ff74674f87
add functions to access list of root namespace objects
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2594
diff
changeset
|
249 |
|
2474
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
250 |
} // namespace Config |
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
251 |
|
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
252 |
} // namespace ns3 |
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
253 |
|
3763
e46e361a4262
give attribute power to Callback.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3752
diff
changeset
|
254 |
#endif /* CONFIG_H */ |