• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ IsClosed函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中IsClosed函数的典型用法代码示例。如果您正苦于以下问题:C++ IsClosed函数的具体用法?C++ IsClosed怎么用?C++ IsClosed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了IsClosed函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Assert

    BackgroundJobProcessor::~BackgroundJobProcessor()
    {
        // This should appear to be called from the same thread from which this instance was created
        Assert(IsClosed());

        if (parallelThreadData)
        {
            for (unsigned int i = 0; i < this->threadCount; i++)
            {
                HeapDelete(parallelThreadData[i]);
            }
            HeapDeleteArray(this->maxThreadCount, parallelThreadData);
        }
    }
开发者ID:Rastaban,项目名称:ChakraCore,代码行数:14,代码来源:Jobs.cpp


示例2: promise

already_AddRefed<Promise>
MediaKeySession::Update(const ArrayBufferViewOrArrayBuffer& aResponse, ErrorResult& aRv)
{
  nsRefPtr<DetailedPromise> promise(MakePromise(aRv));
  if (aRv.Failed()) {
    return nullptr;
  }
  nsTArray<uint8_t> data;
  if (IsClosed() || !mKeys->GetCDMProxy()) {
    promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR,
                         NS_LITERAL_CSTRING("Session is closed or was not properly initialized"));
    EME_LOG("MediaKeySession[%p,'%s'] Update() failed, session is closed or was not properly initialised.",
            this, NS_ConvertUTF16toUTF8(mSessionId).get());
    return promise.forget();
  }
  if (!CopyArrayBufferViewOrArrayBufferData(aResponse, data)) {
    promise->MaybeReject(NS_ERROR_DOM_INVALID_ACCESS_ERR,
                         NS_LITERAL_CSTRING("Invalid response buffer"));
    EME_LOG("MediaKeySession[%p,'%s'] Update() failed, invalid response buffer",
            this, NS_ConvertUTF16toUTF8(mSessionId).get());
    return promise.forget();
  }


#ifdef PR_LOGGING
  // Convert response to base64 for easier logging.
  // Note: UpdateSession() Move()s the data out of the array, so we have
  // to copy it here.
  nsAutoCString base64Response;
  nsDependentCSubstring rawResponse(reinterpret_cast<const char*>(data.Elements()),
    data.Length());
  if (NS_FAILED(Base64Encode(rawResponse, base64Response))) {
    NS_WARNING("Failed to base64 encode response for logging");
  }
#endif

  PromiseId pid = mKeys->StorePromise(promise);
  mKeys->GetCDMProxy()->UpdateSession(mSessionId,
                                      pid,
                                      data);

  EME_LOG("MediaKeySession[%p,'%s'] Update() sent to CDM, "
          "promiseId=%d Response(base64)='%s'",
           this,
           NS_ConvertUTF16toUTF8(mSessionId).get(),
           pid,
           base64Response.get());

  return promise.forget();
}
开发者ID:nixiValor,项目名称:Waterfox,代码行数:50,代码来源:MediaKeySession.cpp


示例3: IsContinuous

bool ON_ArcCurve::IsContinuous(
    ON::continuity c,
    double t, 
    int*,   // hint                - formal parameter intentionally ignored in this virtual function
    double, // point_tolerance     - formal parameter intentionally ignored in this virtual function
    double, // d1_tolerance        - formal parameter intentionally ignored in this virtual function
    double, // d2_tolerance        - formal parameter intentionally ignored in this virtual function
    double, // cos_angle_tolerance - formal parameter intentionally ignored in this virtual function
    double  // curvature_tolerance - formal parameter intentionally ignored in this virtual function
    ) const
{
  // 20 March 2003 Dale Lear
  //      Added this override of IsContinuous() to
  //      speed queries and support the
  //      locus favors of ON::continuity.

  bool rc = true;

  if ( !IsClosed() )
  {
    switch(c)
    {
    case ON::unknown_continuity:
    case ON::C0_continuous:
    case ON::C1_continuous:
    case ON::C2_continuous:
    case ON::G1_continuous:
    case ON::G2_continuous:
    case ON::Cinfinity_continuous:
    case ON::Gsmooth_continuous:
      // rc = true;
      break;

    case ON::C0_locus_continuous:
    case ON::C1_locus_continuous:
    case ON::C2_locus_continuous:
    case ON::G1_locus_continuous:
    case ON::G2_locus_continuous:
      // open arc is locus discontinuous at end parameter.
      // By convention (see ON::continuity comments) it
      // is locus continuous at start parameter.
      if ( t >= Domain()[1] )
        rc = false;
      break;
    }
  }

  return rc;
}
开发者ID:Bastl34,项目名称:PCL,代码行数:49,代码来源:opennurbs_arc.cpp


