Skip to content

Commit c222fc2

Browse files
committed
Move CollectionData definition
1 parent b4024e7 commit c222fc2

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/ArduinoJson/Collection/CollectionData.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,6 @@ class CollectionIterator {
6666
SlotId currentId_;
6767
};
6868

69-
struct CollectionData {
70-
SlotId head = NULL_SLOT;
71-
SlotId tail = NULL_SLOT;
72-
73-
// Placement new
74-
static void* operator new(size_t, void* p) noexcept {
75-
return p;
76-
}
77-
78-
static void operator delete(void*, void*) noexcept {}
79-
};
80-
8169
class CollectionImpl {
8270
protected:
8371
CollectionData* data_;

src/ArduinoJson/Variant/VariantContent.hpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66

77
#include <stddef.h> // size_t
88

9-
#include <ArduinoJson/Array/ArrayData.hpp>
109
#include <ArduinoJson/Numbers/JsonFloat.hpp>
1110
#include <ArduinoJson/Numbers/JsonInteger.hpp>
12-
#include <ArduinoJson/Object/ObjectData.hpp>
1311

1412
ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
1513

@@ -46,6 +44,18 @@ inline bool operator&(VariantType type, VariantTypeBits bit) {
4644
return (uint8_t(type) & uint8_t(bit)) != 0;
4745
}
4846

47+
struct CollectionData {
48+
SlotId head = NULL_SLOT;
49+
SlotId tail = NULL_SLOT;
50+
51+
// Placement new
52+
static void* operator new(size_t, void* p) noexcept {
53+
return p;
54+
}
55+
56+
static void operator delete(void*, void*) noexcept {}
57+
};
58+
4959
const size_t tinyStringMaxLength = 3;
5060

5161
union VariantContent {

src/ArduinoJson/Variant/VariantImpl.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44

55
#pragma once
66

7+
#include <ArduinoJson/Array/ArrayData.hpp>
78
#include <ArduinoJson/Memory/ResourceManager.hpp>
89
#include <ArduinoJson/Misc/SerializedValue.hpp>
910
#include <ArduinoJson/Numbers/convertNumber.hpp>
11+
#include <ArduinoJson/Object/ObjectData.hpp>
1012
#include <ArduinoJson/Strings/JsonString.hpp>
1113
#include <ArduinoJson/Strings/StringAdapters.hpp>
1214
#include <ArduinoJson/Variant/VariantData.hpp>

0 commit comments

Comments
 (0)