#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")
{