示例4:

NS_IMETHODIMP
nsBaseContentStream::ReadSegments(nsWriteSegmentFun fun, void *closure,
                                  PRUint32 count, PRUint32 *result)
{
    *result = 0;

    if (mStatus == NS_BASE_STREAM_CLOSED)
        return NS_OK;

    // No data yet
    if (!IsClosed() && IsNonBlocking())
        return NS_BASE_STREAM_WOULD_BLOCK;

    return mStatus;
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:15,代码来源:nsBaseContentStream.cpp


示例5: IsAtSeam

int ON_Surface::IsAtSeam(double s, double t) const

{
  int rc = 0;
  int i;
  for (i=0; i<2; i++){
    if (!IsClosed(i))
      continue;
    double p = (i) ? t : s;
    if (p == Domain(i)[0] || p == Domain(i)[1])
      rc += (i+1);
  }

  return rc;
}
开发者ID:Bastl34,项目名称:PCL,代码行数:15,代码来源:opennurbs_surface.cpp


示例6: Assert

    void BackgroundJobProcessor::AddJob(Job *const job, const bool prioritize)
    {
        // This function is called from inside the lock

        Assert(job);
        Assert(managers.Contains(job->Manager()));
        Assert(!IsClosed());

        if(numJobs + 1 == 0)
            Js::Throw::OutOfMemory(); // Overflow: job counts we use are int32's.
        ++numJobs;

        __super::AddJob(job, prioritize);
        IndicateNewJob();
    }
开发者ID:dilijev,项目名称:ChakraCore,代码行数:15,代码来源:Jobs.cpp


示例7: promise

already_AddRefed<Promise>
MediaKeySession::Close(ErrorResult& aRv)
{
  nsRefPtr<Promise> promise(mKeys->MakePromise(aRv));
  if (aRv.Failed()) {
    return nullptr;
  }
  if (IsClosed() || !mKeys->GetCDMProxy()) {
    promise->MaybeResolve(JS::UndefinedHandleValue);
    return promise.forget();
  }
  mKeys->GetCDMProxy()->CloseSession(mSessionId, mKeys->StorePromise(promise));

  return promise.forget();
}
开发者ID:Andrel322,项目名称:gecko-dev,代码行数:15,代码来源:MediaKeySession.cpp


示例8: NS_ASSERTION

// static
IndexedDatabaseManager*
IndexedDatabaseManager::GetOrCreate()
{
  NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");

  if (IsClosed()) {
    NS_ERROR("Calling GetOrCreate() after shutdown!");
    return nullptr;
  }

  if (!gDBManager) {
    sIsMainProcess = XRE_IsParentProcess();

    if (sIsMainProcess && Preferences::GetBool("disk_space_watcher.enabled", false)) {
      // See if we're starting up in low disk space conditions.
      nsCOMPtr<nsIDiskSpaceWatcher> watcher =
        do_GetService(DISKSPACEWATCHER_CONTRACTID);
      if (watcher) {
        bool isDiskFull;
        if (NS_SUCCEEDED(watcher->GetIsDiskFull(&isDiskFull))) {
          sLowDiskSpaceMode = isDiskFull;
        }
        else {
          NS_WARNING("GetIsDiskFull failed!");
        }
      }
      else {
        NS_WARNING("No disk space watcher component available!");
      }
    }

    RefPtr<IndexedDatabaseManager> instance(new IndexedDatabaseManager());

    nsresult rv = instance->Init();
    NS_ENSURE_SUCCESS(rv, nullptr);

    if (gInitialized.exchange(true)) {
      NS_ERROR("Initialized more than once?!");
    }

    gDBManager = instance;

    ClearOnShutdown(&gDBManager);
  }

  return gDBManager;
}
开发者ID:MekliCZ,项目名称:positron,代码行数:48,代码来源:IndexedDatabaseManager.cpp


示例9: promise

already_AddRefed<Promise>
MediaKeySession::Close(ErrorResult& aRv)
{
  RefPtr<DetailedPromise> promise(MakePromise(aRv,
    NS_LITERAL_CSTRING("MediaKeySession.close")));
  if (aRv.Failed()) {
    return nullptr;
  }
  // 1. Let session be the associated MediaKeySession object.
  // 2. If session is closed, return a resolved promise.
  if (IsClosed()) {
    EME_LOG("MediaKeySession[%p,'%s'] Close() already closed",
            this, NS_ConvertUTF16toUTF8(mSessionId).get());
    promise->MaybeResolveWithUndefined();
    return promise.forget();
  }
  // 3. If session's callable value is false, return a promise rejected
  // with an InvalidStateError.
  if (!IsCallable()) {
    EME_LOG("MediaKeySession[%p,''] Close() called before sessionId set by CDM", this);
    promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR,
      NS_LITERAL_CSTRING("MediaKeySession.Close() called before sessionId set by CDM"));
    return promise.forget();
  }
  if (!mKeys->GetCDMProxy()) {
    EME_LOG("MediaKeySession[%p,'%s'] Close() null CDMProxy",
            this, NS_ConvertUTF16toUTF8(mSessionId).get());
    promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR,
      NS_LITERAL_CSTRING("MediaKeySession.Close() lost reference to CDM"));
    return promise.forget();
  }
  // 4. Let promise be a new promise.
  PromiseId pid = mKeys->StorePromise(promise);
  // 5. Run the following steps in parallel:
  // 5.1 Let cdm be the CDM instance represented by session's cdm instance value.
  // 5.2 Use cdm to close the session associated with session.
  mKeys->GetCDMProxy()->CloseSession(mSessionId, pid);

  EME_LOG("MediaKeySession[%p,'%s'] Close() sent to CDM, promiseId=%d",
          this, NS_ConvertUTF16toUTF8(mSessionId).get(), pid);

  // Session Closed algorithm is run when CDM causes us to run OnSessionClosed().

  // 6. Return promise.
  return promise.forget();
}
开发者ID:bitwiseworks,项目名称:mozilla-os2,代码行数:46,代码来源:MediaKeySession.cpp


