Skip to content

Commit

Permalink
Mark JsonArray, JsonObject, and JsonVariant as final
Browse files Browse the repository at this point in the history
See #2056
  • Loading branch information
bblanchon committed Feb 18, 2024
1 parent 848c0cd commit 483a2c9
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
ArduinoJson: change log
=======================

HEAD
----

* Mark `JsonArray`, `JsonObject`, and `JsonVariant` as `final` (issue #2056)

v7.0.3 (2024-02-05)
------

Expand Down
2 changes: 1 addition & 1 deletion src/ArduinoJson/Array/JsonArray.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class JsonObject;

// A reference to an array in a JsonDocument
// https://arduinojson.org/v7/api/jsonarray/
class JsonArray : public detail::VariantOperators<JsonArray> {
class JsonArray final : public detail::VariantOperators<JsonArray> {
friend class detail::VariantAttorney;

public:
Expand Down
2 changes: 1 addition & 1 deletion src/ArduinoJson/Array/JsonArrayConst.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class JsonObject;

// A read-only reference to an array in a JsonDocument
// https://arduinojson.org/v7/api/jsonarrayconst/
class JsonArrayConst : public detail::VariantOperators<JsonArrayConst> {
class JsonArrayConst final : public detail::VariantOperators<JsonArrayConst> {
friend class JsonArray;
friend class detail::VariantAttorney;

Expand Down
4 changes: 2 additions & 2 deletions src/ArduinoJson/Array/JsonArrayIterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Ptr {
T value_;
};

class JsonArrayIterator {
class JsonArrayIterator final {
friend class JsonArray;

public:
Expand Down Expand Up @@ -59,7 +59,7 @@ class JsonArrayIterator {
detail::ResourceManager* resources_;
};

class JsonArrayConstIterator {
class JsonArrayConstIterator final {
friend class JsonArray;

public:
Expand Down
2 changes: 1 addition & 1 deletion src/ArduinoJson/Object/JsonObject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class JsonArray;

// A reference to an object in a JsonDocument.
// https://arduinojson.org/v7/api/jsonobject/
class JsonObject : public detail::VariantOperators<JsonObject> {
class JsonObject final : public detail::VariantOperators<JsonObject> {
friend class detail::VariantAttorney;

public:
Expand Down
2 changes: 1 addition & 1 deletion src/ArduinoJson/Object/JsonObjectConst.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE

// A read-only reference to an object in a JsonDocument.
// https://arduinojson.org/v7/api/jsonobjectconst/
class JsonObjectConst : public detail::VariantOperators<JsonObjectConst> {
class JsonObjectConst final : public detail::VariantOperators<JsonObjectConst> {
friend class JsonObject;
friend class detail::VariantAttorney;

Expand Down
4 changes: 2 additions & 2 deletions src/ArduinoJson/Object/JsonObjectIterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE

class JsonObjectIterator {
class JsonObjectIterator final {
friend class JsonObject;

public:
Expand Down Expand Up @@ -43,7 +43,7 @@ class JsonObjectIterator {
detail::ResourceManager* resources_;
};

class JsonObjectConstIterator {
class JsonObjectConstIterator final {
friend class JsonObject;

public:
Expand Down
4 changes: 2 additions & 2 deletions src/ArduinoJson/Object/JsonPair.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE

// A key-value pair.
// https://arduinojson.org/v7/api/jsonobject/begin_end/
class JsonPair {
class JsonPair final {
public:
// INTERNAL USE ONLY
JsonPair(detail::ObjectData::iterator iterator,
Expand Down Expand Up @@ -41,7 +41,7 @@ class JsonPair {

// A read-only key-value pair.
// https://arduinojson.org/v7/api/jsonobjectconst/begin_end/
class JsonPairConst {
class JsonPairConst final {
public:
JsonPairConst(detail::ObjectData::iterator iterator,
const detail::ResourceManager* resources)
Expand Down
4 changes: 2 additions & 2 deletions src/ArduinoJson/Variant/JsonVariant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE

// A reference to a value in a JsonDocument.
// https://arduinojson.org/v7/api/jsonvariant/
class JsonVariant : public detail::VariantRefBase<JsonVariant>,
public detail::VariantOperators<JsonVariant> {
class JsonVariant final : public detail::VariantRefBase<JsonVariant>,
public detail::VariantOperators<JsonVariant> {
friend class detail::VariantAttorney;

public:
Expand Down
5 changes: 3 additions & 2 deletions src/ArduinoJson/Variant/JsonVariantConst.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ class JsonObject;

// A read-only reference to a value in a JsonDocument
// https://arduinojson.org/v7/api/jsonarrayconst/
class JsonVariantConst : public detail::VariantTag,
public detail::VariantOperators<JsonVariantConst> {
class JsonVariantConst final
: public detail::VariantTag,
public detail::VariantOperators<JsonVariantConst> {
friend class detail::VariantAttorney;

public:
Expand Down

0 comments on commit 483a2c9

Please sign in to comment.