nemiver r689 - in trunk: . src/dbgengine



Author: dodji
Date: Thu Jan 17 22:06:58 2008
New Revision: 689
URL: http://svn.gnome.org/viewvc/nemiver?rev=689&view=rev

Log:
code cleanup


Modified:
   trunk/ChangeLog
   trunk/src/dbgengine/nmv-i-var-walker.h
   trunk/src/dbgengine/nmv-var-walker.cc

Modified: trunk/src/dbgengine/nmv-i-var-walker.h
==============================================================================
--- trunk/src/dbgengine/nmv-i-var-walker.h	(original)
+++ trunk/src/dbgengine/nmv-i-var-walker.h	Thu Jan 17 22:06:58 2008
@@ -31,9 +31,9 @@
 
 NEMIVER_BEGIN_NAMESPACE (nemiver)
 
-using nemiver::common::ObjectRef ;
-using nemiver::common::ObjectUnref ;
-using nemiver::common::SafePtr ;
+using nemiver::common::ObjectRef;
+using nemiver::common::ObjectUnref;
+using nemiver::common::SafePtr;
 
 class IVarWalker;
 typedef SafePtr<IVarWalker,ObjectRef, ObjectUnref> IVarWalkerSafePtr;
@@ -67,7 +67,7 @@
     /// been visited.
     virtual sigc::signal<void,
                          const IDebugger::VariableSafePtr&>&
-                                            visited_variable_signal () const = 0;
+                                        visited_variable_signal () const = 0;
     ///@}
 
     /// connect the walker to a variable and to a debugger
@@ -83,10 +83,10 @@
     /// gets the root variable this walker is connected to.
     /// this will return a non null variable if and only if
     /// the visited_root_variabls_signal() has been emited already.
-    virtual const IDebugger::VariableSafePtr& get_variable () const = 0 ;
+    virtual const IDebugger::VariableSafePtr& get_variable () const = 0;
 
     /// gets the debugger the walker is connected to
-    virtual IDebuggerSafePtr get_debugger () const = 0 ;
+    virtual IDebuggerSafePtr get_debugger () const = 0;
 };//end IVarWalker
 
 NEMIVER_END_NAMESPACE (nemiver)

Modified: trunk/src/dbgengine/nmv-var-walker.cc
==============================================================================
--- trunk/src/dbgengine/nmv-var-walker.cc	(original)
+++ trunk/src/dbgengine/nmv-var-walker.cc	Thu Jan 17 22:06:58 2008
@@ -28,26 +28,26 @@
 #include "nmv-gdb-engine.h"
 #include "common/nmv-sequence.h"
 
-using std::list ;
-using std::map ;
-using nemiver::common::DynamicModule ;
-using nemiver::common::DynamicModuleSafePtr ;
-using nemiver::common::DynModIface ;
-using nemiver::common::DynModIfaceSafePtr ;
-using nemiver::common::ObjectRef ;
-using nemiver::common::ObjectUnref ;
+using std::list;
+using std::map;
+using nemiver::common::DynamicModule;
+using nemiver::common::DynamicModuleSafePtr;
+using nemiver::common::DynModIface;
+using nemiver::common::DynModIfaceSafePtr;
+using nemiver::common::ObjectRef;
+using nemiver::common::ObjectUnref;
 
-typedef SafePtr<nemiver::GDBEngine, ObjectRef, ObjectUnref> GDBEngineSafePtr ;
+typedef SafePtr<nemiver::GDBEngine, ObjectRef, ObjectUnref> GDBEngineSafePtr;
 
 NEMIVER_BEGIN_NAMESPACE (nemiver)
 
