bb2e1f2932a53057bcb7ce1d9d16c33ae5f11a49
[platform/framework/native/appfw.git] / src / io / inc / FIo_DataRowImpl.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        FIo_DataRowImpl.h
20  * @brief       This is the header file for the %_DataRowImpl class.
21  *
22  * This header file contains declarations of the %_DataRowImpl class.
23  */
24
25 #ifndef _FIO_INTERNAL_DATAROW_IMPL_H_
26 #define _FIO_INTERNAL_DATAROW_IMPL_H_
27
28 #include <unique_ptr.h>
29 #include <FIoDbTypes.h>
30 #include <FOspConfig.h>
31 #include <FBaseCol.h>
32 #include <FIoDataRow.h>
33
34 namespace Tizen { namespace Base
35 {
36 class String;
37 class ByteBuffer;
38 class DateTime;
39 }}
40
41 namespace Tizen { namespace Io
42 {
43
44 class _DataItem
45         : public Tizen::Base::Object
46 {
47 public:
48         _DataItem(void);
49         ~_DataItem(void);
50         virtual int GetHashCode(void) const;
51
52         DbColumnType type;
53         int size;
54         int intValue;
55         long long int64Value;
56         double doubleValue;
57         Tizen::Base::Object* pObj;
58 };
59
60
61 /**
62  * @class       _DataRowImpl
63  * @brief       This class implements the DataRow.
64  * @since 2.1
65  *
66  * @see Tizen::Io::DataRow
67  */
68 class _DataRowImpl
69         : public Tizen::Base::Object
70 {
71
72 public:
73         _DataRowImpl(void);
74
75         virtual ~_DataRowImpl(void);
76
77         result SetBlobAt(int columnIndex, Tizen::Base::ByteBuffer* pValue);
78
79         result SetDateTimeAt(int columnIndex, const Tizen::Base::DateTime& value);
80
81         result SetDoubleAt(int columnIndex, double value);
82
83         result SetIntAt(int columnIndex, int value);
84
85         result SetInt64At(int columnIndex, long long value);
86
87         result SetStringAt(int columnIndex, const Tizen::Base::String& value);
88
89         static int GetHashCode(const Tizen::Base::Collection::ArrayList* pRowArrayList);
90
91         static _DataRowImpl* GetInstance(DataRow& dataRow);
92
93         static const _DataRowImpl* GetInstance(const DataRow& dataRow);
94
95         static DataRow* CreateDataRowInstanceN(int columnCount, Tizen::Base::Collection::ArrayList* pArrayListRow);
96
97         Tizen::Base::Collection::ArrayList* GetRowArrayList(void) const;
98
99         result Clone(const Tizen::Base::Collection::ArrayList* pOthersRowArrayList) const;
100
101 private:
102         Tizen::Base::Collection::ArrayList* __pDataRow;
103         Tizen::Base::Collection::ArrayList* __pColumnTypeList;
104         int __columnCount;
105
106         bool __dataSetDeleted;
107         Tizen::Base::Collection::LinkedList* __pRowImplList;
108
109         friend class _DataSetImpl;
110
111 }; //_DataRowImpl
112
113 }} // Tizen::Io
114
115 #endif  //_FIO_INTERNAL_DATAROW_IMPL_H_
116