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


C++ UIDSet::insert方法代码示例

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


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

示例1: locker

void
IMAPFolder::MessageEntriesFetched()
{
	_WaitForFolderState();

	// Synchronize all pending flags first
	UIDToFlagsMap::const_iterator pendingIterator = fPendingFlagsMap.begin();
	for (; pendingIterator != fPendingFlagsMap.end(); pendingIterator++)
		SyncMessageFlags(pendingIterator->first, pendingIterator->second);

	fPendingFlagsMap.clear();

	// Delete all local messages that are no longer found on the server

	MutexLocker locker(fLock);
	UIDSet deleteUIDs;
	UIDToRefMap::const_iterator iterator = fRefMap.begin();
	for (; iterator != fRefMap.end(); iterator++) {
		uint32 uid = iterator->first;
		if (fSynchronizedUIDsSet.find(uid) == fSynchronizedUIDsSet.end())
			deleteUIDs.insert(uid);
	}

	fSynchronizedUIDsSet.clear();
	locker.Unlock();

	UIDSet::const_iterator deleteIterator = deleteUIDs.begin();
	for (; deleteIterator != deleteUIDs.end(); deleteIterator++)
		_DeleteLocalMessage(*deleteIterator);
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:30,代码来源:IMAPFolder.cpp

示例2: main

int main(int argc, char* argv[]) {
    UIDSet uids;

    if (argc < 3) {
        std::cerr << "ERROR: Must have at least two arguments: basename and a UID"
                  << std::endl;
        return -1;
    }

    try {
        stoi(argv[1], NULL, 10);
        std::cerr << "ERROR: First argument must not be an integer"
                  << std::endl;
        return -1;
    } catch (...) {}

    std::string basename(std::string(argv[1]) + "_mixed");

    if (basename.find("/") != std::string::npos) {
        std::cerr << "ERROR: Basename may not contain path separator"
                  << std::endl;
        return -1;
    }

    for (int i = 2; i < argc; ++i) {
        uids.insert(stoi(argv[i], NULL, 10));
    }
    ParamSet extraParams;
    extraParams.insert(-1); // Don't-care value
    SetuidState startState = SetuidState::get();
    Explorer explorer(
        Graph(VG(), uids, startState),
        EG(),
        uids,
        extraParams);

    explorer.exploreAll();

    Graph const& graph = explorer.getGraph();
    GraphName name(basename, uids, extraParams);
    ArchiveWriter<Graph>().write(graph, name);
    DotWriter<Graph>().write(graph, name);

    return 0;
}
开发者ID:mdittmer,项目名称:unix-process-identity,代码行数:45,代码来源:CollectSetuidPrivData.cpp


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