add some doxygen, remove a couple of XXX
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon, 02 Jun 2008 10:30:24 -0700
changeset 3190 51fe9001a679
parent 3189 7ddf4ad61707
child 3191 5d50569cd94e
add some doxygen, remove a couple of XXX
src/core/attribute-list.cc
src/core/attribute-list.h
src/core/attribute-test.cc
src/core/attribute.h
src/core/command-line.h
src/core/config.h
src/core/object-vector.cc
src/core/object.h
src/core/singleton.h
src/core/trace-source-accessor.h
src/core/traced-value.h
--- a/src/core/attribute-list.cc	Sat May 31 16:14:49 2008 +0100
+++ b/src/core/attribute-list.cc	Mon Jun 02 10:30:24 2008 -0700
@@ -212,7 +212,7 @@
     std::string::size_type equal = str.find ("=", cur);
     if (equal == std::string::npos)
       {
-        // XXX: invalid attribute.
+        NS_FATAL_ERROR ("Error while parsing serialized attribute: \"" << str << "\"");
         break;
       }
     else
@@ -221,7 +221,7 @@
         struct TypeId::AttributeInfo info;
         if (!TypeId::LookupAttributeByFullName (name, &info))
           {
-            // XXX invalid name.
+            NS_FATAL_ERROR ("Error while parsing serialized attribute: name does not exist: \"" << name << "\"");
             break;
           }
         else
@@ -242,7 +242,7 @@
             bool ok = val->DeserializeFromString (value, info.checker);
             if (!ok)
               {
-                // XXX invalid value
+                NS_FATAL_ERROR ("Error while parsing serialized attribute: value invalid: \"" << value << "\"");
                 break;
               }
             else
--- a/src/core/attribute-list.h	Sat May 31 16:14:49 2008 +0100
+++ b/src/core/attribute-list.h	Mon Jun 02 10:30:24 2008 -0700
@@ -87,7 +87,6 @@
    */
   static AttributeList *GetGlobal (void);
 
-  // XXX: untested.
   std::string SerializeToString (void) const;
   bool DeserializeFromString (std::string value);
 private:
--- a/src/core/attribute-test.cc	Sat May 31 16:14:49 2008 +0100
+++ b/src/core/attribute-test.cc	Mon Jun 02 10:30:24 2008 -0700
@@ -167,7 +167,7 @@
 		       MakeTraceSourceAccessor (&AttributeObjectTest::m_cb))
       .AddTraceSource ("ValueSource", "help text",
 		       MakeTraceSourceAccessor (&AttributeObjectTest::m_valueSrc))
-      .AddAttribute ("Pointer", "XXX",
+      .AddAttribute ("Pointer", "help text",
                      PointerValue (),
                      MakePointerAccessor (&AttributeObjectTest::m_ptr),
                      MakePointerChecker<Derived> ())
--- a/src/core/attribute.h	Sat May 31 16:14:49 2008 +0100
+++ b/src/core/attribute.h	Mon Jun 02 10:30:24 2008 -0700
@@ -144,7 +144,7 @@
  * to detect the type of the associated attribute.
  *
  * Most subclasses of this base class are implemented by the 
- * ATTRIBUTE_HELPER_* macros.
+ * \ref ATTRIBUTE_HELPER_HEADER and \ref ATTRIBUTE_HELPER_CPP macros.
  */
 class AttributeChecker : public RefCountBase
 {
--- a/src/core/command-line.h	Sat May 31 16:14:49 2008 +0100
+++ b/src/core/command-line.h	Mon Jun 02 10:30:24 2008 -0700
@@ -28,6 +28,7 @@
 
 /**
  * \brief parse command-line arguments
+ * \ingroup core
  *
  * Instances of this class can be used to parse command-line 
  * arguments: users can register new arguments with
--- a/src/core/config.h	Sat May 31 16:14:49 2008 +0100
+++ b/src/core/config.h	Mon Jun 02 10:30:24 2008 -0700
@@ -29,6 +29,10 @@
 class Object;
 class CallbackBase;
 
+/**
+ * \brief Configuration of simulation parameters and tracing
+ * \ingroup core
+ */
 namespace Config {
 
 /**
--- a/src/core/object-vector.cc	Sat May 31 16:14:49 2008 +0100
+++ b/src/core/object-vector.cc	Mon Jun 02 10:30:24 2008 -0700
@@ -34,8 +34,16 @@
 std::string 
 ObjectVectorValue::SerializeToString (Ptr<const AttributeChecker> checker) const
 {
-  // XXX
-  return "";
+  std::ostringstream oss;
+  for (uint32_t i = 0; i < m_objects.size (); ++i)
+    {
+      oss << m_objects[i];
+      if (i != m_objects.size () - 1)
+	{
+	  oss << " ";
+	}
+    }
+  return oss.str ();
 }
 bool 
 ObjectVectorValue::DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker)
--- a/src/core/object.h	Sat May 31 16:14:49 2008 +0100
+++ b/src/core/object.h	Mon Jun 02 10:30:24 2008 -0700
@@ -46,6 +46,14 @@
  * \ingroup object
  * \brief a base class which provides memory management and object aggregation
  *
+ * The memory management scheme is based on reference-counting with dispose-like
+ * functionality to break the reference cycles. The reference count is increamented
+ * and decremented with the methods Object::Ref and Object::Unref. If a reference cycle is
+ * present, the user is responsible for breaking it by calling Object::Dispose in
+ * a single location. This will eventually trigger the invocation of Object::DoDispose 
+ * on itself and all its aggregates. The Object::DoDispose method is always automatically
+ * invoked from the Object::Unref method before destroying the object, even if the user 
+ * did not call Object::Dispose directly.
  */
 class Object : public ObjectBase
 {
--- a/src/core/singleton.h	Sat May 31 16:14:49 2008 +0100
+++ b/src/core/singleton.h	Mon Jun 02 10:30:24 2008 -0700
@@ -22,6 +22,17 @@
 
 namespace ns3 {
 
+/**
+ * \brief a template singleton
+ *
+ * This template class can be used to implement the singleton pattern.
+ * The underlying object will be destroyed automatically when the process
+ * exits. Note that, if you call Singleton::Get again after the object has
+ * been destroyed, the object will be re-created which will result in a
+ * memory leak as reported by most memory leak checkers. It is up to the
+ * user to ensure that Singleton::Get is never called from a static variable
+ * finalizer.
+ */
 template <typename T>
 class Singleton
 {
--- a/src/core/trace-source-accessor.h	Sat May 31 16:14:49 2008 +0100
+++ b/src/core/trace-source-accessor.h	Mon Jun 02 10:30:24 2008 -0700
@@ -74,7 +74,10 @@
  * \param a the trace source
  *
  * Create a TraceSourceAccessor which will control access to the underlying
- * trace source.
+ * trace source. This helper template method assumes that the underlying
+ * type implements a statically-polymorphic set of Connect and Disconnect
+ * methods and creates a dynamic-polymorphic class to wrap the underlying
+ * static-polymorphic class.
  */
 template <typename T>
 Ptr<const TraceSourceAccessor> MakeTraceSourceAccessor (T a);
--- a/src/core/traced-value.h	Sat May 31 16:14:49 2008 +0100
+++ b/src/core/traced-value.h	Mon Jun 02 10:30:24 2008 -0700
@@ -47,7 +47,7 @@
  * this template: this instance will behave just like
  * the original class (if it did not export any special method),
  * and will define Connect/DisconnectWithoutContext methods to work
- * with an ns3::TraceSourceAccessor.
+ * with ns3::MakeTraceSourceAccessor.
  */
 template <typename T>
 class TracedValue