Просмотр исходного кода

Remove serialization for boxing classes

Patrick-Christopher Mattulat 3 лет назад
Родитель
Сommit
7908cc3566
20 измененных файлов с 1 добавлено и 1049 удалено
  1. 0 12
      CMakeLists.txt
  2. 1 7
      include/ls_std/ls_std.hpp
  3. 0 48
      include/ls_std/serialization/json/boxing/SerializableJsonBoolean.hpp
  4. 0 48
      include/ls_std/serialization/json/boxing/SerializableJsonDouble.hpp
  5. 0 48
      include/ls_std/serialization/json/boxing/SerializableJsonFloat.hpp
  6. 0 47
      include/ls_std/serialization/json/boxing/SerializableJsonInteger.hpp
  7. 0 47
      include/ls_std/serialization/json/boxing/SerializableJsonLong.hpp
  8. 0 47
      include/ls_std/serialization/json/boxing/SerializableJsonString.hpp
  9. 0 57
      source/ls_std/serialization/json/boxing/SerializableJsonBoolean.cpp
  10. 0 58
      source/ls_std/serialization/json/boxing/SerializableJsonDouble.cpp
  11. 0 58
      source/ls_std/serialization/json/boxing/SerializableJsonFloat.cpp
  12. 0 58
      source/ls_std/serialization/json/boxing/SerializableJsonInteger.cpp
  13. 0 58
      source/ls_std/serialization/json/boxing/SerializableJsonLong.cpp
  14. 0 57
      source/ls_std/serialization/json/boxing/SerializableJsonString.cpp
  15. 0 68
      test/cases/serialization/json/boxing/SerializableJsonBooleanTest.cpp
  16. 0 67
      test/cases/serialization/json/boxing/SerializableJsonDoubleTest.cpp
  17. 0 66
      test/cases/serialization/json/boxing/SerializableJsonFloatTest.cpp
  18. 0 66
      test/cases/serialization/json/boxing/SerializableJsonIntegerTest.cpp
  19. 0 66
      test/cases/serialization/json/boxing/SerializableJsonLongTest.cpp
  20. 0 66
      test/cases/serialization/json/boxing/SerializableJsonStringTest.cpp

+ 0 - 12
CMakeLists.txt

@@ -67,12 +67,6 @@ set(SOURCE_FILES
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/FileOutputStream.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/logging/Logger.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/logging/LogLevel.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/boxing/SerializableJsonInteger.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/boxing/SerializableJsonLong.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/boxing/SerializableJsonString.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/boxing/SerializableJsonFloat.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/boxing/SerializableJsonDouble.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/boxing/SerializableJsonBoolean.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/logic/StateMachine.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/logic/State.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/logic/StateConnection.cpp
@@ -117,12 +111,6 @@ if (${LS_STD_BUILD_WITH_TESTS})
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileOutputStreamTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/logging/LoggerTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/JsonTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/boxing/SerializableJsonIntegerTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/boxing/SerializableJsonLongTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/boxing/SerializableJsonStringTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/boxing/SerializableJsonFloatTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/boxing/SerializableJsonDoubleTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/boxing/SerializableJsonBooleanTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/logic/StateTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/logic/StateMachineTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/logic/StateConnectionTest.cpp

+ 1 - 7
include/ls_std/ls_std.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-29
- * Changed:         2021-07-14
+ * Changed:         2021-07-15
  *
  * */
 
@@ -68,12 +68,6 @@
 #include "logic/StateMachine.hpp"
 #include "logic/StateMachineTypes.hpp"
 
-#include "serialization/json/boxing/SerializableJsonBoolean.hpp"
-#include "serialization/json/boxing/SerializableJsonDouble.hpp"
-#include "serialization/json/boxing/SerializableJsonFloat.hpp"
-#include "serialization/json/boxing/SerializableJsonInteger.hpp"
-#include "serialization/json/boxing/SerializableJsonLong.hpp"
-#include "serialization/json/boxing/SerializableJsonString.hpp"
 #include "serialization/json/logic/SerializableJsonState.hpp"
 #include "serialization/json/logic/SerializableJsonStateConnection.hpp"
 #include "serialization/json/logic/SerializableJsonStateMachine.hpp"

+ 0 - 48
include/ls_std/serialization/json/boxing/SerializableJsonBoolean.hpp

@@ -1,48 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-09-04
- * Changed:         2021-05-02
- *
- * */
-
-#ifndef LS_STD_SERIALIZABLE_JSON_BOOLEAN_HPP
-#define LS_STD_SERIALIZABLE_JSON_BOOLEAN_HPP
-
-#include <memory>
-#include <ls_std/lib/nlohmann_json/include/nlohmann/json.hpp>
-#include <ls_std/base/Class.hpp>
-#include <ls_std/serialization/ISerializable.hpp>
-#include <ls_std/boxing/Boolean.hpp>
-
-namespace ls_std
-{
-  class SerializableJsonBoolean : public ls_std::Class, public ls_std::ISerializable
-  {
-    public:
-
-      explicit SerializableJsonBoolean(const std::shared_ptr<ls_std::Boolean> &_value);
-      ~SerializableJsonBoolean() override = default;
-
-      // implementation
-
-      ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field &_data) override;
-
-      // additional functionality
-
-      std::shared_ptr<ls_std::Boolean> getValue();
-      void setValue(const std::shared_ptr<ls_std::Boolean> &_value);
-
-    private:
-
-      std::shared_ptr<ls_std::Boolean> value{};
-      nlohmann::json jsonObject{};
-
-      void _assignValue(const std::shared_ptr<ls_std::Boolean> &_value);
-      void _update();
-  };
-}
-
-#endif

