mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-02 14:03:41 +01:00
some compilation refactoring
This commit is contained in:
@@ -40,7 +40,8 @@ namespace Test {
|
||||
|
||||
|
||||
TestStatementImpl::TestStatementImpl(SessionImpl& rSession):
|
||||
Poco::Data::StatementImpl(rSession)
|
||||
Poco::Data::StatementImpl(rSession),
|
||||
_compiled(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -50,13 +51,13 @@ TestStatementImpl::~TestStatementImpl()
|
||||
}
|
||||
|
||||
|
||||
bool TestStatementImpl::compileImpl()
|
||||
void TestStatementImpl::compileImpl()
|
||||
{
|
||||
// prepare binding
|
||||
_ptrBinder = new Binder;
|
||||
_ptrExtractor = new Extractor;
|
||||
_ptrPrepare = new Preparation;
|
||||
return false;
|
||||
_compiled = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -83,7 +83,10 @@ protected:
|
||||
bool canBind() const;
|
||||
/// Returns true if a valid statement is set and we can bind.
|
||||
|
||||
bool compileImpl();
|
||||
bool canCompile() const;
|
||||
/// Returns true if statement was not compiled.
|
||||
|
||||
void compileImpl();
|
||||
/// Compiles the statement, doesn't bind yet
|
||||
|
||||
void bindImpl();
|
||||
@@ -96,9 +99,10 @@ protected:
|
||||
/// Returns the concrete binder used by the statement.
|
||||
|
||||
private:
|
||||
Poco::SharedPtr<Binder> _ptrBinder;
|
||||
Poco::SharedPtr<Extractor> _ptrExtractor;
|
||||
Poco::SharedPtr<Binder> _ptrBinder;
|
||||
Poco::SharedPtr<Extractor> _ptrExtractor;
|
||||
Poco::SharedPtr<Preparation> _ptrPrepare;
|
||||
bool _compiled;
|
||||
};
|
||||
|
||||
|
||||
@@ -123,6 +127,12 @@ inline Poco::UInt32 TestStatementImpl::affectedRowCount() const
|
||||
}
|
||||
|
||||
|
||||
inline bool TestStatementImpl::canCompile() const
|
||||
{
|
||||
return !_compiled;
|
||||
}
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::Test
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user