mirror of
				https://github.com/bblanchon/ArduinoJson.git
				synced 2025-11-04 00:21:36 +01:00 
			
		
		
		
	Extracting a common base class for JsonArray and JsonObject...
This commit is contained in:
		@@ -6,6 +6,7 @@
 | 
			
		||||
 | 
			
		||||
#include "../../include/ArduinoJson/Internals/List.hpp"
 | 
			
		||||
 | 
			
		||||
#include "../../include/ArduinoJson/Internals/PlacementNew.hpp"
 | 
			
		||||
#include "../../include/ArduinoJson/JsonPair.hpp"
 | 
			
		||||
#include "../../include/ArduinoJson/JsonVariant.hpp"
 | 
			
		||||
 | 
			
		||||
@@ -19,5 +20,12 @@ int List<T>::size() const {
 | 
			
		||||
  return nodeCount;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <typename T>
 | 
			
		||||
Node<T> *List<T>::createNode() {
 | 
			
		||||
  if (!_buffer) return NULL;
 | 
			
		||||
  void *ptr = _buffer->alloc(sizeof(node_type));
 | 
			
		||||
  return ptr ? new (ptr) node_type() : NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template class List<JsonPair>;
 | 
			
		||||
template class List<JsonVariant>;
 | 
			
		||||
		Reference in New Issue
	
	Block a user