+ 0 - 48
include/ls_std/serialization/json/boxing/SerializableJsonDouble.hpp

@@ -1,48 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-09-04
- * Changed:         2021-05-02
- *
- * */
-
-#ifndef LS_STD_SERIALIZABLE_JSON_DOUBLE_HPP
-#define LS_STD_SERIALIZABLE_JSON_DOUBLE_HPP
-
-#include <memory>
-#include <ls_std/lib/nlohmann_json/include/nlohmann/json.hpp>
-#include <ls_std/base/Class.hpp>
-#include <ls_std/serialization/ISerializable.hpp>
-#include <ls_std/boxing/Double.hpp>
-
-namespace ls_std
-{
-  class SerializableJsonDouble : public ls_std::Class, public ls_std::ISerializable
-  {
-    public:
-
-      explicit SerializableJsonDouble(const std::shared_ptr<ls_std::Double> &_value);
-      ~SerializableJsonDouble() override = default;
-
-      // implementation
-
-      ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field &_data) override;
-
-      // additional functionality
-
-      std::shared_ptr<ls_std::Double> getValue();
-      void setValue(const std::shared_ptr<ls_std::Double> &_value);
-
-    private:
-
-      std::shared_ptr<ls_std::Double> value{};
-      nlohmann::json jsonObject{};
-
-      void _assignValue(const std::shared_ptr<ls_std::Double> &_value);
-      void _update();
-  };
-}
-
-#endif

+ 0 - 48
include/ls_std/serialization/json/boxing/SerializableJsonFloat.hpp

@@ -1,48 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-09-04
- * Changed:         2021-05-02
- *
- * */
-
-#ifndef LS_STD_SERIALIZABLE_JSON_FLOAT_HPP
-#define LS_STD_SERIALIZABLE_JSON_FLOAT_HPP
-
-#include <memory>
-#include <ls_std/lib/nlohmann_json/include/nlohmann/json.hpp>
-#include <ls_std/base/Class.hpp>
-#include <ls_std/serialization/ISerializable.hpp>
-#include <ls_std/boxing/Float.hpp>
-
-namespace ls_std
-{
-  class SerializableJsonFloat : public ls_std::Class, public ls_std::ISerializable
-  {
-    public:
-
-      explicit SerializableJsonFloat(const std::shared_ptr<ls_std::Float> &_value);
-      ~SerializableJsonFloat() override = default;
-
-      // implementation
-
-      ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field &_data) override;
-
-      // additional functionality
-
-      std::shared_ptr<ls_std::Float> getValue();
-      void setValue(const std::shared_ptr<ls_std::Float> &_value);
-
-    private:
-
-      std::shared_ptr<ls_std::Float> value{};
-      nlohmann::json jsonObject{};
-
-      void _assignValue(const std::shared_ptr<ls_std::Float> &_value);
-      void _update();
-  };
-}
-
-#endif

+ 0 - 47
include/ls_std/serialization/json/boxing/SerializableJsonInteger.hpp

