namespace Tizen { namespace App
{
+class _SqlDataControlImpl;
+class _MapDataControlImpl;
+
class _DataControlRequestInfo
: public Tizen::Base::Object
{
public:
_DataControlRequestInfo(Tizen::Base::Runtime::Event* pEvent)
+ : __pEvent(null)
+ , __pSqlDcImpl(null)
+ , __pMapDcImpl(null)
{
__pEvent = pEvent;
}
{
return __pEvent;
}
-private:
- _DataControlRequestInfo(void)
- : __pEvent(null)
+
+ void SetSqlDataControlImpl(_SqlDataControlImpl* pSqlDcImpl)
{
+ __pSqlDcImpl = pSqlDcImpl;
}
+
+ void SetMapDataControlImpl(_MapDataControlImpl* pMapDcImpl)
+ {
+ __pMapDcImpl = pMapDcImpl;
+ }
+
+ _SqlDataControlImpl* GetSqlDataControlImpl(void)
+ {
+ return __pSqlDcImpl;
+ }
+
+ _MapDataControlImpl* GetMapDataControlImpl(void)
+ {
+ return __pMapDcImpl;
+ }
+
+private:
+ _DataControlRequestInfo(void);
+
private:
Tizen::Base::Runtime::Event* __pEvent;
+ _SqlDataControlImpl* __pSqlDcImpl;
+ _MapDataControlImpl* __pMapDcImpl;
};
class _DataControlManager
#include <FBaseInteger.h>
#include <FBaseString.h>
+#include <FBaseColLinkedList.h>
#include <FBaseRtIEventArg.h>
#include <FIoFile.h>
#include <FAppMapDataControl.h>
: public Event
{
protected:
- virtual void FireImpl(IEventListener& listener, const IEventArg& arg);
+ virtual void FireImpl(IEventListener& listener, const IEventArg& arg);
};
void
_MapDataControlImpl::~_MapDataControlImpl(void)
{
delete __pMapDataControlEvent;
+
+ _DataControlManager* pDcMgr = _DataControlManager::GetInstance();
+
+ IEnumerator* pEnum = __pRequestList->GetEnumeratorN();
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ Integer* pReqId = dynamic_cast< Integer* >(pEnum->GetCurrent());
+ if (pReqId != null)
+ {
+ pDcMgr->RemoveRequestInfo(*pReqId);
+ }
+ }
+ delete __pRequestList;
}
_MapDataControlImpl*
"[E_OUT_OF_MEMORY] The memory is insufficient");
pReqInfo = new (std::nothrow) _DataControlRequestInfo(__pMapDataControlEvent);
- SysTryCatch(NID_APP, pReqId != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
+ SysTryCatch(NID_APP, pReqInfo != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
"[E_OUT_OF_MEMORY] The memory is insufficient");
+ pReqInfo->SetMapDataControlImpl(this);
r = pDcMgr->AddRequestInfo(pReqId, pReqInfo);
SysTryCatch(NID_APP, !IsFailed(r), r = E_SYSTEM, E_SYSTEM, "[%s] Failed to add request info", GetErrorMessage(r));
return r;
}
+ __pRequestList->Add(new (std::nothrow) Integer(req));
+
if (pReq)
{
*pReq = req;
}
_MapDataControlEvent* pMapDataControlEvent = dynamic_cast< _MapDataControlEvent* >(pReqInfo->GetEvent());
- SysTryCatch(NID_APP, pMapDataControlEvent != null, r = E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] invalid request info");
+ SysTryCatch(NID_APP, pMapDataControlEvent != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request info");
+
+ pDcMgr->RemoveRequestInfo(key);
+
+ _MapDataControlImpl* pDcImpl = pReqInfo->GetMapDataControlImpl();
+ SysTryCatch(NID_APP, pDcImpl != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request info");
+ pDcImpl->__pRequestList->Remove(key);
// Remove the request from the queue
SysLog(NID_APP, "Remove the request, req: %d", reqId);
- pDcMgr->RemoveRequestInfo(key);
-
if (pMapDataControlEvent != null && typeid(pMapDataControlEvent) == typeid(_MapDataControlEvent*))
{
SysTryReturn(NID_APP, pDc != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient");
_MapDataControlImpl* pDcImpl = _MapDataControlImpl::GetInstance(*pDc);
+ pDcImpl->__appId = appId;
+ pDcImpl->__providerId = providerId;
unique_ptr<_MapDataControlEvent> pMapDataControlEvent(new (std::nothrow) _MapDataControlEvent);
SysTryReturn(NID_IO, pMapDataControlEvent != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ pDcImpl->__pRequestList = new (std::nothrow) LinkedList(SingleObjectDeleter);
+ SysTryReturn(NID_IO, pDcImpl->__pRequestList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+
pDcImpl->__pMapDataControlEvent = pMapDataControlEvent.release();
- pDcImpl->__appId = appId;
- pDcImpl->__providerId = providerId;
if (access == L"readonly")
{
{
namespace Collection
{
+class LinkedList;
class IList;
}
}}
int __access;
IMapDataControlResponseListener* __pPreviousListener;
Tizen::Base::Runtime::Event* __pMapDataControlEvent;
+ Tizen::Base::Collection::LinkedList* __pRequestList;
friend class MapDataControl;
friend class _AppManagerImpl;
#include <FBaseInteger.h>
#include <FBaseString.h>
#include <FBaseLongLong.h>
+#include <FBaseColLinkedList.h>
#include <FBaseColIList.h>
#include <FBaseColIMap.h>
#include <FBaseColIMapEnumerator.h>
: public Event
{
protected:
- virtual void FireImpl(IEventListener& listener, const IEventArg& arg);
+ virtual void FireImpl(IEventListener& listener, const IEventArg& arg);
};
void
_SqlDataControlImpl::~_SqlDataControlImpl(void)
{
delete __pSqlDataControlEvent;
+
+ _DataControlManager* pDcMgr = _DataControlManager::GetInstance();
+
+ IEnumerator* pEnum = __pRequestList->GetEnumeratorN();
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ Integer* pReqId = dynamic_cast< Integer* >(pEnum->GetCurrent());
+ if (pReqId != null)
+ {
+ pDcMgr->RemoveRequestInfo(*pReqId);
+ }
+ }
+ delete __pRequestList;
}
_SqlDataControlImpl*
"[E_OUT_OF_MEMORY] The memory is insufficient");
pReqInfo = new (std::nothrow) _DataControlRequestInfo(__pSqlDataControlEvent);
- SysTryCatch(NID_APP, pReqId != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
+ SysTryCatch(NID_APP, pReqInfo != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
"[E_OUT_OF_MEMORY] The memory is insufficient");
+ pReqInfo->SetSqlDataControlImpl(this);
r = pDcMgr->AddRequestInfo(pReqId, pReqInfo);
SysTryCatch(NID_APP, !IsFailed(r), r = E_SYSTEM, E_SYSTEM, "[%s] Failed to add request info", GetErrorMessage(r));
return r;
}
+ __pRequestList->Add(new (std::nothrow) Integer(req));
+
if (pReq)
{
*pReq = req;
}
_SqlDataControlEvent* pSqlDataControlEvent = dynamic_cast< _SqlDataControlEvent* >(pReqInfo->GetEvent());
- SysTryCatch(NID_APP, pSqlDataControlEvent != null, r = E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] invalid request info");
+ SysTryCatch(NID_APP, pSqlDataControlEvent != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request info");
+
+ pDcMgr->RemoveRequestInfo(key);
+
+ _SqlDataControlImpl* pDcImpl = pReqInfo->GetSqlDataControlImpl();
+ SysTryCatch(NID_APP, pDcImpl != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request info");
+ pDcImpl->__pRequestList->Remove(key);
// Remove the request from the queue
SysLog(NID_APP, "Remove the request, req: %d", reqId);
- pDcMgr->RemoveRequestInfo(key);
-
if (pSqlDataControlEvent != null && typeid(pSqlDataControlEvent) == typeid(_SqlDataControlEvent*))
{
// result list
unique_ptr<_SqlDataControlEvent> pSqlDataControlEvent(new (std::nothrow) _SqlDataControlEvent);
SysTryReturn(NID_IO, pSqlDataControlEvent != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ pDcImpl->__pRequestList = new (std::nothrow) LinkedList(SingleObjectDeleter);
+ SysTryReturn(NID_IO, pDcImpl->__pRequestList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+
pDcImpl->__pSqlDataControlEvent = pSqlDataControlEvent.release();
if (access == L"readonly")
{
namespace Collection
{
+class LinkedList;
class IList;
class IMap;
}
int __access;
ISqlDataControlResponseListener* __pPreviousListener;
Tizen::Base::Runtime::Event* __pSqlDataControlEvent;
+ Tizen::Base::Collection::LinkedList* __pRequestList;
friend class SqlDataControl;
friend class _AppManagerImpl;