-const UString VAR_WALKER_COOKIE="var-walker-cookie" ;
+const UString VAR_WALKER_COOKIE="var-walker-cookie";
 
 nemiver::common::Sequence&
 get_sequence ()
 {
-    static nemiver::common::Sequence sequence ;
-    return sequence ;
+    static nemiver::common::Sequence sequence;
+    return sequence;
 }
 
 struct SafePtrCmp {
@@ -64,26 +64,26 @@
 
     mutable sigc::signal<void,
                  const IDebugger::VariableSafePtr&>
-                                            m_visited_variable_signal ;
+                                            m_visited_variable_signal;
 
-    mutable GDBEngineSafePtr m_debugger ;
-    UString m_root_var_name ;
-    list<sigc::connection> m_connections ;
+    mutable GDBEngineSafePtr m_debugger;
+    UString m_root_var_name;
+    list<sigc::connection> m_connections;
     map<IDebugger::VariableSafePtr, bool, SafePtrCmp> m_vars_to_visit;
-    UString m_cookie ;
-    IDebugger::VariableSafePtr m_root_var ;
+    UString m_cookie;
+    IDebugger::VariableSafePtr m_root_var;
 
     void on_variable_value_signal (const UString &a_name,
                                    const IDebugger::VariableSafePtr &a_var,
-                                   const UString &a_cookie) ;
+                                   const UString &a_cookie);
 
     void on_variable_value_set_signal (const IDebugger::VariableSafePtr &a_var,
-                                       const UString &a_cookie) ;
+                                       const UString &a_cookie);
 
     void on_variable_type_set_signal (const IDebugger::VariableSafePtr &a_var,
-                                      const UString &a_cookie) ;
+                                      const UString &a_cookie);
 
-    void get_type_of_all_members (const IDebugger::VariableSafePtr a_from) ;
+    void get_type_of_all_members (const IDebugger::VariableSafePtr a_from);
 
 public:
 
@@ -103,15 +103,15 @@
     //</event getters>
     //********************
 
-    void connect (IDebuggerSafePtr &a_debugger, const UString &a_var_name) ;
+    void connect (IDebuggerSafePtr &a_debugger, const UString &a_var_name);
 
-    void connect (IDebuggerSafePtr &a_debugger, const IDebugger::VariableSafePtr &a_var) ;
+    void connect (IDebuggerSafePtr &a_debugger, const IDebugger::VariableSafePtr &a_var);
 
     void do_walk_variable (const UString &a_cookie="");
 
-    const IDebugger::VariableSafePtr& get_variable () const ;
+    const IDebugger::VariableSafePtr& get_variable () const;
 
-    IDebuggerSafePtr get_debugger () const  ;
+    IDebuggerSafePtr get_debugger () const ;
 };//end class VarWalker
 
 void
@@ -121,15 +121,15 @@
 {
     if (a_name.raw () == "") {}
     if (a_cookie.raw () != m_cookie.raw ()) {
-        return ;
+        return;
     }
 
     NEMIVER_TRY
 
     //now query for the type
-    get_type_of_all_members (a_var) ;
-    m_root_var = a_var ;
-    LOG_DD ("set m_root_var") ;
+    get_type_of_all_members (a_var);
+    m_root_var = a_var;
+    LOG_DD ("set m_root_var");
 
     NEMIVER_CATCH_NOX
 }
@@ -139,15 +139,15 @@
                                          const UString &a_cookie)
 {
     if (a_cookie.raw () != m_cookie.raw ()) {
-        return ;
+        return;
     }
 
     NEMIVER_TRY
 
     //now query for the type
-    get_type_of_all_members (a_var) ;
+    get_type_of_all_members (a_var);
 
-    LOG_DD ("m_vars_to_visit.size () = " << (int)m_vars_to_visit.size ()) ;
+    LOG_DD ("m_vars_to_visit.size () = " << (int)m_vars_to_visit.size ());
     UString var_str;
     NEMIVER_CATCH_NOX
 }
@@ -157,38 +157,38 @@
                                         const UString &a_cookie)
 {
     if (a_cookie.raw () != m_cookie.raw ()) {
-        return ;
+        return;
     }
 
     NEMIVER_TRY
 
-    THROW_IF_FAIL (a_var) ;
+    THROW_IF_FAIL (a_var);
     THROW_IF_FAIL (!m_vars_to_visit.empty ());
 
     UString parent_name;
     if (a_var->parent ()) {
-        parent_name = a_var->parent ()->name () ;
+        parent_name = a_var->parent ()->name ();
     } else {
         parent_name = "null";
     }
     LOG_DD ("var: " << a_var->name ()
             << " type: " << a_var->type ()
-            << " parent: " << parent_name) ;
+            << " parent: " << parent_name);
 