@@ -1,47 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-21
- * Changed:         2021-05-02
- *
- * */
-
-#ifndef LS_STD_SERIALIZABLE_JSON_INTEGER_HPP
-#define LS_STD_SERIALIZABLE_JSON_INTEGER_HPP
-
-#include <ls_std/serialization/ISerializable.hpp>
-#include <ls_std/base/Class.hpp>
-#include <ls_std/boxing/Integer.hpp>
-#include <ls_std/lib/nlohmann_json/include/nlohmann/json.hpp>
-
-namespace ls_std
-{
-  class SerializableJsonInteger : public ls_std::Class, public ls_std::ISerializable
-  {
-    public:
-
-      explicit SerializableJsonInteger(const std::shared_ptr<ls_std::Integer> &_value);
-      ~SerializableJsonInteger() override = default;
-
-      // implementation
-
-      ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field &_data) override;
-
-      // additional functionality
-
-      std::shared_ptr<ls_std::Integer> getValue();
-      void setValue(const std::shared_ptr<ls_std::Integer> &_value);
-
-    private:
-
-      std::shared_ptr<ls_std::Integer> value{};
-      nlohmann::json jsonObject{};
-
-      void _assignValue(const std::shared_ptr<ls_std::Integer> &_value);
-      void _update();
-  };
-}
-
-#endif

+ 0 - 47
include/ls_std/serialization/json/boxing/SerializableJsonLong.hpp

@@ -1,47 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-25
- * Changed:         2021-05-02
- *
- * */
-
-#ifndef LS_STD_SERIALIZABLE_JSON_LONG_HPP
-#define LS_STD_SERIALIZABLE_JSON_LONG_HPP
-
-#include <ls_std/base/Class.hpp>
-#include <ls_std/serialization/ISerializable.hpp>
-#include <ls_std/boxing/Long.hpp>
-#include <ls_std/lib/nlohmann_json/include/nlohmann/json.hpp>
-
-namespace ls_std
-{
-  class SerializableJsonLong : public ls_std::Class, public ls_std::ISerializable
-  {
-    public:
-
-      explicit SerializableJsonLong(const std::shared_ptr<ls_std::Long> &_value);
-      ~SerializableJsonLong() override = default;
-
-      // implementation
-
-      ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field &_data) override;
-
-      // additional functionality
-
-      std::shared_ptr<ls_std::Long> getValue();
-      void setValue(const std::shared_ptr<ls_std::Long> &_value);
-
-    private:
-
-      nlohmann::json jsonObject{};
-      std::shared_ptr<ls_std::Long> value{};
-
-      void _assignValue(const std::shared_ptr<ls_std::Long> &_value);
-      void _update();
-  };
-}
-
-#endif

+ 0 - 47
include/ls_std/serialization/json/boxing/SerializableJsonString.hpp

@@ -1,47 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-30
- * Changed:         2021-05-02
- *
- * */
-
-#ifndef LS_STD_SERIALIZABLE_JSON_STRING_HPP
-#define LS_STD_SERIALIZABLE_JSON_STRING_HPP
-
-#include <memory>
-#include <ls_std/lib/nlohmann_json/include/nlohmann/json.hpp>
-#include <ls_std/serialization/ISerializable.hpp>
-#include <ls_std/boxing/String.hpp>
-
-namespace ls_std
-{
-  class SerializableJsonString : public ls_std::Class, public ls_std::ISerializable
-  {
-    public:
-
-      explicit SerializableJsonString(const std::shared_ptr<ls_std::String> &_value);
-      ~SerializableJsonString() override = default;
-
-      // implementation
-
-      ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field &_data) override;
-
-      // additional functionality
-
-      std::shared_ptr<ls_std::String> getValue();
-      void setValue(const std::shared_ptr<ls_std::String> &_value);
-
-    private:
-
-      nlohmann::json jsonObject{};
-      std::shared_ptr<ls_std::String> value{};
-
-      void _assignValue(const std::shared_ptr<ls_std::String> &_value);
-      void _update();
-  };
-}
-
-#endif

+ 0 - 57
source/ls_std/serialization/json/boxing/SerializableJsonBoolean.cpp

@@ -1,57 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-09-04
- * Changed:         2021-05-02
- *
- * */
-
-#include <ls_std/serialization/json/boxing/SerializableJsonBoolean.hpp>
-#include <ls_std/exception/IllegalArgumentException.hpp>
-
-ls_std::SerializableJsonBoolean::SerializableJsonBoolean(const std::shared_ptr<ls_std::Boolean> &_value) : ls_std::Class("SerializableJsonBoolean")
-{
-  this->_assignValue(_value);
-}
-
-ls_std::byte_field ls_std::SerializableJsonBoolean::marshal()
-{
-  this->_update();
-  return this->jsonObject.dump();
-}
-
-void ls_std::SerializableJsonBoolean::unmarshal(const ls_std::byte_field &_data)
-{
-  this->jsonObject = nlohmann::json::parse(_data);
-
-  if (this->jsonObject.contains("value"))
-  {
-    *this->value = (bool) this->jsonObject["value"];
-  }
-}
-
-std::shared_ptr<ls_std::Boolean> ls_std::SerializableJsonBoolean::getValue()
-{
-  return this->value;
-}
-
-void ls_std::SerializableJsonBoolean::setValue(const std::shared_ptr<ls_std::Boolean> &_value)
-{
-  this->_assignValue(_value);
-}
-
-void ls_std::SerializableJsonBoolean::_assignValue(const std::shared_ptr<ls_std::Boolean> &_value)
-{
-  if (_value == nullptr)
-  {
-    throw ls_std::IllegalArgumentException{};
-  }
-
-  this->value = _value;
-}
-
-void ls_std::SerializableJsonBoolean::_update()
-{
-  this->jsonObject = {{"value", this->value->getValue()}};
-}

