本文整理汇总了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;
}
示例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);
}
示例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;
}