Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76539 - sandbox/icl/libs/xplore/br1/sqlbrowser
From: afojgo_at_[hidden]
Date: 2012-01-16 02:51:11


Author: jofaber
Date: 2012-01-16 02:51:10 EST (Mon, 16 Jan 2012)
New Revision: 76539
URL: http://svn.boost.org/trac/boost/changeset/76539

Log:
Some work on Dag.
Binary files modified:
   sandbox/icl/libs/xplore/br1/sqlbrowser/objects1.db
Text files modified:
   sandbox/icl/libs/xplore/br1/sqlbrowser/ExtensibleObjectModel.sql | 9 ++++-----
   sandbox/icl/libs/xplore/br1/sqlbrowser/dagmodel.cpp | 14 ++++++++------
   sandbox/icl/libs/xplore/br1/sqlbrowser/dagmodel.h | 6 +++++-
   sandbox/icl/libs/xplore/br1/sqlbrowser/qsqlconnectiondialog.ui | 2 +-
   4 files changed, 18 insertions(+), 13 deletions(-)

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/ExtensibleObjectModel.sql
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/ExtensibleObjectModel.sql (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/ExtensibleObjectModel.sql 2012-01-16 02:51:10 EST (Mon, 16 Jan 2012)
@@ -24,13 +24,15 @@
 -- This is a directed acyclic graph.
 create table Dag (Parent integer, Child integer, primary key (Parent, Child) );
 
+-- The sequence of records is significant and represents in-order traversal
+-- of the "expanded tree" of the Dag
 insert into Dag values (0, 0); -- Nil group
 insert into Dag values (0, 1); -- (0:ROOT, 1:Songs)
 insert into Dag values (1, 2); -- (1:Songs, 2:Blues)
-insert into Dag values (1, 3); -- (1:Songs, 3:Latin)
 insert into Dag values (2, 4); -- (2:Blues, 4:St.Louis Blues)
-insert into Dag values (3, 5); -- (3:Latin, 4:Oye Come Va)
 insert into Dag values (2, 6); -- (2:Blues, 4:Blue Bossa)
+insert into Dag values (1, 3); -- (1:Songs, 3:Latin)
+insert into Dag values (3, 5); -- (3:Latin, 4:Oye Come Va)
 insert into Dag values (3, 6); -- (3:Latin, 4:Blue Bossa)
 
 -- -----------------------------------------------------------------------------
@@ -49,7 +51,6 @@
   inner join Objects on Dag.Child = Objects.id
   inner join Types on Objects.TypeOf = Types.id
   where Dag.Child <> 0
- order by Dag.Parent, Dag.Child
 
 
 -- ----------------------------------------------------------------------------
@@ -60,6 +61,4 @@
   from Dag
   inner join Objects on Dag.Child = Objects.id
   inner join Types on Objects.TypeOf = Types.id
- where Dag.Child <> 0
- order by Dag.Parent, Dag.Child
 

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/dagmodel.cpp
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/dagmodel.cpp (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/dagmodel.cpp 2012-01-16 02:51:10 EST (Mon, 16 Jan 2012)
@@ -248,7 +248,7 @@
     }
 }
 
-
+/*
 //JODO Populate a DagModel from an sql-query that provides the DAG as
 // (ParentId -> ChildId), ParentName, ChildName, ChildType
 void DagModel::fromSql(const QSqlQuery& query)
@@ -280,6 +280,7 @@
 
     }
 }
+*/
 
 /*
 void DagModel::fromSql(const QSqlQuery& query, DagItem* parent, int depth)
@@ -289,14 +290,15 @@
     if(!query.next())
         return;
     else
- // Same parent-id
- while(query.value(0).toInt() == parent->nodeId())
- { //Same node as before. Add a child
- parent->addChild(parent, data)
- }
+ {
+ create a node
+ if(! the new node is terminal)
+ addChildren(query, newNode, depth+1);
+ }
 }
 */
 
+
 //JOFA Iteration example: The container as String
 QString DagModel::toString()const
 {

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/dagmodel.h
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/dagmodel.h (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/dagmodel.h 2012-01-16 02:51:10 EST (Mon, 16 Jan 2012)
@@ -10,6 +10,10 @@
 #include <QModelIndex>
 #include <QVariant>
 
+#include <map>
+
+typedef std::map<int, int> daggy;
+
 class QSqlQuery;
 class DagItem;
 
@@ -49,7 +53,7 @@
                     const QModelIndex &parent = QModelIndex());
 
 
- //JOFA Populationg a DAG from an Sql-query
+ //JOFA Populating a DAG from an Sql-query
     void fromSql(const QSqlQuery& query);
 
     void fromSql(const QSqlQuery& query, DagItem* node, int depth);

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/objects1.db
==============================================================================
Binary files. No diff available.

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/qsqlconnectiondialog.ui
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/qsqlconnectiondialog.ui (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/qsqlconnectiondialog.ui 2012-01-16 02:51:10 EST (Mon, 16 Jan 2012)
@@ -58,7 +58,7 @@
       <item row="1" column="1">
        <widget class="QLineEdit" name="editDatabase">
         <property name="text">
- <string>../sqlbrowser/media1.db</string>
+ <string>../sqlbrowser/objects1.db</string>
         </property>
        </widget>
       </item>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk