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/process/process_identifier.h 10 : /// \brief add your file description here. 11 : 12 : #ifndef MCRL2_PROCESS_PROCESS_IDENTIFIER_H 13 : #define MCRL2_PROCESS_PROCESS_IDENTIFIER_H 14 : 15 : #include "mcrl2/process/action_name_multiset.h" 16 : 17 : namespace mcrl2 18 : { 19 : 20 : namespace process 21 : { 22 : 23 : //--- start generated class process_identifier ---// 24 : /// \\brief A process identifier 25 : class process_identifier: public atermpp::aterm_appl 26 : { 27 : public: 28 : 29 : 30 : /// Move semantics 31 52503 : process_identifier(const process_identifier&) noexcept = default; 32 10983 : process_identifier(process_identifier&&) noexcept = default; 33 21821 : process_identifier& operator=(const process_identifier&) noexcept = default; 34 4910 : process_identifier& operator=(process_identifier&&) noexcept = default; 35 : 36 22425 : const core::identifier_string& name() const 37 : { 38 22425 : return atermpp::down_cast<core::identifier_string>((*this)[0]); 39 : } 40 : 41 24356 : const data::variable_list& variables() const 42 : { 43 24356 : return atermpp::down_cast<data::variable_list>((*this)[1]); 44 : } 45 : //--- start user section process_identifier ---// 46 : /// \brief Default constructor. 47 48244 : process_identifier() 48 48244 : : atermpp::aterm_appl(core::detail::default_values::ProcVarId) 49 48244 : {} 50 : 51 : /// \brief Constructor. 52 : /// \param term A term 53 99091 : explicit process_identifier(const atermpp::aterm& term) 54 99091 : : atermpp::aterm_appl(term) 55 : { 56 99091 : assert(core::detail::check_term_ProcVarId(*this)); 57 99091 : } 58 : 59 : /// \brief Constructor. 60 5338 : process_identifier(const core::identifier_string& name, const data::variable_list& variables) 61 5338 : { 62 5338 : atermpp::make_term_appl(*this, core::detail::function_symbol_ProcVarId(), name, variables); 63 5338 : } 64 : 65 : /// \brief Constructor. 66 875 : process_identifier(const std::string& name, const data::variable_list& variables) 67 875 : { 68 875 : atermpp::make_term_appl(*this, core::detail::function_symbol_ProcVarId(), core::identifier_string(name), variables); 69 875 : } 70 : //--- end user section process_identifier ---// 71 : }; 72 : 73 : /// \\brief Make_process_identifier constructs a new term into a given address. 74 : /// \\ \param t The reference into which the new process_identifier is constructed. 75 : template <class... ARGUMENTS> 76 1145 : inline void make_process_identifier(atermpp::aterm_appl& t, const ARGUMENTS&... args) 77 : { 78 1145 : atermpp::make_term_appl(t, core::detail::function_symbol_ProcVarId(), args...); 79 1145 : } 80 : 81 : /// \\brief list of process_identifiers 82 : typedef atermpp::term_list<process_identifier> process_identifier_list; 83 : 84 : /// \\brief vector of process_identifiers 85 : typedef std::vector<process_identifier> process_identifier_vector; 86 : 87 : /// \\brief Test for a process_identifier expression 88 : /// \\param x A term 89 : /// \\return True if \\a x is a process_identifier expression 90 : inline 91 0 : bool is_process_identifier(const atermpp::aterm_appl& x) 92 : { 93 0 : return x.function() == core::detail::function_symbols::ProcVarId; 94 : } 95 : 96 : // prototype declaration 97 : std::string pp(const process_identifier& x); 98 : 99 : /// \\brief Outputs the object to a stream 100 : /// \\param out An output stream 101 : /// \\param x Object x 102 : /// \\return The output stream 103 : inline 104 0 : std::ostream& operator<<(std::ostream& out, const process_identifier& x) 105 : { 106 0 : return out << process::pp(x); 107 : } 108 : 109 : /// \\brief swap overload 110 : inline void swap(process_identifier& t1, process_identifier& t2) 111 : { 112 : t1.swap(t2); 113 : } 114 : //--- end generated class process_identifier ---// 115 : 116 : // template function overloads 117 : std::string pp(const process_identifier_list& x); 118 : std::string pp(const process_identifier_vector& x); 119 : void normalize_sorts(process_identifier_vector& x, const data::sort_specification& sortspec); 120 : 121 : } // namespace process 122 : 123 : } // namespace mcrl2 124 : 125 : #endif // MCRL2_PROCESS_PROCESS_IDENTIFIER_H