diff --git a/alib2data/src/regexp/formal/FormalRegExpAlternation.h b/alib2data/src/regexp/formal/FormalRegExpAlternation.h index 301887a86c76320929e55595f9bb000728dc56be..18456ca67f26a2b1f053c8977bf9e60f2c2e07ed 100644 --- a/alib2data/src/regexp/formal/FormalRegExpAlternation.h +++ b/alib2data/src/regexp/formal/FormalRegExpAlternation.h @@ -40,10 +40,17 @@ class FormalRegExpAlternation : public ext::BinaryNode < FormalRegExpElement < S /** * @copydoc regexp::FormalRegExpElement < SymbolType >::accept ( ) const */ - void accept ( typename FormalRegExpElement < SymbolType >::Visitor & visitor ) const override { + void accept ( typename FormalRegExpElement < SymbolType >::Visitor & visitor ) const & override { visitor.visit ( * this ); } + /** + * @copydoc regexp::FormalRegExpElement < SymbolType >::accept ( ) const + */ + void accept ( typename FormalRegExpElement < SymbolType >::RvalueVisitor & visitor ) && override { + visitor.visit ( std::move ( * this ) ); + } + public: /** * \brief Creates a new instance of the alternation node with explicit alternated elements diff --git a/alib2data/src/regexp/formal/FormalRegExpConcatenation.h b/alib2data/src/regexp/formal/FormalRegExpConcatenation.h index 0fb9dd13cf6e4fe642d4d26570a8fc0042d1480a..4f537fa79c3f8b887ff50b629be785061a5da941 100644 --- a/alib2data/src/regexp/formal/FormalRegExpConcatenation.h +++ b/alib2data/src/regexp/formal/FormalRegExpConcatenation.h @@ -40,10 +40,17 @@ class FormalRegExpConcatenation : public ext::BinaryNode < FormalRegExpElement < /** * @copydoc regexp::FormalRegExpElement < SymbolType >::accept ( ) const */ - void accept ( typename FormalRegExpElement < SymbolType >::Visitor & visitor ) const override { + void accept ( typename FormalRegExpElement < SymbolType >::Visitor & visitor ) const & override { visitor.visit ( * this ); } + /** + * @copydoc regexp::FormalRegExpElement < SymbolType >::accept ( ) const + */ + void accept ( typename FormalRegExpElement < SymbolType >::RvalueVisitor & visitor ) && override { + visitor.visit ( std::move ( * this ) ); + } + public: /** * \brief Creates a new instance of the concatenation node with explicit concatenated elements diff --git a/alib2data/src/regexp/formal/FormalRegExpElement.h b/alib2data/src/regexp/formal/FormalRegExpElement.h index 548249abba7f8792c787bb41235d8ae2bb3ba469..8cabef5ed997940add776b13289e4f108334548f 100644 --- a/alib2data/src/regexp/formal/FormalRegExpElement.h +++ b/alib2data/src/regexp/formal/FormalRegExpElement.h @@ -70,6 +70,20 @@ protected: virtual void visit ( const FormalRegExpEpsilon < SymbolType > & ) = 0; }; + /** + * Visitor interface of the element. + */ + class RvalueVisitor { + public: + virtual ~RvalueVisitor ( ) noexcept = default; + virtual void visit ( FormalRegExpAlternation < SymbolType > && ) = 0; + virtual void visit ( FormalRegExpConcatenation < SymbolType > && ) = 0; + virtual void visit ( FormalRegExpIteration < SymbolType > && ) = 0; + virtual void visit ( FormalRegExpSymbol < SymbolType > && ) = 0; + virtual void visit ( FormalRegExpEmpty < SymbolType > && ) = 0; + virtual void visit ( FormalRegExpEpsilon < SymbolType > && ) = 0; + }; + /** * Helper class interconnecting the visitor interface and visitor core logic. * @@ -128,12 +142,77 @@ protected: } }; + /** + * Helper class interconnecting the visitor interface and visitor core logic. + * + * \tparam ReturnType the return type of the result of the visit + * \tparam Visitorr the type of the actuall visitor + * \tparam Params ... types of data passed with the visitor call + */ + template < class ReturnType, class Visitorr, class ... Params > + class RvalueVisitorContext : public core::VisitorContextAux < ReturnType, Visitorr, Params ... >, public FormalRegExpElement::RvalueVisitor { + public: + /** + * Inherited constructor. + */ + using core::VisitorContextAux < ReturnType, Visitorr, Params ... >::VisitorContextAux; + + /** + * Method passing the visit call to the visitor core logic. + */ + void visit ( FormalRegExpAlternation < SymbolType > && inherit ) override { + this->call ( std::move ( inherit ), std::make_index_sequence < sizeof ... ( Params ) > { } ); + } + + /** + * Method passing the visit call to the visitor core logic. + */ + void visit ( FormalRegExpConcatenation < SymbolType > && inherit ) override { + this->call ( std::move ( inherit ), std::make_index_sequence < sizeof ... ( Params ) > { } ); + } + + /** + * Method passing the visit call to the visitor core logic. + */ + void visit ( FormalRegExpIteration < SymbolType > && inherit ) override { + this->call ( std::move ( inherit ), std::make_index_sequence < sizeof ... ( Params ) > { } ); + } + + /** + * Method passing the visit call to the visitor core logic. + */ + void visit ( FormalRegExpSymbol < SymbolType > && inherit ) override { + this->call ( std::move ( inherit ), std::make_index_sequence < sizeof ... ( Params ) > { } ); + } + + /** + * Method passing the visit call to the visitor core logic. + */ + void visit ( FormalRegExpEmpty < SymbolType > && inherit ) override { + this->call ( std::move ( inherit ), std::make_index_sequence < sizeof ... ( Params ) > { } ); + } + + /** + * Method passing the visit call to the visitor core logic. + */ + void visit ( FormalRegExpEpsilon < SymbolType > && inherit ) override { + this->call ( std::move ( inherit ), std::make_index_sequence < sizeof ... ( Params ) > { } ); + } + }; + /** * \brief Accept method of the visitor pattern. This is where the actual type of this object is evaluated. * * \param visitor the accepted visitor. */ - virtual void accept ( FormalRegExpElement::Visitor & visitor ) const = 0; + virtual void accept ( FormalRegExpElement::Visitor & visitor ) const & = 0; + + /** + * \brief Accept method of the visitor pattern. This is where the actual type of this object is evaluated. + * + * \param visitor the accepted visitor. + */ + virtual void accept ( FormalRegExpElement::RvalueVisitor & visitor ) && = 0; public: virtual FormalRegExpElement < SymbolType > * clone ( ) const & = 0; @@ -152,12 +231,31 @@ public: * \return result of the visit */ template < class ReturnType, class Visitor, class ... Params > - ReturnType accept ( Params && ... params ) const { + ReturnType accept ( Params && ... params ) const & { VisitorContext < ReturnType, Visitor, Params ... > context ( std::forward < Params > ( params ) ... ); accept ( context ); return context.getResult ( ); } + /** + * Visitor interface method. + * + * \tparam ReturnType the return type of the result of the visit + * \tparam Visitorr the type of the actuall visitor + * \tparam Params ... types of data passed with the visitor call + * + * \params params ... Additional params passed to visited nodes + * + * \return result of the visit + */ + template < class ReturnType, class Visitorr, class ... Params > + ReturnType accept ( Params && ... params ) && { + RvalueVisitorContext < ReturnType, Visitorr, Params ... > context ( std::forward < Params > ( params ) ... ); + std::move ( * this ).accept ( context ); + return context.getResult ( ); + } + + /** * Creates copy of the element. * diff --git a/alib2data/src/regexp/formal/FormalRegExpEmpty.h b/alib2data/src/regexp/formal/FormalRegExpEmpty.h index ab6911a2e24ed0d27cd36a2d5ae48950b5fc4f8a..55102bc31ffe5d6f722991ddad76317b781261b3 100644 --- a/alib2data/src/regexp/formal/FormalRegExpEmpty.h +++ b/alib2data/src/regexp/formal/FormalRegExpEmpty.h @@ -37,10 +37,17 @@ class FormalRegExpEmpty : public ext::NullaryNode < FormalRegExpElement < Symbol /** * @copydoc regexp::FormalRegExpElement < SymbolType >::accept ( ) const */ - void accept ( typename FormalRegExpElement < SymbolType >::Visitor & visitor ) const override { + void accept ( typename FormalRegExpElement < SymbolType >::Visitor & visitor ) const & override { visitor.visit ( * this ); } + /** + * @copydoc regexp::FormalRegExpElement < SymbolType >::accept ( ) const + */ + void accept ( typename FormalRegExpElement < SymbolType >::RvalueVisitor & visitor ) && override { + visitor.visit ( std::move ( * this ) ); + } + public: /** * \brief Creates a new instance of the empty node. diff --git a/alib2data/src/regexp/formal/FormalRegExpEpsilon.h b/alib2data/src/regexp/formal/FormalRegExpEpsilon.h index a32b7c961512033f138079fd1645a42c1dd25a9c..100146afff83b6af7eef240edbd07f72640d6b1c 100644 --- a/alib2data/src/regexp/formal/FormalRegExpEpsilon.h +++ b/alib2data/src/regexp/formal/FormalRegExpEpsilon.h @@ -37,10 +37,17 @@ class FormalRegExpEpsilon : public ext::NullaryNode < FormalRegExpElement < Symb /** * @copydoc regexp::FormalRegExpElement < SymbolType >::accept ( ) const */ - void accept ( typename FormalRegExpElement < SymbolType >::Visitor & visitor ) const override { + void accept ( typename FormalRegExpElement < SymbolType >::Visitor & visitor ) const & override { visitor.visit ( * this ); } + /** + * @copydoc regexp::FormalRegExpElement < SymbolType >::accept ( ) const + */ + void accept ( typename FormalRegExpElement < SymbolType >::RvalueVisitor & visitor ) && override { + visitor.visit ( std::move ( * this ) ); + } + public: /** * \brief Creates a new instance of the epsilon node. diff --git a/alib2data/src/regexp/formal/FormalRegExpIteration.h b/alib2data/src/regexp/formal/FormalRegExpIteration.h index a18a216e1cfe828859bd58c481dc2e934573d9f8..62f8fdd819aa51eabf1499b0a92371b0217fe3e7 100644 --- a/alib2data/src/regexp/formal/FormalRegExpIteration.h +++ b/alib2data/src/regexp/formal/FormalRegExpIteration.h @@ -40,10 +40,17 @@ class FormalRegExpIteration : public ext::UnaryNode < FormalRegExpElement < Symb /** * @copydoc regexp::FormalRegExpElement < SymbolType >::accept ( ) const */ - void accept ( typename FormalRegExpElement < SymbolType >::Visitor & visitor ) const override { + void accept ( typename FormalRegExpElement < SymbolType >::Visitor & visitor ) const & override { visitor.visit ( * this ); } + /** + * @copydoc regexp::FormalRegExpElement < SymbolType >::accept ( ) const + */ + void accept ( typename FormalRegExpElement < SymbolType >::RvalueVisitor & visitor ) && override { + visitor.visit ( std::move ( * this ) ); + } + public: /** * \brief Creates a new instance of the iteration node with explicit iterated element diff --git a/alib2data/src/regexp/formal/FormalRegExpSymbol.h b/alib2data/src/regexp/formal/FormalRegExpSymbol.h index c2039bcf53487d1f57b375376955d8e6c5cb1329..6e1d4bd53e7d44a5cbe9cbcb6d68aad0efc78baf 100644 --- a/alib2data/src/regexp/formal/FormalRegExpSymbol.h +++ b/alib2data/src/regexp/formal/FormalRegExpSymbol.h @@ -43,10 +43,17 @@ class FormalRegExpSymbol : public ext::NullaryNode < FormalRegExpElement < Symbo /** * @copydoc regexp::FormalRegExpElement < SymbolType >::accept ( ) const */ - void accept ( typename FormalRegExpElement < SymbolType >::Visitor & visitor ) const override { + void accept ( typename FormalRegExpElement < SymbolType >::Visitor & visitor ) const & override { visitor.visit ( * this ); } + /** + * @copydoc regexp::FormalRegExpElement < SymbolType >::accept ( ) const + */ + void accept ( typename FormalRegExpElement < SymbolType >::RvalueVisitor & visitor ) && override { + visitor.visit ( std::move ( * this ) ); + } + public: /** * \brief Creates a new instance of the symbol node using the actual symbol to represent. diff --git a/alib2data/src/rte/formal/FormalRTEAlternation.h b/alib2data/src/rte/formal/FormalRTEAlternation.h index 4c789b4ce2c7ec93cbb00ce679a34962f42aa058..57138ed5a2955c4f2b23867d56d8f73988aa3c50 100644 --- a/alib2data/src/rte/formal/FormalRTEAlternation.h +++ b/alib2data/src/rte/formal/FormalRTEAlternation.h @@ -38,19 +38,26 @@ namespace rte { template < class SymbolType > class FormalRTEAlternation : public ext::BinaryNode < FormalRTEElement < SymbolType > > { /** - * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const & */ - void accept ( typename FormalRTEElement < SymbolType >::ConstVisitor & visitor ) const override { + void accept ( typename FormalRTEElement < SymbolType >::ConstVisitor & visitor ) const & override { visitor.visit ( * this ); } /** - * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) & */ - void accept ( typename FormalRTEElement < SymbolType >::Visitor & visitor ) override { + void accept ( typename FormalRTEElement < SymbolType >::Visitor & visitor ) & override { visitor.visit ( * this ); } + /** + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) && + */ + void accept ( typename FormalRTEElement < SymbolType >::RValueVisitor & visitor ) && override { + visitor.visit ( std::move ( * this ) ); + } + public: /** * \brief Creates a new instance of the alternation node with explicit alternated elements diff --git a/alib2data/src/rte/formal/FormalRTEElement.h b/alib2data/src/rte/formal/FormalRTEElement.h index b86cca329e50ad9096170c8cf2c84f0a38900042..05973493002b65fce4b740031e7ba6a60c60d385 100644 --- a/alib2data/src/rte/formal/FormalRTEElement.h +++ b/alib2data/src/rte/formal/FormalRTEElement.h @@ -73,6 +73,17 @@ protected: virtual void visit ( FormalRTEEmpty < SymbolType > & empty ) = 0; }; + class RValueVisitor { + public: + virtual ~RValueVisitor ( ) noexcept = default; + virtual void visit ( FormalRTEAlternation < SymbolType > && alternation ) = 0; + virtual void visit ( FormalRTEIteration < SymbolType > && iteration ) = 0; + virtual void visit ( FormalRTESubstitution < SymbolType > && substitution ) = 0; + virtual void visit ( FormalRTESymbolAlphabet < SymbolType > && symbol ) = 0; + virtual void visit ( FormalRTESymbolSubst < SymbolType > && symbol ) = 0; + virtual void visit ( FormalRTEEmpty < SymbolType > && empty ) = 0; + }; + /** * Helper class interconnecting the visitor interface and visitor core logic. * @@ -190,19 +201,84 @@ protected: } }; + /** + * Helper class interconnecting the visitor interface and visitor core logic. + * + * \tparam ReturnType the return type of the result of the visit + * \tparam Visitorr the type of the actuall visitor + * \tparam Params ... types of data passed with the visitor call + */ + template < class ReturnType, class Visitorr, class ... Params > + class RValueVisitorContext : public core::VisitorContextAux < ReturnType, Visitorr, Params ... >, public FormalRTEElement::RValueVisitor { + public: + /** + * Inherited constructor. + */ + using core::VisitorContextAux < ReturnType, Visitorr, Params ... >::VisitorContextAux; + + /** + * Method passing the visit call to the visitor core logic. + */ + void visit ( FormalRTEAlternation < SymbolType > && inherit ) override { + this->call ( std::move ( inherit ), std::make_index_sequence < sizeof ... ( Params ) > { } ); + } + + /** + * Method passing the visit call to the visitor core logic. + */ + void visit ( FormalRTEIteration < SymbolType > && inherit ) override { + this->call ( std::move ( inherit ), std::make_index_sequence < sizeof ... ( Params ) > { } ); + } + + /** + * Method passing the visit call to the visitor core logic. + */ + void visit ( FormalRTESubstitution < SymbolType > && inherit ) override { + this->call ( std::move ( inherit ), std::make_index_sequence < sizeof ... ( Params ) > { } ); + } + + /** + * Method passing the visit call to the visitor core logic. + */ + void visit ( FormalRTESymbolAlphabet < SymbolType > && inherit ) override { + this->call ( std::move ( inherit ), std::make_index_sequence < sizeof ... ( Params ) > { } ); + } + + /** + * Method passing the visit call to the visitor core logic. + */ + void visit ( FormalRTESymbolSubst < SymbolType > && inherit ) override { + this->call ( std::move ( inherit ), std::make_index_sequence < sizeof ... ( Params ) > { } ); + } + + /** + * Method passing the visit call to the visitor core logic. + */ + void visit ( FormalRTEEmpty < SymbolType > && inherit ) override { + this->call ( std::move ( inherit ), std::make_index_sequence < sizeof ... ( Params ) > { } ); + } + }; + + /** + * \brief Accept method of the visitor pattern. This is where the actual type of this object is evaluated. + * + * \param visitor the accepted visitor. + */ + virtual void accept ( FormalRTEElement::ConstVisitor & visitor ) const & = 0; + /** * \brief Accept method of the visitor pattern. This is where the actual type of this object is evaluated. * * \param visitor the accepted visitor. */ - virtual void accept ( FormalRTEElement::ConstVisitor & visitor ) const = 0; + virtual void accept ( FormalRTEElement::Visitor & visitor ) & = 0; /** * \brief Accept method of the visitor pattern. This is where the actual type of this object is evaluated. * * \param visitor the accepted visitor. */ - virtual void accept ( FormalRTEElement::Visitor & visitor ) = 0; + virtual void accept ( FormalRTEElement::RValueVisitor & visitor ) && = 0; public: virtual FormalRTEElement < SymbolType > * clone ( ) const & = 0; @@ -221,7 +297,7 @@ public: * \return result of the visit */ template < class ReturnType, class Visitorr, class ... Params > - ReturnType accept ( Params && ... params ) const { + ReturnType accept ( Params && ... params ) const & { ConstVisitorContext < ReturnType, Visitorr, Params ... > context ( std::forward < Params > ( params ) ... ); accept ( context ); return context.getResult ( ); @@ -239,12 +315,30 @@ public: * \return result of the visit */ template < class ReturnType, class Visitorr, class ... Params > - ReturnType accept ( Params && ... params ) { + ReturnType accept ( Params && ... params ) & { VisitorContext < ReturnType, Visitorr, Params ... > context ( std::forward < Params > ( params ) ... ); accept ( context ); return context.getResult ( ); } + /** + * Visitor interface method. + * + * \tparam ReturnType the return type of the result of the visit + * \tparam Visitorr the type of the actuall visitor + * \tparam Params ... types of data passed with the visitor call + * + * \params params ... Additional params passed to visited nodes + * + * \return result of the visit + */ + template < class ReturnType, class Visitorr, class ... Params > + ReturnType accept ( Params && ... params ) && { + RValueVisitorContext < ReturnType, Visitorr, Params ... > context ( std::forward < Params > ( params ) ... ); + std::move ( * this ).accept ( context ); + return context.getResult ( ); + } + /** * Traverses the rte tree looking if particular Symbol is used in the rte. * diff --git a/alib2data/src/rte/formal/FormalRTEEmpty.h b/alib2data/src/rte/formal/FormalRTEEmpty.h index 661d23a2567bc5f75281ae79500d93c658e42349..7b3bda3a60764464f4c5c8f07692c3f07277a1d4 100644 --- a/alib2data/src/rte/formal/FormalRTEEmpty.h +++ b/alib2data/src/rte/formal/FormalRTEEmpty.h @@ -34,19 +34,26 @@ namespace rte { template < class SymbolType > class FormalRTEEmpty : public ext::NullaryNode < FormalRTEElement < SymbolType > > { /** - * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const & */ - void accept ( typename FormalRTEElement < SymbolType >::ConstVisitor & visitor ) const override { + void accept ( typename FormalRTEElement < SymbolType >::ConstVisitor & visitor ) const & override { visitor.visit ( * this ); } /** - * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) & */ - void accept ( typename FormalRTEElement < SymbolType >::Visitor & visitor ) override { + void accept ( typename FormalRTEElement < SymbolType >::Visitor & visitor ) & override { visitor.visit ( * this ); } + /** + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) && + */ + void accept ( typename FormalRTEElement < SymbolType >::RValueVisitor & visitor ) && override { + visitor.visit ( std::move ( * this ) ); + } + public: /** * \brief Creates a new instance of the empty node. diff --git a/alib2data/src/rte/formal/FormalRTEIteration.h b/alib2data/src/rte/formal/FormalRTEIteration.h index 15bb54ac36a7d2a0aa42303991a92fb2d12c9ccc..bebb77b70b3496679d76479cecf7c436f016c34b 100644 --- a/alib2data/src/rte/formal/FormalRTEIteration.h +++ b/alib2data/src/rte/formal/FormalRTEIteration.h @@ -44,19 +44,26 @@ class FormalRTEIteration : public ext::UnaryNode < FormalRTEElement < SymbolType FormalRTESymbolSubst < SymbolType > m_substitutionSymbol; /** - * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const & */ - void accept ( typename FormalRTEElement < SymbolType >::ConstVisitor & visitor ) const override { + void accept ( typename FormalRTEElement < SymbolType >::ConstVisitor & visitor ) const & override { visitor.visit ( * this ); } /** - * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) & */ - void accept ( typename FormalRTEElement < SymbolType >::Visitor & visitor ) override { + void accept ( typename FormalRTEElement < SymbolType >::Visitor & visitor ) & override { visitor.visit ( * this ); } + /** + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) && + */ + void accept ( typename FormalRTEElement < SymbolType >::RValueVisitor & visitor ) && override { + visitor.visit ( std::move ( * this ) ); + } + public: /** * \brief Creates a new instance of the substitution node with explicit tree to iterate and a symbol representing place of substitution diff --git a/alib2data/src/rte/formal/FormalRTESubstitution.h b/alib2data/src/rte/formal/FormalRTESubstitution.h index c4c2ae80df3e4960b1e74e1a5f8b454594b4c98b..b00746f4b0f75910359794d4dc6bfa7b1026a69a 100644 --- a/alib2data/src/rte/formal/FormalRTESubstitution.h +++ b/alib2data/src/rte/formal/FormalRTESubstitution.h @@ -43,19 +43,26 @@ class FormalRTESubstitution : public ext::BinaryNode < FormalRTEElement < Symbol FormalRTESymbolSubst < SymbolType > m_substitutionSymbol; /** - * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const & */ - void accept ( typename FormalRTEElement < SymbolType >::ConstVisitor & visitor ) const override { + void accept ( typename FormalRTEElement < SymbolType >::ConstVisitor & visitor ) const & override { visitor.visit ( * this ); } /** - * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) & */ - void accept ( typename FormalRTEElement < SymbolType >::Visitor & visitor ) override { + void accept ( typename FormalRTEElement < SymbolType >::Visitor & visitor ) & override { visitor.visit ( * this ); } + /** + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) && + */ + void accept ( typename FormalRTEElement < SymbolType >::RValueVisitor & visitor ) && override { + visitor.visit ( std::move ( * this ) ); + } + public: /** * \brief Creates a new instance of the substitution node with explicit tree to substitute in, tree to substitue by and a symbol representing place of substitution diff --git a/alib2data/src/rte/formal/FormalRTESymbolAlphabet.h b/alib2data/src/rte/formal/FormalRTESymbolAlphabet.h index 34a43edd1fdb98d211dafc97b8cbef9cebbe752a..71fcf4ecee44664d68555b95c7310eacc53bd604 100644 --- a/alib2data/src/rte/formal/FormalRTESymbolAlphabet.h +++ b/alib2data/src/rte/formal/FormalRTESymbolAlphabet.h @@ -38,19 +38,26 @@ namespace rte { template < class SymbolType > class FormalRTESymbolAlphabet : public FormalRTESymbol < SymbolType >, public ext::VararyNode < FormalRTEElement < SymbolType > > { /** - * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const & */ - void accept ( typename FormalRTEElement < SymbolType >::ConstVisitor & visitor ) const override { + void accept ( typename FormalRTEElement < SymbolType >::ConstVisitor & visitor ) const & override { visitor.visit ( * this ); } /** - * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) & */ - void accept ( typename FormalRTEElement < SymbolType >::Visitor & visitor ) override { + void accept ( typename FormalRTEElement < SymbolType >::Visitor & visitor ) & override { visitor.visit ( * this ); } + /** + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) && + */ + void accept ( typename FormalRTEElement < SymbolType >::RValueVisitor & visitor ) && override { + visitor.visit ( std::move ( * this ) ); + } + public: /** * \brief Creates a new instance of the symbol node using the actual symbol to represent. diff --git a/alib2data/src/rte/formal/FormalRTESymbolSubst.h b/alib2data/src/rte/formal/FormalRTESymbolSubst.h index 627b9c46eeaed0accb3f6e0fb1dfe01b187eabec..f3f9229f0d4b8b746d97ef7783e13b7d2eb62e45 100644 --- a/alib2data/src/rte/formal/FormalRTESymbolSubst.h +++ b/alib2data/src/rte/formal/FormalRTESymbolSubst.h @@ -37,19 +37,26 @@ namespace rte { template < class SymbolType > class FormalRTESymbolSubst : public FormalRTESymbol < SymbolType >, public ext::NullaryNode < FormalRTEElement < SymbolType > > { /** - * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const & */ - void accept ( typename FormalRTEElement < SymbolType >::ConstVisitor & visitor ) const override { + void accept ( typename FormalRTEElement < SymbolType >::ConstVisitor & visitor ) const & override { visitor.visit ( * this ); } /** - * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) const + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) & */ - void accept ( typename FormalRTEElement < SymbolType >::Visitor & visitor ) override { + void accept ( typename FormalRTEElement < SymbolType >::Visitor & visitor ) & override { visitor.visit ( * this ); } + /** + * @copydoc rte::FormalRTEElement < SymbolType >::accept ( ) && + */ + void accept ( typename FormalRTEElement < SymbolType >::RValueVisitor & visitor ) && override { + visitor.visit ( std::move ( * this ) ); + } + public: /** * \brief Creates a new instance of the symbol node using the actual symbol to represent.