Line data Source code
1 : // Author(s): Jeroen Keiren 2 : // Copyright: see the accompanying file COPYING or copy at 3 : // https://github.com/mCRL2org/mCRL2/blob/master/COPYING 4 : // 5 : // Distributed under the Boost Software License, Version 1.0. 6 : // (See accompanying file LICENSE_1_0.txt or copy at 7 : // http://www.boost.org/LICENSE_1_0.txt) 8 : // 9 : /// \file mcrl2/data/basic_sort.h 10 : /// \brief The class basic_sort. 11 : 12 : #ifndef MCRL2_DATA_BASIC_SORT_H 13 : #define MCRL2_DATA_BASIC_SORT_H 14 : 15 : #include "mcrl2/data/sort_expression.h" 16 : 17 : namespace mcrl2 18 : { 19 : 20 : namespace data 21 : { 22 : 23 : //--- start generated class basic_sort ---// 24 : /// \\brief A basic sort 25 : class basic_sort: public sort_expression 26 : { 27 : public: 28 : /// \\brief Default constructor. 29 329 : basic_sort() 30 329 : : sort_expression(core::detail::default_values::SortId) 31 329 : {} 32 : 33 : /// \\brief Constructor. 34 : /// \\param term A term 35 7947596 : explicit basic_sort(const atermpp::aterm& term) 36 7947596 : : sort_expression(term) 37 : { 38 7947596 : assert(core::detail::check_term_SortId(*this)); 39 7947596 : } 40 : 41 : /// \\brief Constructor. 42 3488 : explicit basic_sort(const core::identifier_string& name) 43 3488 : : sort_expression(atermpp::aterm_appl(core::detail::function_symbol_SortId(), name)) 44 3488 : {} 45 : 46 : /// \\brief Constructor. 47 123 : basic_sort(const std::string& name) 48 123 : : sort_expression(atermpp::aterm_appl(core::detail::function_symbol_SortId(), core::identifier_string(name))) 49 123 : {} 50 : 51 : /// Move semantics 52 40514 : basic_sort(const basic_sort&) noexcept = default; 53 104 : basic_sort(basic_sort&&) noexcept = default; 54 826 : basic_sort& operator=(const basic_sort&) noexcept = default; 55 1 : basic_sort& operator=(basic_sort&&) noexcept = default; 56 : 57 6234358 : const core::identifier_string& name() const 58 : { 59 6234358 : return atermpp::down_cast<core::identifier_string>((*this)[0]); 60 : } 61 : }; 62 : 63 : /// \\brief Make_basic_sort constructs a new term into a given address. 64 : /// \\ \param t The reference into which the new basic_sort is constructed. 65 : template <class... ARGUMENTS> 66 0 : inline void make_basic_sort(atermpp::aterm_appl& t, const ARGUMENTS&... args) 67 : { 68 0 : atermpp::make_term_appl(t, core::detail::function_symbol_SortId(), args...); 69 0 : } 70 : 71 : // prototype declaration 72 : std::string pp(const basic_sort& x); 73 : 74 : /// \\brief Outputs the object to a stream 75 : /// \\param out An output stream 76 : /// \\param x Object x 77 : /// \\return The output stream 78 : inline 79 0 : std::ostream& operator<<(std::ostream& out, const basic_sort& x) 80 : { 81 0 : return out << data::pp(x); 82 : } 83 : 84 : /// \\brief swap overload 85 : inline void swap(basic_sort& t1, basic_sort& t2) 86 : { 87 : t1.swap(t2); 88 : } 89 : //--- end generated class basic_sort ---// 90 : 91 : /// \brief list of basic sorts 92 : typedef atermpp::term_list<basic_sort> basic_sort_list; 93 : /// \brief vector of basic sorts 94 : typedef std::vector<basic_sort> basic_sort_vector; 95 : 96 : } // namespace data 97 : 98 : } // namespace mcrl2 99 : 100 : #endif // MCRL2_DATA_BASIC_SORT_H 101 :