Move CollectionData definition

This commit is contained in:
Benoit Blanchon
2025-07-02 18:25:40 +02:00
parent 8790802ce3
commit a265ef4927
3 changed files with 14 additions and 14 deletions

View File

@ -66,18 +66,6 @@ class CollectionIterator {
SlotId currentId_; SlotId currentId_;
}; };
struct CollectionData {
SlotId head = NULL_SLOT;
SlotId tail = NULL_SLOT;
// Placement new
static void* operator new(size_t, void* p) noexcept {
return p;
}
static void operator delete(void*, void*) noexcept {}
};
class CollectionImpl { class CollectionImpl {
protected: protected:
CollectionData* data_; CollectionData* data_;

View File

@ -6,10 +6,8 @@
#include <stddef.h> // size_t #include <stddef.h> // size_t
#include <ArduinoJson/Array/ArrayData.hpp>
#include <ArduinoJson/Numbers/JsonFloat.hpp> #include <ArduinoJson/Numbers/JsonFloat.hpp>
#include <ArduinoJson/Numbers/JsonInteger.hpp> #include <ArduinoJson/Numbers/JsonInteger.hpp>
#include <ArduinoJson/Object/ObjectData.hpp>
ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
@ -47,6 +45,18 @@ inline bool operator&(VariantType type, VariantTypeBits bit) {
return (uint8_t(type) & uint8_t(bit)) != 0; return (uint8_t(type) & uint8_t(bit)) != 0;
} }
struct CollectionData {
SlotId head = NULL_SLOT;
SlotId tail = NULL_SLOT;
// Placement new
static void* operator new(size_t, void* p) noexcept {
return p;
}
static void operator delete(void*, void*) noexcept {}
};
const size_t tinyStringMaxLength = 3; const size_t tinyStringMaxLength = 3;
union VariantContent { union VariantContent {

View File

@ -4,9 +4,11 @@
#pragma once #pragma once
#include <ArduinoJson/Array/ArrayData.hpp>
#include <ArduinoJson/Memory/ResourceManager.hpp> #include <ArduinoJson/Memory/ResourceManager.hpp>
#include <ArduinoJson/Misc/SerializedValue.hpp> #include <ArduinoJson/Misc/SerializedValue.hpp>
#include <ArduinoJson/Numbers/convertNumber.hpp> #include <ArduinoJson/Numbers/convertNumber.hpp>
#include <ArduinoJson/Object/ObjectData.hpp>
#include <ArduinoJson/Strings/JsonString.hpp> #include <ArduinoJson/Strings/JsonString.hpp>
#include <ArduinoJson/Strings/StringAdapters.hpp> #include <ArduinoJson/Strings/StringAdapters.hpp>
#include <ArduinoJson/Variant/VariantData.hpp> #include <ArduinoJson/Variant/VariantData.hpp>