LibreOffice Module dbaccess (master) 1
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
dbaccess::ORowSetCache Class Reference

#include <RowSetCache.hxx>

Collaboration diagram for dbaccess::ORowSetCache:
[legend]

Public Member Functions

 ORowSetCache (const css::uno::Reference< css::sdbc::XResultSet > &_xRs, const css::uno::Reference< css::sdb::XSingleSelectQueryAnalyzer > &_xAnalyzer, const css::uno::Reference< css::uno::XComponentContext > &_rContext, const OUString &_rUpdateTableName, bool &_bModified, bool &_bNew, const ORowSetValueVector &_aParameterValueForCache, const OUString &i_sRowSetFilter, sal_Int32 i_nMaxRows)
 
 ~ORowSetCache ()
 
void setUpdateIterator (const ORowSetMatrix::iterator &_rOriginalRow)
 
ORowSetCacheIterator createIterator (ORowSetBase *_pRowSet)
 
void deleteIterator (const ORowSetBase *_pRowSet)
 
void setFetchSize (sal_Int32 _nSize)
 
TORowSetOldRowHelperRef registerOldRow ()
 
void deregisterOldRow (const TORowSetOldRowHelperRef &_rRow)
 
const css::uno::Reference< css::sdbc::XResultSetMetaData > & getMetaData () const
 
css::uno::Any getBookmark ()
 
bool moveToBookmark (const css::uno::Any &bookmark)
 
bool moveRelativeToBookmark (const css::uno::Any &bookmark, sal_Int32 rows)
 
sal_Int32 compareBookmarks (const css::uno::Any &first, const css::uno::Any &second)
 
bool hasOrderedBookmarks ()
 
sal_Int32 hashBookmark (const css::uno::Any &bookmark)
 
void updateCharacterStream (sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length, ORowSetValueVector::Vector &io_aRow, std::vector< sal_Int32 > &o_ChangedColumns)
 
void updateObject (sal_Int32 columnIndex, const css::uno::Any &x, ORowSetValueVector::Vector &io_aRow, std::vector< sal_Int32 > &o_ChangedColumns)
 
void updateNumericObject (sal_Int32 columnIndex, const css::uno::Any &x, ORowSetValueVector::Vector &io_aRow, std::vector< sal_Int32 > &o_ChangedColumns)
 
void updateNull (sal_Int32 columnIndex, ORowSetValueVector::Vector &io_aRow, std::vector< sal_Int32 > &o_ChangedColumns)
 
bool next ()
 
bool isBeforeFirst () const
 
bool isAfterLast () const
 
bool isFirst () const
 
bool isLast () const
 
void beforeFirst ()
 
void afterLast ()
 
bool first ()
 
bool last ()
 
sal_Int32 getRow () const
 
bool absolute (sal_Int32 row)
 
bool relative (sal_Int32 rows)
 
bool previous ()
 
void refreshRow ()
 
bool rowUpdated ()
 
bool rowInserted ()
 
bool insertRow (std::vector< css::uno::Any > &o_aBookmarks)
 
void resetInsertRow (bool _bClearInsertRow)
 
void updateRow (ORowSetMatrix::iterator const &_rUpdateRow, std::vector< css::uno::Any > &o_aBookmarks)
 
bool deleteRow ()
 
void cancelRowUpdates ()
 
void moveToInsertRow ()
 
const std::map< sal_Int32, sal_Int32 > & getKeyColumns () const
 
bool isResultSetChanged () const
 
void reset (const css::uno::Reference< css::sdbc::XResultSet > &_xDriverSet)
 

Protected Member Functions

const ORowSetMatrix::iterator & getEnd () const
 
void cancelRowModification ()
 

Private Types

typedef std::vector< TORowSetOldRowHelperRefTOldRowSetRows
 

Private Member Functions

bool fill (ORowSetMatrix::iterator &_aIter, const ORowSetMatrix::const_iterator &_aEnd, sal_Int32 &_nPos, bool _bCheck)
 
