src/core/config.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon, 10 Mar 2008 14:51:15 -0700
changeset 2585 b74a38fc7a9a
parent 2570 15d5421022a1
child 2586 50d78910a997
permissions -rw-r--r--
dox doc
     1 #ifndef CONFIG_H
     2 #define CONFIG_H
     3 
     4 #include "attribute.h"
     5 #include "ptr.h"
     6 #include "object.h"
     7 #include <string>
     8 
     9 namespace ns3 {
    10 
    11 namespace Config {
    12 
    13 /**
    14  * \param path a path to match attributes.
    15  * \param value the value to set in all matching attributes.
    16  *
    17  * This function will attempt to find attributes which
    18  * match the input path and will then set their value to the input
    19  * value.
    20  */
    21 void Set (std::string path, Attribute value);
    22 /**
    23  * \param name the full name of the attribute
    24  * \param value the value to set.
    25  *
    26  * This method overrides the initial value of the 
    27  * matching attribute. This method cannot fail: it will
    28  * crash if the input attribute name or value is invalid.
    29  */
    30 void SetDefault (std::string name, Attribute value);
    31 /**
    32  * \param name the full name of the attribute
    33  * \param value the value to set.
    34  * \returns true if the value was set successfully, false otherwise.
    35  *
    36  * This method overrides the initial value of the 
    37  * matching attribute. 
    38  */
    39 bool SetDefaultFailSafe (std::string name, Attribute value);
    40 /**
    41  * \param name the name of the requested GlobalValue.
    42  * \param value the value to set
    43  *
    44  * This method is equivalent to GlobalValue::Bind
    45  */
    46 void SetGlobal (std::string name, Attribute value);
    47 /**
    48  * \param name the name of the requested GlobalValue.
    49  * \param value the value to set
    50  *
    51  * This method is equivalent to GlobalValue::BindFailSafe
    52  */
    53 bool SetGlobalFailSafe (std::string name, Attribute value);
    54 /**
    55  * \param path a path to match trace sources.
    56  * \param cb the callback to connect to the matching trace sources.
    57  *
    58  * This function will attempt to find all trace sources which
    59  * match the input path and will then connect the input callback
    60  * to them.
    61  */
    62 void Connect (std::string path, const CallbackBase &cb);
    63 /**
    64  * \param path a path to match trace sources.
    65  * \param cb the callback to disconnect to the matching trace sources.
    66  *
    67  * This function undoes the work of Config::Connect.
    68  */
    69 void Disconnect (std::string path, const CallbackBase &cb);
    70 /**
    71  * \param path a path to match trace sources.
    72  * \param cb the callback to connect to the matching trace sources.
    73  *
    74  * This function will attempt to find all trace sources which
    75  * match the input path and will then connect the input callback
    76  * to them in such a way that the callback will receive an extra
    77  * context string upon trace event notification.
    78  */
    79 void ConnectWithContext (std::string path, const CallbackBase &cb);
    80 /**
    81  * \param path a path to match trace sources.
    82  * \param cb the callback to connect to the matching trace sources.
    83  *
    84  * This function undoes the work of Config::ConnectWithContext.
    85  */
    86 void DisconnectWithContext (std::string path, const CallbackBase &cb);
    87 
    88 /**
    89  * \param obj a new root object
    90  *
    91  * Each root object is used during path matching as
    92  * the root of the path by Config::Connect, and Config::Set.
    93  */
    94 void RegisterRootNamespaceObject (Ptr<Object> obj);
    95 /**
    96  * \param obj a new root object
    97  *
    98  * This function undoes the work of Config::RegisterRootNamespaceObject.
    99  */
   100 void UnregisterRootNamespaceObject (Ptr<Object> obj);
   101 
   102 } // namespace Config
   103 
   104 } // namespace ns3
   105 
   106 #endif /* CONFIG_H */