当前位置: 首页>>代码示例>>C++>>正文


C++ MessagePtr::release方法代码示例

本文整理汇总了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;
      }
    }
开发者ID:BackupTheBerlios,项目名称:pyasynchio-svn,代码行数:35,代码来源:TransactionController.hpp


示例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;
}
开发者ID:agx,项目名称:zarafa-debian,代码行数:47,代码来源:ECQuotaMonitor.cpp



注:本文中的MessagePtr::release方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。