本文整理汇总了C++中hashtable::Iterator::next方法的典型用法代码示例。如果您正苦于以下问题:C++ Iterator::next方法的具体用法?C++ Iterator::next怎么用?C++ Iterator::next使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hashtable::Iterator
的用法示例。
在下文中一共展示了Iterator::next方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reapOldMembers
void RTCPMemberDatabase::reapOldMembers(unsigned threshold) {
Boolean foundOldMember;
unsigned oldSSRC = 0;
do {
foundOldMember = False;
HashTable::Iterator* iter
= HashTable::Iterator::create(*fTable);
unsigned long timeCount;
char const* key;
while ((timeCount = (unsigned long)(iter->next(key))) != 0) {
#ifdef DEBUG
fprintf(stderr, "reap: checking SSRC 0x%lx: %ld (threshold %d)\n", (unsigned long)key, timeCount, threshold);
#endif
if (timeCount < (unsigned long)threshold) { // this SSRC is old
unsigned long ssrc = (unsigned long)key;
oldSSRC = (unsigned)ssrc;
foundOldMember = True;
}
}
delete iter;
if (foundOldMember) {
#ifdef DEBUG
fprintf(stderr, "reap: removing SSRC 0x%x\n", oldSSRC);
#endif
fOurRTCPInstance.removeSSRC(oldSSRC, True);
}
} while (foundOldMember);
}
示例2: createIterator
vector<unsigned int> HashTable::statBuckets()
{
vector<unsigned int> ret;
HashTable::Iterator it = createIterator();
for (unsigned int i=0; i<getNumberOfBuckets(); ++i)
{
placeIterator(it, i);
unsigned int count = 0;
while (it.next())
{
++count;
}
if (count >= ret.size())
{
ret.resize(count+1, 0);
}
++ret.at(count);
}
return ret;
}
示例3: closeAllClientSessionsForServerMediaSession
void GenericMediaServer::closeAllClientSessionsForServerMediaSession(ServerMediaSession* serverMediaSession) {
if (serverMediaSession == NULL) return;
HashTable::Iterator* iter = HashTable::Iterator::create(*fClientSessions);
GenericMediaServer::ClientSession* clientSession;
char const* key; // dummy
while ((clientSession = (GenericMediaServer::ClientSession*)(iter->next(key))) != NULL) {
if (clientSession->fOurServerMediaSession == serverMediaSession) {
delete clientSession;
}
}
delete iter;
}
示例4: handleEndOfFile
void MatroskaDemux::handleEndOfFile() {
// Iterate through all of our 'demuxed tracks', handling 'end of input' on each one.
// Hack: Because this can cause the hash table to get modified underneath us, we don't call the handlers until after we've
// first iterated through all of the tracks.
unsigned numTracks = fDemuxedTracksTable->numEntries();
if (numTracks == 0) return;
MatroskaDemuxedTrack** tracks = new MatroskaDemuxedTrack*[numTracks];
HashTable::Iterator* iter = HashTable::Iterator::create(*fDemuxedTracksTable);
unsigned i;
char const* trackNumber;
for (i = 0; i < numTracks; ++i) {
tracks[i] = (MatroskaDemuxedTrack*)iter->next(trackNumber);
}
delete iter;
for (i = 0; i < numTracks; ++i) {
if (tracks[i] == NULL) continue; // sanity check; shouldn't happen
FramedSource::handleClosure(tracks[i]);
}
delete[] tracks;
}