本文整理汇总了C++中MessagePtr::release方法的典型用法代码示例。如果您正苦于以下问题:C++ MessagePtr::release方法的具体用法?C++ MessagePtr::release怎么用?C++ MessagePtr::release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessagePtr
的用法示例。
在下文中一共展示了MessagePtr::release方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: m
void
api ()
{
if ((current_.status == Protocol::TS_COMMITED ||
current_.status == Protocol::TS_ABORTED) &&
separation_duration_ == 0) // no transaction in progress
{
// start new transaction
// Note that in_ is already locked by Scheduler
MessagePtr m (in_.front ());
in_.pop ();
if (typeid (*m) == typeid (Send))
{
send_ = SendPtr (dynamic_cast<Send*> (m.release ()));
}
else
{
// cerr << "Expecting Send but received " << typeid (*m).name ()
// << endl;
::abort ();
}
current_.id++;
current_.status = Protocol::TS_BEGIN;
initiated_ = true;
// if (trace_) cerr << "starting transaction with id " << current_.id
// << endl;
}
}
示例2: CheckQuotaInterval
/**
* Check the last mail time for the quota message.
*
* @param lpStore Store that is over quota
*
* @retval hrSuccess User should not receive quota message
* @retval MAPI_E_TIMEOUT User should receive quota message
* @return MAPI Error code
*/
HRESULT ECQuotaMonitor::CheckQuotaInterval(LPMDB lpStore, LPMESSAGE *lppMessage, bool *lpbTimeout)
{
HRESULT hr = hrSuccess;
MessagePtr ptrMessage;
SPropValuePtr ptrProp;
char *lpResendInterval = NULL;
ULONG ulResendInterval = 0;
FILETIME ft;
FILETIME ftNextRun;
hr = GetConfigMessage(lpStore, QUOTA_CONFIG_MSG, &ptrMessage);
if (hr != hrSuccess)
goto exit;
hr = HrGetOneProp(ptrMessage, PR_EC_QUOTA_MAIL_TIME, &ptrProp);
if (hr == MAPI_E_NOT_FOUND) {
*lppMessage = ptrMessage.release();
*lpbTimeout = true;
hr = hrSuccess;
goto exit;
}
if (hr != hrSuccess)
goto exit;
/* Determine when the last warning mail was send, and if a new one should be send. */
lpResendInterval = m_lpThreadMonitor->lpConfig->GetSetting("mailquota_resend_interval");
ulResendInterval = (lpResendInterval && atoui(lpResendInterval) > 0) ? atoui(lpResendInterval) : 1;
GetSystemTimeAsFileTime(&ft);
UnixTimeToFileTime(FileTimeToUnixTime(ptrProp->Value.ft.dwHighDateTime, ptrProp->Value.ft.dwLowDateTime) +
(ulResendInterval * 60 * 60 * 24) -(2 * 60), &ftNextRun);
*lppMessage = ptrMessage.release();
*lpbTimeout = (ft > ftNextRun);
exit:
return hr;
}