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

C++ epicsGuard类代码示例

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

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



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

示例1: exception

void cac::exception ( 
    epicsGuard < epicsMutex > & cbGuard, 
    epicsGuard < epicsMutex > & guard, int status, 
    const char * pContext, const char * pFileName, unsigned lineNo )
{
    cbGuard.assertIdenticalMutex ( this->cbMutex );
    guard.assertIdenticalMutex ( this->mutex );
    this->notify.exception ( guard, status, pContext, 
        pFileName, lineNo );
}
开发者ID:ISISComputingGroup,项目名称:EPICS-base,代码行数:10,代码来源:cac.cpp


示例2: beaconAnomalyNotify

void bhe::beaconAnomalyNotify ( epicsGuard < epicsMutex > & guard )
{
    guard.assertIdenticalMutex ( this->mutex );
    if ( this->pIIU ) {
        this->pIIU->beaconAnomalyNotify ( guard );
    }
}
开发者ID:zlxmsu,项目名称:TestEpics,代码行数:7,代码来源:bhe.cpp


示例3: installChan

void disconnectGovernorTimer::installChan ( 
    epicsGuard < epicsMutex > & guard, nciu & chan )
{
    guard.assertIdenticalMutex ( this->mutex );
    this->chanList.add ( chan );
    chan.channelNode::listMember = channelNode::cs_disconnGov;
}
开发者ID:zlxmsu,项目名称:TestEpics,代码行数:7,代码来源:disconnectGovernorTimer.cpp


示例4: registerSearchDest

void cac::registerSearchDest (
    epicsGuard < epicsMutex > & guard,
    SearchDest & req )
{
    guard.assertIdenticalMutex ( this->mutex );
    this->searchDestList.add ( req );
}
开发者ID:ISISComputingGroup,项目名称:EPICS-base,代码行数:7,代码来源:cac.cpp


示例5: channelDeleteException

void dbSubscriptionIO::channelDeleteException ( 
    epicsGuard < epicsMutex > & guard )
{
    guard.assertIdenticalMutex ( this->mutex );
    this->notify.exception ( guard, ECA_CHANDESTROY, 
        this->chan.pName(guard), this->type, this->count );
}
开发者ID:zlxmsu,项目名称:TestEpics,代码行数:7,代码来源:dbSubscriptionIO.cpp


示例6: uninstallChan

void searchTimer::uninstallChan (
    epicsGuard < epicsMutex > & cacGuard, nciu & chan )
{
    cacGuard.assertIdenticalMutex ( this->mutex );
    unsigned ulistmem = 
	static_cast <unsigned> ( chan.channelNode::listMember );
    unsigned uReqBase = 
	static_cast <unsigned> ( channelNode::cs_searchReqPending0 );
    if ( ulistmem == this->index + uReqBase ) {
        this->chanListReqPending.remove ( chan );
    }
    else { 
	unsigned uRespBase = 
	    static_cast <unsigned > ( 
		channelNode::cs_searchRespPending0 );
	if ( ulistmem == this->index + uRespBase ) {
	    this->chanListRespPending.remove ( chan );
	}
	else {
	    throw std::runtime_error ( 
		"uninstalling channel search timer, but channel "
		"state is wrong" );
	}
    }
    chan.channelNode::listMember = channelNode::cs_none;
}
开发者ID:zlxmsu,项目名称:TestEpics,代码行数:26,代码来源:searchTimer.cpp


示例7: pushDatagramMsg

