diff --git a/alib2data/src/rte/formal/FormalRTEAlternation.h b/alib2data/src/rte/formal/FormalRTEAlternation.h index cedd459f6f4953e1696243ab63dd0f4c82b6ac5c..53b3f6d199f12372ded9e668bee4ac0de92367d4 100644 --- a/alib2data/src/rte/formal/FormalRTEAlternation.h +++ b/alib2data/src/rte/formal/FormalRTEAlternation.h @@ -221,7 +221,7 @@ void FormalRTEAlternation < SymbolType, RankType >::setLeftElement ( const Forma template < class SymbolType, class RankType > void FormalRTEAlternation < SymbolType, RankType >::setLeftElement ( FormalRTEElement < SymbolType, RankType > && element ) { - setLeft ( std::move ( element ) ); + this->setLeft ( std::move ( element ) ); } template < class SymbolType, class RankType > @@ -231,7 +231,7 @@ void FormalRTEAlternation < SymbolType, RankType >::setRightElement ( const Form template < class SymbolType, class RankType > void FormalRTEAlternation < SymbolType, RankType >::setRightElement ( FormalRTEElement < SymbolType, RankType > && element ) { - setRight ( std::move ( element ) ); + this->setRight ( std::move ( element ) ); } template < class SymbolType, class RankType > diff --git a/alib2data/src/rte/formal/FormalRTEIteration.h b/alib2data/src/rte/formal/FormalRTEIteration.h index 75f84d3b4afae0a3ba2d754a31a08dfed6e80ced..07149c048eca55107e4c8a549d5270cebeef56da 100644 --- a/alib2data/src/rte/formal/FormalRTEIteration.h +++ b/alib2data/src/rte/formal/FormalRTEIteration.h @@ -221,7 +221,7 @@ void FormalRTEIteration < SymbolType, RankType >::setElement ( const FormalRTEEl template < class SymbolType, class RankType > void FormalRTEIteration < SymbolType, RankType >::setElement ( FormalRTEElement < SymbolType, RankType > && elementParam ) { - setChild ( std::move ( elementParam ) ); + this->setChild ( std::move ( elementParam ) ); } template < class SymbolType, class RankType > diff --git a/alib2data/src/rte/formal/FormalRTESubstitution.h b/alib2data/src/rte/formal/FormalRTESubstitution.h index a3bad0195391f4ac6ee2586e5f497f93059af70e..aefb4a13cc1c20434dd808d4da6f7b4c2f59e769 100644 --- a/alib2data/src/rte/formal/FormalRTESubstitution.h +++ b/alib2data/src/rte/formal/FormalRTESubstitution.h @@ -260,7 +260,7 @@ void FormalRTESubstitution < SymbolType, RankType >::setLeftElement ( const Form template < class SymbolType, class RankType > void FormalRTESubstitution < SymbolType, RankType >::setLeftElement ( FormalRTEElement < SymbolType, RankType > && element ) { - setLeft ( std::move ( element ) ); + this->setLeft ( std::move ( element ) ); } template < class SymbolType, class RankType > @@ -270,7 +270,7 @@ void FormalRTESubstitution < SymbolType, RankType >::setRightElement ( const For template < class SymbolType, class RankType > void FormalRTESubstitution < SymbolType, RankType >::setRightElement ( FormalRTEElement < SymbolType, RankType > && element ) { - setRight ( std::move ( element ) ); + this->setRight ( std::move ( element ) ); } template < class SymbolType, class RankType > diff --git a/alib2data/src/rte/formal/FormalRTESymbolAlphabet.h b/alib2data/src/rte/formal/FormalRTESymbolAlphabet.h index 0e7965b47828080925ad4b7135cfc95ac3686a7a..60b5f350523e755ed35df8c16dec56f9be59cdeb 100644 --- a/alib2data/src/rte/formal/FormalRTESymbolAlphabet.h +++ b/alib2data/src/rte/formal/FormalRTESymbolAlphabet.h @@ -99,6 +99,36 @@ public: */ const ext::ptr_vector < FormalRTEElement < SymbolType, RankType > > & getElements ( ); + /** + * Getter of child node on n-th position + * + * \return child node + */ + const FormalRTEElement < SymbolType, RankType > & getElement ( unsigned index ) const; + + /** + * Getter of child node on n-th position + * + * \return child node + */ + FormalRTEElement < SymbolType, RankType > & getElement ( unsigned index ); + + /** + * Setter of the n-th child + * + * \param index the index of child to change + * \param element the iterated tree + */ + void setElement ( unsigned index, const FormalRTEElement < SymbolType, RankType > & element ); + + /** + * Setter of the n-th child + * + * \param index the index of child to change + * \param element the iterated tree + */ + void setElement ( unsigned index, FormalRTEElement < SymbolType, RankType > && element ); + /** * @copydoc base::CommonBase < FormalRTEElement < SymbolType, RankType > >::compare ( const FormalRTEElement < SymbolType, RankType > & ) const */ @@ -166,6 +196,26 @@ const ext::ptr_vector < FormalRTEElement < SymbolType, RankType > > & FormalRTES return this->getChildren ( ); } +template < class SymbolType, class RankType > +const FormalRTEElement < SymbolType, RankType > & FormalRTESymbolAlphabet < SymbolType, RankType >::getElement ( unsigned index ) const { + return this->getChild ( index ); +} + +template < class SymbolType, class RankType > +FormalRTEElement < SymbolType, RankType > & FormalRTESymbolAlphabet < SymbolType, RankType >::getElement ( unsigned index ) { + return this->getChild ( index ); +} + +template < class SymbolType, class RankType > +void FormalRTESymbolAlphabet < SymbolType, RankType >::setElement ( unsigned index, const FormalRTEElement < SymbolType, RankType > & element ) { + setElement ( index, ext::move_copy ( element ) ); +} + +template < class SymbolType, class RankType > +void FormalRTESymbolAlphabet < SymbolType, RankType >::setElement ( unsigned index, FormalRTEElement < SymbolType, RankType > && elementParam ) { + this->setChild ( std::move ( elementParam ), index ); +} + template < class SymbolType, class RankType > int FormalRTESymbolAlphabet < SymbolType, RankType >::compare ( const FormalRTESymbolAlphabet < SymbolType, RankType > & other ) const { auto first = ext::tie ( this->getSymbol ( ), this->getChildren ( ) );