+ 0 - 58
source/ls_std/serialization/json/boxing/SerializableJsonDouble.cpp

@@ -1,58 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-09-04
- * Changed:         2021-05-02
- *
- * */
-
-#include <ls_std/serialization/json/boxing/SerializableJsonDouble.hpp>
-#include <ls_std/exception/IllegalArgumentException.hpp>
-
-ls_std::SerializableJsonDouble::SerializableJsonDouble(const std::shared_ptr<ls_std::Double> &_value) : ls_std::Class("SerializableJsonDouble")
-{
-  this->_assignValue(_value);
-}
-
-ls_std::byte_field ls_std::SerializableJsonDouble::marshal()
-{
-  this->_update();
-  return this->jsonObject.dump();
-}
-
-void ls_std::SerializableJsonDouble::unmarshal(const ls_std::byte_field &_data)
-{
-  std::string jsonString = std::string(_data);
-  this->jsonObject = nlohmann::json::parse(jsonString);
-
-  if (this->jsonObject.contains("value"))
-  {
-    *this->value = this->jsonObject["value"];
-  }
-}
-
-std::shared_ptr<ls_std::Double> ls_std::SerializableJsonDouble::getValue()
-{
-  return this->value;
-}
-
-void ls_std::SerializableJsonDouble::setValue(const std::shared_ptr<ls_std::Double> &_value)
-{
-  this->_assignValue(_value);
-}
-
-void ls_std::SerializableJsonDouble::_assignValue(const std::shared_ptr<ls_std::Double> &_value)
-{
-  if (_value == nullptr)
-  {
-    throw ls_std::IllegalArgumentException{};
-  }
-
-  this->value = _value;
-}
-
-void ls_std::SerializableJsonDouble::_update()
-{
-  this->jsonObject = {{"value", this->value->getValue()}};
-}

+ 0 - 58
source/ls_std/serialization/json/boxing/SerializableJsonFloat.cpp

@@ -1,58 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-09-04
- * Changed:         2021-05-02
- *
- * */
-
-#include <ls_std/serialization/json/boxing/SerializableJsonFloat.hpp>
-#include <ls_std/exception/IllegalArgumentException.hpp>
-
-ls_std::SerializableJsonFloat::SerializableJsonFloat(const std::shared_ptr<ls_std::Float> &_value) : ls_std::Class("SerializableJsonFloat")
-{
-  this->_assignValue(_value);
-}
-
-ls_std::byte_field ls_std::SerializableJsonFloat::marshal()
-{
-  this->_update();
-  return this->jsonObject.dump();
-}
-
-void ls_std::SerializableJsonFloat::unmarshal(const ls_std::byte_field &_data)
-{
-  std::string jsonString = std::string(_data);
-  this->jsonObject = nlohmann::json::parse(jsonString);
-
-  if (this->jsonObject.contains("value"))
-  {
-    *this->value = this->jsonObject["value"];
-  }
-}
-
-std::shared_ptr<ls_std::Float> ls_std::SerializableJsonFloat::getValue()
-{
-  return this->value;
-}
-
-void ls_std::SerializableJsonFloat::setValue(const std::shared_ptr<ls_std::Float> &_value)
-{
-  this->_assignValue(_value);
-}
-
-void ls_std::SerializableJsonFloat::_assignValue(const std::shared_ptr<ls_std::Float> &_value)
-{
-  if (_value == nullptr)
-  {
-    throw ls_std::IllegalArgumentException{};
-  }
-
-  this->value = _value;
-}
-
-void ls_std::SerializableJsonFloat::_update()
-{
-  this->jsonObject = {{"value", this->value->getValue()}};
-}

+ 0 - 58
source/ls_std/serialization/json/boxing/SerializableJsonInteger.cpp

