1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
3 * Copyright (c) 2008 INRIA
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
33 * \brief Configuration of simulation parameters and tracing
39 * \param path a path to match attributes.
40 * \param value the value to set in all matching attributes.
42 * This function will attempt to find attributes which
43 * match the input path and will then set their value to the input
46 void Set (std::string path, const AttributeValue &value);
48 * \param name the full name of the attribute
49 * \param value the value to set.
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.
55 void SetDefault (std::string name, const AttributeValue &value);
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.
61 * This method overrides the initial value of the
64 bool SetDefaultFailSafe (std::string name, const AttributeValue &value);
66 * \param name the name of the requested GlobalValue.
67 * \param value the value to set
69 * This method is equivalent to GlobalValue::Bind
71 void SetGlobal (std::string name, const AttributeValue &value);
73 * \param name the name of the requested GlobalValue.
74 * \param value the value to set
76 * This method is equivalent to GlobalValue::BindFailSafe
78 bool SetGlobalFailSafe (std::string name, const AttributeValue &value);
80 * \param path a path to match trace sources.
81 * \param cb the callback to connect to the matching trace sources.
83 * This function will attempt to find all trace sources which
84 * match the input path and will then connect the input callback
87 void ConnectWithoutContext (std::string path, const CallbackBase &cb);
89 * \param path a path to match trace sources.
90 * \param cb the callback to disconnect to the matching trace sources.
92 * This function undoes the work of Config::Connect.
94 void DisconnectWithoutContext (std::string path, const CallbackBase &cb);
96 * \param path a path to match trace sources.
97 * \param cb the callback to connect to the matching trace sources.
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.
104 void Connect (std::string path, const CallbackBase &cb);
106 * \param path a path to match trace sources.
107 * \param cb the callback to connect to the matching trace sources.
109 * This function undoes the work of Config::ConnectWithContext.
111 void Disconnect (std::string path, const CallbackBase &cb);
114 * \param obj a new root object
116 * Each root object is used during path matching as
117 * the root of the path by Config::Connect, and Config::Set.
119 void RegisterRootNamespaceObject (Ptr<Object> obj);
121 * \param obj a new root object
123 * This function undoes the work of Config::RegisterRootNamespaceObject.
125 void UnregisterRootNamespaceObject (Ptr<Object> obj);
128 * \returns the number of registered root namespace objects.
130 uint32_t GetRootNamespaceObjectN (void);
133 * \param i the index of the requested object.
134 * \returns the requested root namespace object
136 Ptr<Object> GetRootNamespaceObject (uint32_t i);
138 } // namespace Config
142 #endif /* CONFIG_H */