MCPcopy Create free account
hub / github.com/catboost/catboost / Next

Method Next

library/cpp/getopt/small/last_getopt_parser.cpp:296–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294 }
295
296 bool TOptsParser::Next() {
297 bool r = false;
298
299 if (OptsDefault_.empty()) {
300 CurrentOpt_ = nullptr;
301 TempCurrentOpt_.Destroy();
302
303 CurrentValue_ = nullptr;
304
305 if (Stopped_)
306 return false;
307
308 TOptsParser copy = *this;
309
310 r = copy.DoNext();
311
312 Swap(copy);
313
314 if (!r) {
315 Stopped_ = true;
316 // we are done; check for missing options
317 Finish();
318 }
319 }
320
321 if (!r && !OptsDefault_.empty()) {
322 CurrentOpt_ = OptsDefault_.front();
323 CurrentValue_ = CurrentOpt_->GetDefaultValue();
324 OptsDefault_.pop_front();
325 r = true;
326 }
327
328 if (r) {
329 if (CurOpt())
330 CurOpt()->FireHandlers(this);
331 }
332
333 return r;
334 }
335
336 void TOptsParser::Finish() {
337 const TOpts::TOptsVector& optvec = Opts_->Opts_;

Callers

nothing calls this directly

Calls 9

pop_frontMethod · 0.80
FireHandlersMethod · 0.80
SwapFunction · 0.50
FinishFunction · 0.50
emptyMethod · 0.45
DestroyMethod · 0.45
DoNextMethod · 0.45
frontMethod · 0.45
GetDefaultValueMethod · 0.45

Tested by

no test coverage detected