Author: mysqlpp
Date: Thu Nov 22 18:37:23 2007
New Revision: 1881

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1881&view=rev
Log:
Removed dependency between Res* classes and Connection.  ResUse no
longer makes use of its conn ctor parameter, and if it ever did, it
probably remained in the parm list only to preserve the ABI.  ResNSel
accepted it only for laziness reasons: it populated its four data
members directly from Connection, but they can just as well be passed
individually by Query which creates the ResNSel object, which _does_
have a good reason to depend on Connection.

None of this will affect end-user programs.  It's all internal details.

Modified:
    trunk/lib/connection.h
    trunk/lib/query.cpp
    trunk/lib/result.cpp
    trunk/lib/result.h

Modified: trunk/lib/connection.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/connection.h?rev=1881&r1=1880&r2=1881&view=diff
==============================================================================
--- trunk/lib/connection.h (original)
+++ trunk/lib/connection.h Thu Nov 22 18:37:23 2007
@@ -542,8 +542,6 @@
        std::string error_message_;             ///< MySQL++ specific error, if 
any
 
 private:
-       friend class ResNSel;
-       friend class ResUse;
        friend class Query;
 
        struct OptionInfo {

Modified: trunk/lib/query.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/query.cpp?rev=1881&r1=1880&r2=1881&view=diff
==============================================================================
--- trunk/lib/query.cpp (original)
+++ trunk/lib/query.cpp Thu Nov 22 18:37:23 2007
@@ -188,7 +188,8 @@
        }
 
        if (copacetic_) {
-               return ResNSel(conn_);
+               return ResNSel(conn_, conn_->insert_id(),
+                               conn_->affected_rows(), conn_->info());
        }
        else if (throw_exceptions()) {
                throw BadQuery(error(), errnum());
@@ -597,7 +598,7 @@
        }
 
        if (res) {
-               return ResUse(res, conn_, throw_exceptions());
+               return ResUse(res, throw_exceptions());
        }
        else {
                // Either result set is empty (which is copacetic), or there

Modified: trunk/lib/result.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/result.cpp?rev=1881&r1=1880&r2=1881&view=diff
==============================================================================
--- trunk/lib/result.cpp (original)
+++ trunk/lib/result.cpp Thu Nov 22 18:37:23 2007
@@ -26,20 +26,9 @@
 
 #include "result.h"
 
-#include "connection.h"
-
 namespace mysqlpp {
 
-ResNSel::ResNSel(Connection* c) :
-copacetic_(c->copacetic_),
-insert_id_(c->insert_id()),
-rows_(c->affected_rows()),
-info_(c->info())
-{
-}
-
-
-ResUse::ResUse(MYSQL_RES* result, Connection* c, bool te) :
+ResUse::ResUse(MYSQL_RES* result, bool te) :
 OptionalExceptions(te),
 initialized_(false),
 types_(0),

Modified: trunk/lib/result.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/result.h?rev=1881&r1=1880&r2=1881&view=diff
==============================================================================
--- trunk/lib/result.h (original)
+++ trunk/lib/result.h Thu Nov 22 18:37:23 2007
@@ -40,11 +40,6 @@
 #include "subiter.h"
 
 namespace mysqlpp {
-
-#if !defined(DOXYGEN_IGNORE)
-// Make Doxygen ignore this
-class MYSQLPP_EXPORT Connection;
-#endif
 
 /// \brief A basic result set class, for use with "use" queries.
 ///
@@ -70,7 +65,7 @@
        }
        
        /// \brief Create the object, fully initialized
-       ResUse(MYSQL_RES* result, Connection* c = 0, bool te = true);
+       ResUse(MYSQL_RES* result, bool te = true);
        
        /// \brief Create a copy of another ResUse object
        ResUse(const ResUse& other) :
@@ -370,7 +365,7 @@
        
        /// \brief Fully initialize object
        Result(MYSQL_RES* result, bool te = true) :
-       ResUse(result, 0, te)
+       ResUse(result, te)
        {
        }
 
@@ -453,7 +448,14 @@
        }
 
        /// \brief Initialize object
-       ResNSel(Connection* c);
+       ResNSel::ResNSel(bool copacetic, my_ulonglong insert_id,
+                       my_ulonglong rows, const std::string& info) :
+       copacetic_(copacetic),
+       insert_id_(insert_id),
+       rows_(rows),
+       info_(info)
+       {
+       }
 
        /// \brief Test whether the query was successful
        operator bool() const { return copacetic_; }


_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits

Reply via email to