Rev | Line | |
---|
[209] | 1 | // Copyright Benoit Blanchon 2014-2016
|
---|
| 2 | // MIT License
|
---|
| 3 | //
|
---|
| 4 | // Arduino JSON library
|
---|
| 5 | // https://github.com/bblanchon/ArduinoJson
|
---|
| 6 | // If you like this project, please add a star!
|
---|
| 7 |
|
---|
| 8 | #pragma once
|
---|
| 9 |
|
---|
| 10 | namespace ArduinoJson {
|
---|
| 11 | namespace Internals {
|
---|
| 12 |
|
---|
| 13 | // A type that is meant to be used by reference only (JsonArray and JsonObject)
|
---|
| 14 | class ReferenceType {
|
---|
| 15 | public:
|
---|
| 16 | bool operator==(const ReferenceType& other) const {
|
---|
| 17 | // two JsonArray are equal if they are the same instance
|
---|
| 18 | // (we don't compare the content)
|
---|
| 19 | return this == &other;
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | bool operator!=(const ReferenceType& other) const { return this != &other; }
|
---|
| 23 |
|
---|
| 24 | protected:
|
---|
| 25 | ReferenceType() {}
|
---|
| 26 |
|
---|
| 27 | private:
|
---|
| 28 | // copy constructor is private
|
---|
| 29 | ReferenceType(const ReferenceType&);
|
---|
| 30 |
|
---|
| 31 | // copy operator is private
|
---|
| 32 | ReferenceType& operator=(const ReferenceType&);
|
---|
| 33 | };
|
---|
| 34 | }
|
---|
| 35 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.