LCOV - code coverage report
Current view: top level - process/include/mcrl2/process - communication_expression.h (source / functions) Hit Total Coverage
Test: mcrl2_coverage.info.cleaned Lines: 9 10 90.0 %
Date: 2020-09-16 00:45:56 Functions: 5 6 83.3 %
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/communication_expression.h
      10             : /// \brief add your file description here.
      11             : 
      12             : #ifndef MCRL2_PROCESS_COMMUNICATION_EXPRESSION_H
      13             : #define MCRL2_PROCESS_COMMUNICATION_EXPRESSION_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 communication_expression ---//
      24             : /// \brief A communication expression
      25        1036 : class communication_expression: public atermpp::aterm_appl
      26             : {
      27             :   public:
      28             :     /// \brief Default constructor.
      29             :     communication_expression()
      30             :       : atermpp::aterm_appl(core::detail::default_values::CommExpr)
      31             :     {}
      32             : 
      33             :     /// \brief Constructor.
      34             :     /// \param term A term
      35             :     explicit communication_expression(const atermpp::aterm& term)
      36             :       : atermpp::aterm_appl(term)
      37             :     {
      38             :       assert(core::detail::check_term_CommExpr(*this));
      39             :     }
      40             : 
      41             :     /// \brief Constructor.
      42         573 :     communication_expression(const action_name_multiset& action_name, const core::identifier_string& name)
      43         573 :       : atermpp::aterm_appl(core::detail::function_symbol_CommExpr(), action_name, name)
      44         573 :     {}
      45             : 
      46             :     /// \brief Constructor.
      47             :     communication_expression(const action_name_multiset& action_name, const std::string& name)
      48             :       : atermpp::aterm_appl(core::detail::function_symbol_CommExpr(), action_name, core::identifier_string(name))
      49             :     {}
      50             : 
      51             :     /// Move semantics
      52           0 :     communication_expression(const communication_expression&) noexcept = default;
      53         463 :     communication_expression(communication_expression&&) noexcept = default;
      54             :     communication_expression& operator=(const communication_expression&) noexcept = default;
      55             :     communication_expression& operator=(communication_expression&&) noexcept = default;
      56             : 
      57      128855 :     const action_name_multiset& action_name() const
      58             :     {
      59      128855 :       return atermpp::down_cast<action_name_multiset>((*this)[0]);
      60             :     }
      61             : 
      62      130002 :     const core::identifier_string& name() const
      63             :     {
      64      130002 :       return atermpp::down_cast<core::identifier_string>((*this)[1]);
      65             :     }
      66             : };
      67             : 
      68             : /// \brief list of communication_expressions
      69             : typedef atermpp::term_list<communication_expression> communication_expression_list;
      70             : 
      71             : /// \brief vector of communication_expressions
      72             : typedef std::vector<communication_expression>    communication_expression_vector;
      73             : 
      74             : /// \brief Test for a communication_expression expression
      75             : /// \param x A term
      76             : /// \return True if \a x is a communication_expression expression
      77             : inline
      78             : bool is_communication_expression(const atermpp::aterm_appl& x)
      79             : {
      80             :   return x.function() == core::detail::function_symbols::CommExpr;
      81             : }
      82             : 
      83             : // prototype declaration
      84             : std::string pp(const communication_expression& x);
      85             : 
      86             : /// \brief Outputs the object to a stream
      87             : /// \param out An output stream
      88             : /// \param x Object x
      89             : /// \return The output stream
      90             : inline
      91             : std::ostream& operator<<(std::ostream& out, const communication_expression& x)
      92             : {
      93             :   return out << process::pp(x);
      94             : }
      95             : 
      96             : /// \brief swap overload
      97             : inline void swap(communication_expression& t1, communication_expression& t2)
      98             : {
      99             :   t1.swap(t2);
     100             : }
     101             : //--- end generated class communication_expression ---//
     102             : 
     103             : } // namespace process
     104             : 
     105             : } // namespace mcrl2
     106             : 
     107             : #endif // MCRL2_PROCESS_COMMUNICATION_EXPRESSION_H

Generated by: LCOV version 1.13