diff --git a/alib2abstraction/src/abstraction/AnyaryOperationAbstraction.hpp b/alib2abstraction/src/abstraction/AnyaryOperationAbstraction.hpp index 62047414a2af3dd4a1036d159aa82ff07fd3a26f..7feebdc1425bb79048fedd07081df655dd4425ab 100644 --- a/alib2abstraction/src/abstraction/AnyaryOperationAbstraction.hpp +++ b/alib2abstraction/src/abstraction/AnyaryOperationAbstraction.hpp @@ -47,7 +47,7 @@ public: template < class ReturnType, class ParamType > class AnyaryOperationAbstraction : virtual public AnyaryOperationAbstractionImpl, virtual public ValueOperationAbstraction < ReturnType > { bool checkInput ( const std::shared_ptr < OperationAbstraction > & input, size_t index ) const override { - return abstraction::checkInput < ValueProvider < ParamType > > ( input, index ); + return abstraction::checkInput < ValueInterface < std::decay_t < ParamType > > > ( input, index ); } public: diff --git a/alib2abstraction/src/abstraction/NaryOperationAbstraction.hpp b/alib2abstraction/src/abstraction/NaryOperationAbstraction.hpp index f2ea56ab5961ce93ca67434c55f1139ba7840a9b..668e12695860f9f509100e70c7e5aef7419b724a 100644 --- a/alib2abstraction/src/abstraction/NaryOperationAbstraction.hpp +++ b/alib2abstraction/src/abstraction/NaryOperationAbstraction.hpp @@ -93,7 +93,7 @@ public: template < class ReturnType, class ... ParamTypes > class NaryOperationAbstraction : virtual public NaryOperationAbstractionImpl < sizeof ... ( ParamTypes ) >, virtual public ValueOperationAbstraction < ReturnType > { bool checkInput ( const std::shared_ptr < OperationAbstraction > & input, size_t index ) const override { - return abstraction::checkInput < ValueProvider < ParamTypes > ... > ( input, index ); + return abstraction::checkInput < ValueInterface < std::decay_t < ParamTypes > > ... > ( input, index ); } public: diff --git a/alib2abstraction/src/abstraction/ValueOperationAbstraction.hpp b/alib2abstraction/src/abstraction/ValueOperationAbstraction.hpp index 492ff194305aa76ddd5fc4449ce54d47357332c7..7856945226cda1eca5eb26824cb28489945893d3 100644 --- a/alib2abstraction/src/abstraction/ValueOperationAbstraction.hpp +++ b/alib2abstraction/src/abstraction/ValueOperationAbstraction.hpp @@ -13,18 +13,36 @@ #include <alib/typeindex> #include <abstraction/OperationAbstraction.hpp> -#include <abstraction/ValueProvider.hpp> + +namespace abstraction { + +template < class ReturnType > +class ValueInterface : public virtual OperationAbstraction { +public: + virtual ReturnType && getValue ( ) const = 0; + + virtual bool isConst ( ) const = 0; + virtual bool isRvalueRef ( ) const = 0; + virtual bool isLvalueRef ( ) const = 0; + virtual bool isAutoMove ( ) const { + return false; + } + + ext::type_index getReturnTypeIndex ( ) const override { + return ext::type_index ( typeid ( ReturnType ) ); + } + +}; + +} /* namespace abstraction */ #include <common/ParamQualifiers.hpp> #include <common/AbstractionHelpers.hpp> namespace abstraction { -class UnspecifiedType { -}; - template < class ReturnType > -class ValueOperationAbstraction : virtual public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < ReturnType & >, public ValueProvider < const ReturnType & >, public ValueProvider < ReturnType && >, public ValueProvider < const ReturnType && > { +class ValueOperationAbstraction : virtual public ValueInterface < ReturnType > { mutable std::optional < ReturnType > m_data; protected: @@ -40,18 +58,14 @@ protected: return false; } - ReturnType & getData ( ) const override { - return m_data.value ( ); - } - - const ReturnType & getConstData ( ) const override { - return m_data.value ( ); - } - void setData ( ReturnType data ) { m_data = std::move ( data ); } + ReturnType && getValue ( ) const override { + return std::move ( m_data.value ( ) ); + } + public: template < typename ... ParamTypes, typename Callable > inline void run_helper ( Callable callback, const ext::array < std::pair < std::shared_ptr < OperationAbstraction >, bool >, sizeof ... ( ParamTypes ) > & inputs ) { @@ -59,10 +73,6 @@ public: setData ( abstraction::apply < ParamTypes ... > ( callback, inputs ) ); } - ext::type_index getReturnTypeIndex ( ) const override { - return ext::type_index ( typeid ( ReturnType ) ); - } - ext::set < abstraction::ParamQualifiers::ParamQualifier > getReturnTypeQualifiers ( ) const override { return abstraction::ParamQualifiers::paramQualifiers < ReturnType > ( ); } @@ -73,7 +83,7 @@ public: }; template < class ReturnType > -class ValueOperationAbstraction < const ReturnType > : virtual public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < const ReturnType & >, public ValueProvider < const ReturnType && > { +class ValueOperationAbstraction < const ReturnType > : virtual public ValueInterface < ReturnType > { mutable std::optional < ReturnType > m_data; protected: @@ -89,18 +99,14 @@ protected: return false; } - ReturnType & getData ( ) const override { - return m_data.value ( ); - } - - const ReturnType & getConstData ( ) const override { - return m_data.value ( ); - } - void setData ( ReturnType data ) { m_data = std::move ( data ); } + ReturnType && getValue ( ) const override { + return std::move ( m_data.value ( ) ); + } + public: template < typename ... ParamTypes, typename Callable > inline void run_helper ( Callable callback, const ext::array < std::pair < std::shared_ptr < OperationAbstraction >, bool >, sizeof ... ( ParamTypes ) > & inputs ) { @@ -108,10 +114,6 @@ public: setData ( abstraction::apply < ParamTypes ... > ( callback, inputs ) ); } - ext::type_index getReturnTypeIndex ( ) const override { - return ext::type_index ( typeid ( ReturnType ) ); - } - ext::set < abstraction::ParamQualifiers::ParamQualifier > getReturnTypeQualifiers ( ) const override { return abstraction::ParamQualifiers::paramQualifiers < const ReturnType > ( ); } @@ -122,7 +124,7 @@ public: }; template < class ReturnType > -class ValueOperationAbstraction < ReturnType & > : virtual public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < ReturnType & >, public ValueProvider < const ReturnType & >, public ValueProvider < ReturnType && >, public ValueProvider < const ReturnType && > { +class ValueOperationAbstraction < ReturnType & > : virtual public ValueInterface < ReturnType > { mutable std::optional < std::reference_wrapper < ReturnType > > m_data; protected: @@ -138,18 +140,14 @@ protected: return false; } - ReturnType & getData ( ) const override { - return m_data->get ( ); - } - - const ReturnType & getConstData ( ) const override { - return m_data->get ( ); - } - void setData ( ReturnType & data ) { m_data = std::reference_wrapper < ReturnType > ( data ); } + ReturnType && getValue ( ) const override { + return std::move ( m_data->get ( ) ); + } + public: template < typename ... ParamTypes, typename Callable > inline void run_helper ( Callable callback, const ext::array < std::pair < std::shared_ptr < OperationAbstraction >, bool >, sizeof ... ( ParamTypes ) > & inputs ) { @@ -157,10 +155,6 @@ public: setData ( abstraction::apply < ParamTypes ... > ( callback, inputs ) ); } - ext::type_index getReturnTypeIndex ( ) const override { - return ext::type_index ( typeid ( ReturnType ) ); - } - ext::set < abstraction::ParamQualifiers::ParamQualifier > getReturnTypeQualifiers ( ) const override { return abstraction::ParamQualifiers::paramQualifiers < ReturnType & > ( ); } @@ -171,7 +165,7 @@ public: }; template < class ReturnType > -class ValueOperationAbstraction < const ReturnType & > : virtual public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < const ReturnType & >, public ValueProvider < const ReturnType && > { +class ValueOperationAbstraction < const ReturnType & > : virtual public ValueInterface < ReturnType > { mutable std::optional < std::reference_wrapper < const ReturnType > > m_data; protected: @@ -187,18 +181,14 @@ protected: return false; } - ReturnType & getData ( ) const override { - return const_cast < ReturnType & > ( m_data->get ( ) ); - } - - const ReturnType & getConstData ( ) const override { - return m_data->get ( ); - } - void setData ( const ReturnType & data ) { m_data = std::reference_wrapper < const ReturnType > ( data ); } + ReturnType && getValue ( ) const override { + return std::move ( const_cast < ReturnType & > ( m_data->get ( ) ) ); + } + public: template < typename ... ParamTypes, typename Callable > inline void run_helper ( Callable callback, const ext::array < std::pair < std::shared_ptr < OperationAbstraction >, bool >, sizeof ... ( ParamTypes ) > & inputs ) { @@ -206,10 +196,6 @@ public: setData ( abstraction::apply < ParamTypes ... > ( callback, inputs ) ); } - ext::type_index getReturnTypeIndex ( ) const override { - return ext::type_index ( typeid ( ReturnType ) ); - } - ext::set < abstraction::ParamQualifiers::ParamQualifier > getReturnTypeQualifiers ( ) const override { return abstraction::ParamQualifiers::paramQualifiers < const ReturnType & > ( ); } @@ -220,7 +206,7 @@ public: }; template < class ReturnType > -class ValueOperationAbstraction < ReturnType && > : virtual public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < const ReturnType & >, public ValueProvider < ReturnType && >, public ValueProvider < const ReturnType && > { +class ValueOperationAbstraction < ReturnType && > : virtual public ValueInterface < ReturnType > { mutable std::optional < std::reference_wrapper < ReturnType > > m_data; protected: @@ -236,18 +222,14 @@ protected: return true; } - ReturnType & getData ( ) const override { - return m_data->get ( ); - } - - const ReturnType & getConstData ( ) const override { - return m_data->get ( ); - } - void setData ( ReturnType && data ) { m_data = std::reference_wrapper < ReturnType > ( data ); } + ReturnType && getValue ( ) const override { + return std::move ( m_data->get ( ) ); + } + public: template < typename ... ParamTypes, typename Callable > inline void run_helper ( Callable callback, const ext::array < std::pair < std::shared_ptr < OperationAbstraction >, bool >, sizeof ... ( ParamTypes ) > & inputs ) { @@ -255,10 +237,6 @@ public: setData ( abstraction::apply < ParamTypes ... > ( callback, inputs ) ); } - ext::type_index getReturnTypeIndex ( ) const override { - return ext::type_index ( typeid ( ReturnType ) ); - } - ext::set < abstraction::ParamQualifiers::ParamQualifier > getReturnTypeQualifiers ( ) const override { return abstraction::ParamQualifiers::paramQualifiers < ReturnType && > ( ); } @@ -269,7 +247,7 @@ public: }; template < class ReturnType > -class ValueOperationAbstraction < const ReturnType && > : virtual public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < const ReturnType & >, public ValueProvider < const ReturnType && > { +class ValueOperationAbstraction < const ReturnType && > : virtual public ValueInterface < ReturnType > { mutable std::optional < std::reference_wrapper < const ReturnType > > m_data; protected: @@ -285,18 +263,14 @@ protected: return true; } - ReturnType & getData ( ) const override { - return const_cast < ReturnType & > ( m_data->get ( ) ); - } - - const ReturnType & getConstData ( ) const override { - return m_data->get ( ); - } - void setData ( const ReturnType && data ) { m_data = std::reference_wrapper < const ReturnType > ( data ); } + ReturnType && getValue ( ) const override { + return std::move ( const_cast < ReturnType & > ( m_data->get ( ) ) ); + } + public: template < typename ... ParamTypes, typename Callable > inline void run_helper ( Callable callback, const ext::array < std::pair < std::shared_ptr < OperationAbstraction >, bool >, sizeof ... ( ParamTypes ) > & inputs ) { @@ -304,10 +278,6 @@ public: setData ( abstraction::apply < ParamTypes ... > ( callback, inputs ) ); } - ext::type_index getReturnTypeIndex ( ) const override { - return ext::type_index ( typeid ( ReturnType ) ); - } - ext::set < abstraction::ParamQualifiers::ParamQualifier > getReturnTypeQualifiers ( ) const override { return abstraction::ParamQualifiers::paramQualifiers < const ReturnType && > ( ); } diff --git a/alib2abstraction/src/abstraction/ValueProvider.hpp b/alib2abstraction/src/abstraction/ValueProvider.hpp deleted file mode 100644 index 82fc09159a4a98a07410303272530e087b53784b..0000000000000000000000000000000000000000 --- a/alib2abstraction/src/abstraction/ValueProvider.hpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - * ValueProvider.hpp - * - * Created on: 11. 7. 2017 - * Author: Jan Travnicek - */ - -#ifndef _VALUE_PROVIDER_HPP_ -#define _VALUE_PROVIDER_HPP_ - -#include <exception> - -#include <alib/utility> - -namespace abstraction { - -template < class Type > -class ValueProvider { -protected: - virtual bool isConst ( ) const = 0; - virtual bool isLvalueRef ( ) const = 0; - virtual bool isRvalueRef ( ) const = 0; - virtual Type & getData ( ) const = 0; - -public: - Type getValue ( bool move ) const { - if constexpr ( std::is_copy_constructible_v < Type > && std::is_move_constructible_v < Type > ) { - if ( ! isConst ( ) && move ) - return std::move ( getData ( ) ); - else - return getData ( ); - } else if constexpr ( std::is_copy_constructible_v < Type > && ! std::is_move_constructible_v < Type > ) { - if ( ! isConst ( ) && move ) - throw std::domain_error ( "Value not move constructible" ); - else - return getData ( ); - } else if constexpr ( ! std::is_copy_constructible_v < Type > && std::is_move_constructible_v < Type > ) { - if ( ! isConst ( ) && move ) - return std::move ( getData ( ) ); - else - throw std::domain_error ( "Value not copy constructible" ); - } else { // ! std::is_copy_constructible_v < Type > && ! std::is_move_constructible_v < Type > - if ( ! isConst ( ) && move ) - throw std::domain_error ( "Value not move constructible" ); - else - throw std::domain_error ( "Value not copy constructible" ); - } - } -}; - -template < class Type > -class ValueProvider < Type & > { -protected: - virtual bool isConst ( ) const = 0; - virtual bool isLvalueRef ( ) const = 0; - virtual bool isRvalueRef ( ) const = 0; - virtual Type & getData ( ) const = 0; - -public: - Type & getValue ( bool ) const { - return getData ( ); - } -}; - -template < class Type > -class ValueProvider < const Type & > { -protected: - virtual bool isConst ( ) const = 0; - virtual bool isLvalueRef ( ) const = 0; - virtual bool isRvalueRef ( ) const = 0; - virtual const Type & getConstData ( ) const = 0; - -public: - const Type & getValue ( bool ) const { - return getConstData ( ); - } -}; - -template < class Type > -class ValueProvider < Type && > { -protected: - virtual bool isConst ( ) const = 0; - virtual bool isLvalueRef ( ) const = 0; - virtual bool isRvalueRef ( ) const = 0; - virtual Type & getData ( ) const = 0; - -public: - Type && getValue ( bool move ) const { - if ( move ) - return std::move ( getData ( ) ); - else - throw std::domain_error ( "Value not copy constructible" ); - } -}; - -template < class Type > -class ValueProvider < const Type && > { -protected: - virtual bool isConst ( ) const = 0; - virtual bool isLvalueRef ( ) const = 0; - virtual bool isRvalueRef ( ) const = 0; - virtual const Type & getConstData ( ) const = 0; - -public: - const Type && getValue ( bool move ) const { - if ( move ) - return std::move ( getConstData ( ) ); - else - throw std::domain_error ( "Value not copy constructible" ); - } -}; - -} /* namespace abstraction */ - -#endif /* _VALUE_PROVIDER_HPP_ */ diff --git a/alib2abstraction/src/abstraction/WrapperAbstraction.hpp b/alib2abstraction/src/abstraction/WrapperAbstraction.hpp index 65896fedb63dd11450ed65fa9d88347f12f26626..b8b68c8b48668d5a4e402819b028c746a698ee31 100644 --- a/alib2abstraction/src/abstraction/WrapperAbstraction.hpp +++ b/alib2abstraction/src/abstraction/WrapperAbstraction.hpp @@ -13,6 +13,9 @@ namespace abstraction { +class UnspecifiedType { +}; + template < class ... ParamTypes > class BaseWrapperAbstraction : public OperationAbstraction { std::function < std::shared_ptr < OperationAbstraction > ( ParamTypes ... ) > m_WrapperFinder; @@ -76,7 +79,7 @@ private: } bool checkInput ( const std::shared_ptr < OperationAbstraction > & input, size_t index ) const override { - return abstraction::checkInput < ValueProvider < ParamTypes > ... > ( input, index ); + return abstraction::checkInput < ValueInterface < std::decay_t < ParamTypes > > ... > ( input, index ); } public: diff --git a/alib2abstraction/src/common/AbstractionHelpers.hpp b/alib2abstraction/src/common/AbstractionHelpers.hpp index 891cbe8d51b4daf595b18cfcab70c24548497e49..d8e3a9de98aefda124042bd1b86628f0fb2d42ad 100644 --- a/alib2abstraction/src/common/AbstractionHelpers.hpp +++ b/alib2abstraction/src/common/AbstractionHelpers.hpp @@ -8,16 +8,47 @@ namespace abstraction { template < class ParamType > -std::shared_ptr < ValueProvider < ParamType > > translateParam ( const std::shared_ptr < OperationAbstraction > & param ) { - std::shared_ptr < ValueProvider < ParamType > > res = std::dynamic_pointer_cast < ValueProvider < ParamType > > ( param->getProxyAbstraction ( ) ); - if ( ! res ) +ParamType retrieveValue ( const std::shared_ptr < OperationAbstraction > & param, bool move ) { + (void) move; + using Type = std::decay_t < ParamType >; + + std::shared_ptr < ValueInterface < std::decay_t < Type > > > interface = std::dynamic_pointer_cast < ValueInterface < std::decay_t < Type > > > ( param->getProxyAbstraction ( ) ); + if ( ! interface ) throw std::invalid_argument ( "Abstraction does not provide value of type " + ext::to_string < ParamType > ( ) + " but " + param->getReturnType ( ) + "." ); - return res; -} -template < class ParamType > -ParamType retrieveValue ( const std::shared_ptr < OperationAbstraction > & param, bool move ) { - return translateParam < ParamType > ( param )->getValue ( move ); + if constexpr ( std::is_rvalue_reference_v < ParamType > ) { + if ( move || interface->isAutoMove ( ) ) + return std::move ( interface->getValue ( ) ); + else + throw std::domain_error ( "Cannot bind without move" ); + } else if constexpr ( std::is_lvalue_reference_v < ParamType > ) { + Type && res = interface->getValue ( ); + return res; + } else if constexpr ( std::is_copy_constructible_v < Type > && std::is_move_constructible_v < Type > ) { + if ( ! interface->isConst ( ) && ( move || interface->isAutoMove ( ) ) ) + return std::move ( interface->getValue ( ) ); + else { + Type && res = interface->getValue ( ); + return res; + } + } else if constexpr ( std::is_copy_constructible_v < Type > && ! std::is_move_constructible_v < Type > ) { + if ( ! interface->isConst ( ) && move ) + throw std::domain_error ( "Value not move constructible" ); + else { + Type && res = interface->getValue ( ); + return res; + } + } else if constexpr ( ! std::is_copy_constructible_v < Type > && std::is_move_constructible_v < Type > ) { + if ( ! interface->isConst ( ) && move ) + return std::move ( interface->getValue ( ) ); + else + throw std::domain_error ( "Value not copy constructible" ); + } else { // ! std::is_copy_constructible_v < Type > && ! std::is_move_constructible_v < Type > + if ( ! interface->isConst ( ) && move ) + throw std::domain_error ( "Value not move constructible" ); + else + throw std::domain_error ( "Value not copy constructible" ); + } } namespace detail { diff --git a/alib2cli/src/environment/Environment.h b/alib2cli/src/environment/Environment.h index 5279e44e077e31b5c396db340cace5f7af0df4bf..eb7a1a5186bed806f4f675909471b77f3d637012 100644 --- a/alib2cli/src/environment/Environment.h +++ b/alib2cli/src/environment/Environment.h @@ -78,10 +78,7 @@ public: template < class T > const T & getVariable ( const std::string & name ) const { - std::shared_ptr < abstraction::ValueProvider < const T & > > ptr = abstraction::translateParam < const T & > ( getVariableInt ( name ) ); - if ( ! ptr ) - throw exception::CommonException ( "Invalid variable type. Requested: " + ext::to_string < T > ( ) + ", actual : " + getVariableInt ( name )->getReturnType ( ) ); - return ptr->getValue ( false ); + return abstraction::retrieveValue < const T & > ( getVariableInt ( name ), false ); } std::set < std::string > getVariableNames ( ) const { @@ -113,15 +110,15 @@ public: int getResult ( ) const { if ( m_result ) { - std::shared_ptr < abstraction::ValueProvider < int > > ptr1 = std::dynamic_pointer_cast < abstraction::ValueProvider < int > > ( m_result ); + std::shared_ptr < abstraction::ValueInterface < int > > ptr1 = std::dynamic_pointer_cast < abstraction::ValueInterface < int > > ( m_result ); if ( ptr1 ) - return ptr1->getValue ( false ); - std::shared_ptr < abstraction::ValueProvider < unsigned > > ptr2 = std::dynamic_pointer_cast < abstraction::ValueProvider < unsigned > > ( m_result ); + return ptr1->getValue ( ); + std::shared_ptr < abstraction::ValueInterface < unsigned > > ptr2 = std::dynamic_pointer_cast < abstraction::ValueInterface < unsigned > > ( m_result ); if ( ptr2 ) - return ptr2->getValue ( false ); - std::shared_ptr < abstraction::ValueProvider < bool > > ptr3 = std::dynamic_pointer_cast < abstraction::ValueProvider < bool > > ( m_result ); + return ptr2->getValue ( ); + std::shared_ptr < abstraction::ValueInterface < bool > > ptr3 = std::dynamic_pointer_cast < abstraction::ValueInterface < bool > > ( m_result ); if ( ptr3 ) - return static_cast < int > ( ! ptr3->getValue ( false ) ); + return static_cast < int > ( ! ptr3->getValue ( ) ); throw exception::CommonException ( "Invalid result type. Provided: " + m_result->getReturnType ( ) ); } else { diff --git a/alib2gui/src/Converter.cpp b/alib2gui/src/Converter.cpp index 8c6ba6898811c29c3db046bdbc2a9e357143ece6..840fd3cab14e55c71d808bf8b628c1a42b4715a6 100644 --- a/alib2gui/src/Converter.cpp +++ b/alib2gui/src/Converter.cpp @@ -7,7 +7,6 @@ #include <QDomComment> #include <abstraction/ImmediateValueAbstraction.hpp> -#include <abstraction/ValueProvider.hpp> #include <common/AlgorithmHelper.h> #include <registry/StringWriterRegistry.hpp> #include <registry/XmlRegistry.h> @@ -24,8 +23,8 @@ namespace Converter { res->attachInput(data, 0, true, true); res->eval(); - auto& value = dynamic_cast<abstraction::ValueProvider<std::string>&>(*res); - return QString::fromStdString(value.getValue(true)); + auto& value = dynamic_cast<abstraction::ValueInterface<std::string>&>(*res); + return QString::fromStdString(value.getValue ( ) ); } catch ( ... ) { alib::ExceptionHandler::handle ( std::cerr ); @@ -47,9 +46,9 @@ namespace Converter { moves, abstraction::AlgorithmCategories::AlgorithmCategory::DEFAULT); - auto& value = dynamic_cast<abstraction::ValueProvider<std::string>&>(*res); + auto& value = dynamic_cast<abstraction::ValueInterface<std::string>&>(*res); - return QString::fromStdString(value.getValue(true)); + return QString::fromStdString(value.getValue()); } catch ( ... ) { alib::ExceptionHandler::handle ( std::cerr ); @@ -64,10 +63,10 @@ namespace Converter { res->attachInput(data, 0, true, true); res->eval(); - auto& value = dynamic_cast<abstraction::ValueProvider<ext::deque<sax::Token>>&>(*res); + auto& value = dynamic_cast<abstraction::ValueInterface<ext::deque<sax::Token>>&>(*res); std::string result; - sax::SaxComposeInterface::composeMemory(result, value.getValue(true)); + sax::SaxComposeInterface::composeMemory(result, value.getValue()); auto text = QString::fromStdString(result);