@@ -1,58 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-21
- * Changed:         2021-05-02
- *
- * */
-
-#include <ls_std/serialization/json/boxing/SerializableJsonInteger.hpp>
-#include <ls_std/exception/IllegalArgumentException.hpp>
-
-ls_std::SerializableJsonInteger::SerializableJsonInteger(const std::shared_ptr<ls_std::Integer> &_value) : ls_std::Class("SerializableJsonInteger")
-{
-  this->_assignValue(_value);
-}
-
-ls_std::byte_field ls_std::SerializableJsonInteger::marshal()
-{
-  this->_update();
-  return this->jsonObject.dump();
-}
-
-void ls_std::SerializableJsonInteger::unmarshal(const ls_std::byte_field &_data)
-{
-  std::string jsonString = std::string(_data);
-  this->jsonObject = nlohmann::json::parse(jsonString);
-
-  if (this->jsonObject.contains("value"))
-  {
-    *this->value = this->jsonObject["value"];
-  }
-}
-
-std::shared_ptr<ls_std::Integer> ls_std::SerializableJsonInteger::getValue()
-{
-  return this->value;
-}
-
-void ls_std::SerializableJsonInteger::setValue(const std::shared_ptr<ls_std::Integer> &_value)
-{
-  this->_assignValue(_value);
-}
-
-void ls_std::SerializableJsonInteger::_assignValue(const std::shared_ptr<ls_std::Integer> &_value)
-{
-  if (_value == nullptr)
-  {
-    throw ls_std::IllegalArgumentException{};
-  }
-
-  this->value = _value;
-}
-
-void ls_std::SerializableJsonInteger::_update()
-{
-  this->jsonObject = {{"value", this->value->getValue()}};
-}

+ 0 - 58
source/ls_std/serialization/json/boxing/SerializableJsonLong.cpp

@@ -1,58 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-25
- * Changed:         2021-05-02
- *
- * */
-
-#include <ls_std/serialization/json/boxing/SerializableJsonLong.hpp>
-#include <ls_std/exception/IllegalArgumentException.hpp>
-
-ls_std::SerializableJsonLong::SerializableJsonLong(const std::shared_ptr<ls_std::Long> &_value) : ls_std::Class("SerializableJsonLong")
-{
-  this->_assignValue(_value);
-}
-
-ls_std::byte_field ls_std::SerializableJsonLong::marshal()
-{
-  this->_update();
-  return this->jsonObject.dump();
-}
-
-void ls_std::SerializableJsonLong::unmarshal(const ls_std::byte_field &_data)
-{
-  std::string jsonString = std::string(_data);
-  this->jsonObject = nlohmann::json::parse(jsonString);
-
-  if (this->jsonObject.contains("value"))
-  {
-    *this->value = this->jsonObject["value"];
-  }
-}
-
-std::shared_ptr<ls_std::Long> ls_std::SerializableJsonLong::getValue()
-{
-  return this->value;
-}
-
-void ls_std::SerializableJsonLong::setValue(const std::shared_ptr<ls_std::Long> &_value)
-{
-  this->_assignValue(_value);
-}
-
-void ls_std::SerializableJsonLong::_assignValue(const std::shared_ptr<ls_std::Long> &_value)
-{
-  if (_value == nullptr)
-  {
-    throw ls_std::IllegalArgumentException{};
-  }
-
-  this->value = _value;
-}
-
-void ls_std::SerializableJsonLong::_update()
-{
-  this->jsonObject = {{"value", (ls_std::long_type) this->value->getValue()}};
-}

+ 0 - 57
source/ls_std/serialization/json/boxing/SerializableJsonString.cpp

@@ -1,57 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-30
- * Changed:         2021-05-02
- *
- * */
-
-#include <ls_std/serialization/json/boxing/SerializableJsonString.hpp>
-#include <ls_std/exception/IllegalArgumentException.hpp>
-
-ls_std::SerializableJsonString::SerializableJsonString(const std::shared_ptr<ls_std::String> &_value) : ls_std::Class("SerializableJsonString")
-{
-  this->_assignValue(_value);
-}
-
-ls_std::byte_field ls_std::SerializableJsonString::marshal()
-{
-  this->_update();
-  return this->jsonObject.dump();
-}
-
-void ls_std::SerializableJsonString::unmarshal(const ls_std::byte_field &_data)
-{
-  this->jsonObject = nlohmann::json::parse(_data);
-
-  if (this->jsonObject.contains("value"))
-  {
-    *this->value = this->jsonObject["value"];
-  }
-}
-
-std::shared_ptr<ls_std::String> ls_std::SerializableJsonString::getValue()
-{
-  return this->value;
-}
-
-void ls_std::SerializableJsonString::setValue(const std::shared_ptr<ls_std::String> &_value)
-{
-  this->_assignValue(_value);
-}
-
-void ls_std::SerializableJsonString::_assignValue(const std::shared_ptr<ls_std::String> &_value)
-{
-  if (_value == nullptr)
-  {
-    throw ls_std::IllegalArgumentException{};
-  }
-
-  this->value = _value;
-}
-
-void ls_std::SerializableJsonString::_update()
-{
-  this->jsonObject = {{"value", this->value->toString()}};
-}

+ 0 - 68
test/cases/serialization/json/boxing/SerializableJsonBooleanTest.cpp

@@ -1,68 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-09-04
- * Changed:         2021-05-02
- *
- * */
-
-#include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
-
-namespace
-{
-  class SerializableJsonBooleanTest : public ::testing::Test
-  {
-    protected:
-
-      SerializableJsonBooleanTest() = default;
-      ~SerializableJsonBooleanTest() override = default;
-
-      void SetUp() override
-      {}
-
-      void TearDown() override
-      {}
-  };
-
-  TEST_F(SerializableJsonBooleanTest, marshal)
-  {
-    ls_std::Boolean x{true};
-    ls_std::SerializableJsonBoolean serializable{std::make_shared<ls_std::Boolean>(x)};
-    ls_std::String jsonString{serializable.marshal()};
-
-    ASSERT_TRUE(jsonString.contains(R"({"value":true)"));
-  }
-
-  TEST_F(SerializableJsonBooleanTest, unmarshal)
-  {
-    std::shared_ptr<ls_std::Boolean> x = std::make_shared<ls_std::Boolean>(false);
-
-    ASSERT_FALSE(*x);
-
-    ls_std::SerializableJsonBoolean serializable{x};
-    serializable.unmarshal(R"({"value":true})");
-
-    ASSERT_TRUE(*x);
-  }
-
-  TEST_F(SerializableJsonBooleanTest, getValue)
-  {
-    std::shared_ptr<ls_std::Boolean> x = std::make_shared<ls_std::Boolean>(false);
-    ls_std::SerializableJsonBoolean serializable{x};
-
-    ASSERT_TRUE(serializable.getValue() == x);
-  }
-
-  TEST_F(SerializableJsonBooleanTest, setValue)
-  {
-    std::shared_ptr<ls_std::Boolean> x = std::make_shared<ls_std::Boolean>(false);
-    ls_std::SerializableJsonBoolean serializable{x};
-    ASSERT_TRUE(serializable.getValue() == x);
-
-    x = std::make_shared<ls_std::Boolean>(true);
-    serializable.setValue(x);
-    ASSERT_TRUE(serializable.getValue() == x);
-  }
-}

+ 0 - 67
test/cases/serialization/json/boxing/SerializableJsonDoubleTest.cpp

@@ -1,67 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-09-04
- * Changed:         2021-05-02
- *
- * */
-
-#include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
-
-namespace
-{
-  class SerializableJsonDoubleTest : public ::testing::Test
-  {
-    protected:
-
-      SerializableJsonDoubleTest() = default;
-      ~SerializableJsonDoubleTest() override = default;
-
-      void SetUp() override
-      {}
-
-      void TearDown() override
-      {}
-  };
-
-  TEST_F(SerializableJsonDoubleTest, marshal)
-  {
-    ls_std::Double x{3.14159};
-    ls_std::SerializableJsonDouble serializable{std::make_shared<ls_std::Double>(x)};
-    ls_std::String jsonString{serializable.marshal()};
-
-    ASSERT_TRUE(jsonString.contains(R"({"value":3.14159)"));
-  }
-
-  TEST_F(SerializableJsonDoubleTest, unmarshal)
-  {
-    std::shared_ptr<ls_std::Double> x = std::make_shared<ls_std::Double>(14.2234);
-
-    ASSERT_DOUBLE_EQ(14.2234, *x);
-
-    ls_std::SerializableJsonDouble serializable{x};
-    serializable.unmarshal(R"({"value":3.14159})");
-
-    ASSERT_DOUBLE_EQ(3.14159, *x);
-  }
-
-  TEST_F(SerializableJsonDoubleTest, getValue)
-  {
-    std::shared_ptr<ls_std::Double> x = std::make_shared<ls_std::Double>(14.2234);
-    ls_std::SerializableJsonDouble serializable{x};
-    ASSERT_TRUE(serializable.getValue() == x);
-  }
-
-  TEST_F(SerializableJsonDoubleTest, setValue)
-  {
-    std::shared_ptr<ls_std::Double> x = std::make_shared<ls_std::Double>(14.2234);
-    ls_std::SerializableJsonDouble serializable{x};
-    ASSERT_TRUE(serializable.getValue() == x);
-
-    x = std::make_shared<ls_std::Double>(3.145);
-    serializable.setValue(x);
-    ASSERT_TRUE(serializable.getValue() == x);
-  }
-}

