Function forEachConfigType

Synopsis

#include <src/easylogging++.h>

static void forEachConfigType(base::type::EnumType *startIndex, const std::function< bool(void)> &fn)

Description

Applies specified function to each configuration type starting from startIndex.

Parameters

startIndex - initial value to start the iteration from. This is passed by pointer and is left-shifted so this can be used inside function (fn) to represent current configuration type.

fn - function to apply with each configuration type. This bool represent whether or not to stop iterating through configurations.

Source

Lines 227-235 in src/easylogging++.cc. Line 695 in src/easylogging++.h.

void ConfigurationTypeHelper::forEachConfigType(base::type::EnumType* startIndex, const std::function<bool(void)>& fn) {
  base::type::EnumType cIndexMax = ConfigurationTypeHelper::kMaxValid;
  do {
    if (fn()) {
      break;
    }
    *startIndex = static_cast<base::type::EnumType>(*startIndex << 1);
  } while (*startIndex <= cIndexMax);
}





Add Discussion

Log in to comment