bool udpiiu::pushDatagramMsg ( epicsGuard < epicsMutex > & guard, 
    const caHdr & msg, const void * pExt, ca_uint16_t extsize )
{
    guard.assertIdenticalMutex ( this->cacMutex );

    ca_uint16_t alignedExtSize = static_cast <ca_uint16_t> (CA_MESSAGE_ALIGN ( extsize ));
    arrayElementCount msgsize = sizeof ( caHdr ) + alignedExtSize;

    /* fail out if max message size exceeded */
    if ( msgsize >= sizeof ( this->xmitBuf ) - 7 ) {
        return false;
    }

    if ( msgsize + this->nBytesInXmitBuf > sizeof ( this->xmitBuf ) ) {
        return false;
    }

    caHdr * pbufmsg = ( caHdr * ) &this->xmitBuf[this->nBytesInXmitBuf];
    *pbufmsg = msg;
    if ( extsize ) {
        memcpy ( pbufmsg + 1, pExt, extsize );
        if ( extsize != alignedExtSize ) {
            char *pDest = (char *) ( pbufmsg + 1 );
            memset ( pDest + extsize, '\0', alignedExtSize - extsize );
        }
    }
    AlignedWireRef < epicsUInt16 > ( pbufmsg->m_postsize ) = alignedExtSize;
    this->nBytesInXmitBuf += msgsize;

    return true;
}
开发者ID:ISISComputingGroup,项目名称:EPICS-base,代码行数:31,代码来源:udpiiu.cpp


示例8: selfTest

void cac::selfTest ( 
    epicsGuard < epicsMutex > & guard ) const
{
    guard.assertIdenticalMutex ( this->mutex );
    this->chanTable.verify ();
    this->ioTable.verify ();
    this->beaconTable.verify ();
}
开发者ID:ISISComputingGroup,项目名称:EPICS-base,代码行数:8,代码来源:cac.cpp


示例9: show

void udpiiu :: SearchDestUDP :: show ( 
    epicsGuard < epicsMutex > & guard, unsigned level ) const
{
    guard.assertIdenticalMutex ( _udpiiu.cacMutex );
    char buf[64];
    sockAddrToDottedIP ( &_destAddr.sa, buf, sizeof ( buf ) );
    :: printf ( "UDP Search destination \"%s\"\n", buf );
}
开发者ID:ISISComputingGroup,项目名称:EPICS-base,代码行数:8,代码来源:udpiiu.cpp


示例10: initiateConnect

void cac::initiateConnect ( 
    epicsGuard < epicsMutex > & guard, 
    nciu & chan, netiiu * & piiu )
{
    guard.assertIdenticalMutex ( this->mutex );
    assert ( this->pudpiiu );
    this->pudpiiu->installNewChannel ( guard, chan, piiu );
}
开发者ID:ISISComputingGroup,项目名称:EPICS-base,代码行数:8,代码来源:cac.cpp


示例11: flush

//
// set the push pending flag on all virtual circuits
//
void cac::flush ( epicsGuard < epicsMutex > & guard )
{
    guard.assertIdenticalMutex ( this->mutex );
    tsDLIter < tcpiiu > iter = this->circuitList.firstIter ();
    while ( iter.valid () ) {
        iter->flushRequest ( guard );
        iter++;
    }
}
开发者ID:ISISComputingGroup,项目名称:EPICS-base,代码行数:12,代码来源:cac.cpp


示例12: show

void dbContextReadNotifyCache::show (
    epicsGuard < epicsMutex > & guard, unsigned level ) const
{
    guard.assertIdenticalMutex ( _mutex );

    printf ( "dbContextReadNotifyCache\n" );
    if ( level > 0 ) {
        this->_allocator.show ( level - 1 );
    }
}
开发者ID:ukaea,项目名称:epics,代码行数:10,代码来源:dbContextReadNotifyCache.cpp


示例13: disconnectChannel

void cac::disconnectChannel (
        epicsGuard < epicsMutex > & cbGuard,
        epicsGuard < epicsMutex > & guard, nciu & chan )
{
    guard.assertIdenticalMutex ( this->mutex );
    assert ( this->pudpiiu );
    chan.disconnectAllIO ( cbGuard, guard );
    chan.getPIIU(guard)->uninstallChan ( guard, chan );
    this->pudpiiu->installDisconnectedChannel ( guard, chan );
    chan.unresponsiveCircuitNotify ( cbGuard, guard );
}
开发者ID:ISISComputingGroup,项目名称:EPICS-base,代码行数:11,代码来源:cac.cpp


