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