2 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
\r
4 // Licensed under the Apache License, Version 2.0 (the License);
\r
5 // you may not use this file except in compliance with the License.
\r
6 // You may obtain a copy of the License at
\r
8 // http://www.apache.org/licenses/LICENSE-2.0
\r
10 // Unless required by applicable law or agreed to in writing, software
\r
11 // distributed under the License is distributed on an "AS IS" BASIS,
\r
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 // See the License for the specific language governing permissions and
\r
14 // limitations under the License.
\r
18 * @file FIoDataSet.cpp
\r
19 * @brief This is the implementation file for the DataSet class.
\r
22 #include <unique_ptr.h>
\r
24 #include <FBaseResult.h>
\r
25 #include <FBaseSysLog.h>
\r
26 #include <FBase_NativeError.h>
\r
28 #include <FIoDataSet.h>
\r
29 #include <FIoDataRow.h>
\r
30 #include <FIoDataSetEnumerator.h>
\r
31 #include <FIo_DataSetImpl.h>
\r
34 using namespace std;
\r
35 using namespace Tizen::Base;
\r
36 using namespace Tizen::Base::Runtime;
\r
37 using namespace Tizen::System;
\r
39 namespace Tizen { namespace Io
\r
43 DataSet::DataSet(void)
\r
44 : __pDataSetImpl(null)
\r
48 DataSet::~DataSet(void)
\r
50 delete __pDataSetImpl;
\r
54 DataSet::Construct(const Tizen::Base::Collection::IList& columnNames)
\r
56 SysAssertf(__pDataSetImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
\r
59 unique_ptr<_DataSetImpl> pDataSetImpl(new (std::nothrow) _DataSetImpl);
\r
60 SysTryReturnResult(NID_IO, pDataSetImpl != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
\r
62 result r = pDataSetImpl->Construct(columnNames);
\r
63 SysTryReturn(NID_IO, !IsFailed(r), r, r, "[%s] Propagated.", GetErrorMessage(r));
\r
65 __pDataSetImpl = pDataSetImpl.release();
\r
71 DataSet::CreateDataRowN(void)
\r
73 SysAssertf(__pDataSetImpl != null, "Not yet constructed. Construct() should be called before use.\n");
\r
75 return __pDataSetImpl->CreateDataRowN();
\r
79 DataSet::GetDataSetEnumeratorN(void)
\r
81 SysAssertf(__pDataSetImpl != null, "Not yet constructed. Construct() should be called before use.\n");
\r
83 return __pDataSetImpl->GetDataSetEnumeratorN();
\r
87 DataSet::CloneN(void) const
\r
89 SysAssertf(__pDataSetImpl != null, "Not yet constructed. Construct() should be called before use.\n");
\r
91 return __pDataSetImpl->CloneN();
\r
95 DataSet::Equals(const Tizen::Base::Object& obj) const
\r
97 SysAssertf(__pDataSetImpl != null, "Not yet constructed. Construct() should be called before use.\n");
\r
99 return __pDataSetImpl->Equals(obj);
\r
103 DataSet::GetHashCode(void) const
\r
105 SysAssertf(__pDataSetImpl != null, "Not yet constructed. Construct() should be called before use.\n");
\r
107 return __pDataSetImpl->GetHashCode();
\r