示例14: unregisterIIU

void bhe::unregisterIIU ( 
    epicsGuard < epicsMutex > & guard, tcpiiu & iiu )
{
    guard.assertIdenticalMutex ( this->mutex );
    if ( this->pIIU == & iiu ) {
        this->pIIU = 0;
        this->timeStamp = epicsTime();
        this->averagePeriod = - DBL_MAX;
        logBeacon ( "ui", this->averagePeriod, epicsTime::getCurrent () );
    }
}
开发者ID:zlxmsu,项目名称:TestEpics,代码行数:11,代码来源:bhe.cpp


示例15: disconnectAllIO

void cac::disconnectAllIO ( 
    epicsGuard < epicsMutex > & cbGuard,
    epicsGuard < epicsMutex > & guard, 
    nciu & chan, tsDLList < baseNMIU > & ioList )
{
    cbGuard.assertIdenticalMutex ( this->cbMutex );
    guard.assertIdenticalMutex ( this->mutex );
    char buf[128];
    chan.getHostName ( guard, buf, sizeof ( buf ) );

    tsDLIter < baseNMIU > pNetIO = ioList.firstIter();
    while ( pNetIO.valid () ) {
        tsDLIter < baseNMIU > pNext = pNetIO;
        pNext++;
        if ( ! pNetIO->isSubscription() ) {
            this->ioTable.remove ( pNetIO->getId () );
        }
        pNetIO->exception ( guard, *this, ECA_DISCONN, buf );
        pNetIO = pNext;
    }
}
开发者ID:ISISComputingGroup,项目名称:EPICS-base,代码行数:21,代码来源:cac.cpp


示例16: unguard

void dbSubscriptionIO::unsubscribe ( CallbackGuard & cbGuard, 
    epicsGuard < epicsMutex > & guard )
{
    guard.assertIdenticalMutex ( this->mutex );
    if ( this->es ) {
        dbEventSubscription tmp = this->es;
        this->es = 0;
        {
            epicsGuardRelease < epicsMutex > unguard ( guard );
            db_cancel_event ( tmp );
        }
    }
}
开发者ID:ukaea,项目名称:epics,代码行数:13,代码来源:dbSubscriptionIO.cpp


示例17: destructor

void  oldChannelNotify::destructor (
    CallbackGuard & cbGuard,
    epicsGuard < epicsMutex > & mutexGuard )
{
    mutexGuard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
    this->io.destroy ( cbGuard, mutexGuard );
    // no need to worry about a connect preempting here because
    // the io (the nciu) has been destroyed above
    if ( this->pConnCallBack == 0 && ! this->currentlyConnected ) {
        this->cacCtx.decrementOutstandingIO ( mutexGuard, this->ioSeqNo );
    }
    this->~oldChannelNotify ();
}
开发者ID:T-A-R-L-A,项目名称:EPICS-Base,代码行数:13,代码来源:oldChannelNotify.cpp


示例18: searchRequest

