LCOV - code coverage report
Current view: top level - data/include/mcrl2/data - untyped_sort_variable.h (source / functions) Hit Total Coverage
Test: mcrl2_coverage.info.cleaned Lines: 18 18 100.0 %
Date: 2024-04-21 03:44:01 Functions: 8 8 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/data/untyped_sort_variable.h
      10             : /// \brief add your file description here.
      11             : 
      12             : #ifndef MCRL2_DATA_UNTYPED_SORT_VARIABLE_H
      13             : #define MCRL2_DATA_UNTYPED_SORT_VARIABLE_H
      14             : 
      15             : #include "mcrl2/data/sort_expression.h"
      16             : 
      17             : namespace mcrl2 {
      18             : 
      19             : namespace data {
      20             : 
      21             : //--- start generated class untyped_sort_variable ---//
      22             : /// \\brief Untyped sort variable
      23             : class untyped_sort_variable: public sort_expression
      24             : {
      25             :   public:
      26             :     /// \\brief Default constructor.
      27         321 :     untyped_sort_variable()
      28         321 :       : sort_expression(core::detail::default_values::UntypedSortVariable)
      29         321 :     {}
      30             : 
      31             :     /// \\brief Constructor.
      32             :     /// \\param term A term
      33        1980 :     explicit untyped_sort_variable(const atermpp::aterm& term)
      34        1980 :       : sort_expression(term)
      35             :     {
      36        1980 :       assert(core::detail::check_term_UntypedSortVariable(*this));
      37        1980 :     }
      38             : 
      39             :     /// \\brief Constructor.
      40             :     explicit untyped_sort_variable(const atermpp::aterm_int& value)
      41             :       : sort_expression(atermpp::aterm_appl(core::detail::function_symbol_UntypedSortVariable(), value))
      42             :     {}
      43             : 
      44             :     /// Move semantics
      45        1420 :     untyped_sort_variable(const untyped_sort_variable&) noexcept = default;
      46             :     untyped_sort_variable(untyped_sort_variable&&) noexcept = default;
      47             :     untyped_sort_variable& operator=(const untyped_sort_variable&) noexcept = default;
      48         321 :     untyped_sort_variable& operator=(untyped_sort_variable&&) noexcept = default;
      49             : 
      50        2209 :     const atermpp::aterm_int& value() const
      51             :     {
      52        2209 :       return atermpp::down_cast<atermpp::aterm_int>((*this)[0]);
      53             :     }
      54             : //--- start user section untyped_sort_variable ---//
      55             :     /// \brief Constructor.
      56         512 :     untyped_sort_variable(std::size_t value)
      57         512 :       : sort_expression(atermpp::aterm_appl(core::detail::function_symbol_UntypedSortVariable(), atermpp::aterm_int(value)))
      58         512 :     {}
      59             : //--- end user section untyped_sort_variable ---//
      60             : };
      61             : 
      62             : /// \\brief Make_untyped_sort_variable constructs a new term into a given address.
      63             : /// \\ \param t The reference into which the new untyped_sort_variable is constructed. 
      64             : template <class... ARGUMENTS>
      65             : inline void make_untyped_sort_variable(atermpp::aterm_appl& t, const ARGUMENTS&... args)
      66             : {
      67             :   atermpp::make_term_appl(t, core::detail::function_symbol_UntypedSortVariable(), args...);
      68             : }
      69             : 
      70             : /// \\brief Test for a untyped_sort_variable expression
      71             : /// \\param x A term
      72             : /// \\return True if \\a x is a untyped_sort_variable expression
      73             : inline
      74        2699 : bool is_untyped_sort_variable(const atermpp::aterm_appl& x)
      75             : {
      76        2699 :   return x.function() == core::detail::function_symbols::UntypedSortVariable;
      77             : }
      78             : 
      79             : // prototype declaration
      80             : std::string pp(const untyped_sort_variable& x);
      81             : 
      82             : /// \\brief Outputs the object to a stream
      83             : /// \\param out An output stream
      84             : /// \\param x Object x
      85             : /// \\return The output stream
      86             : inline
      87         321 : std::ostream& operator<<(std::ostream& out, const untyped_sort_variable& x)
      88             : {
      89         321 :   return out << data::pp(x);
      90             : }
      91             : 
      92             : /// \\brief swap overload
      93             : inline void swap(untyped_sort_variable& t1, untyped_sort_variable& t2)
      94             : {
      95             :   t1.swap(t2);
      96             : }
      97             : //--- end generated class untyped_sort_variable ---//
      98             : 
      99             : } // namespace data
     100             : 
     101             : } // namespace mcrl2
     102             : 
     103             : #endif // MCRL2_DATA_UNTYPED_SORT_VARIABLE_H

Generated by: LCOV version 1.14