-    visited_variable_node_signal ().emit (a_var) ;
-    m_vars_to_visit.erase (a_var) ;
+    visited_variable_node_signal ().emit (a_var);
+    m_vars_to_visit.erase (a_var);
     if (m_vars_to_visit.size () == 0) {
-        visited_variable_signal ().emit (m_root_var) ;
+        visited_variable_signal ().emit (m_root_var);
         LOG_DD ("visited var: " << m_root_var->name ()
-                << ", cur node: " << a_var->name ()) ;
+                << ", cur node: " << a_var->name ());
     } else {
-        LOG_DD ("m_vars_to_visit.size () = " << (int) m_vars_to_visit.size ()) ;
+        LOG_DD ("m_vars_to_visit.size () = " << (int) m_vars_to_visit.size ());
     }
     map<IDebugger::VariableSafePtr, bool>::iterator it;
     for (it = m_vars_to_visit.begin ();
          it != m_vars_to_visit.end ();
          ++it) {
-        LOG_DD ("m_vars_to_visit[x] = " << it->first->name ()) ;
+        LOG_DD ("m_vars_to_visit[x] = " << it->first->name ());
     }
 
     NEMIVER_CATCH_NOX
@@ -197,53 +197,53 @@
 void
 VarWalker::get_type_of_all_members (const IDebugger::VariableSafePtr a_from)
 {
-    RETURN_IF_FAIL (a_from) ;
+    RETURN_IF_FAIL (a_from);
 
-    LOG_DD ("member: " << a_from->name ()) ;
+    LOG_DD ("member: " << a_from->name ());
     if (a_from->parent ()) {
-        LOG_DD ("parent: " << a_from->parent ()->name ()) ;
+        LOG_DD ("parent: " << a_from->parent ()->name ());
     } else {
-        LOG_DD ("parent: null") ;
+        LOG_DD ("parent: null");
     }
 
     UString qname;
-    a_from->build_qname (qname) ;
-    LOG_DD ("qname: " << qname) ;
-    qname.chomp () ;
+    a_from->build_qname (qname);
+    LOG_DD ("qname: " << qname);
+    qname.chomp ();
     if (qname.raw ()[0] == '<' || a_from->name ().raw ()[0] == '<') {
         //this is a hack to detect c++ templated unamed members
         //usually, their name have the form "<blablah>"
-        LOG_DD ("templated unnamed member, don't query for its type") ;
-        LOG_DD ("member was: " << a_from->name ()) ;
+        LOG_DD ("templated unnamed member, don't query for its type");
+        LOG_DD ("member was: " << a_from->name ());
     } else if (qname.get_number_of_words () != 1) {
-        LOG_DD ("variable name is weird, don't query for its type") ;
-        LOG_DD ("member was: " << a_from->name ()) ;
+        LOG_DD ("variable name is weird, don't query for its type");
+        LOG_DD ("member was: " << a_from->name ());
         return;
     } else {
         m_vars_to_visit[a_from] = true;
-        m_debugger->get_variable_type (a_from, m_cookie) ;
-        LOG_DD ("member : " << a_from->name () << "to added to m_vars_to_visit") ;
+        m_debugger->get_variable_type (a_from, m_cookie);
+        LOG_DD ("member : " << a_from->name () << "to added to m_vars_to_visit");
         return;
     }
     list<IDebugger::VariableSafePtr>::const_iterator it;
     for (it = a_from->members ().begin ();
          it != a_from->members ().end ();
          ++it) {
-        get_type_of_all_members (*it) ;
+        get_type_of_all_members (*it);
     }
-    LOG_DD ("m_vars_to_visit.size () = " << (int)m_vars_to_visit.size ()) ;
+    LOG_DD ("m_vars_to_visit.size () = " << (int)m_vars_to_visit.size ());
 }
 
 sigc::signal<void, const IDebugger::VariableSafePtr&>&
 VarWalker::visited_variable_node_signal () const
 {
-    return m_visited_variable_node_signal ;
+    return m_visited_variable_node_signal;
 }
 
 sigc::signal<void, const IDebugger::VariableSafePtr&>&
 VarWalker::visited_variable_signal () const
 {
-    return m_visited_variable_signal ;
+    return m_visited_variable_signal;
 }
 
 void
