本文整理汇总了C++中PtrLList::getCount方法的典型用法代码示例。如果您正苦于以下问题:C++ PtrLList::getCount方法的具体用法?C++ PtrLList::getCount怎么用?C++ PtrLList::getCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PtrLList
的用法示例。
在下文中一共展示了PtrLList::getCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rsrm
/*
send ReplicationStartReqMsg
if send error delete self
wait for ReplicationStartReplyMsg as follows
loop until reply is received
on receive error or peerNode dies, delete self
get filtered list of messages to replicate
for all messages to send, loop
if clear to send
send next message
if send error, delete self
else wait for clear to send (watch out for deadPeer?)
all done delete self
note: deleting self signals thread's parent to terminate this thread
go through the list of successfully send and ack'd?
and possibly queue up another session?
*/
void TargetBasedReplicationController::ReplicationSessionThread::run (void)
{
int rc;
const char *pszMethod = "TargetBasedReplicationController::ReplicationSessionThread::run";
// First - send the ReplicationStartReqMsg
ReplicationStartReqMsg rsrm (_localNodeID, _targetNodeID, TargetBasedReplicationController::CONTROLLER_TYPE, TargetBasedReplicationController::CONTROLLER_VERSION, _bCheckTargetForMsgs, _bRequireAcks);
if (_pTBRepCtlr->transmitCtrlToCtrlMessage (&rsrm, "TargetBasedReplicationController: sending ReplicationStartReqMsg") != 0) {
checkAndLogMsg (pszMethod, Logger::L_MildError,
"transmission of ReplicationStartReqMsg failed - terminating replication session\n");
_pTBRepCtlr->addTerminatingReplicator (this);
setTerminatingResultCode (-1);
terminating();
return;
}
else {
checkAndLogMsg (pszMethod, Logger::L_Info,
"transmitted ReplicationStartReqMsg to target node %s\n",
(const char*) _targetNodeID);
}
// Wait for the ReplicationStartReplyMsg
_m.lock();
while (!_bReplicating) {
if (terminationRequested()) {
_pTBRepCtlr->addTerminatingReplicator (this);
setTerminatingResultCode (-2);
terminating();
_m.unlock();
return;
}
else if (_bTargetDead) {
checkAndLogMsg (pszMethod, Logger::L_Warning,
"target node %s died while waiting for the ReplicationStartReplyMsg\n",
(const char*) _targetNodeID);
_pTBRepCtlr->addTerminatingReplicator (this);
setTerminatingResultCode (-3);
terminating();
_m.unlock();
return;
}
_cv.wait (1000);
}
_m.unlock();
// Ready to replicate messages at this point
if ((_pMsgsToExclude != NULL) && (_pMsgsToExclude->getCount() > 0)) {
checkAndLogMsg (pszMethod, Logger::L_Info,
"adding constraint to exclude messages previously received by node %s\n", (const char*) _targetNodeID);
}
int64 i64QueryStartTime = getTimeInMilliseconds();
PtrLList<MessageId> *pMsgIds = _pTBRepCtlr->_pDataCacheInterface->getNotReplicatedMsgList (_targetNodeID, 0, _pMsgsToExclude);
if (pMsgIds != NULL) {
checkAndLogMsg (pszMethod, Logger::L_Info,
"identified %lu messages to replicate to node %s - query time %lu ms\n",
(uint32) pMsgIds->getCount(), (const char*) _targetNodeID, (uint32) (getTimeInMilliseconds() - i64QueryStartTime));
for (MessageId *pMIdTemp = pMsgIds->getFirst(); pMIdTemp; pMIdTemp = pMsgIds->getNext()) {
// Check for termination
if (terminationRequested()) {
setTerminatingResultCode (-4);
break;
}
// Check Flow Control and target peer death
int64 i64PauseStartTime = 0;
while ((!_bTargetDead) && (!_pTBRepCtlr->clearToSendOnAllInterfaces())) {
if (i64PauseStartTime == 0) {
i64PauseStartTime = getTimeInMilliseconds();
}
sleepForMilliseconds (100);
}
if (_bTargetDead) {
checkAndLogMsg (pszMethod, Logger::L_Warning,
"target %s died while replicating messages\n",
(const char*) _targetNodeID);
setTerminatingResultCode (-5);
break;
}
if (i64PauseStartTime != 0) {
//.........这里部分代码省略.........