// ArduinoJson - https://arduinojson.org // Copyright © 2014-2022, Benoit BLANCHON // MIT License #pragma once #include #include #include #include "VariantConstRef.hpp" namespace ARDUINOJSON_NAMESPACE { // Grants access to the internal variant API class VariantAttorney { // Tells whether getData() returns a const pointer template struct ResultOfGetData { protected: // <- to avoid GCC's "all member functions in class are private" static int probe(const VariantData*); static char probe(VariantData*); static TClient& client; public: typedef typename conditional::type type; }; public: template FORCE_INLINE static MemoryPool* getPool(TClient& client) { return client.getPool(); } template FORCE_INLINE static typename ResultOfGetData::type getData( TClient& client) { return client.getData(); } template FORCE_INLINE static VariantData* getOrCreateData(TClient& client) { return client.getOrCreateData(); } }; } // namespace ARDUINOJSON_NAMESPACE