Move CollectionData definition

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

View File

@ -65,18 +65,6 @@ class CollectionIterator {
SlotId currentId_, nextId_;
};
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 {
protected:
CollectionData* data_;

View File

@ -6,10 +6,8 @@
#include <stddef.h> // size_t
#include <ArduinoJson/Array/ArrayData.hpp>
#include <ArduinoJson/Numbers/JsonFloat.hpp>
#include <ArduinoJson/Numbers/JsonInteger.hpp>
#include <ArduinoJson/Object/ObjectData.hpp>
ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
@ -47,6 +45,18 @@ inline bool operator&(VariantType type, VariantTypeBits bit) {
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;
union VariantContent {

View File

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