+ 0 - 66
test/cases/serialization/json/boxing/SerializableJsonFloatTest.cpp

@@ -1,66 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-09-04
- * Changed:         2021-05-02
- *
- * */
-
-#include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
-
-namespace
-{
-  class SerializableJsonFloatTest : public ::testing::Test
-  {
-    protected:
-
-      SerializableJsonFloatTest() = default;
-      ~SerializableJsonFloatTest() override = default;
-
-      void SetUp() override
-      {}
-
-      void TearDown() override
-      {}
-  };
-
-  TEST_F(SerializableJsonFloatTest, marshal)
-  {
-    ls_std::Float x{3.14159f};
-    ls_std::SerializableJsonFloat serializable{std::make_shared<ls_std::Float>(x)};
-    ls_std::String jsonString{serializable.marshal()};
-
-    ASSERT_TRUE(jsonString.contains(R"({"value":3.14159)"));
-  }
-
-  TEST_F(SerializableJsonFloatTest, unmarshal)
-  {
-    std::shared_ptr<ls_std::Float> x = std::make_shared<ls_std::Float>(14.2234f);
-    ASSERT_FLOAT_EQ(14.2234f, *x);
-
-    ls_std::SerializableJsonFloat serializable{x};
-    serializable.unmarshal(R"({"value":3.14159})");
-
-    ASSERT_FLOAT_EQ(3.14159f, *x);
-  }
-
-  TEST_F(SerializableJsonFloatTest, getValue)
-  {
-    std::shared_ptr<ls_std::Float> x = std::make_shared<ls_std::Float>(14.2234f);
-    ls_std::SerializableJsonFloat serializable{x};
-    ASSERT_TRUE(serializable.getValue() == x);
-  }
-
-  TEST_F(SerializableJsonFloatTest, setValue)
-  {
-    std::shared_ptr<ls_std::Float> x = std::make_shared<ls_std::Float>(14.2234f);
-    ls_std::SerializableJsonFloat serializable{x};
-    ASSERT_TRUE(serializable.getValue() == x);
-
-    x = std::make_shared<ls_std::Float>(3.134f);
-    serializable.setValue(x);
-    ASSERT_TRUE(serializable.getValue() == x);
-  }
-}

+ 0 - 66
test/cases/serialization/json/boxing/SerializableJsonIntegerTest.cpp

@@ -1,66 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-21
- * Changed:         2021-05-02
- *
- * */
-
-#include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
-
-namespace
-{
-  class SerializableJsonIntegerTest : public ::testing::Test
-  {
-    protected:
-
-      SerializableJsonIntegerTest() = default;
-      ~SerializableJsonIntegerTest() override = default;
-
-      void SetUp() override
-      {}
-
-      void TearDown() override
-      {}
-  };
-
-  TEST_F(SerializableJsonIntegerTest, marshal)
-  {
-    ls_std::Integer x{3};
-    ls_std::SerializableJsonInteger serializable{std::make_shared<ls_std::Integer>(x)};
-    ls_std::byte_field content = serializable.marshal();
-
-    ASSERT_STREQ(R"({"value":3})", content.c_str());
-  }
-
-  TEST_F(SerializableJsonIntegerTest, unmarshal)
-  {
-    std::shared_ptr<ls_std::Integer> x = std::make_shared<ls_std::Integer>(13);
-    ASSERT_EQ(13, *x);
-
-    ls_std::SerializableJsonInteger serializable{x};
-    serializable.unmarshal(R"({"value":1989})");
-
-    ASSERT_EQ(1989, *x);
-  }
-
-  TEST_F(SerializableJsonIntegerTest, getValue)
-  {
-    std::shared_ptr<ls_std::Integer> x = std::make_shared<ls_std::Integer>(13);
-    ls_std::SerializableJsonInteger serializable{x};
-    ASSERT_TRUE(serializable.getValue() == x);
-  }
-
-  TEST_F(SerializableJsonIntegerTest, setValue)
-  {
-    std::shared_ptr<ls_std::Integer> x = std::make_shared<ls_std::Integer>(13);
-    ls_std::SerializableJsonInteger serializable{x};
-    ASSERT_TRUE(serializable.getValue() == x);
-
-    x = std::make_shared<ls_std::Integer>(25);
-    serializable.setValue(x);
-    ASSERT_TRUE(serializable.getValue() == x);
-  }
-}

