本文整理汇总了C++中ListOfStrings::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ ListOfStrings::clear方法的具体用法?C++ ListOfStrings::clear怎么用?C++ ListOfStrings::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListOfStrings
的用法示例。
在下文中一共展示了ListOfStrings::clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetListOfJobs
void ServerScheduler::GetListOfJobs(ListOfStrings& jobs)
{
boost::mutex::scoped_lock lock(mutex_);
jobs.clear();
for (Jobs::const_iterator
it = jobs_.begin(); it != jobs_.end(); ++it)
{
jobs.push_back(it->first);
}
}
示例2: SubmitAndWait
bool ServerScheduler::SubmitAndWait(ListOfStrings& outputs,
ServerJob& job)
{
std::string jobId = job.GetId();
outputs.clear();
if (job.filters_.empty())
{
return true;
}
// Add a sink filter to collect all the results of the filters
// that have no next filter.
ServerCommandInstance& sink = job.AddCommand(new Sink(outputs));
for (std::list<ServerCommandInstance*>::iterator
it = job.filters_.begin(); it != job.filters_.end(); ++it)
{
if ((*it) != &sink &&
(*it)->IsConnectedToSink())
{
(*it)->ConnectOutput(sink);
}
}
// Submit the job
SubmitInternal(job, true);
// Wait for the job to complete (either success or failure)
JobStatus status;
{
boost::mutex::scoped_lock lock(mutex_);
assert(watchedJobStatus_.find(jobId) != watchedJobStatus_.end());
while (watchedJobStatus_[jobId] == JobStatus_Running)
{
watchedJobFinished_.wait(lock);
}
status = watchedJobStatus_[jobId];
watchedJobStatus_.erase(jobId);
}
return (status == JobStatus_Success);
}