bool reFillMatrix (sal_Int32 _nNewStartPos, sal_Int32 nNewEndPos)
 
bool fillMatrix (sal_Int32 &_nNewStartPos, sal_Int32 &_nNewEndPos)
 
void moveWindow ()
 
void rotateCacheIterator (ORowSetMatrix::difference_type _nDist)
 
void rotateAllCacheIterators ()
 
void updateValue (sal_Int32 columnIndex, const connectivity::ORowSetValue &x, ORowSetValueVector::Vector &io_aRow, std::vector< sal_Int32 > &o_ChangedColumns)
 
void impl_updateRowFromCache_throw (ORowSetValueVector::Vector &io_aRow, std::vector< sal_Int32 > const &o_ChangedColumns)
 
void checkPositionFlags ()
 
void checkUpdateConditions (sal_Int32 columnIndex)
 
bool checkJoin (const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const css::uno::Reference< css::sdb::XSingleSelectQueryAnalyzer > &_xComposer, const OUString &_sUpdateTableName)
 
bool checkInnerJoin (const ::connectivity::OSQLParseNode *pNode, const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const OUString &_sUpdateTableName)
 
void clearInsertRow ()
 
ORowSetMatrix::iterator calcPosition () const
 

Private Attributes

std::map< sal_Int32, sal_Int32 > m_aKeyColumns
 
css::uno::WeakReference< css::sdbc::XResultSet > m_xSet
 
css::uno::Reference< css::sdbc::XResultSetMetaData > m_xMetaData
 
css::uno::Reference< css::uno::XComponentContext > m_aContext
 
rtl::Reference< OCacheSetm_xCacheSet
 
std::unique_ptr< ORowSetMatrixm_pMatrix
 
ORowSetMatrix::iterator m_aMatrixIter
 
ORowSetMatrix::iterator m_aMatrixEnd
 
ORowSetCacheMap m_aCacheIterators
 
TOldRowSetRows m_aOldRows
 
std::unique_ptr< ORowSetMatrixm_pInsertMatrix
 
ORowSetMatrix::iterator m_aInsertRow
 
connectivity::OSQLTable m_aUpdateTable
 
sal_Int32 m_nFetchSize
 
sal_Int32 m_nRowCount
 
sal_Int32 m_nPrivileges
 
sal_Int32 m_nPosition
 
sal_Int32 m_nStartPos
 
sal_Int32 m_nEndPos
 
bool m_bRowCountFinal
 
bool m_bBeforeFirst
 
bool m_bAfterLast
 
bool & m_bModified
 
bool & m_bNew
 

Friends

class ORowSetBase
 
class ORowSet
 
class ORowSetClone
 
class ORowSetCacheIterator
 

Detailed Description

Definition at line 37 of file RowSetCache.hxx.

Member Typedef Documentation

◆ TOldRowSetRows

Definition at line 44 of file RowSetCache.hxx.

Constructor & Destructor Documentation

◆ ORowSetCache()

ORowSetCache::ORowSetCache ( const css::uno::Reference< css::sdbc::XResultSet > &  _xRs,
const css::uno::Reference< css::sdb::XSingleSelectQueryAnalyzer > &  _xAnalyzer,
const css::uno::Reference< css::uno::XComponentContext > &  _rContext,
const OUString &  _rUpdateTableName,
bool &  _bModified,
bool &  _bNew,
const ORowSetValueVector _aParameterValueForCache,
const OUString &  i_sRowSetFilter,
sal_Int32  i_nMaxRows 
)

◆ ~ORowSetCache()

ORowSetCache::~ORowSetCache ( )

Definition at line 340 of file RowSetCache.cxx.

References m_aUpdateTable, m_pInsertMatrix, m_pMatrix, m_xCacheSet, m_xMetaData, and m_xSet.

Member Function Documentation

◆ absolute()

bool ORowSetCache::absolute ( sal_Int32  row)

◆ afterLast()

void ORowSetCache::afterLast ( )

