1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: RowSetRow.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef DBACCESS_CORE_API_ROWSETROW_HXX
31 #define DBACCESS_CORE_API_ROWSETROW_HXX
34 #include <vos/ref.hxx>
36 #ifndef _CONNECTIVITY_COMMONTOOLS_HXX_
37 #include <connectivity/CommonTools.hxx>
39 #ifndef _CONNECTIVITY_FILE_VALUE_HXX_
40 #include "connectivity/FValue.hxx"
42 #ifndef _COMPHELPER_TYPES_HXX_
43 #include <comphelper/types.hxx>
48 typedef connectivity::ORowVector
< connectivity::ORowSetValue
> ORowSetValueVector
;
49 typedef ::vos::ORef
< ORowSetValueVector
> ORowSetRow
;
50 typedef ::std::vector
< ORowSetRow
> ORowSetMatrix
;
52 class ORowSetOldRowHelper
54 oslInterlockedCount m_refCount
;
57 ORowSetOldRowHelper
& operator=(const ORowSetOldRowHelper
& _rRH
);
58 ORowSetOldRowHelper(const ORowSetOldRowHelper
& _rRh
);
60 ORowSetOldRowHelper() : m_refCount(0){}
61 ORowSetOldRowHelper(const ORowSetRow
& _rRow
)
65 // ORowSetOldRowHelper(const ORowSetOldRowHelper& _rRh)
67 // , m_aRow(_rRh.m_aRow)
72 osl_incrementInterlockedCount( &m_refCount
);
76 if (! osl_decrementInterlockedCount( &m_refCount
))
79 inline ORowSetRow
getRow() const { return m_aRow
; }
80 inline void clearRow() { m_aRow
= NULL
; }
81 inline void setRow(const ORowSetRow
& _rRow
) { m_aRow
= _rRow
; }
84 typedef ::vos::ORef
< ORowSetOldRowHelper
> TORowSetOldRowHelperRef
;
86 class ORowSetValueCompare
88 const ::com::sun::star::uno::Any
& m_rAny
;
90 ORowSetValueCompare(const ::com::sun::star::uno::Any
& _rAny
) : m_rAny(_rAny
){}
92 sal_Bool
operator ()(const ORowSetRow
& _rRH
)
94 switch((_rRH
->get())[0].getTypeKind())
96 case ::com::sun::star::sdbc::DataType::TINYINT
:
97 case ::com::sun::star::sdbc::DataType::SMALLINT
:
98 case ::com::sun::star::sdbc::DataType::INTEGER
:
99 return comphelper::getINT32(m_rAny
) == (sal_Int32
)(_rRH
->get())[0];
102 ::com::sun::star::uno::Sequence
<sal_Int8
> aSeq
;
104 return aSeq
== (_rRH
->get())[0];
110 #endif // DBACCESS_CORE_API_ROWSETROW_HXX