Date: Wednesday, February 15, 2006 @ 12:34:46
Author: gilles
Path: /cvsroot/carob/carob
Modified: include/Connection.hpp (1.57 -> 1.58)
include/DriverResultSet.hpp (1.30 -> 1.31) include/Statement.hpp
(1.31 -> 1.32) src/DriverResultSet.cpp (1.37 -> 1.38)
Removed Connection <> DriverResultSet full friendship
Only DriverResultSet constructor and next() functions are friends. This lead to
changing receiveRows() so it now takes DriverSocket as parameter
Part of CAROB-59
-----------------------------+
include/Connection.hpp | 10 +++++++---
include/DriverResultSet.hpp | 6 ++++--
include/Statement.hpp | 1 -
src/DriverResultSet.cpp | 8 ++++----
4 files changed, 15 insertions(+), 10 deletions(-)
Index: carob/include/Connection.hpp
diff -u carob/include/Connection.hpp:1.57 carob/include/Connection.hpp:1.58
--- carob/include/Connection.hpp:1.57 Wed Feb 15 11:03:42 2006
+++ carob/include/Connection.hpp Wed Feb 15 12:34:46 2006
@@ -114,9 +114,13 @@
*/
class Connection
{
-// For now, DriverResultSet must access getDriverSocket() function
-// TODO: change this to remove the friendship
-friend class DriverResultSet;
+// These functions need access to getDriverSocket()
+friend DriverResultSet::DriverResultSet(Connection* conn)
+ throw (ProtocolException, SocketIOException, NotImplementedException,
+ UnexpectedException);
+friend bool DriverResultSet::next() throw (SocketIOException,
+ ControllerException, ProtocolException, BackendException,
+ UnexpectedException);
public:
/**
Index: carob/include/DriverResultSet.hpp
diff -u carob/include/DriverResultSet.hpp:1.30
carob/include/DriverResultSet.hpp:1.31
--- carob/include/DriverResultSet.hpp:1.30 Wed Feb 1 13:39:24 2006
+++ carob/include/DriverResultSet.hpp Wed Feb 15 12:34:46 2006
@@ -323,11 +323,13 @@
/**
* De-serialize only data rows, not any metadata.
*
+ * @param socket opened socket to controller
* @throw SocketIOException stream error
* @throw ProtocolException protocol corruption
*/
- void receiveRows() throw (SocketIOException,
- ProtocolException, UnexpectedException);
+ void receiveRows(const DriverSocket& socket)
+ throw (SocketIOException, ProtocolException,
+ UnexpectedException);
/**
* Sets the statement.
*
Index: carob/include/Statement.hpp
diff -u carob/include/Statement.hpp:1.31 carob/include/Statement.hpp:1.32
--- carob/include/Statement.hpp:1.31 Wed Feb 1 11:30:56 2006
+++ carob/include/Statement.hpp Wed Feb 15 12:34:46 2006
@@ -53,7 +53,6 @@
class Connection;
class ResultSetMetaData;
-class DriverResultSet;
class RequestWithResultSetParameters;
/**
Index: carob/src/DriverResultSet.cpp
diff -u carob/src/DriverResultSet.cpp:1.37 carob/src/DriverResultSet.cpp:1.38
--- carob/src/DriverResultSet.cpp:1.37 Wed Feb 15 11:03:42 2006
+++ carob/src/DriverResultSet.cpp Wed Feb 15 12:34:46 2006
@@ -142,7 +142,7 @@
columnTypeTags.push_back(tag);
}
}
- receiveRows();
+ receiveRows(socket);
if (hasMoreData)
socket>>cursorName;
isClosed = false;
@@ -185,7 +185,7 @@
// TODO: what happens if user closed this connection? What says JDBC?
connectionPtr->tryFetchNext(cursorName, fetchSize);
// no exception from controller, so let's receive our new rows
- receiveRows();
+ receiveRows(connectionPtr->getDriverSocket());
currentRow = 0;
if (dataIsNull)
{
@@ -576,11 +576,11 @@
isClosed = true;
}
-void DriverResultSet::receiveRows() throw (SocketIOException,
ProtocolException,
+void DriverResultSet::receiveRows(const DriverSocket& socket)
+ throw (SocketIOException, ProtocolException,
UnexpectedException)
{
clearAllData();
- const DriverSocket& socket = connectionPtr->getDriverSocket();
socket>>nbOfRows;
vector<bool> nullsForThisRow;
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits