Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
NestingLimit.hpp
00001 // ArduinoJson - arduinojson.org 00002 // Copyright Benoit Blanchon 2014-2021 00003 // MIT License 00004 00005 #pragma once 00006 00007 #include <ArduinoJson/Namespace.hpp> 00008 #include <ArduinoJson/Polyfills/assert.hpp> 00009 00010 namespace ARDUINOJSON_NAMESPACE { 00011 00012 class NestingLimit { 00013 public: 00014 NestingLimit() : _value(ARDUINOJSON_DEFAULT_NESTING_LIMIT) {} 00015 explicit NestingLimit(uint8_t n) : _value(n) {} 00016 00017 NestingLimit decrement() const { 00018 ARDUINOJSON_ASSERT(_value > 0); 00019 return NestingLimit(static_cast<uint8_t>(_value - 1)); 00020 } 00021 00022 bool reached() const { 00023 return _value == 0; 00024 } 00025 00026 private: 00027 uint8_t _value; 00028 }; 00029 } // namespace ARDUINOJSON_NAMESPACE
Generated on Wed Jul 13 2022 01:10:36 by
1.7.2