您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ IsClosed函数代码示例

51自学网 2021-06-01 21:40:31
  C++
这篇教程C++ IsClosed函数代码示例写得很实用,希望能帮到您。

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

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


示例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,


示例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,


示例4:

NS_IMETHODIMPnsBaseContentStream::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,


示例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,


示例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,


示例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,


示例8: NS_ASSERTION

// staticIndexedDatabaseManager*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,


示例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,


示例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,


示例11: assert

/**--------------------------------------------------------------------------<BR>C2DLineBaseSet::AddIfCommonEnd/brief Adds the points of another to this if they have a common end which is eitherthe 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,


示例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,


示例13:

NS_IMETHODIMPnsFileUploadContentStream::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,


示例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,


示例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,


示例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,


示例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,


示例18:

voidMediaKeySession::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,


示例19: ClearValidationErrors

boolAbstractTaskFactory::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,


示例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,


示例21: promise

already_AddRefed<Promise>MediaKeySession::Remove(ErrorResult& aRv){  nsRefPtr<Promise> promise(mKeys->MakePromise(aRv));  if (aRv.Failed()) {    return nullptr;  }  if (mSessionType != SessionType::Persistent) {    promise->MaybeReject(NS_ERROR_DOM_INVALID_ACCESS_ERR);    // "The operation is not supported on session type sessions."    return promise.forget();  }  if (IsClosed() || !mKeys->GetCDMProxy()) {    promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);    // "The session is closed."    return promise.forget();  }  mKeys->GetCDMProxy()->RemoveSession(mSessionId, mKeys->StorePromise(promise));  return promise.forget();}
开发者ID:aknow,项目名称:gecko-dev,代码行数:20,


示例22: SetFileComment

bool CZipArchive::SetFileComment(WORD uIndex, 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;	}		if (!m_centralDir.IsValidIndex(uIndex))		return false;	m_centralDir.m_headers[uIndex]->m_szComment = szComment;	m_centralDir.m_headers[uIndex]->ValidateComment();	m_centralDir.RemoveFromDisk();	return true;}
开发者ID:F5000,项目名称:spree,代码行数:20,


示例23: IsAngle

/////////////////////////////////////////////////////////////////////////////// Test for angle/////////////////////////////////////////////////////////////////////////////bool CDiscretizedLine::IsAngle(int i) const{ if ((i == 0 || i == Size() - 1) && !IsClosed())  return true; int Next = NextIndex(i); int Prev = PreviousIndex(i); double x1 = vx[Next] - vx[i]; double y1 = vy[Next] - vy[i]; double x2 = vx[Prev] - vx[i]; double y2 = vy[Prev] - vy[i]; double det = x1 * y2 - x2 * y1; double n1 = x1 * x1 + y1 * y1; double n2 = x2 * x2 + y2 * y2; return std::fabs(det / std::sqrt(n1 * n2)) > 0.4; // ???}
开发者ID:jdc2172,项目名称:clop,代码行数:23,


示例24: close

void Socket::close(){    if( IsClosed() )        return;    m_closing = true;    try    {        if( m_socket.is_open() )        {            m_socket.shutdown( boost::asio::socket_base::shutdown_both );            m_socket.close();        }    }    catch( boost::system::error_code& e)    {        sLog.outError("Socket::close: error occurred while closing socket = %s", e.message().c_str());    }}
开发者ID:Ambal,项目名称:mangos,代码行数:20,


示例25: OnNewSystem

void CMission::OnNewSystem (CSystem *pSystem)//	OnNewSystem////	We are in a new system{    //	Ignore any closed missions (completed missions)    if (IsClosed())        return;    //	Resolve owner    m_pOwner.Resolve();    //	Clear any object references (because they might belong to a different    //	system).    ClearObjReferences();}
开发者ID:alanhorizon,项目名称:Transcendence,代码行数:21,


示例26: promise

already_AddRefed<Promise>MediaKeySession::Close(ErrorResult& aRv){  nsRefPtr<Promise> promise(mKeys->MakePromise(aRv));  if (aRv.Failed()) {    return nullptr;  }  if (IsClosed() || !mKeys->GetCDMProxy()) {    EME_LOG("MediaKeySession[%p,'%s'] Close() already closed",            this, NS_ConvertUTF16toUTF8(mSessionId).get());    promise->MaybeResolve(JS::UndefinedHandleValue);    return promise.forget();  }  PromiseId pid = mKeys->StorePromise(promise);  mKeys->GetCDMProxy()->CloseSession(mSessionId, mKeys->StorePromise(promise));  EME_LOG("MediaKeySession[%p,'%s'] Close() sent to CDM, promiseId=%d",          this, NS_ConvertUTF16toUTF8(mSessionId).get(), pid);  return promise.forget();}
开发者ID:LordJZ,项目名称:gecko-dev,代码行数:21,



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


C++ IsCombatMovementAllowed函数代码示例
C++ IsClipboardFormatAvailable函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。