◆ beforeFirst()

void ORowSetCache::beforeFirst ( )

◆ calcPosition()

ORowSetMatrix::iterator ORowSetCache::calcPosition ( ) const
private

◆ cancelRowModification()

void ORowSetCache::cancelRowModification ( )
protected

Definition at line 1303 of file RowSetCache.cxx.

References m_aCacheIterators, m_aInsertRow, m_pMatrix, and resetInsertRow().

Referenced by refreshRow().

◆ cancelRowUpdates()

void ORowSetCache::cancelRowUpdates ( )

Definition at line 1371 of file RowSetCache.cxx.

References m_aMatrixIter, m_bModified, m_bNew, m_nPosition, and m_xCacheSet.

◆ checkInnerJoin()

bool ORowSetCache::checkInnerJoin ( const ::connectivity::OSQLParseNode pNode,
const css::uno::Reference< css::sdbc::XConnection > &  _xConnection,
const OUString &  _sUpdateTableName 
)
private

◆ checkJoin()

bool ORowSetCache::checkJoin ( const css::uno::Reference< css::sdbc::XConnection > &  _xConnection,
const css::uno::Reference< css::sdb::XSingleSelectQueryAnalyzer > &  _xComposer,
const OUString &  _sUpdateTableName 
)
private

◆ checkPositionFlags()

void ORowSetCache::checkPositionFlags ( )
private

Definition at line 1489 of file RowSetCache.cxx.

References m_bAfterLast, m_bRowCountFinal, m_nPosition, and m_nRowCount.

Referenced by absolute(), moveToBookmark(), next(), and previous().

◆ checkUpdateConditions()

void ORowSetCache::checkUpdateConditions ( sal_Int32  columnIndex)
private

◆ clearInsertRow()

void ORowSetCache::clearInsertRow ( )
private

Definition at line 1607 of file RowSetCache.cxx.

References m_aInsertRow, and m_pInsertMatrix.

Referenced by resetInsertRow().

◆ compareBookmarks()

sal_Int32 ORowSetCache::compareBookmarks ( const css::uno::Any &  first,
const css::uno::Any &  second 
)

Definition at line 524 of file RowSetCache.cxx.

References m_xCacheSet.

◆ createIterator()

ORowSetCacheIterator ORowSetCache::createIterator ( ORowSetBase _pRowSet)

Definition at line 1410 of file RowSetCache.cxx.

References aHelper, m_aCacheIterators, m_pMatrix, and ORowSetCacheIterator.

◆ deleteIterator()

void ORowSetCache::deleteIterator ( const ORowSetBase _pRowSet)

Definition at line 1418 of file RowSetCache.cxx.

References m_aCacheIterators.

◆ deleteRow()

bool ORowSetCache::deleteRow ( )

◆ deregisterOldRow()

void ORowSetCache::deregisterOldRow ( const TORowSetOldRowHelperRef _rRow)

Definition at line 1637 of file RowSetCache.cxx.

References m_aOldRows.

◆ fill()

bool ORowSetCache::fill ( ORowSetMatrix::iterator &  _aIter,
const ORowSetMatrix::const_iterator &  _aEnd,
sal_Int32 &  _nPos,
bool  _bCheck 
)
private

Definition at line 1660 of file RowSetCache.cxx.

References _nPos, m_aOldRows, m_xCacheSet, and m_xMetaData.

Referenced by moveWindow().

◆ fillMatrix()

bool ORowSetCache::fillMatrix ( sal_Int32 &  _nNewStartPos,
sal_Int32 &  _nNewEndPos 
)
private

◆ first()

bool ORowSetCache::first ( )

◆ getBookmark()

Any ORowSetCache::getBookmark ( )

◆ getEnd()

const ORowSetMatrix::iterator & dbaccess::ORowSetCache::getEnd ( ) const
inlineprotected

Definition at line 110 of file RowSetCache.hxx.

References m_aMatrixEnd.

◆ getKeyColumns()

const std::map< sal_Int32, sal_Int32 > & dbaccess::ORowSetCache::getKeyColumns ( ) const
inline

Definition at line 184 of file RowSetCache.hxx.

References m_aKeyColumns.

◆ getMetaData()

const css::uno::Reference< css::sdbc::XResultSetMetaData > & dbaccess::ORowSetCache::getMetaData ( ) const
inline

Definition at line 137 of file RowSetCache.hxx.

References m_xMetaData.

Referenced by reset().

◆ getRow()

sal_Int32 ORowSetCache::getRow ( ) const

Definition at line 1119 of file RowSetCache.cxx.

References isAfterLast(), isBeforeFirst(), and m_nPosition.

◆ hashBookmark()

sal_Int32 ORowSetCache::hashBookmark ( const css::uno::Any &  bookmark)

Definition at line 534 of file RowSetCache.cxx.

References m_xCacheSet.

◆ hasOrderedBookmarks()

bool ORowSetCache::hasOrderedBookmarks ( )

Definition at line 529 of file RowSetCache.cxx.

References m_xCacheSet.

◆ impl_updateRowFromCache_throw()

void ORowSetCache::impl_updateRowFromCache_throw ( ORowSetValueVector::Vector io_aRow,
std::vector< sal_Int32 > const &  o_ChangedColumns 
)
private

◆ insertRow()

bool ORowSetCache::insertRow ( std::vector< css::uno::Any > &  o_aBookmarks)

◆ isAfterLast()

bool dbaccess::ORowSetCache::isAfterLast ( ) const
inline

Definition at line 160 of file RowSetCache.hxx.

References m_bAfterLast.

Referenced by deleteRow(), getRow(), next(), refreshRow(), relative(), and updateRow().

◆ isBeforeFirst()

bool dbaccess::ORowSetCache::isBeforeFirst ( ) const
inline

Definition at line 159 of file RowSetCache.hxx.

References m_bBeforeFirst.

Referenced by deleteRow(), getRow(), previous(), relative(), and updateRow().

◆ isFirst()

bool ORowSetCache::isFirst ( ) const

Definition at line 668 of file RowSetCache.cxx.

References m_nPosition.

◆ isLast()

bool ORowSetCache::isLast ( ) const

Definition at line 673 of file RowSetCache.cxx.

References m_nPosition, and m_nRowCount.

◆ isResultSetChanged()

bool ORowSetCache::isResultSetChanged ( ) const

Definition at line 1681 of file RowSetCache.cxx.

References m_xCacheSet.

◆ last()

bool ORowSetCache::last ( )

◆ moveRelativeToBookmark()

bool ORowSetCache::moveRelativeToBookmark ( const css::uno::Any &  bookmark,
sal_Int32  rows 
)

◆ moveToBookmark()

bool ORowSetCache::moveToBookmark ( const css::uno::Any &  bookmark)

◆ moveToInsertRow()

void ORowSetCache::moveToInsertRow ( )

Definition at line 1389 of file RowSetCache.cxx.

References i, m_aInsertRow, m_bAfterLast, m_bNew, m_pInsertMatrix, and m_xMetaData.

◆ moveWindow()

void ORowSetCache::moveWindow ( )
private

◆ next()

bool ORowSetCache::next ( )

◆ previous()

bool ORowSetCache::previous ( )

◆ reFillMatrix()

bool ORowSetCache::reFillMatrix ( sal_Int32  _nNewStartPos,
sal_Int32  nNewEndPos 
)
private

Definition at line 1645 of file RowSetCache.cxx.

References fillMatrix(), m_aOldRows, m_nEndPos, m_nStartPos, and rotateAllCacheIterators().

Referenced by moveWindow(), and reset().

◆ refreshRow()

void ORowSetCache::refreshRow ( )

◆ registerOldRow()

TORowSetOldRowHelperRef ORowSetCache::registerOldRow ( )

Definition at line 1630 of file RowSetCache.cxx.

References m_aOldRows.

◆ relative()

bool ORowSetCache::relative ( sal_Int32  rows)

◆ reset()

void ORowSetCache::reset ( const css::uno::Reference< css::sdbc::XResultSet > &  _xDriverSet)

◆ resetInsertRow()

void ORowSetCache::resetInsertRow ( bool  _bClearInsertRow)

Definition at line 1295 of file RowSetCache.cxx.

References clearInsertRow(), m_bModified, and m_bNew.

Referenced by cancelRowModification().

◆ rotateAllCacheIterators()

void ORowSetCache::rotateAllCacheIterators ( )
private

Definition at line 1462 of file RowSetCache.cxx.

References m_aCacheIterators, m_bModified, and m_pMatrix.

Referenced by reFillMatrix().

◆ rotateCacheIterator()

void ORowSetCache::rotateCacheIterator ( ORowSetMatrix::difference_type  _nDist)
private

Definition at line 1432 of file RowSetCache.cxx.

References m_aCacheIterators, m_bModified, and m_pMatrix.

Referenced by moveWindow().

◆ rowInserted()

bool ORowSetCache::rowInserted ( )

Definition at line 1254 of file RowSetCache.cxx.

References m_xCacheSet.

Referenced by insertRow().

◆ rowUpdated()

bool ORowSetCache::rowUpdated ( )

Definition at line 1249 of file RowSetCache.cxx.

References m_xCacheSet.

◆ setFetchSize()

void ORowSetCache::setFetchSize ( sal_Int32  _nSize)

◆ setUpdateIterator()

void ORowSetCache::setUpdateIterator ( const ORowSetMatrix::iterator &  _rOriginalRow)

Definition at line 1477 of file RowSetCache.cxx.

References m_aInsertRow, m_pInsertMatrix, and m_xMetaData.

◆ updateCharacterStream()

void ORowSetCache::updateCharacterStream ( sal_Int32  columnIndex,
const css::uno::Reference< css::io::XInputStream > &  x,
sal_Int32  length,
ORowSetValueVector::Vector io_aRow,
std::vector< sal_Int32 > &  o_ChangedColumns 
)

◆ updateNull()

void ORowSetCache::updateNull ( sal_Int32  columnIndex,
ORowSetValueVector::Vector io_aRow,
std::vector< sal_Int32 > &  o_ChangedColumns 
)

◆ updateNumericObject()

void ORowSetCache::updateNumericObject ( sal_Int32  columnIndex,
const css::uno::Any &  x,
ORowSetValueVector::Vector io_aRow,
std::vector< sal_Int32 > &  o_ChangedColumns 
)

◆ updateObject()

void ORowSetCache::updateObject ( sal_Int32  columnIndex,
const css::uno::Any &  x,
ORowSetValueVector::Vector io_aRow,
std::vector< sal_Int32 > &  o_ChangedColumns 
)

◆ updateRow()

void ORowSetCache::updateRow ( ORowSetMatrix::iterator const &  _rUpdateRow,
std::vector< css::uno::Any > &  o_aBookmarks 
)

◆ updateValue()

void ORowSetCache::updateValue ( sal_Int32  columnIndex,
const connectivity::ORowSetValue x,
ORowSetValueVector::Vector io_aRow,
std::vector< sal_Int32 > &  o_ChangedColumns 
)
private

Friends And Related Function Documentation

◆ ORowSet

friend class ORowSet
friend

Definition at line 40 of file RowSetCache.hxx.

◆ ORowSetBase

friend class ORowSetBase
friend

Definition at line 39 of file RowSetCache.hxx.

◆ ORowSetCacheIterator

friend class ORowSetCacheIterator
friend

Definition at line 42 of file RowSetCache.hxx.

Referenced by createIterator().

◆ ORowSetClone

friend class ORowSetClone
friend

Definition at line 41 of file RowSetCache.hxx.

Member Data Documentation

◆ m_aCacheIterators

ORowSetCacheMap dbaccess::ORowSetCache::m_aCacheIterators
private

◆ m_aContext

css::uno::Reference< css::uno::XComponentContext> dbaccess::ORowSetCache::m_aContext
private

Definition at line 50 of file RowSetCache.hxx.

Referenced by checkJoin(), and ORowSetCache().

◆ m_aInsertRow

ORowSetMatrix::iterator dbaccess::ORowSetCache::m_aInsertRow
private

◆ m_aKeyColumns

std::map<sal_Int32,sal_Int32> dbaccess::ORowSetCache::m_aKeyColumns
private

Definition at line 46 of file RowSetCache.hxx.

Referenced by getKeyColumns(), and ORowSetCache().

◆ m_aMatrixEnd

ORowSetMatrix::iterator dbaccess::ORowSetCache::m_aMatrixEnd
private

Definition at line 56 of file RowSetCache.hxx.

Referenced by getEnd(), and setFetchSize().

◆ m_aMatrixIter

ORowSetMatrix::iterator dbaccess::ORowSetCache::m_aMatrixIter
private

◆ m_aOldRows

TOldRowSetRows dbaccess::ORowSetCache::m_aOldRows
private

Definition at line 58 of file RowSetCache.hxx.

Referenced by deregisterOldRow(), fill(), reFillMatrix(), and registerOldRow().

◆ m_aUpdateTable

connectivity::OSQLTable dbaccess::ORowSetCache::m_aUpdateTable
private

Definition at line 63 of file RowSetCache.hxx.

Referenced by deleteRow(), insertRow(), ORowSetCache(), updateRow(), and ~ORowSetCache().

◆ m_bAfterLast

bool dbaccess::ORowSetCache::m_bAfterLast
private

◆ m_bBeforeFirst

bool dbaccess::ORowSetCache::m_bBeforeFirst
private

◆ m_bModified

bool& dbaccess::ORowSetCache::m_bModified
private

◆ m_bNew

bool& dbaccess::ORowSetCache::m_bNew
private

◆ m_bRowCountFinal

bool dbaccess::ORowSetCache::m_bRowCountFinal
private

◆ m_nEndPos

sal_Int32 dbaccess::ORowSetCache::m_nEndPos
private

Definition at line 71 of file RowSetCache.hxx.

Referenced by fillMatrix(), moveWindow(), reFillMatrix(), reset(), and setFetchSize().

◆ m_nFetchSize

sal_Int32 dbaccess::ORowSetCache::m_nFetchSize
private

Definition at line 65 of file RowSetCache.hxx.

Referenced by fillMatrix(), moveWindow(), and setFetchSize().

◆ m_nPosition

sal_Int32 dbaccess::ORowSetCache::m_nPosition
private

◆ m_nPrivileges

sal_Int32 dbaccess::ORowSetCache::m_nPrivileges
private

Definition at line 67 of file RowSetCache.hxx.

Referenced by ORowSetCache().

◆ m_nRowCount

sal_Int32 dbaccess::ORowSetCache::m_nRowCount
private

◆ m_nStartPos

sal_Int32 dbaccess::ORowSetCache::m_nStartPos
private

◆ m_pInsertMatrix

std::unique_ptr<ORowSetMatrix> dbaccess::ORowSetCache::m_pInsertMatrix
private

◆ m_pMatrix

std::unique_ptr<ORowSetMatrix> dbaccess::ORowSetCache::m_pMatrix
private

◆ m_xCacheSet

rtl::Reference<OCacheSet> dbaccess::ORowSetCache::m_xCacheSet
private

◆ m_xMetaData

css::uno::Reference< css::sdbc::XResultSetMetaData > dbaccess::ORowSetCache::m_xMetaData
private

◆ m_xSet

css::uno::WeakReference< css::sdbc::XResultSet> dbaccess::ORowSetCache::m_xSet
private

Definition at line 48 of file RowSetCache.hxx.

Referenced by checkUpdateConditions(), getBookmark(), reset(), and ~ORowSetCache().


The documentation for this class was generated from the following files: