Date: Thursday, November 24, 2005 @ 12:15:42
Author: gilles
Path: /cvsroot/carob/carob
Modified: include/Statement.hpp (1.5 -> 1.6) src/Statement.cpp (1.6 ->
1.7)
Passed contructor as protected so that only Connection class can create it.
Also removed default constructor
-----------------------+
include/Statement.hpp | 15 ++++++++++++---
src/Statement.cpp | 5 -----
2 files changed, 12 insertions(+), 8 deletions(-)
Index: carob/include/Statement.hpp
diff -u carob/include/Statement.hpp:1.5 carob/include/Statement.hpp:1.6
--- carob/include/Statement.hpp:1.5 Wed Nov 23 16:16:46 2005
+++ carob/include/Statement.hpp Thu Nov 24 12:15:42 2005
@@ -42,10 +42,14 @@
*/
class Statement
{
+/**
+ * Connection class must have access to at least constructor and destructor
+ * because only Connection can create statements
+ */
+friend class Connection;
+
public:
- Statement();
- /** Constructs a Statement with the given connection */
- Statement(Connection* c);
+ //No constructor, statements must be created by connections
virtual ~Statement();
/**
* Execute a SQL statement that may return multiple results.
@@ -197,6 +201,11 @@
{ escapeProcessing = enable; }
protected:
/**
+ * Constructs a Statement with the given connection. Protected access so that
+ * only Connection class can create a statement
+ */
+ Statement(Connection* c);
+ /**
* Sets the maxRows, fetchSize and cursorName values of this Statement in the
* given request
* @param request on which to set parameters
Index: carob/src/Statement.cpp
diff -u carob/src/Statement.cpp:1.6 carob/src/Statement.cpp:1.7
--- carob/src/Statement.cpp:1.6 Wed Nov 23 18:51:45 2005
+++ carob/src/Statement.cpp Thu Nov 24 12:15:42 2005
@@ -5,11 +5,6 @@
using namespace std;
-Statement::Statement()
-{
- Statement(NULL);
-}
-
Statement::Statement(Connection* c) :
connectionPtr(c),
resultPtr(NULL),
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits