Line data Source code
1 : // Author(s): Wieger Wesselink 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/untyped_data_parameter.h 10 : /// \brief add your file description here. 11 : 12 : #ifndef MCRL2_DATA_UNTYPED_DATA_PARAMETER_H 13 : #define MCRL2_DATA_UNTYPED_DATA_PARAMETER_H 14 : 15 : #include "mcrl2/data/data_expression.h" 16 : 17 : namespace mcrl2 { 18 : 19 : namespace data { 20 : 21 : //--- start generated class untyped_data_parameter ---// 22 : /// \\brief An untyped parameter 23 : class untyped_data_parameter: public atermpp::aterm_appl 24 : { 25 : public: 26 : /// \\brief Default constructor. 27 0 : untyped_data_parameter() 28 0 : : atermpp::aterm_appl(core::detail::default_values::UntypedDataParameter) 29 0 : {} 30 : 31 : /// \\brief Constructor. 32 : /// \\param term A term 33 11931 : explicit untyped_data_parameter(const atermpp::aterm& term) 34 11931 : : atermpp::aterm_appl(term) 35 : { 36 11931 : assert(core::detail::check_term_UntypedDataParameter(*this)); 37 11931 : } 38 : 39 : /// \\brief Constructor. 40 6157 : untyped_data_parameter(const core::identifier_string& name, const data_expression_list& arguments) 41 6157 : : atermpp::aterm_appl(core::detail::function_symbol_UntypedDataParameter(), name, arguments) 42 6157 : {} 43 : 44 : /// \\brief Constructor. 45 : untyped_data_parameter(const std::string& name, const data_expression_list& arguments) 46 : : atermpp::aterm_appl(core::detail::function_symbol_UntypedDataParameter(), core::identifier_string(name), arguments) 47 : {} 48 : 49 : /// Move semantics 50 : untyped_data_parameter(const untyped_data_parameter&) noexcept = default; 51 189 : untyped_data_parameter(untyped_data_parameter&&) noexcept = default; 52 : untyped_data_parameter& operator=(const untyped_data_parameter&) noexcept = default; 53 : untyped_data_parameter& operator=(untyped_data_parameter&&) noexcept = default; 54 : 55 19606 : const core::identifier_string& name() const 56 : { 57 19606 : return atermpp::down_cast<core::identifier_string>((*this)[0]); 58 : } 59 : 60 13277 : const data_expression_list& arguments() const 61 : { 62 13277 : return atermpp::down_cast<data_expression_list>((*this)[1]); 63 : } 64 : }; 65 : 66 : /// \\brief Make_untyped_data_parameter constructs a new term into a given address. 67 : /// \\ \param t The reference into which the new untyped_data_parameter is constructed. 68 : template <class... ARGUMENTS> 69 6136 : inline void make_untyped_data_parameter(atermpp::aterm_appl& t, const ARGUMENTS&... args) 70 : { 71 6136 : atermpp::make_term_appl(t, core::detail::function_symbol_UntypedDataParameter(), args...); 72 6136 : } 73 : 74 : /// \\brief list of untyped_data_parameters 75 : typedef atermpp::term_list<untyped_data_parameter> untyped_data_parameter_list; 76 : 77 : /// \\brief vector of untyped_data_parameters 78 : typedef std::vector<untyped_data_parameter> untyped_data_parameter_vector; 79 : 80 : /// \\brief Test for a untyped_data_parameter expression 81 : /// \\param x A term 82 : /// \\return True if \\a x is a untyped_data_parameter expression 83 : inline 84 267847 : bool is_untyped_data_parameter(const atermpp::aterm_appl& x) 85 : { 86 267847 : return x.function() == core::detail::function_symbols::UntypedDataParameter; 87 : } 88 : 89 : // prototype declaration 90 : std::string pp(const untyped_data_parameter& x); 91 : 92 : /// \\brief Outputs the object to a stream 93 : /// \\param out An output stream 94 : /// \\param x Object x 95 : /// \\return The output stream 96 : inline 97 : std::ostream& operator<<(std::ostream& out, const untyped_data_parameter& x) 98 : { 99 : return out << data::pp(x); 100 : } 101 : 102 : /// \\brief swap overload 103 : inline void swap(untyped_data_parameter& t1, untyped_data_parameter& t2) 104 : { 105 : t1.swap(t2); 106 : } 107 : //--- end generated class untyped_data_parameter ---// 108 : 109 : } // namespace data 110 : 111 : } // namespace mcrl2 112 : 113 : #endif // MCRL2_DATA_UNTYPED_DATA_PARAMETER_H