@@ -251,17 +251,17 @@
                     const UString &a_var_name)
 {
     m_debugger = a_debugger.do_dynamic_cast<GDBEngine> ();
-    THROW_IF_FAIL (m_debugger) ;
-    m_root_var_name = a_var_name ;
+    THROW_IF_FAIL (m_debugger);
+    m_root_var_name = a_var_name;
 
     list<sigc::connection>::iterator it;
     for (it = m_connections.begin (); it != m_connections.end (); ++it) {
-        it->disconnect () ;
+        it->disconnect ();
     }
     m_connections.push_back (m_debugger->variable_value_signal ().connect
-            (sigc::mem_fun (*this, &VarWalker::on_variable_value_signal))) ;
+            (sigc::mem_fun (*this, &VarWalker::on_variable_value_signal)));
     m_connections.push_back (m_debugger->variable_type_set_signal ().connect
-                    (sigc::mem_fun (*this, &VarWalker::on_variable_type_set_signal))) ;
+                    (sigc::mem_fun (*this, &VarWalker::on_variable_type_set_signal)));
 }
 
 void
@@ -269,18 +269,20 @@
                     const IDebugger::VariableSafePtr &a_var)
 {
     m_debugger = a_debugger.do_dynamic_cast<GDBEngine> ();
-    THROW_IF_FAIL (m_debugger) ;
-    m_root_var = a_var ;
+    THROW_IF_FAIL (m_debugger);
+    m_root_var = a_var;
 
     list<sigc::connection>::iterator it;
     for (it = m_connections.begin (); it != m_connections.end (); ++it) {
-        it->disconnect () ;
+        it->disconnect ();
     }
     m_connections.clear ();
     m_connections.push_back (m_debugger->variable_value_set_signal ().connect
-            (sigc::mem_fun (*this, &VarWalker::on_variable_value_set_signal))) ;
+            (sigc::mem_fun (*this,
+                            &VarWalker::on_variable_value_set_signal)));
     m_connections.push_back (m_debugger->variable_type_set_signal ().connect
-                    (sigc::mem_fun (*this, &VarWalker::on_variable_type_set_signal))) ;
+                (sigc::mem_fun (*this,
+                                &VarWalker::on_variable_type_set_signal)));
 }
 
 void
@@ -289,29 +291,29 @@
     if (a_cookie.raw () == "") {
         m_cookie =
             UString::from_int (get_sequence ().create_next_integer ()) +
-            "-" + VAR_WALKER_COOKIE ;
+            "-" + VAR_WALKER_COOKIE;
     } else {
         m_cookie = a_cookie;
     }
 
     if (m_root_var_name.raw () != "") {
         m_debugger->print_variable_value (m_root_var_name,
-                                          m_cookie) ;
+                                          m_cookie);
     } else if (m_root_var){
-        m_debugger->get_variable_value (m_root_var, m_cookie) ;
+        m_debugger->get_variable_value (m_root_var, m_cookie);
     }
 }
 
 const IDebugger::VariableSafePtr&
 VarWalker::get_variable () const
 {
-    return m_root_var ;
+    return m_root_var;
 }
 
 IDebuggerSafePtr
 VarWalker::get_debugger () const
 {
-    return m_debugger.do_dynamic_cast<IDebugger> () ;
+    return m_debugger.do_dynamic_cast<IDebugger> ();
 }
 
 //the dynmod used to instanciate the VarWalker service object
@@ -323,8 +325,8 @@
         const static Info s_info ("varWalker",
                                   "The Variable Walker dynmod. "
                                   "Implements the IVarWalker interface",
-                                  "1.0") ;
-        a_info = s_info ;
+                                  "1.0");
+        a_info = s_info;
     }
 
     void do_init ()
@@ -335,11 +337,11 @@
                            DynModIfaceSafePtr &a_iface)
     {
         if (a_iface_name == "IVarWalker") {
-            a_iface.reset (new VarWalker (this)) ;
+            a_iface.reset (new VarWalker (this));
         } else {
-            return false ;
+            return false;
         }
-        return true ;
+        return true;
     }
 };//end class varListDynMod
 
@@ -351,8 +353,8 @@
 bool
 NEMIVER_API nemiver_common_create_dynamic_module_instance (void **a_new_instance)
 {
-    *a_new_instance = new nemiver::VarWalkerDynMod () ;
-    return (*a_new_instance != 0) ;
+    *a_new_instance = new nemiver::VarWalkerDynMod ();
+    return (*a_new_instance != 0);
 }
 
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]