|
@@ -3,15 +3,15 @@
|
|
|
* Company: Lynar Studios
|
|
|
* E-Mail: webmaster@lynarstudios.com
|
|
|
* Created: 2023-02-10
|
|
|
-* Changed: 2023-02-11
|
|
|
+* Changed: 2023-02-13
|
|
|
*
|
|
|
* */
|
|
|
|
|
|
+#include <ls-std/core/ConditionalFunctionExecutor.hpp>
|
|
|
#include <ls-std/core/evaluator/EmptyStringArgumentEvaluator.hpp>
|
|
|
-#include <ls-std/core/evaluator/NullPointerArgumentEvaluator.hpp>
|
|
|
-#include <ls-std/core/evaluator/NullPointerEvaluator.hpp>
|
|
|
#include <ls-std/io/section-pair/evaluator/SectionPairRowValueArgumentEvaluator.hpp>
|
|
|
#include <ls-std/io/section-pair/model/SectionPairRowSingleValue.hpp>
|
|
|
+#include <ls-std/io/section-pair/serialization/SerializableSectionPairRowSingleValue.hpp>
|
|
|
|
|
|
ls::std::io::SectionPairRowSingleValue::SectionPairRowSingleValue(const ls::std::io::section_pair_row_value &_value) : ls::std::core::Class("SectionPairRowSingleValue"), ls::std::io::SectionPairRowValue(ls::std::io::SECTION_PAIR_ROW_SINGLE_VALUE)
|
|
|
{
|
|
@@ -32,8 +32,7 @@ ls::std::io::SectionPairRowEnumType ls::std::io::SectionPairRowSingleValue::getT
|
|
|
|
|
|
ls::std::core::type::byte_field ls::std::io::SectionPairRowSingleValue::marshal()
|
|
|
{
|
|
|
- ::std::string message = "member \"serializable\" for marshal attempt is null!";
|
|
|
- ls::std::core::NullPointerEvaluator{::std::reinterpret_pointer_cast<void>(this->serializable), message}.evaluate();
|
|
|
+ ls::std::core::ConditionalFunctionExecutor{this->serializable == nullptr}.execute([this] { _createSerializable(); });
|
|
|
return this->serializable->marshal();
|
|
|
}
|
|
|
|
|
@@ -42,17 +41,15 @@ void ls::std::io::SectionPairRowSingleValue::set(const ls::std::io::section_pair
|
|
|
this->_set(_value);
|
|
|
}
|
|
|
|
|
|
-void ls::std::io::SectionPairRowSingleValue::setSerializable(const ::std::shared_ptr<ls::std::core::interface_type::ISerializable> &_serializable)
|
|
|
+void ls::std::io::SectionPairRowSingleValue::unmarshal(const ls::std::core::type::byte_field &_data)
|
|
|
{
|
|
|
- ls::std::core::NullPointerArgumentEvaluator{_serializable}.evaluate();
|
|
|
- this->serializable = _serializable;
|
|
|
+ ls::std::core::ConditionalFunctionExecutor{this->serializable == nullptr}.execute([this] { _createSerializable(); });
|
|
|
+ this->serializable->unmarshal(_data);
|
|
|
}
|
|
|
|
|
|
-void ls::std::io::SectionPairRowSingleValue::unmarshal(const ls::std::core::type::byte_field &_data)
|
|
|
+void ls::std::io::SectionPairRowSingleValue::_createSerializable()
|
|
|
{
|
|
|
- ::std::string message = "member \"serializable\" for unmarshal attempt is null!";
|
|
|
- ls::std::core::NullPointerEvaluator{::std::reinterpret_pointer_cast<void>(this->serializable), message}.evaluate();
|
|
|
- this->serializable->unmarshal(_data);
|
|
|
+ this->serializable = ::std::make_shared<ls::std::io::SerializableSectionPairRowSingleValue>(shared_from_this());
|
|
|
}
|
|
|
|
|
|
void ls::std::io::SectionPairRowSingleValue::_set(const ls::std::io::section_pair_row_value &_value)
|