Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78547 - in sandbox/icl/libs/xplore/br1/sqlbrowser: . gen
From: afojgo_at_[hidden]
Date: 2012-05-23 03:22:30


Author: jofaber
Date: 2012-05-23 03:22:28 EDT (Wed, 23 May 2012)
New Revision: 78547
URL: http://svn.boost.org/trac/boost/changeset/78547

Log:
Generating Db.
Text files modified:
   sandbox/icl/libs/xplore/br1/sqlbrowser/gen/DbGenerator.cpp | 8 ++++----
   sandbox/icl/libs/xplore/br1/sqlbrowser/gen/DbGenerator.h | 26 +++++++++++++++++++++-----
   sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro | 4 ++--
   3 files changed, 27 insertions(+), 11 deletions(-)

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/gen/DbGenerator.cpp
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/gen/DbGenerator.cpp (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/gen/DbGenerator.cpp 2012-05-23 03:22:28 EDT (Wed, 23 May 2012)
@@ -150,12 +150,12 @@
     );
 }
 
-/*
+
 void DbGenerator::generateArtist()
 {
     tKey aKey = generateObject();
     generateVertex(aKey, a_artist);
- generateVarCharObject(aKey, )
-
+ generateVarCharObject(aKey, A_Name, m_aSomeName());
+ generateIntObject(aKey, A_Year, gen::IntGenerator(1940, 1990)());
 }
-*/
+

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/gen/DbGenerator.h
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/gen/DbGenerator.h (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/gen/DbGenerator.h 2012-05-23 03:22:28 EDT (Wed, 23 May 2012)
@@ -21,6 +21,8 @@
 {
 public:
     typedef dag::db::tKey tKey;
+ typedef unsigned int tObjectType;
+ typedef unsigned int tAttribute;
 
     enum {
         a_text = 1
@@ -46,8 +48,15 @@
       , A_Position = 32
     };
 
+ enum {
+ minSyllables = 2
+ , maxSyllables = 5
+ };
+
     DbGenerator(const QSqlDatabase& db):
- m_aDb(db), m_aQuery("", m_aDb){}
+ m_aDb(db), m_aQuery("", m_aDb)
+ , m_aSomeName(minSyllables, maxSyllables)
+ {}
 
     bool generate();
     void clean();
@@ -66,11 +75,18 @@
     void generateEdgeTypes();
     void generateAttributes();
 
+ tKey generateObject();
+ void generateVertex(tKey aKey, tObjectType eObjectType);
+ void generateVarCharObject(tKey aKey, );
+
+ void generateArtist();
+
 private:
- QSqlDatabase m_aDb;
- QSqlQuery m_aQuery;
- QSqlError m_aLastError;
- tString m_aFailingSql;
+ QSqlDatabase m_aDb;
+ QSqlQuery m_aQuery;
+ QSqlError m_aLastError;
+ tString m_aFailingSql;
+ NameGenerator m_aSomeName;
 };
 
 } // namespace data

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro 2012-05-23 03:22:28 EDT (Wed, 23 May 2012)
@@ -3,8 +3,8 @@
 
 QT += sql
 
-#INCLUDEPATH += /cygwin/home/jofa/dev/boost/branches/release
-INCLUDEPATH += C:\NIBuild\3rdparty\boost-1.48.0
+INCLUDEPATH += /cygwin/home/jofa/dev/boost/branches/release
+#INCLUDEPATH += C:\NIBuild\3rdparty\boost-1.48.0
 
 HEADERS = browser.h connectionwidget.h qsqlconnectiondialog.h \
     exttableview.h \


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