author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Thu, 16 Oct 2008 12:53:05 +0200 | |
changeset 3752 | 5ab2feb083a0 |
parent 3190 | 51fe9001a679 |
child 3763 | e46e361a4262 |
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 |
*/ |
3752
5ab2feb083a0
bug 202: header file conflict
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3190
diff
changeset
|
20 |
#ifndef NS3_CONFIG_H |
5ab2feb083a0
bug 202: header file conflict
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3190
diff
changeset
|
21 |
#define NS3_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> |
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
|
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
namespace ns3 { |
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
|
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
28 |
class AttributeValue; |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
29 |
class Object; |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
30 |
class CallbackBase; |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
31 |
|
3190
51fe9001a679
add some doxygen, remove a couple of XXX
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
32 |
/** |
51fe9001a679
add some doxygen, remove a couple of XXX
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
33 |
* \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
|
34 |
* \ingroup core |
51fe9001a679
add some doxygen, remove a couple of XXX
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
35 |
*/ |
2474
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
36 |
namespace Config { |
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
37 |
|
2585 | 38 |
/** |
39 |
* \param path a path to match attributes. |
|
40 |
* \param value the value to set in all matching attributes. |
|
41 |
* |
|
42 |
* This function will attempt to find attributes which |
|
43 |
* match the input path and will then set their value to the input |
|
44 |
* value. |
|
45 |
*/ |
|
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
46 |
void Set (std::string path, const AttributeValue &value); |
2585 | 47 |
/** |
48 |
* \param name the full name of the attribute |
|
49 |
* \param value the value to set. |
|
50 |
* |
|
51 |
* This method overrides the initial value of the |
|
52 |
* matching attribute. This method cannot fail: it will |
|
53 |
* crash if the input attribute name or value is invalid. |
|
54 |
*/ |
|
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
55 |
void SetDefault (std::string name, const AttributeValue &value); |
2585 | 56 |
/** |
57 |
* \param name the full name of the attribute |
|
58 |
* \param value the value to set. |
|
59 |
* \returns true if the value was set successfully, false otherwise. |
|
60 |
* |
|
61 |
* This method overrides the initial value of the |
|
62 |
* matching attribute. |
|
63 |
*/ |
|
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
64 |
bool SetDefaultFailSafe (std::string name, const AttributeValue &value); |
2585 | 65 |
/** |
66 |
* \param name the name of the requested GlobalValue. |
|
67 |
* \param value the value to set |
|
68 |
* |
|
69 |
* This method is equivalent to GlobalValue::Bind |
|
70 |
*/ |
|
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
71 |
void SetGlobal (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::BindFailSafe |
|
77 |
*/ |
|
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2941
diff
changeset
|
78 |
bool SetGlobalFailSafe (std::string name, const AttributeValue &value); |
2585 | 79 |
/** |
80 |
* \param path a path to match trace sources. |
|
81 |
* \param cb the callback to connect to the matching trace sources. |
|
82 |
* |
|
83 |
* This function will attempt to find all trace sources which |
|
84 |
* match the input path and will then connect the input callback |
|
85 |
* to them. |
|
86 |
*/ |
|
2594
a8f89acd17a1
Config::Connect -> Config::ConnectWithoutContext && Config::ConnectWithContext -> Config::Connect
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2586
diff
changeset
|
87 |
void ConnectWithoutContext (std::string path, const CallbackBase &cb); |
2585 | 88 |
/** |
89 |
* \param path a path to match trace sources. |
|
90 |
* \param cb the callback to disconnect to the matching trace sources. |
|
91 |
* |
|
92 |
* This function undoes the work of Config::Connect. |
|
93 |
*/ |
|
2594
a8f89acd17a1
Config::Connect -> Config::ConnectWithoutContext && Config::ConnectWithContext -> Config::Connect
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2586
diff
changeset
|
94 |
void DisconnectWithoutContext (std::string path, const CallbackBase &cb); |
2585 | 95 |
/** |
96 |
* \param path a path to match trace sources. |
|
97 |
* \param cb the callback to connect to the matching trace sources. |
|
98 |
* |
|
99 |
* This function will attempt to find all trace sources which |
|
100 |
* match the input path and will then connect the input callback |
|
101 |
* to them in such a way that the callback will receive an extra |
|
102 |
* context string upon trace event notification. |
|
103 |
*/ |
|
2594
a8f89acd17a1
Config::Connect -> Config::ConnectWithoutContext && Config::ConnectWithContext -> Config::Connect
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2586
diff
changeset
|
104 |
void Connect (std::string path, const CallbackBase &cb); |
2585 | 105 |
/** |
106 |
* \param path a path to match trace sources. |
|
107 |
* \param cb the callback to connect to the matching trace sources. |
|
108 |
* |
|
109 |
* This function undoes the work of Config::ConnectWithContext. |
|
110 |
*/ |
|
2594
a8f89acd17a1
Config::Connect -> Config::ConnectWithoutContext && Config::ConnectWithContext -> Config::Connect
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2586
diff
changeset
|
111 |
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
|
112 |
|
2585 | 113 |
/** |
114 |
* \param obj a new root object |
|
115 |
* |
|
116 |
* Each root object is used during path matching as |
|
117 |
* the root of the path by Config::Connect, and Config::Set. |
|
118 |
*/ |
|
2474
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
119 |
void RegisterRootNamespaceObject (Ptr<Object> obj); |
2585 | 120 |
/** |
121 |
* \param obj a new root object |
|
122 |
* |
|
123 |
* This function undoes the work of Config::RegisterRootNamespaceObject. |
|
124 |
*/ |
|
2532
86a40c7cbfe9
register and unregister the NodeList as a config root namespace
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2531
diff
changeset
|
125 |
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
|
126 |
|
2941
e1ff74674f87
add functions to access list of root namespace objects
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2594
diff
changeset
|
127 |
/** |
e1ff74674f87
add functions to access list of root namespace objects
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2594
diff
changeset
|
128 |
* \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
|
129 |
*/ |
e1ff74674f87
add functions to access list of root namespace objects
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2594
diff
changeset
|
130 |
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
|
131 |
|
e1ff74674f87
add functions to access list of root namespace objects
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2594
diff
changeset
|
132 |
/** |
e1ff74674f87
add functions to access list of root namespace objects
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2594
diff
changeset
|
133 |
* \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
|
134 |
* \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
|
135 |
*/ |
e1ff74674f87
add functions to access list of root namespace objects
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2594
diff
changeset
|
136 |
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
|
137 |
|
2474
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
138 |
} // namespace Config |
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
139 |
|
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
140 |
} // namespace ns3 |
1d1f77782138
A Config class which hooks into the Object Attribute/Tracing system.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
141 |
|
3752
5ab2feb083a0
bug 202: header file conflict
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3190
diff
changeset
|
142 |
#endif /* NS3_CONFIG_H */ |