Change-Id: I4ec0fc51db6d9fe22c3d345843f0eb8f11e54e7c
__pCurrentRow(null),
__columnCount(0),
__rowCount(0),
__pCurrentRow(null),
__columnCount(0),
__rowCount(0),
+ __currentRowIndex(-1),
+ __dataSetDeleted(0)
{
}
_DataSetEnumeratorImpl::~_DataSetEnumeratorImpl(void)
{
{
}
_DataSetEnumeratorImpl::~_DataSetEnumeratorImpl(void)
{
+ if (__dataSetDeleted == 0)
+ {
+ __pEnumImplList->Remove(*this);
+ }
}
result
_DataSetEnumeratorImpl::MoveNext(void)
{
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
}
result
_DataSetEnumeratorImpl::MoveNext(void)
{
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
if (__currentRowIndex +1 == __rowCount)
return E_OUT_OF_RANGE;
if (__currentRowIndex +1 == __rowCount)
return E_OUT_OF_RANGE;
_DataSetEnumeratorImpl::MovePrevious(void)
{
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
_DataSetEnumeratorImpl::MovePrevious(void)
{
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
if (__currentRowIndex == 0)
return E_OUT_OF_RANGE;
if (__currentRowIndex == 0)
return E_OUT_OF_RANGE;
_DataSetEnumeratorImpl::MoveFirst(void)
{
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
_DataSetEnumeratorImpl::MoveFirst(void)
{
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
__currentRowIndex = 0;
__pCurrentRow = static_cast<ArrayList*>(__pDataSet->GetAt(__currentRowIndex));
__currentRowIndex = 0;
__pCurrentRow = static_cast<ArrayList*>(__pDataSet->GetAt(__currentRowIndex));
_DataSetEnumeratorImpl::MoveLast(void)
{
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
_DataSetEnumeratorImpl::MoveLast(void)
{
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
__currentRowIndex = __rowCount -1;
__pCurrentRow = static_cast<ArrayList*>(__pDataSet->GetAt(__currentRowIndex));
__currentRowIndex = __rowCount -1;
__pCurrentRow = static_cast<ArrayList*>(__pDataSet->GetAt(__currentRowIndex));
_DataSetEnumeratorImpl::Reset(void)
{
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
_DataSetEnumeratorImpl::Reset(void)
{
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
__currentRowIndex = -1;
__pCurrentRow = null;
__currentRowIndex = -1;
__pCurrentRow = null;
result r = E_SUCCESS;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
result r = E_SUCCESS;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
result r = E_SUCCESS;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
result r = E_SUCCESS;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
result r = E_SUCCESS;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
result r = E_SUCCESS;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
result r = E_SUCCESS;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
result r = E_SUCCESS;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
ByteBuffer* pBuffer = null;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
ByteBuffer* pBuffer = null;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
ByteBuffer* pBuffer = null;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
ByteBuffer* pBuffer = null;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
String* pStr = null;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
String* pStr = null;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The instance is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
int
_DataSetEnumeratorImpl::GetColumnCount(void) const
{
int
_DataSetEnumeratorImpl::GetColumnCount(void) const
{
- SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ SysTryReturn(NID_IO, __pDataSet != null, -1, E_INVALID_STATE,
+ "[E_INVALID_STATE] The Object is not constructed.");
+ SysTryReturn(NID_IO, __dataSetDeleted != 1, -1, E_INVALID_STATE,
+ "[E_INVALID_STATE] The dataset is already been deleted.");
DbColumnType type = DB_COLUMNTYPE_UNDEFINED;
SysTryReturn(NID_IO, __pDataSet != null, DB_COLUMNTYPE_UNDEFINED, E_INVALID_STATE,
DbColumnType type = DB_COLUMNTYPE_UNDEFINED;
SysTryReturn(NID_IO, __pDataSet != null, DB_COLUMNTYPE_UNDEFINED, E_INVALID_STATE,
- "[E_INVALID_STATE] The instance is not constructed or the dataset is already been deleted.");
-
+ "[E_INVALID_STATE] The instance is not constructed.");
+ SysTryReturn(NID_IO, __dataSetDeleted != 1, DB_COLUMNTYPE_UNDEFINED, E_INVALID_STATE,
+ "[E_INVALID_STATE] The dataset is already been deleted.");
SysTryReturn(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, DB_COLUMNTYPE_UNDEFINED, E_INVALID_ARG,
"[E_INVALID_ARG] Given column index is out of range.");
SysTryReturn(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, DB_COLUMNTYPE_UNDEFINED, E_INVALID_ARG,
"[E_INVALID_ARG] Given column index is out of range.");
_DataSetEnumeratorImpl::GetColumnName(int columnIndex) const
{
SysTryReturn(NID_IO, __pDataSet != null, null, E_INVALID_STATE,
_DataSetEnumeratorImpl::GetColumnName(int columnIndex) const
{
SysTryReturn(NID_IO, __pDataSet != null, null, E_INVALID_STATE,
- "[E_INVALID_STATE] The instance is not constructed or the dataset is already been deleted.");
-
+ "[E_INVALID_STATE] The instance is not constructed.");
+ SysTryReturn(NID_IO, __dataSetDeleted != 1, null, E_INVALID_STATE,
+ "[E_INVALID_STATE] The dataset is already been deleted.");
SysTryReturn(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, null, E_INVALID_ARG,
"[E_INVALID_ARG] Given column index is out of range.");
SysTryReturn(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, null, E_INVALID_ARG,
"[E_INVALID_ARG] Given column index is out of range.");
int bytes = 0;
SysTryReturn(NID_IO, __pDataSet != null, -1, E_INVALID_STATE,
int bytes = 0;
SysTryReturn(NID_IO, __pDataSet != null, -1, E_INVALID_STATE,
- "[E_INVALID_STATE] The instance is not constructed or the dataset is already been deleted.");
-
+ "[E_INVALID_STATE] The instance is not constructed.");
+ SysTryReturn(NID_IO, __dataSetDeleted != 1, -1, E_INVALID_STATE,
+ "[E_INVALID_STATE] The dataset is already been deleted.");
SysTryReturn(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, -1, E_INVALID_ARG,
"[E_INVALID_ARG] Given column index is out of range.");
SysTryReturn(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, -1, E_INVALID_ARG,
"[E_INVALID_ARG] Given column index is out of range.");
SysTryReturn(NID_IO, __pCurrentRow != null, -1, E_INVALID_STATE,
"[E_INVALID_STATE] The method has tried to fetch the column data of a result set that is not activated.");
SysTryReturn(NID_IO, __pCurrentRow != null, -1, E_INVALID_STATE,
"[E_INVALID_STATE] The method has tried to fetch the column data of a result set that is not activated.");
_DataSetImpl::~_DataSetImpl(void)
{
_DataSetImpl::~_DataSetImpl(void)
{
+ for (int i = 0; i< __enumImplList.GetCount() ; i++)
+ (static_cast<_DataSetEnumeratorImpl*>(__enumImplList.GetAt(i)))->__dataSetDeleted = 1;
+
delete __pDataSet;
delete __pColumnList;
delete __pColumnTypeList;
delete __pDataSet;
delete __pColumnList;
delete __pColumnTypeList;
DataSetEnumerator*
_DataSetImpl::GetDataSetEnumeratorN(void)
{
DataSetEnumerator*
_DataSetImpl::GetDataSetEnumeratorN(void)
{
unique_ptr<DataSetEnumerator> pDataSetEnum(_DataSetEnumeratorImpl::CreateDataSetEnumeratorInstanceN());
_DataSetEnumeratorImpl::GetInstance(*pDataSetEnum)->__pDataSet = __pDataSet;
unique_ptr<DataSetEnumerator> pDataSetEnum(_DataSetEnumeratorImpl::CreateDataSetEnumeratorInstanceN());
_DataSetEnumeratorImpl::GetInstance(*pDataSetEnum)->__pDataSet = __pDataSet;
//SysLog(NID_IO, "row count is %d, column count is %d", __rowCount, __columnCount);
//SysLog(NID_IO, "row count is %d, column count is %d", __rowCount, __columnCount);
+ r = __enumImplList.Add(_DataSetEnumeratorImpl::GetInstance(*pDataSetEnum));
+ SysTryReturn(NID_IO, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Add to LinkedList Falied");
+
+ _DataSetEnumeratorImpl::GetInstance(*pDataSetEnum)->__pEnumImplList = &__enumImplList;
+
return pDataSetEnum.release();
}
return pDataSetEnum.release();
}
Tizen::Base::Collection::ArrayList* __pCurrentRow;
int __columnCount;
Tizen::Base::Collection::ArrayList* __pCurrentRow;
int __columnCount;
+ int __dataSetDeleted;
+ Tizen::Base::Collection::LinkedList* __pEnumImplList;
friend class _DataSetImpl;
}; // _DataSetEnumeratorImpl
friend class _DataSetImpl;
}; // _DataSetEnumeratorImpl
int __columnCount;
int __rowCount;
int __columnCount;
int __rowCount;
+
+ Tizen::Base::Collection::LinkedList __enumImplList;
}; // _DataSetImpl
}} // Tizen::Io
}; // _DataSetImpl
}} // Tizen::Io