void udpiiu :: SearchDestUDP :: searchRequest ( 
            epicsGuard < epicsMutex > & guard, const char * pBuf, size_t bufSize )
{
    guard.assertIdenticalMutex ( _udpiiu.cacMutex );
    assert ( bufSize <= INT_MAX );
    int bufSizeAsInt = static_cast < int > ( bufSize );
    while ( true ) {
        // This const_cast is needed for vxWorks:
        int status = sendto ( _udpiiu.sock, const_cast<char *>(pBuf), bufSizeAsInt, 0, 
                & _destAddr.sa, sizeof ( _destAddr.sa ) );
        if ( status == bufSizeAsInt ) {
            break;
        }
        if ( status >= 0 ) {
            errlogPrintf ( "CAC: UDP sendto () call returned strange xmit count?\n" );
            break;
        }
        else {
            int localErrno = SOCKERRNO;

            if ( localErrno == SOCK_EINTR ) {
                if ( _udpiiu.shutdownCmd ) {
                    break;
                }
                else {
                    continue;
                }
            }
            else if ( localErrno == SOCK_SHUTDOWN ) {
                break;
            }
            else if ( localErrno == SOCK_ENOTSOCK ) {
                break;
            }
            else if ( localErrno == SOCK_EBADF ) {
                break;
            }
            else {
                char sockErrBuf[64];
                epicsSocketConvertErrnoToString ( 
                    sockErrBuf, sizeof ( sockErrBuf ) );
                char buf[64];
                sockAddrToDottedIP ( &_destAddr.sa, buf, sizeof ( buf ) );
                errlogPrintf (
                    "CAC: error = \"%s\" sending UDP msg to %s\n",
                    sockErrBuf, buf);
                break;
            }
        }
    }
}
开发者ID:ISISComputingGroup,项目名称:EPICS-base,代码行数:51,代码来源:udpiiu.cpp


示例19: findOrCreateVirtCircuit

bool cac::findOrCreateVirtCircuit ( 
    epicsGuard < epicsMutex > & guard, const osiSockAddr & addr,
    unsigned priority, tcpiiu *& piiu, unsigned minorVersionNumber,
    SearchDestTCP * pSearchDest )
{
    guard.assertIdenticalMutex ( this->mutex );
    bool newIIU = false;

    if ( piiu ) {
        if ( ! piiu->alive ( guard ) ) {
            return newIIU;
        }
    }
    else {
        try {
            autoPtrFreeList < tcpiiu, 32, epicsMutexNOOP > pnewiiu (
                    this->freeListVirtualCircuit,
                    new ( this->freeListVirtualCircuit ) tcpiiu ( 
                        *this, this->mutex, this->cbMutex, this->notify, this->connTMO, 
                        this->timerQueue, addr, this->comBufMemMgr, minorVersionNumber, 
                        this->ipToAEngine, priority, pSearchDest ) );

            bhe * pBHE = this->beaconTable.lookup ( addr.ia );
            if ( ! pBHE ) {
                pBHE = new ( this->bheFreeList ) 
                                    bhe ( this->mutex, epicsTime (), 0u, addr.ia );
                if ( this->beaconTable.add ( *pBHE ) < 0 ) {
                    return newIIU;
                }
            }
            this->serverTable.add ( *pnewiiu );
            this->circuitList.add ( *pnewiiu );
            this->iiuExistenceCount++;
            pBHE->registerIIU ( guard, *pnewiiu );
            piiu = pnewiiu.release ();
            newIIU = true;
        }
        catch ( std :: exception & except ) {
            errlogPrintf ( 
                "CAC: exception during virtual circuit creation \"%s\"\n",
                except.what () );
            return newIIU;
        }
        catch ( ... ) {
            errlogPrintf ( 
                "CAC: Nonstandard exception during virtual circuit creation\n" );
            return newIIU;
        }
    }
    return newIIU;
}
开发者ID:ISISComputingGroup,项目名称:EPICS-base,代码行数:51,代码来源:cac.cpp


示例20: destroyChannel

void cac::destroyChannel ( 
    epicsGuard < epicsMutex > & guard,
    nciu & chan ) 
{
    guard.assertIdenticalMutex ( this->mutex );

    // uninstall channel so that recv threads
    // will not start a new callback for this channel's IO. 
    if ( this->chanTable.remove ( chan ) != & chan ) {
        throw std::logic_error ( "Invalid channel identifier" );
    }
    chan.~nciu ();
    this->channelFreeList.release ( & chan );
}
开发者ID:ISISComputingGroup,项目名称:EPICS-base,代码行数:14,代码来源:cac.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ errlHndl_t类代码示例发布时间:2022-05-31
下一篇:
C++ environment类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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