ScopedCounter
Parameters
maxDepth
maximum allowed depth. If exceeded, onOverflow is invoked
onOverflow
action to perform when the maximum depth is exceeded
maximum allowed depth. If exceeded, onOverflow is invoked
action to perform when the maximum depth is exceeded