cleanup.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon, 24 Mar 2008 13:15:53 -0700
changeset 2718 9fe723baa16b
parent 2717 688bd2a63e58
child 2719 6688934b493a
cleanup.
src/core/config.cc
src/core/object-base.cc
src/core/object-base.h
--- a/src/core/config.cc	Mon Mar 24 13:11:48 2008 -0700
+++ b/src/core/config.cc	Mon Mar 24 13:15:53 2008 -0700
@@ -369,7 +369,7 @@
 	m_cb (cb) {}
   private:
     virtual void DoOne (Ptr<Object> object, std::string path, std::string name) {
-      object->TraceConnectWithoutContext (name, path, m_cb);
+      object->TraceConnect (name, path, m_cb);
     }
     CallbackBase m_cb;
   } resolver = ConnectWithContextResolver (path, cb);
@@ -389,7 +389,7 @@
 	m_cb (cb) {}
   private:
     virtual void DoOne (Ptr<Object> object, std::string path, std::string name) {
-      object->TraceDisconnectWithoutContext (name, path, m_cb);
+      object->TraceDisconnect (name, path, m_cb);
     }
     CallbackBase m_cb;
   } resolver = DisconnectWithContextResolver (path, cb);
--- a/src/core/object-base.cc	Mon Mar 24 13:11:48 2008 -0700
+++ b/src/core/object-base.cc	Mon Mar 24 13:15:53 2008 -0700
@@ -1,3 +1,22 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2008 INRIA
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
 #include "object-base.h"
 #include "log.h"
 #include "trace-source-accessor.h"
@@ -254,7 +273,7 @@
   return ok;
 }
 bool 
-ObjectBase::TraceConnectWithoutContext (std::string name, std::string context, const CallbackBase &cb)
+ObjectBase::TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 {
   TypeId tid = GetInstanceTypeId ();
   Ptr<const TraceSourceAccessor> accessor = tid.LookupTraceSourceByName (name);
@@ -278,7 +297,7 @@
   return ok;
 }
 bool 
-ObjectBase::TraceDisconnectWithoutContext (std::string name, std::string context, const CallbackBase &cb)
+ObjectBase::TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 {
   TypeId tid = GetInstanceTypeId ();
   Ptr<const TraceSourceAccessor> accessor = tid.LookupTraceSourceByName (name);
--- a/src/core/object-base.h	Mon Mar 24 13:11:48 2008 -0700
+++ b/src/core/object-base.h	Mon Mar 24 13:15:53 2008 -0700
@@ -1,3 +1,22 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2008 INRIA
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
 #ifndef OBJECT_BASE_H
 #define OBJECT_BASE_H
 
@@ -89,19 +108,55 @@
    */
   bool GetAttributeFailSafe (std::string name, Attribute &attribute) const;
 
+  /**
+   * \param name the name of the targetted trace source
+   * \param context the trace context associated to the callback
+   * \param cb the callback to connect to the trace source.
+   *
+   * The targetted trace source should be registered with TypeId::AddTraceSource.
+   */
+  bool TraceConnect (std::string name, std::string context, const CallbackBase &cb);
+  /**
+   * \param name the name of the targetted trace source
+   * \param cb the callback to connect to the trace source.
+   *
+   * The targetted trace source should be registered with TypeId::AddTraceSource.
+   */
   bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb);
-  bool TraceConnectWithoutContext (std::string name, std::string context, const CallbackBase &cb);
+  /**
+   * \param name the name of the targetted trace source
+   * \param context the trace context associated to the callback
+   * \param cb the callback to disconnect from the trace source.
+   *
+   * The targetted trace source should be registered with TypeId::AddTraceSource.
+   */
+  bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb);
+  /**
+   * \param name the name of the targetted trace source
+   * \param cb the callback to disconnect from the trace source.
+   *
+   * The targetted trace source should be registered with TypeId::AddTraceSource.
+   */
   bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb);
-  bool TraceDisconnectWithoutContext (std::string name, std::string context, const CallbackBase &cb);
 
 protected:
+  /**
+   * This method is invoked once all member attributes have been 
+   * initialized. Subclasses can override this method to be notified
+   * of this event but if they do this, they must chain up to their
+   * parent's NotifyConstructionCompleted method.
+   */
   virtual void NotifyConstructionCompleted (void);
   /**
    * \param attributes the attribute values used to initialize 
    *        the member variables of this object's instance.
    *
    * Invoked from subclasses to initialize all of their 
-   * attribute members.
+   * attribute members. This method will typically be invoked
+   * automatically from ns3::CreateObject if your class derives
+   * from ns3::Object. If you derive from ns3::ObjectBase directly,
+   * you should make sure that you invoke this method from
+   * your most-derived constructor.
    */
   void ConstructSelf (const AttributeList &attributes);