+ 0 - 66
test/cases/serialization/json/boxing/SerializableJsonLongTest.cpp

@@ -1,66 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-26
- * Changed:         2021-05-02
- *
- * */
-
-#include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
-
-namespace
-{
-  class SerializableJsonLongTest : public ::testing::Test
-  {
-    protected:
-
-      SerializableJsonLongTest() = default;
-      ~SerializableJsonLongTest() override = default;
-
-      void SetUp() override
-      {}
-
-      void TearDown() override
-      {}
-  };
-
-  TEST_F(SerializableJsonLongTest, marshal)
-  {
-    ls_std::Long x{(ls_std::long_type) 31983771009271};
-    ls_std::SerializableJsonLong serializable{std::make_shared<ls_std::Long>(x)};
-    ls_std::byte_field content = serializable.marshal();
-
-    ASSERT_STREQ(R"({"value":31983771009271})", content.c_str());
-  }
-
-  TEST_F(SerializableJsonLongTest, unmarshal)
-  {
-    std::shared_ptr<ls_std::Long> x = std::make_shared<ls_std::Long>(31983771009271);
-    ASSERT_EQ(31983771009271, *x);
-
-    ls_std::SerializableJsonLong serializable{x};
-    serializable.unmarshal(R"({"value":1989})");
-
-    ASSERT_EQ(1989, *x);
-  }
-
-  TEST_F(SerializableJsonLongTest, getValue)
-  {
-    std::shared_ptr<ls_std::Long> x = std::make_shared<ls_std::Long>(31983771009271);
-    ls_std::SerializableJsonLong serializable{x};
-    ASSERT_TRUE(serializable.getValue() == x);
-  }
-
-  TEST_F(SerializableJsonLongTest, setValue)
-  {
-    std::shared_ptr<ls_std::Long> x = std::make_shared<ls_std::Long>(31983771009271);
-    ls_std::SerializableJsonLong serializable{x};
-    ASSERT_TRUE(serializable.getValue() == x);
-
-    x = std::make_shared<ls_std::Long>(31983771009221);
-    serializable.setValue(x);
-    ASSERT_TRUE(serializable.getValue() == x);
-  }
-}

+ 0 - 66
test/cases/serialization/json/boxing/SerializableJsonStringTest.cpp

@@ -1,66 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-30
- * Changed:         2021-05-02
- *
- * */
-
-#include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
-
-namespace
-{
-  class SerializableJsonStringTest : public ::testing::Test
-  {
-    protected:
-
-      SerializableJsonStringTest() = default;
-      ~SerializableJsonStringTest() override = default;
-
-      void SetUp() override
-      {}
-
-      void TearDown() override
-      {}
-  };
-
-  TEST_F(SerializableJsonStringTest, marshal)
-  {
-    ls_std::String x{"Testing something!"};
-    ls_std::SerializableJsonString serializable{std::make_shared<ls_std::String>(x)};
-    ls_std::byte_field content = serializable.marshal();
-
-    ASSERT_STREQ(R"({"value":"Testing something!"})", content.c_str());
-  }
-
-  TEST_F(SerializableJsonStringTest, unmarshal)
-  {
-    std::shared_ptr<ls_std::String> x = std::make_shared<ls_std::String>("Hello!");
-    ASSERT_STREQ("Hello!", *x);
-
-    ls_std::SerializableJsonString serializable{x};
-    serializable.unmarshal(R"({"value":"Ups!"})");
-
-    ASSERT_STREQ("Ups!", *x);
-  }
-
-  TEST_F(SerializableJsonStringTest, getValue)
-  {
-    std::shared_ptr<ls_std::String> x = std::make_shared<ls_std::String>("Hello!");
-    ls_std::SerializableJsonString serializable{x};
-    ASSERT_TRUE(serializable.getValue() == x);
-  }
-
-  TEST_F(SerializableJsonStringTest, setValue)
-  {
-    std::shared_ptr<ls_std::String> x = std::make_shared<ls_std::String>("Hello!");
-    ls_std::SerializableJsonString serializable{x};
-    ASSERT_TRUE(serializable.getValue() == x);
-
-    x = std::make_shared<ls_std::String>("Hello again!");
-    serializable.setValue(x);
-    ASSERT_TRUE(serializable.getValue() == x);
-  }
-}