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


C++ PtrLList::remove方法代码示例

本文整理汇总了C++中PtrLList::remove方法的典型用法代码示例。如果您正苦于以下问题:C++ PtrLList::remove方法的具体用法?C++ PtrLList::remove怎么用?C++ PtrLList::remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PtrLList的用法示例。


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

示例1: deleteEvent

/**
 * Delete an event, given the eventId
 */
int Cron::deleteEvent (int iEventId)
{
    Event *pEvent;
    PtrLList<Cron::Event> *pEventList = (PtrLList<Cron::Event>*) _pEventList;
    pEventList->resetGet();
    while ((pEvent = pEventList->getNext()) != NULL) {
        if (pEvent->_id == iEventId) {
            pEventList->remove (pEvent);
            return 1;
        }
    }
    return 0;
}
开发者ID:agilecomputing,项目名称:nomads,代码行数:16,代码来源:Cron.cpp

示例2: sendWaypointMessage

void DSProImpl::sendWaypointMessage (const void *pBuf, uint32 ui32BufLen)
{
    if (pBuf == NULL || ui32BufLen == 0) {
        return;
    }

    PtrLList<String> *pNeighborList = _pTopology->getNeighbors();
    if (pNeighborList == NULL) {
        return;
    }
    if (pNeighborList->getFirst () == NULL) {
        delete pNeighborList;
        return;
    }

    NodeIdSet nodeIdSet;
    PreviousMessageIds previousMessageIds;
    String *pszNextPeerId = pNeighborList->getFirst ();
    for (String *pszCurrPeerId; (pszCurrPeerId = pszNextPeerId) != NULL;) {
        pszNextPeerId = pNeighborList->getNext ();
        previousMessageIds.add (pszCurrPeerId->c_str (), _pScheduler->getLatestMessageReplicatedToPeer (pszCurrPeerId->c_str ()));
        nodeIdSet.add (pszCurrPeerId->c_str ());
        delete pNeighborList->remove (pszCurrPeerId);
    }
    delete pNeighborList;

    uint32 ui32TotalLen = 0;
    void *pData = WaypointMessageHelper::writeWaypointMessageForTarget (previousMessageIds, pBuf, ui32BufLen, ui32TotalLen);
    Targets **ppTargets = _pTopology->getNextHopsAsTarget (nodeIdSet);
    if ((ppTargets != NULL) && (ppTargets[0] != NULL)) {
        // Send the waypoint message on each available interface that reaches the recipients
        int rc = _adaptMgr.sendWaypointMessage (pData, ui32TotalLen, _nodeId, ppTargets);
        String sLatestMsgs (previousMessageIds);
        String sPeers (nodeIdSet);
        checkAndLogMsg ("DSPro::sendWaypointMessage", Logger::L_Info, "sending waypoint message "
            "to %s (%s); last message pushed to this node was %s.\n", sPeers.c_str (),
            (rc == 0 ? "succeeded" : "failed"), sLatestMsgs.c_str ());
    }
    Targets::deallocateTargets (ppTargets);
    free (pData);
}
开发者ID:fpoltronieri,项目名称:nomads,代码行数:41,代码来源:DSProImpl.cpp

示例3:

PtrLList<String> * LocalNodeInfo::getAllSubscriptions (void)
{
    _m.lock (326);
    if (_consolidatedSubscriptions.isEmpty()) {
        _m.unlock (326);
        return NULL;
    }
    PtrLList<String> *pRet = _consolidatedSubscriptions.getAllSubscribedGroups();
    const char *pszEnd = ".[od]";
    PtrLList<String> temp = (*pRet);
    for (String *pszCurr = temp.getFirst(); pszCurr != NULL; pszCurr = temp.getNext()) {
        if (pszCurr->endsWith (pszEnd) == 1) {
            String *pDel = pRet->remove (pszCurr);
            if (pDel != NULL) {
                delete pDel;
            }
        }
    }
    _m.unlock (326);
    return pRet;
}
开发者ID:ihmc,项目名称:nomads,代码行数:21,代码来源:NodeInfo.cpp


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