diff --git a/src/common/trace-container.cc b/src/common/trace-container.cc index 5dcd9d3ce..154b40c32 100644 --- a/src/common/trace-container.cc +++ b/src/common/trace-container.cc @@ -36,7 +36,7 @@ TraceContainer::~TraceContainer () } void -TraceContainer::SetUiVariableCallback (char const *name, Callback callback) +TraceContainer::SetUiVariableCallback (std::string const&name, Callback callback) { for (UiListI i = m_uiList.begin (); i != m_uiList.end (); i++) { @@ -49,7 +49,7 @@ TraceContainer::SetUiVariableCallback (char const *name, Callback callback) +TraceContainer::SetSiVariableCallback (std::string const&name, Callback callback) { for (SiListI i = m_siList.begin (); i != m_siList.end (); i++) { @@ -62,12 +62,12 @@ TraceContainer::SetSiVariableCallback (char const *name, Callback callback) +TraceContainer::SetFVariableCallback (std::string const&name, Callback callback) { NS_ASSERT (false); } void -TraceContainer::SetStream (char const *name, std::ostream *os) +TraceContainer::SetStream (std::string const&name, std::ostream *os) { for (StreamTracerListI i = m_traceStreamList.begin (); i != m_traceStreamList.end (); i++) { @@ -81,7 +81,7 @@ TraceContainer::SetStream (char const *name, std::ostream *os) } void -TraceContainer::RegisterUiVariable (char const *name, UiVariableTracerBase *var) +TraceContainer::RegisterUiVariable (std::string const&name, UiVariableTracerBase *var) { // ensure unicity for (UiListI i = m_uiList.begin (); i != m_uiList.end (); i++) @@ -95,7 +95,7 @@ TraceContainer::RegisterUiVariable (char const *name, UiVariableTracerBase *var) m_uiList.push_back (std::make_pair (var, name)); } void -TraceContainer::RegisterSiVariable (char const *name, SiVariableTracerBase *var) +TraceContainer::RegisterSiVariable (std::string const&name, SiVariableTracerBase *var) { // ensure unicity for (SiListI i = m_siList.begin (); i != m_siList.end (); i++) @@ -109,13 +109,13 @@ TraceContainer::RegisterSiVariable (char const *name, SiVariableTracerBase *var) m_siList.push_back (std::make_pair (var, name)); } void -TraceContainer::RegisterFVariable (char const *name, FVariableTracerBase *var) +TraceContainer::RegisterFVariable (std::string const&name, FVariableTracerBase *var) { NS_ASSERT (false); } void -TraceContainer::RegisterStream (char const *name, StreamTracer *stream) +TraceContainer::RegisterStream (std::string const&name, StreamTracer *stream) { // ensure unicity for (StreamTracerListI i = m_traceStreamList.begin (); i != m_traceStreamList.end (); i++) @@ -131,7 +131,7 @@ TraceContainer::RegisterStream (char const *name, StreamTracer *stream) } void -TraceContainer::RegisterCallback (char const *name, CallbackTracerBase *tracer) +TraceContainer::RegisterCallback (std::string const&name, CallbackTracerBase *tracer) { for (CallbackListI i = m_callbackList.begin (); i != m_callbackList.end (); i++) { diff --git a/src/common/trace-container.h b/src/common/trace-container.h index a8f8ba5b9..2bf660474 100644 --- a/src/common/trace-container.h +++ b/src/common/trace-container.h @@ -68,7 +68,7 @@ public: * This method targets only event sources which are variables of any unsigned * integer type. */ - void SetUiVariableCallback (char const *name, + void SetUiVariableCallback (std::string const &name, Callback callback); /** * \param name the name of the target event source @@ -77,21 +77,21 @@ public: * This method targets only event sources which are variables of any signed * integer type. */ - void SetSiVariableCallback (char const *name, Callback callback); + void SetSiVariableCallback (std::string const &name, Callback callback); /** * \param name the name of the target event source * \param callback the callback being connected to the target event source * * This method targets only event sources which are variables of any double type. */ - void SetFVariableCallback (char const *name, Callback callback); + void SetFVariableCallback (std::string const &name, Callback callback); /** * \param name the name of the target event source * \param os the output stream being connected to the source trace stream * * This method targets only event sources which are of type StreamTracer. */ - void SetStream (char const *name, std::ostream *os); + void SetStream (std::string const &name, std::ostream *os); /** * \param name the name of the target event source @@ -100,7 +100,7 @@ public: * This method targets only event sources which are of type CallbackTracer */ template - void SetCallback (char const *name, Callback callback); + void SetCallback (std::string const &name, Callback callback); /** * \param name the name of the target event source * \param callback the callback being connected to the target event source. @@ -108,7 +108,7 @@ public: * This method targets only event sources which are of type CallbackTracer */ template - void SetCallback (char const *name, Callback callback); + void SetCallback (std::string const &name, Callback callback); /** * \param name the name of the target event source * \param callback the callback being connected to the target event source. @@ -116,7 +116,7 @@ public: * This method targets only event sources which are of type CallbackTracer */ template - void SetCallback (char const *name, Callback callback); + void SetCallback (std::string const &name, Callback callback); /** * \param name the name of the target event source * \param callback the callback being connected to the target event source. @@ -124,7 +124,7 @@ public: * This method targets only event sources which are of type CallbackTracer */ template - void SetCallback (char const *name, Callback callback); + void SetCallback (std::string const&name, Callback callback); /** * \param name the name of the target event source * \param callback the callback being connected to the target event source. @@ -132,7 +132,7 @@ public: * This method targets only event sources which are of type CallbackTracer */ template - void SetCallback (char const *name, Callback callback); + void SetCallback (std::string const &name, Callback callback); /** * \param name the name of the registered event source @@ -140,28 +140,28 @@ public: * * This method registers only event sources of type "unsigned integer". */ - void RegisterUiVariable (char const *name, UiVariableTracerBase *var); + void RegisterUiVariable (std::string const&name, UiVariableTracerBase *var); /** * \param name the name of the registered event source * \param var the event source being registered * * This method registers only event sources of type "signed integer". */ - void RegisterSiVariable (char const *name, SiVariableTracerBase *var); + void RegisterSiVariable (std::string const&name, SiVariableTracerBase *var); /** * \param name the name of the registered event source * \param var the event source being registered * * This method registers only event sources of type "double". */ - void RegisterFVariable (char const *name, FVariableTracerBase *var); + void RegisterFVariable (std::string const&name, FVariableTracerBase *var); /** * \param name the name of the registered event source * \param stream the event source being registered * * This method registers only event sources of type StreamTracer. */ - void RegisterStream (char const *name, StreamTracer *stream); + void RegisterStream (std::string const&name, StreamTracer *stream); /** * \param name the name of the registeref event source @@ -169,7 +169,7 @@ public: * * This method registers only event sources of type CallbackTracer */ - void RegisterCallback (char const *name, CallbackTracerBase*tracer); + void RegisterCallback (std::string const&name, CallbackTracerBase*tracer); /** * Print the list of registered event sources in this container only. @@ -202,7 +202,7 @@ namespace ns3 { template void -TraceContainer::SetCallback (char const *name, Callback callback) +TraceContainer::SetCallback (std::string const&name, Callback callback) { for (CallbackListI i = m_callbackList.begin (); i != m_callbackList.end (); i++) { @@ -223,7 +223,7 @@ TraceContainer::SetCallback (char const *name, Callback callback) } template void -TraceContainer::SetCallback (char const *name, Callback callback) +TraceContainer::SetCallback (std::string const&name, Callback callback) { for (CallbackListI i = m_callbackList.begin (); i != m_callbackList.end (); i++) { @@ -244,7 +244,7 @@ TraceContainer::SetCallback (char const *name, Callback callback) } template void -TraceContainer::SetCallback (char const *name, Callback callback) +TraceContainer::SetCallback (std::string const&name, Callback callback) { for (CallbackListI i = m_callbackList.begin (); i != m_callbackList.end (); i++) { @@ -265,7 +265,7 @@ TraceContainer::SetCallback (char const *name, Callback callback) } template void -TraceContainer::SetCallback (char const *name, Callback callback) +TraceContainer::SetCallback (std::string const&name, Callback callback) { for (CallbackListI i = m_callbackList.begin (); i != m_callbackList.end (); i++) { @@ -286,7 +286,7 @@ TraceContainer::SetCallback (char const *name, Callback callba } template void -TraceContainer::SetCallback (char const *name, Callback callback) +TraceContainer::SetCallback (std::string const&name, Callback callback) { for (CallbackListI i = m_callbackList.begin (); i != m_callbackList.end (); i++) {