replace char const * with std::string const &
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 21 Feb 2007 16:27:42 +0100
changeset 315 ed16b2078aa4
parent 314 2a105293177d
child 316 e41511af6a4b
replace char const * with std::string const &
src/common/trace-container.cc
src/common/trace-container.h
--- a/src/common/trace-container.cc	Wed Feb 21 01:37:00 2007 -0800
+++ b/src/common/trace-container.cc	Wed Feb 21 16:27:42 2007 +0100
@@ -36,7 +36,7 @@
 }
 
 void 
-TraceContainer::SetUiVariableCallback (char const *name, Callback<void,uint64_t, uint64_t> callback)
+TraceContainer::SetUiVariableCallback (std::string const&name, Callback<void,uint64_t, uint64_t> callback)
 {
   for (UiListI i = m_uiList.begin (); i != m_uiList.end (); i++) 
     {
@@ -49,7 +49,7 @@
   NS_ASSERT (false);
 }
 void 
-TraceContainer::SetSiVariableCallback (char const *name, Callback<void,int64_t, int64_t> callback)
+TraceContainer::SetSiVariableCallback (std::string const&name, Callback<void,int64_t, int64_t> callback)
 {
   for (SiListI i = m_siList.begin (); i != m_siList.end (); i++) 
     {
@@ -62,12 +62,12 @@
   NS_ASSERT (false);
 }
 void 
-TraceContainer::SetFVariableCallback (char const *name, Callback<void,double, double> callback)
+TraceContainer::SetFVariableCallback (std::string const&name, Callback<void,double, double> 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 @@
 }
 
 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 @@
   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 @@
   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 @@
 }
 
 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++) 
     {
--- a/src/common/trace-container.h	Wed Feb 21 01:37:00 2007 -0800
+++ b/src/common/trace-container.h	Wed Feb 21 16:27:42 2007 +0100
@@ -68,7 +68,7 @@
    * 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<void,uint64_t, uint64_t> callback);
   /**
    * \param name the name of the target event source
@@ -77,21 +77,21 @@
    * This method targets only event sources which are variables of any signed
    * integer type.
    */
-  void SetSiVariableCallback (char const *name, Callback<void,int64_t, int64_t> callback);
+  void SetSiVariableCallback (std::string const &name, Callback<void,int64_t, int64_t> 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<void,double, double> callback);
+  void SetFVariableCallback (std::string const &name, Callback<void,double, double> 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 @@
    * This method targets only event sources which are of type CallbackTracer<T1>
    */
   template <typename T1>
-  void SetCallback (char const *name, Callback<void,T1> callback);
+  void SetCallback (std::string const &name, Callback<void,T1> 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 @@
    * This method targets only event sources which are of type CallbackTracer<T1,T2>
    */
   template <typename T1, typename T2>
-  void SetCallback (char const *name, Callback<void,T1,T2> callback);
+  void SetCallback (std::string const &name, Callback<void,T1,T2> 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 @@
    * This method targets only event sources which are of type CallbackTracer<T1,T2,T3>
    */
   template <typename T1, typename T2, typename T3>
-  void SetCallback (char const *name, Callback<void,T1,T2,T3> callback);
+  void SetCallback (std::string const &name, Callback<void,T1,T2,T3> 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 @@
    * This method targets only event sources which are of type CallbackTracer<T1,T2,T3,T4>
    */
   template <typename T1, typename T2, typename T3, typename T4>
-  void SetCallback (char const *name, Callback<void,T1,T2,T3,T4> callback);
+  void SetCallback (std::string const&name, Callback<void,T1,T2,T3,T4> 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 @@
    * This method targets only event sources which are of type CallbackTracer<T1,T2,T3,T4,T5>
    */
   template <typename T1, typename T2, typename T3, typename T4, typename T5>
-  void SetCallback (char const *name, Callback<void,T1,T2,T3,T4,T5> callback);
+  void SetCallback (std::string const &name, Callback<void,T1,T2,T3,T4,T5> callback);
 
   /**
    * \param name the name of the registered event source
@@ -140,28 +140,28 @@
    *
    * 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 @@
    *
    * 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 @@
 
 template <typename T1>
 void 
-TraceContainer::SetCallback (char const *name, Callback<void,T1> callback)
+TraceContainer::SetCallback (std::string const&name, Callback<void,T1> callback)
 {
   for (CallbackListI i = m_callbackList.begin (); i != m_callbackList.end (); i++) 
     {
@@ -223,7 +223,7 @@
 }
 template <typename T1, typename T2>
 void 
-TraceContainer::SetCallback (char const *name, Callback<void,T1,T2> callback)
+TraceContainer::SetCallback (std::string const&name, Callback<void,T1,T2> callback)
 {
   for (CallbackListI i = m_callbackList.begin (); i != m_callbackList.end (); i++) 
     {
@@ -244,7 +244,7 @@
 }
 template <typename T1, typename T2, typename T3>
 void 
-TraceContainer::SetCallback (char const *name, Callback<void,T1,T2,T3> callback)
+TraceContainer::SetCallback (std::string const&name, Callback<void,T1,T2,T3> callback)
 {
   for (CallbackListI i = m_callbackList.begin (); i != m_callbackList.end (); i++) 
     {
@@ -265,7 +265,7 @@
 }
 template <typename T1, typename T2, typename T3, typename T4>
 void 
-TraceContainer::SetCallback (char const *name, Callback<void,T1,T2,T3,T4> callback)
+TraceContainer::SetCallback (std::string const&name, Callback<void,T1,T2,T3,T4> callback)
 {
   for (CallbackListI i = m_callbackList.begin (); i != m_callbackList.end (); i++) 
     {
@@ -286,7 +286,7 @@
 }
 template <typename T1, typename T2, typename T3, typename T4, typename T5>
 void 
-TraceContainer::SetCallback (char const *name, Callback<void,T1,T2,T3,T4,T5> callback)
+TraceContainer::SetCallback (std::string const&name, Callback<void,T1,T2,T3,T4,T5> callback)
 {
   for (CallbackListI i = m_callbackList.begin (); i != m_callbackList.end (); i++) 
     {