LCOV - code coverage report
Current view: top level - process/include/mcrl2/process - rename_expression.h (source / functions) Hit Total Coverage
Test: mcrl2_coverage.info.cleaned Lines: 8 8 100.0 %
Date: 2024-04-17 03:40:49 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.14