diff --git a/alib2data/src/alphabet/BarSymbol.cpp b/alib2data/src/alphabet/BarSymbol.cpp index 85adc641c5b2d05fca32462a4d0bca28c0ed98ca..377b4287a03ea8eac5b75015a4681a74623bcbb7 100644 --- a/alib2data/src/alphabet/BarSymbol.cpp +++ b/alib2data/src/alphabet/BarSymbol.cpp @@ -6,9 +6,9 @@ */ #include "BarSymbol.h" -#include "Symbol.h" + #include <object/Object.h> -#include "UniqueSymbol.h" +#include <object/UniqueObject.h> #include <registration/ValuePrinterRegistration.hpp> @@ -38,8 +38,8 @@ BarSymbol::operator std::string () const { return BarSymbol::instance < std::string > ( ); } -SymbolBase* BarSymbol::inc() && { - return new UniqueSymbol(Symbol(std::move(*this)), primitive::Integer(0)); +object::ObjectBase * BarSymbol::inc ( ) && { + return new object::UniqueObject ( object::Object ( std::move ( * this ) ), primitive::Integer ( 0 ) ); } } /* namespace alphabet */ diff --git a/alib2data/src/alphabet/BarSymbol.h b/alib2data/src/alphabet/BarSymbol.h index ed84a2e9d2fdde0d874148d5c6efd22de7935aaf..cb44234c8dd617af2503b1231848df5494f27559 100644 --- a/alib2data/src/alphabet/BarSymbol.h +++ b/alib2data/src/alphabet/BarSymbol.h @@ -96,7 +96,7 @@ public: /** * @copydoc object::ObjectBase::inc ( ) && */ - virtual SymbolBase * inc ( ) &&; + virtual object::ObjectBase * inc ( ) &&; }; template < typename Base > diff --git a/alib2data/src/alphabet/BlankSymbol.cpp b/alib2data/src/alphabet/BlankSymbol.cpp index 937a6cf34e5f3455930935f724a0b43446405281..5c0371120327ca474f176c9e095146fd0ecee8a4 100644 --- a/alib2data/src/alphabet/BlankSymbol.cpp +++ b/alib2data/src/alphabet/BlankSymbol.cpp @@ -6,9 +6,9 @@ */ #include "BlankSymbol.h" -#include "Symbol.h" + #include <object/Object.h> -#include "UniqueSymbol.h" +#include <object/UniqueObject.h> #include <registration/ValuePrinterRegistration.hpp> @@ -38,8 +38,8 @@ BlankSymbol::operator std::string () const { return BlankSymbol::instance < std::string > ( ); } -SymbolBase* BlankSymbol::inc() && { - return new UniqueSymbol(Symbol(std::move(*this)), primitive::Integer(0)); +object::ObjectBase * BlankSymbol::inc ( ) && { + return new object::UniqueObject ( object::Object ( std::move ( * this ) ), primitive::Integer ( 0 ) ); } } /* namespace alphabet */ diff --git a/alib2data/src/alphabet/BlankSymbol.h b/alib2data/src/alphabet/BlankSymbol.h index 1eb01b89e065a06948bb75639ac2d66ae8d99e6e..963322438ee02446b09d9551be60585731c73a52 100644 --- a/alib2data/src/alphabet/BlankSymbol.h +++ b/alib2data/src/alphabet/BlankSymbol.h @@ -96,7 +96,7 @@ public: /** * @copydoc object::ObjectBase::inc ( ) && */ - virtual SymbolBase * inc ( ) &&; + virtual object::ObjectBase * inc ( ) &&; }; template < typename Base > diff --git a/alib2data/src/alphabet/BottomOfTheStackSymbol.cpp b/alib2data/src/alphabet/BottomOfTheStackSymbol.cpp index 7310ae2b54d8578bf47ef0ecb8cae1f29b003c61..3216a76397ff1656090c46ad55f995c2be69e376 100644 --- a/alib2data/src/alphabet/BottomOfTheStackSymbol.cpp +++ b/alib2data/src/alphabet/BottomOfTheStackSymbol.cpp @@ -6,9 +6,9 @@ */ #include "BottomOfTheStackSymbol.h" -#include "Symbol.h" + #include <object/Object.h> -#include "UniqueSymbol.h" +#include <object/UniqueObject.h> #include <registration/ValuePrinterRegistration.hpp> @@ -39,8 +39,8 @@ BottomOfTheStackSymbol::operator std::string () const { ; } -SymbolBase* BottomOfTheStackSymbol::inc() && { - return new UniqueSymbol(Symbol(std::move(*this)), primitive::Integer(0)); +object::ObjectBase * BottomOfTheStackSymbol::inc ( ) && { + return new object::UniqueObject ( object::Object ( std::move ( * this ) ), primitive::Integer ( 0 ) ); } } /* namespace alphabet */ diff --git a/alib2data/src/alphabet/BottomOfTheStackSymbol.h b/alib2data/src/alphabet/BottomOfTheStackSymbol.h index 6fd23d73878cd3dc26f97d9291e0c249f3fccad3..33ff6b0257682a443e41e040c59c759997f69f9c 100644 --- a/alib2data/src/alphabet/BottomOfTheStackSymbol.h +++ b/alib2data/src/alphabet/BottomOfTheStackSymbol.h @@ -96,7 +96,7 @@ public: /** * @copydoc object::ObjectBase::inc ( ) && */ - virtual SymbolBase * inc ( ) &&; + virtual object::ObjectBase * inc ( ) &&; }; template < typename Base > diff --git a/alib2data/src/alphabet/EndSymbol.cpp b/alib2data/src/alphabet/EndSymbol.cpp index a418ff9892776a760a7468004ae36e9f53168b30..b8f179d179d51a0cd22f9952321f81213e9124a2 100644 --- a/alib2data/src/alphabet/EndSymbol.cpp +++ b/alib2data/src/alphabet/EndSymbol.cpp @@ -6,9 +6,9 @@ */ #include "EndSymbol.h" -#include "Symbol.h" + #include <object/Object.h> -#include "UniqueSymbol.h" +#include <object/UniqueObject.h> #include <registration/ValuePrinterRegistration.hpp> @@ -38,8 +38,8 @@ EndSymbol::operator std::string () const { return EndSymbol::instance < std::string > ( ); } -SymbolBase* EndSymbol::inc() && { - return new UniqueSymbol(Symbol(std::move(*this)), primitive::Integer(0)); +object::ObjectBase * EndSymbol::inc ( ) && { + return new object::UniqueObject ( object::Object ( std::move ( * this ) ), primitive::Integer ( 0 ) ); } } /* namespace alphabet */ diff --git a/alib2data/src/alphabet/EndSymbol.h b/alib2data/src/alphabet/EndSymbol.h index fa623e62a1a2c60e5e1beca9a47911d8f1f1aa9c..8556b731a72ade7d436089b5a999693326e2ee37 100644 --- a/alib2data/src/alphabet/EndSymbol.h +++ b/alib2data/src/alphabet/EndSymbol.h @@ -96,7 +96,7 @@ public: /** * @copydoc object::ObjectBase::inc ( ) && */ - virtual SymbolBase * inc ( ) &&; + virtual object::ObjectBase * inc ( ) &&; }; template < typename Base > diff --git a/alib2data/src/alphabet/InitialSymbol.cpp b/alib2data/src/alphabet/InitialSymbol.cpp index e9c5e1fd6ef5ad90e5a32f66eb18cd1270b537a4..ba88fdd1a3482ea77bae1ac33bb6005947d84a70 100644 --- a/alib2data/src/alphabet/InitialSymbol.cpp +++ b/alib2data/src/alphabet/InitialSymbol.cpp @@ -6,9 +6,9 @@ */ #include "InitialSymbol.h" -#include "Symbol.h" + #include <object/Object.h> -#include "UniqueSymbol.h" +#include <object/UniqueObject.h> #include <registration/ValuePrinterRegistration.hpp> @@ -38,8 +38,8 @@ InitialSymbol::operator std::string() const { return InitialSymbol::instance < std::string > ( ); } -SymbolBase* InitialSymbol::inc() && { - return new UniqueSymbol(Symbol(std::move(*this)), primitive::Integer(0)); +object::ObjectBase * InitialSymbol::inc ( ) && { + return new object::UniqueObject ( object::Object ( std::move ( * this ) ), primitive::Integer ( 0 ) ); } } /* namespace alphabet */ diff --git a/alib2data/src/alphabet/InitialSymbol.h b/alib2data/src/alphabet/InitialSymbol.h index 8e2749d79154985da8c04be805734d1b326fc738..2a441a11013b1582f4abef07a8f821db768e2d8d 100644 --- a/alib2data/src/alphabet/InitialSymbol.h +++ b/alib2data/src/alphabet/InitialSymbol.h @@ -96,7 +96,7 @@ public: /** * @copydoc object::ObjectBase::inc ( ) && */ - virtual SymbolBase * inc ( ) &&; + virtual object::ObjectBase * inc ( ) &&; }; template < typename Base > diff --git a/alib2data/src/alphabet/NonlinearVariableSymbol.cpp b/alib2data/src/alphabet/NonlinearVariableSymbol.cpp index f5995316f50764672e44536bf4a1f41389837d71..f5b62b107435e3775dfdb6af69d4092ad4b7e4ea 100644 --- a/alib2data/src/alphabet/NonlinearVariableSymbol.cpp +++ b/alib2data/src/alphabet/NonlinearVariableSymbol.cpp @@ -6,9 +6,6 @@ */ #include "NonlinearVariableSymbol.h" -#include "Symbol.h" -#include <object/Object.h> - #include <registration/ValuePrinterRegistration.hpp> namespace { diff --git a/alib2data/src/alphabet/NonlinearVariableSymbol.h b/alib2data/src/alphabet/NonlinearVariableSymbol.h index c1f583e265aa667b299aaa333f3cb9b71c1b8cc2..9907098103e2b460494f7d1ac5af831b8e94413e 100644 --- a/alib2data/src/alphabet/NonlinearVariableSymbol.h +++ b/alib2data/src/alphabet/NonlinearVariableSymbol.h @@ -25,11 +25,9 @@ #define NONLINEAR_VARIABLE_SYMBOL_H_ #include "Symbol.h" -#include "UniqueSymbol.h" - -#include <alphabet/common/SymbolNormalize.h> #include <core/normalize.hpp> +#include <alphabet/common/SymbolNormalize.h> namespace alphabet { @@ -106,7 +104,7 @@ public: /** * @copydoc object::ObjectBase::inc ( ) && */ - virtual SymbolBase * inc ( ) &&; + virtual object::ObjectBase * inc ( ) &&; }; template < class SymbolType > @@ -151,8 +149,8 @@ NonlinearVariableSymbol < SymbolType >::operator std::string ( ) const { } template < class SymbolType > -SymbolBase * NonlinearVariableSymbol < SymbolType >::inc ( ) && { - return new UniqueSymbol ( Symbol ( std::move ( * this ) ), primitive::Integer ( 0 ) ); +object::ObjectBase * NonlinearVariableSymbol < SymbolType >::inc ( ) && { + return new object::UniqueObject ( object::Object ( std::move ( * this ) ), primitive::Integer ( 0 ) ); } } /* namespace alphabet */ diff --git a/alib2data/src/alphabet/RankedSymbol.cpp b/alib2data/src/alphabet/RankedSymbol.cpp index 6fbcf5fc3885d81dd74136448314b774d54a6416..2823d73bb6190c44fe9f3c239f1e4f6d7b362fc7 100644 --- a/alib2data/src/alphabet/RankedSymbol.cpp +++ b/alib2data/src/alphabet/RankedSymbol.cpp @@ -6,7 +6,6 @@ */ #include "RankedSymbol.h" - #include <registration/ValuePrinterRegistration.hpp> namespace { diff --git a/alib2data/src/alphabet/RankedSymbol.h b/alib2data/src/alphabet/RankedSymbol.h index edaa0d0433bf546712ca4f7ee0a84a20f7c833f2..c8945b9eb92ac2a35e07b218d14899690466360c 100644 --- a/alib2data/src/alphabet/RankedSymbol.h +++ b/alib2data/src/alphabet/RankedSymbol.h @@ -27,9 +27,8 @@ #include "SymbolBase.h" #include <common/ranked_symbol.hpp> -#include <alphabet/common/SymbolNormalize.h> - #include <core/normalize.hpp> +#include <alphabet/common/SymbolNormalize.h> namespace alphabet { @@ -127,7 +126,7 @@ public: /** * @copydoc object::ObjectBase::inc ( ) && */ - virtual SymbolBase * inc ( ) &&; + virtual object::ObjectBase * inc ( ) &&; }; template < class SymbolType, class RankType > @@ -156,8 +155,8 @@ RankedSymbol < SymbolType, RankType >::operator std::string () const { } template < class SymbolType, class RankType > -SymbolBase* RankedSymbol < SymbolType, RankType >::inc() && { - this->m_symbol.inc(); +object::ObjectBase * RankedSymbol < SymbolType, RankType >::inc ( ) && { + this->m_symbol.inc ( ); return NULL; } diff --git a/alib2data/src/alphabet/StartSymbol.cpp b/alib2data/src/alphabet/StartSymbol.cpp index 24488690d61c30391762d43688c4b77314933fdf..c173361b9975ea84ac1d41765e7459df67ba5f6a 100644 --- a/alib2data/src/alphabet/StartSymbol.cpp +++ b/alib2data/src/alphabet/StartSymbol.cpp @@ -6,9 +6,9 @@ */ #include "StartSymbol.h" -#include "Symbol.h" + #include <object/Object.h> -#include "UniqueSymbol.h" +#include <object/UniqueObject.h> #include <registration/ValuePrinterRegistration.hpp> @@ -38,8 +38,8 @@ StartSymbol::operator std::string () const { return StartSymbol::instance < std::string > ( ); } -SymbolBase* StartSymbol::inc() && { - return new UniqueSymbol(Symbol(std::move(*this)), primitive::Integer(0)); +object::ObjectBase * StartSymbol::inc ( ) && { + return new object::UniqueObject ( object::Object ( std::move ( * this ) ), primitive::Integer ( 0 ) ); } } /* namespace alphabet */ diff --git a/alib2data/src/alphabet/StartSymbol.h b/alib2data/src/alphabet/StartSymbol.h index 5ea4b4d88a897767617805031a0b1873f6b82116..7b73cbc7c7af55047bd385c1940e630c04765187 100644 --- a/alib2data/src/alphabet/StartSymbol.h +++ b/alib2data/src/alphabet/StartSymbol.h @@ -96,7 +96,7 @@ public: /** * @copydoc object::ObjectBase::inc ( ) && */ - virtual SymbolBase * inc ( ) &&; + virtual object::ObjectBase * inc ( ) &&; }; template < typename Base > diff --git a/alib2data/src/alphabet/SymbolBase.h b/alib2data/src/alphabet/SymbolBase.h index bb98b3e2ac1aaac3ac751145d2a80fe0beb09a24..08cef4e3a061d53adcfed415063a8783e4dbb099 100644 --- a/alib2data/src/alphabet/SymbolBase.h +++ b/alib2data/src/alphabet/SymbolBase.h @@ -26,11 +26,6 @@ public: * @copydoc ObjectBase::clone ( ) && */ virtual SymbolBase * clone ( ) && override = 0; - - /** - * @copydoc ObjectBase::inc ( ) && - */ - virtual SymbolBase * inc ( ) && override = 0; }; } /* namespace alphabet */ diff --git a/alib2data/src/alphabet/UniqueSymbol.cpp b/alib2data/src/alphabet/UniqueSymbol.cpp deleted file mode 100644 index c0f6f2cf44cc6dfc4eb41f3222ab861a55611273..0000000000000000000000000000000000000000 --- a/alib2data/src/alphabet/UniqueSymbol.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * UniqueSymbol.cpp - * - * Created on: Mar 26, 2013 - * Author: Jan Travicek - */ - -#include "UniqueSymbol.h" -#include <sstream> -#include "Symbol.h" -#include <object/Object.h> - -#include <registration/ValuePrinterRegistration.hpp> - -namespace alphabet { - -UniqueSymbol::UniqueSymbol(Symbol symbol, primitive::Integer id) : m_symbol(std::move(symbol)), m_id(std::move(id)) { - -} - -SymbolBase* UniqueSymbol::clone ( ) const & { - return new UniqueSymbol(*this); -} - -SymbolBase* UniqueSymbol::clone() && { - return new UniqueSymbol(std::move(*this)); -} - -const Symbol & UniqueSymbol::getSymbol ( ) const & { - return m_symbol; -} - -Symbol && UniqueSymbol::getSymbol ( ) && { - return std::move ( m_symbol ); -} - -const primitive::Integer & UniqueSymbol::getId ( ) const & { - return m_id; -} - -primitive::Integer && UniqueSymbol::getId ( ) && { - return std::move ( m_id ); -} - -int UniqueSymbol::compare(const UniqueSymbol& other) const { - int res = m_symbol.getData().compare(other.m_symbol.getData()); - if(res == 0) res = m_id.compare(other.m_id); - return res; -} - -void UniqueSymbol::operator>>(std::ostream& out) const { - out << "(UniqueSymbol " << m_symbol << ", " << m_id << ")"; -} - -UniqueSymbol::operator std::string() const { - std::stringstream ss; - ss << "{"; - ss << m_symbol; - ss << ", "; - ss << m_id; - ss << "}"; - return std::move(ss).str(); -} - -SymbolBase* UniqueSymbol::inc() && { - std::move(m_id).inc(); - return NULL; -} - -} /* namespace alphabet */ - -namespace { - -static auto valuePrinter = registration::ValuePrinterRegister < alphabet::UniqueSymbol > ( ); - -} /* namespace */ diff --git a/alib2data/src/alphabet/UniqueSymbol.h b/alib2data/src/alphabet/UniqueSymbol.h deleted file mode 100644 index 174566a1465300c0814ea72baaabb11bb07551a5..0000000000000000000000000000000000000000 --- a/alib2data/src/alphabet/UniqueSymbol.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - * UniqueSymbol.h - * - * This file is part of Algorithms library toolkit. - * Copyright (C) 2017 Jan Travnicek (jan.travnicek@fit.cvut.cz) - - * Algorithms library toolkit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * Algorithms library toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with Algorithms library toolkit. If not, see <http://www.gnu.org/licenses/>. - * - * Created on: Mar 26, 2013 - * Author: Jan Travnicek - */ - -#ifndef SYMBOL_ID_SYMBOL_H_ -#define SYMBOL_ID_SYMBOL_H_ - -#include "Symbol.h" -#include <primitive/Integer.h> - -namespace alphabet { - -/** - * \brief - * Represents symbol based on other symbol with additional differentiation counter. - * - * The UniqueSymbol is used in situations when some symbol is given and one would like to create new based on it but different. For example q vs. q' vs q'', etc. - * - * Primarly the class is used from inc method. - */ -class UniqueSymbol : public SymbolBase { - /** - * The underlying symbol. - */ - Symbol m_symbol; - - /** - * The differentiating number. - */ - primitive::Integer m_id; - -public: - /** - * \brief - * Creates new symbol with given name and set differentiating number. - * - * \param symbol the underlying symbol - * \param id the differentiating number - */ - explicit UniqueSymbol ( Symbol symbol, primitive::Integer id ); - - /** - * @copydoc alphabet::SymbolBase::clone ( ) const & - */ - virtual SymbolBase * clone ( ) const &; - - /** - * @copydoc alphabet::SymbolBase::clone ( ) && - */ - virtual SymbolBase * clone ( ) &&; - - /** - * Getter of the underlying symbol. - * - * \return the underlying symbol - */ - const Symbol & getSymbol ( ) const &; - - /** - * Getter of the underlying symbol. - * - * \return the underlying symbol - */ - Symbol && getSymbol ( ) &&; - - /** - * Getter of the differentiating number. - * - * \return the differentiating number - */ - const primitive::Integer & getId ( ) const &; - - /** - * Getter of the differentiating number. - * - * \return the differentiating number - */ - primitive::Integer && getId ( ) &&; - - /** - * @copydoc base::CommonBase < ObjectBase >::compare ( const ObjectBase & ) const - */ - virtual int compare ( const ObjectBase & other ) const { - if ( ext::type_index ( typeid ( * this ) ) == ext::type_index ( typeid ( other ) ) ) return this->compare ( ( decltype ( * this ) )other ); - - return ext::type_index ( typeid ( * this ) ) - ext::type_index ( typeid ( other ) ); - } - - /** - * The actual compare method - * - * \param other the other instance - * - * \returns the actual relation between two by type same symbols - */ - virtual int compare ( const UniqueSymbol & other ) const; - - /** - * @copydoc base::CommonBase < ObjectBase >::operator >> ( std::ostream & ) const - */ - virtual void operator >>( std::ostream & ) const; - - /** - * @copydoc base::CommonBase < ObjectBase >::operator std::string ( ) const - */ - virtual explicit operator std::string ( ) const; - - /** - * @copydoc object::ObjectBase::inc ( ) && - */ - virtual SymbolBase * inc ( ) &&; -}; - -} /* namespace alphabet */ - -#endif /* SYMBOL_ID_SYMBOL_H_ */ diff --git a/alib2data/src/alphabet/VariablesBarSymbol.cpp b/alib2data/src/alphabet/VariablesBarSymbol.cpp index 47f1d56ad1098157cbb850eec21bec82ebbeb9ca..b5149f89697510caf9f69e546b5b16a618d9156f 100644 --- a/alib2data/src/alphabet/VariablesBarSymbol.cpp +++ b/alib2data/src/alphabet/VariablesBarSymbol.cpp @@ -6,9 +6,9 @@ */ #include "VariablesBarSymbol.h" -#include "Symbol.h" + #include <object/Object.h> -#include "UniqueSymbol.h" +#include <object/UniqueObject.h> #include <registration/ValuePrinterRegistration.hpp> @@ -37,8 +37,8 @@ VariablesBarSymbol::operator std::string ( ) const { return VariablesBarSymbol::instance < std::string > ( ); } -SymbolBase * VariablesBarSymbol::inc ( ) && { - return new UniqueSymbol ( Symbol ( std::move ( * this ) ), primitive::Integer ( 0 ) ); +object::ObjectBase * VariablesBarSymbol::inc ( ) && { + return new object::UniqueObject ( object::Object ( std::move ( * this ) ), primitive::Integer ( 0 ) ); } } /* namespace alphabet */ diff --git a/alib2data/src/alphabet/VariablesBarSymbol.h b/alib2data/src/alphabet/VariablesBarSymbol.h index f5afe99242b0f435891f229e2cbb4f2f53568358..a64557d07d5c0fa71b01b1d085218367fb9c7c80 100644 --- a/alib2data/src/alphabet/VariablesBarSymbol.h +++ b/alib2data/src/alphabet/VariablesBarSymbol.h @@ -96,7 +96,7 @@ public: /** * @copydoc object::ObjectBase::inc ( ) && */ - virtual SymbolBase * inc ( ) &&; + virtual object::ObjectBase * inc ( ) &&; }; template < typename Base > diff --git a/alib2data/src/alphabet/WildcardSymbol.cpp b/alib2data/src/alphabet/WildcardSymbol.cpp index e48f88b089260a64d07bb693cf451c97bf5026fa..7460db141c747e25f726f1d41a9c23a740026d4d 100644 --- a/alib2data/src/alphabet/WildcardSymbol.cpp +++ b/alib2data/src/alphabet/WildcardSymbol.cpp @@ -6,9 +6,9 @@ */ #include "WildcardSymbol.h" -#include "Symbol.h" + #include <object/Object.h> -#include "UniqueSymbol.h" +#include <object/UniqueObject.h> #include <registration/ValuePrinterRegistration.hpp> @@ -38,10 +38,11 @@ WildcardSymbol::operator std::string () const { return WildcardSymbol::instance < std::string > ( ); } -SymbolBase* WildcardSymbol::inc() && { - return new UniqueSymbol(Symbol(std::move(*this)), primitive::Integer(0)); +object::ObjectBase * WildcardSymbol::inc ( ) && { + return new object::UniqueObject ( object::Object ( std::move ( * this ) ), primitive::Integer ( 0 ) ); } + } /* namespace alphabet */ namespace { diff --git a/alib2data/src/alphabet/WildcardSymbol.h b/alib2data/src/alphabet/WildcardSymbol.h index 1e40d41edade68e787d6184f35325f3e222db91d..dd040ef487abd8619789e3d0822a07f0d7e22116 100644 --- a/alib2data/src/alphabet/WildcardSymbol.h +++ b/alib2data/src/alphabet/WildcardSymbol.h @@ -96,7 +96,7 @@ public: /** * @copydoc object::ObjectBase::inc ( ) && */ - virtual SymbolBase * inc ( ) &&; + virtual object::ObjectBase * inc ( ) &&; }; template < typename Base > diff --git a/alib2data/src/alphabet/xml/UniqueSymbol.cpp b/alib2data/src/alphabet/xml/UniqueSymbol.cpp deleted file mode 100644 index cc57662610aa69aa3fe59c3c93a946b0f2f0aa0e..0000000000000000000000000000000000000000 --- a/alib2data/src/alphabet/xml/UniqueSymbol.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * UniqueSymbol.cpp - * - * Created on: Mar 26, 2013 - * Author: Jan Travicek - */ - -#include "UniqueSymbol.h" -#include <alphabet/Symbol.h> -#include <object/Object.h> - -#include <registration/XmlRegistration.hpp> -#include <primitive/xml/Integer.h> - -namespace core { - -alphabet::UniqueSymbol xmlApi < alphabet::UniqueSymbol >::parse ( ext::deque < sax::Token >::iterator & input ) { - sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ELEMENT, xmlTagName ( ) ); - - alphabet::Symbol firstSymbol = core::xmlApi < alphabet::Symbol >::parse ( input ); - primitive::Integer secondSymbol = core::xmlApi < primitive::Integer >::parse ( input ); - - sax::FromXMLParserHelper::popToken(input, sax::Token::TokenType::END_ELEMENT, xmlTagName ( ) ); - return alphabet::UniqueSymbol ( std::move ( firstSymbol ), std::move ( secondSymbol ) ); -} - -bool xmlApi < alphabet::UniqueSymbol >::first ( const ext::deque < sax::Token >::const_iterator & input ) { - return sax::FromXMLParserHelper::isToken ( input, sax::Token::TokenType::START_ELEMENT, xmlTagName ( ) ); -} - -const std::string & xmlApi < alphabet::UniqueSymbol >::xmlTagName ( ) { - static std::string xmlTagName = "UniqueSymbol"; - - return xmlTagName; -} - -void xmlApi < alphabet::UniqueSymbol >::compose ( ext::deque < sax::Token > & output, const alphabet::UniqueSymbol & data ) { - output.emplace_back ( xmlTagName ( ), sax::Token::TokenType::START_ELEMENT ); - core::xmlApi < alphabet::Symbol >::compose ( output, data.getSymbol ( ) ); - core::xmlApi < primitive::Integer >::compose ( output, data.getId ( ) ); - output.emplace_back ( xmlTagName ( ), sax::Token::TokenType::END_ELEMENT ); -} - -} /* namespace core */ - -namespace { - -static auto xmlWrite = registration::XmlWriterRegister < alphabet::UniqueSymbol > ( ); -static auto xmlRead = registration::XmlReaderRegister < alphabet::UniqueSymbol > ( ); - -static auto xmlGroup1 = registration::XmlRegisterTypeInGroup < alphabet::Symbol, alphabet::UniqueSymbol > ( ); -static auto xmlGroup2 = registration::XmlRegisterTypeInGroup < object::Object, alphabet::UniqueSymbol > ( ); - -} /* namespace */ diff --git a/alib2data/src/alphabet/xml/UniqueSymbol.h b/alib2data/src/alphabet/xml/UniqueSymbol.h deleted file mode 100644 index 67d1cca7a9a80dc114424eeed8e7de86debbd12e..0000000000000000000000000000000000000000 --- a/alib2data/src/alphabet/xml/UniqueSymbol.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * UniqueSymbol.h - * - * Created on: Mar 26, 2013 - * Author: Jan Travnicek - */ - -#ifndef _XML_SYMBOL_ID_SYMBOL_H_ -#define _XML_SYMBOL_ID_SYMBOL_H_ - -#include <alphabet/UniqueSymbol.h> -#include <core/xmlApi.hpp> - -namespace core { - -template < > -struct xmlApi < alphabet::UniqueSymbol > { - static alphabet::UniqueSymbol parse ( ext::deque < sax::Token >::iterator & input ); - static bool first ( const ext::deque < sax::Token >::const_iterator & input ); - static const std::string & xmlTagName ( ); - static void compose ( ext::deque < sax::Token > & output, const alphabet::UniqueSymbol & data ); -}; - -} /* namespace core */ - -#endif /* _XML_SYMBOL_ID_SYMBOL_H_ */ diff --git a/alib2str/src/alphabet/string/UniqueSymbol.cpp b/alib2str/src/alphabet/string/UniqueSymbol.cpp deleted file mode 100644 index aa05f02213cd87c8dc31ed8a46685d4ff56aafad..0000000000000000000000000000000000000000 --- a/alib2str/src/alphabet/string/UniqueSymbol.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * UniqueSymbol.cpp - * - * Created on: Sep 27, 2017 - * Author: Jan Travnicek - */ - -#include "UniqueSymbol.h" -#include <alphabet/UniqueSymbol.h> -#include <object/Object.h> -#include <alphabet/Symbol.h> -#include <primitive/string/Integer.h> - -#include <registration/StringRegistration.hpp> - -namespace core { - -alphabet::UniqueSymbol stringApi < alphabet::UniqueSymbol >::parse ( std::istream & ) { - throw exception::CommonException("parsing UniqueSymbol from string not implemented"); -} - -bool stringApi < alphabet::UniqueSymbol >::first ( std::istream & ) { - return false; -} - -void stringApi < alphabet::UniqueSymbol >::compose ( std::ostream & output, const alphabet::UniqueSymbol & symbol ) { - output << '<'; - stringApi < alphabet::Symbol >::compose ( output, symbol.getSymbol ( ) ); - output << ", "; - stringApi < primitive::Integer >::compose ( output, symbol.getId ( ) ); - output << '>'; -} - -} /* namespace core */ - -namespace { - -static auto stringWrite = registration::StringWriterRegister < alphabet::Symbol, alphabet::UniqueSymbol > ( ); -static auto stringWrite2 = registration::StringWriterRegister < object::Object, alphabet::UniqueSymbol > ( ); - -} /* namespace */ diff --git a/alib2str/src/alphabet/string/UniqueSymbol.h b/alib2str/src/alphabet/string/UniqueSymbol.h deleted file mode 100644 index 26e294e1276904f9b639abd98e6e3b259732fe0f..0000000000000000000000000000000000000000 --- a/alib2str/src/alphabet/string/UniqueSymbol.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * UniqueSymbol.h - * - * Created on: Sep 27, 2017 - * Author: Jan Travnicek - */ - -#ifndef _STRING_UNIQUE_SYMBOL_H_ -#define _STRING_UNIQUE_SYMBOL_H_ - -#include <alphabet/UniqueSymbol.h> -#include <core/stringApi.hpp> - -namespace core { - -template < > -struct stringApi < alphabet::UniqueSymbol > { - static alphabet::UniqueSymbol parse ( std::istream & input ); - static bool first ( std::istream & input ); - static void compose ( std::ostream & output, const alphabet::UniqueSymbol & symbol ); -}; - -} /* namespace core */ - -#endif /* _STRING_UNIQUE_SYMBOL_H_ */