示例10: CSegment

const OPT<SHAPE_LINE_CHAIN::INTERSECTION> SHAPE_LINE_CHAIN::SelfIntersecting() const
{
    for( int s1 = 0; s1 < SegmentCount(); s1++ )
    {
        for( int s2 = s1 + 1; s2 < SegmentCount(); s2++ )
        {
            const VECTOR2I s2a = CSegment( s2 ).A, s2b = CSegment( s2 ).B;

            if( s1 + 1 != s2 && CSegment( s1 ).Contains( s2a ) )
            {
                INTERSECTION is;
                is.our = CSegment( s1 );
                is.their = CSegment( s2 );
                is.p = s2a;
                return is;
            }
            else if( CSegment( s1 ).Contains( s2b ) &&
                     // for closed polylines, the ending point of the
                     // last segment == starting point of the first segment
                     // this is a normal case, not self intersecting case
                     !( IsClosed() && s1 == 0 && s2 == SegmentCount()-1 ) )
            {
                INTERSECTION is;
                is.our = CSegment( s1 );
                is.their = CSegment( s2 );
                is.p = s2b;
                return is;
            }
            else
            {
                OPT_VECTOR2I p = CSegment( s1 ).Intersect( CSegment( s2 ), true );

                if( p )
                {
                    INTERSECTION is;
                    is.our = CSegment( s1 );
                    is.their = CSegment( s2 );
                    is.p = *p;
                    return is;
                }
            }
        }
    }

    return OPT<SHAPE_LINE_CHAIN::INTERSECTION>();
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:46,代码来源:shape_line_chain.cpp


示例11: assert

/**--------------------------------------------------------------------------<BR>
C2DLineBaseSet::AddIfCommonEnd
\brief Adds the points of another to this if they have a common end which is either
the first or last point. Returns true if there was a match.
<P>---------------------------------------------------------------------------*/
bool C2DLineBaseSet::AddIfCommonEnd(C2DLineBaseSet& Other)
{
	assert(!IsClosed());
	assert(!Other.IsClosed());

	int nThisCount = size() ;
	if (nThisCount < 1) return false;

	int nOtherCount = Other.size();
	if (nOtherCount < 1) return false;

	if ( GetAt(0)->GetPointFrom() == Other.GetAt(0)->GetPointFrom())
	{
		ReverseDirection();

		*this << Other;

		return true;
	}
	else if( GetAt(0)->GetPointFrom() == Other.GetAt(nOtherCount - 1)->GetPointTo() )
	{
		ReverseDirection();

		Other.ReverseDirection();

		*this << Other;

		return true;
	}
	else if (GetAt(nThisCount - 1)->GetPointTo() == Other.GetAt(0)->GetPointFrom())
	{
		*this << Other;

		return true;
	}	
	else if (GetAt(nThisCount - 1)->GetPointTo() == Other.GetAt(nOtherCount - 1)->GetPointTo() )
	{
		Other.ReverseDirection();	

		*this << Other;

		return true;
	}	

	return false;
}
开发者ID:Ic3C0ld,项目名称:QtGeometry7316,代码行数:51,代码来源:C2DLineBaseSet.cpp


示例12: SetGlobalComment

bool CZipArchive::SetGlobalComment(const CString &szComment)
{
	if (IsClosed())
	{
		TRACE(_T("ZipArchive is closed.\n"));
		return false;
	}
	if (m_storage.IsSpanMode() == -1)
	{
		TRACE(_T("You cannot modify the global comment of the existing disk spanning archive.\n"));
		return false;
	}
	
	m_centralDir.m_szComment = szComment;
	m_centralDir.RemoveFromDisk();
	return true;
}
开发者ID:F5000,项目名称:spree,代码行数:17,代码来源:ZipArchive.cpp


示例13:

NS_IMETHODIMP
nsFileUploadContentStream::AsyncWait(nsIInputStreamCallback *callback,
                                     uint32_t flags, uint32_t count,
                                     nsIEventTarget *target)
{
  nsresult rv = nsBaseContentStream::AsyncWait(callback, flags, count, target);
  if (NS_FAILED(rv) || IsClosed())
    return rv;

  if (IsNonBlocking()) {
    nsCOMPtr<nsIRunnable> callback =
      NS_NewRunnableMethod(this, &nsFileUploadContentStream::OnCopyComplete);
    mCopyEvent->Dispatch(callback, mSink, target);
  }

  return NS_OK;
}
开发者ID:martasect,项目名称:gecko,代码行数:17,代码来源:nsFileChannel.cpp


示例14: Recv

void BaseSession::Recv(Array& raw_data)
{
	if (IsClosed())
		return;
	stream_ibuffer_.Insert(stream_ibuffer_.End(), raw_data.Begin(), raw_data.Size());

	for (;;)
	{
		if (stream_ibuffer_.Size() < 2)
			return;
		uint16_t len = *reinterpret_cast<uint16_t *>(stream_ibuffer_.Begin());
		if (stream_ibuffer_.Size() < 2 + len)
			return;
		Array proto(static_cast<char *>(stream_ibuffer_.Begin())+2, len);
		OnAfterRecv(proto);
		stream_ibuffer_.Erase(stream_ibuffer_.Begin(), 2+len);
	}
}
开发者ID:kecookier,项目名称:Exercise,代码行数:18,代码来源:event.cpp


示例15: DestroyCurveTree

bool ON_NurbsCurve::Morph( const ON_SpaceMorph& morph )
{
  DestroyCurveTree();
  ON_BOOL32 bIsClosed = IsClosed();
  ON_BOOL32 bIsPeriodic = IsPeriodic();
  morph.MorphPointList( m_dim, m_is_rat, m_cv_count, m_cv_stride, m_cv );
  if ( bIsPeriodic )
  {
    int i, deg = m_order-1;
    for ( i = 0; i < deg; i++ )
      SetCV( m_cv_count-deg+i, ON::intrinsic_point_style, CV(i) );
  }
  else if ( bIsClosed )
  {
    SetCV( m_cv_count-1, ON::intrinsic_point_style, CV(0) );
  }
  return true;
}
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:18,代码来源:opennurbs_morph.cpp


示例16: FindFile

int CZipArchive::FindFile(CString szFileName, bool bCaseSensitive)
{
	if (IsClosed())
	{
		TRACE(_T("ZipArchive is closed.\n"));
		return (int)-1;
	}
	
	for (WORD i = 0; i < GetNoEntries(); i++)
	{
		CFileHeader fh;
		GetFileInfo(fh, i);
		CString temp = fh.m_szFileName;
		if ((bCaseSensitive ? temp.Collate(szFileName) : temp.CollateNoCase(szFileName)) == 0)
			return (int)i;
	}
	return (int) - 1;
}
开发者ID:F5000,项目名称:spree,代码行数:18,代码来源:ZipArchive.cpp


示例17: GetFileInfo

bool CZipArchive::GetFileInfo(CFileHeader & fhInfo, WORD uIndex)
{
	if (IsClosed())
	{
		TRACE(_T("ZipArchive is closed.\n"));
		return false;
	}
	
	if (!m_centralDir.IsValidIndex(uIndex))
		return false;
	
	fhInfo = *(m_centralDir.m_headers[uIndex]);
	//if (m_bOemCompatible)
	//	fhInfo.m_szFileName.OemToAnsi();
	if (m_bSlashChange)
		fhInfo.m_szFileName.Replace(_T('/'), _T('\\'));
	return true;
}
开发者ID:F5000,项目名称:spree,代码行数:18,代码来源:ZipArchive.cpp


示例18:

void
MediaKeySession::DispatchKeysChange()
{
  if (IsClosed()) {
    return;
  }
  DebugOnly<nsresult> rv =
    nsContentUtils::DispatchTrustedEvent(mKeys->GetOwnerDoc(),
                                         this,
                                         NS_LITERAL_STRING("keyschange"),
                                         false,
                                         false);
#ifdef DEBUG
  if (NS_FAILED(rv)) {
    NS_WARNING("Failed to dispatch keyschange event");
  }
#endif
}
开发者ID:Andrel322,项目名称:gecko-dev,代码行数:18,代码来源:MediaKeySession.cpp


示例19: ClearValidationErrors

bool
AbstractTaskFactory::Validate()
{
  ClearValidationErrors();

  bool valid = true;

  if (!task.HasStart()) {
    AddValidationError(TaskValidationErrorType::NO_VALID_START);
    valid = false;
  }
  if (!task.HasFinish()) {
    AddValidationError(TaskValidationErrorType::NO_VALID_FINISH);
    valid = false;
  }

  if (constraints.is_closed && !IsClosed()) {
    AddValidationError(TaskValidationErrorType::TASK_NOT_CLOSED);
    valid = false;
  }

  if (constraints.IsFixedSize()) {
    if (task.TaskSize() != constraints.max_points) {
      AddValidationError(TaskValidationErrorType::INCORRECT_NUMBER_TURNPOINTS);
      valid = false;
    }
  } else {
    if (task.TaskSize() < constraints.min_points) {
      AddValidationError(TaskValidationErrorType::UNDER_MIN_TURNPOINTS);
      valid = false;
    }
    if (task.TaskSize() > constraints.max_points) {
      AddValidationError(TaskValidationErrorType::EXCEEDS_MAX_TURNPOINTS);
      valid = false;
    }
  }

  if (constraints.homogeneous_tps && !IsHomogeneous()) {
    AddValidationError(TaskValidationErrorType::TASK_NOT_HOMOGENEOUS);
    valid = false;
  }

  return valid;
}
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:44,代码来源:AbstractTaskFactory.cpp


示例20: start_async_send

void Socket::start_async_send()
{
    if( IsClosed() )
        return;

    if( m_OutActive )
        return;
    
    if ( m_OutBuffer->length() == 0 )
    {
        m_OutActive = false;
        return;
    }

    m_OutActive = true;

    m_socket.async_write_some( boost::asio::buffer( m_OutBuffer->rd_ptr(), m_OutBuffer->length() ),
                               boost::bind( &Socket::on_write_complete, shared_from_this(), 
                                            boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred ) );
}
开发者ID:Ambal,项目名称:mangos,代码行数:20,代码来源:Socket.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IsCombatMovementAllowed函数代码示例发布时间:2022-05-30
下一篇:
C++ IsClipboardFormatAvailable函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap