Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78791 - in sandbox/icl/libs/xplore/br1/sqlbrowser: . data/concept data/qsql
From: afojgo_at_[hidden]
Date: 2012-06-01 11:15:35


Author: jofaber
Date: 2012-06-01 11:15:34 EDT (Fri, 01 Jun 2012)
New Revision: 78791
URL: http://svn.boost.org/trac/boost/changeset/78791

Log:
Some comments for Accessor traits.
Text files modified:
   sandbox/icl/libs/xplore/br1/sqlbrowser/browser.cpp | 22 ++++++++++++++++++++--
   sandbox/icl/libs/xplore/br1/sqlbrowser/browser.h | 1 +
   sandbox/icl/libs/xplore/br1/sqlbrowser/data/concept/CreatorTraits.h | 5 +++++
   sandbox/icl/libs/xplore/br1/sqlbrowser/data/concept/Selector.h | 5 ++++-
   sandbox/icl/libs/xplore/br1/sqlbrowser/data/qsql/QSqlCreator.h | 2 +-
   5 files changed, 31 insertions(+), 4 deletions(-)

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/browser.cpp
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/browser.cpp (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/browser.cpp 2012-06-01 11:15:34 EDT (Fri, 01 Jun 2012)
@@ -171,8 +171,9 @@
 {
     //return execScript(); // Execute a script containing of multiple sql-statements
     //return casualTests();
- emit statusMessage(tr("Generating DB ..."));
- return generateDb();
+ return testSelector();
+ //emit statusMessage(tr("Generating DB ..."));
+ //return generateDb();
 }
 
 
@@ -209,6 +210,23 @@
     return success;
 }
 
+bool Browser::testSelector()
+{
+ bool success = false;
+ data::QSqlSelector selector;
+ dag::db::TypeGraph tygra;
+
+ selector.setDatabase(connectionWidget->currentDatabase());
+ success = makeTypeGraph(selector, tygra);
+
+ if(success)
+ emit statusMessage(tr("Test executed successfully."));
+ else
+ emit statusMessage(tr("Error(s), Test aborted."));
+
+ return success;
+}
+
 bool Browser::casualTests()
 {
     QString curSql = "select * from EdgeType";

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/browser.h
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/browser.h (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/browser.h 2012-06-01 11:15:34 EDT (Fri, 01 Jun 2012)
@@ -131,6 +131,7 @@
 
     bool execScript();
     bool casualTests();
+ bool testSelector();
     bool generateDb();
 };
 

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/data/concept/CreatorTraits.h
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/data/concept/CreatorTraits.h (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/data/concept/CreatorTraits.h 2012-06-01 11:15:34 EDT (Fri, 01 Jun 2012)
@@ -15,13 +15,18 @@
 //==============================================================================
 //= Concept: data::Creator Traits
 //==============================================================================
+//! A creator creates (Domain)Objects for a Given Accessor
+//! The Accessor encapsulates the Access to a file or data base.
 template<class Object, class Accessor>
 struct CreatorTraits
 {
     typedef typename Accessor::const_iterator const_iterator;
     typedef typename Accessor::tQuery tQuery;
 
+ //! Creates a Query to access domain Objects
     static tString createQuery();
+
+ //! Creates a domain Object from an Accessor's const_iterator
     static Object create(const_iterator);
 };
 

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/data/concept/Selector.h
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/data/concept/Selector.h (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/data/concept/Selector.h 2012-06-01 11:15:34 EDT (Fri, 01 Jun 2012)
@@ -18,7 +18,10 @@
 
 namespace data
 {
-// If it is an SqlAccessor, make the type-graph like so:
+
+//! Given the Accessor is a QuerySelector, it allows to retirieve resultsets
+//! from some Query objects, the function to make a typeGraph is generic for
+//! all those Accessors
 template<class Accessor>
 typename boost::enable_if< IsQuerySelector<Accessor>, bool>::type
 makeTypeGraph(Accessor& accessor, dag::db::TypeGraph& typeGraph)

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/data/qsql/QSqlCreator.h
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/data/qsql/QSqlCreator.h (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/data/qsql/QSqlCreator.h 2012-06-01 11:15:34 EDT (Fri, 01 Jun 2012)
@@ -58,7 +58,7 @@
 
 
 //==============================================================================
-//= Concept: data::Creator Spec: QSqlCreator
+//= Concept: data::Creator Partial Specialisation: QSqlCreator
 //==============================================================================
 
 template<class Object, class Accessor>


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