SerializableJsonStringFactory.cpp 935 B

123456789101112131415161718192021222324
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2021-04-25
  6. * Changed: 2021-05-02
  7. *
  8. * */
  9. #include <ls_std/factory/serialization/json/boxing/SerializableJsonStringFactory.hpp>
  10. #include <ls_std/boxing/String.hpp>
  11. #include <ls_std/serialization/json/boxing/SerializableJsonString.hpp>
  12. ls_std::SerializableJsonStringFactory::SerializableJsonStringFactory() : ls_std::Class("SerializableJsonStringFactory")
  13. {}
  14. std::shared_ptr<ls_std::Class> ls_std::SerializableJsonStringFactory::build()
  15. {
  16. std::shared_ptr<ls_std::String> requestedObject = std::make_shared<ls_std::String>();
  17. std::shared_ptr<ls_std::ISerializable> serializable = std::make_shared<ls_std::SerializableJsonString>(requestedObject);
  18. requestedObject->setSerializable(serializable);
  19. return std::dynamic_pointer_cast<ls_std::Class>(requestedObject);
  20. }