LCOV - code coverage report
Current view: top level - process/include/mcrl2/process - process_identifier.h (source / functions) Hit Total Coverage
Test: mcrl2_coverage.info.cleaned Lines: 20 28 71.4 %
Date: 2020-02-19 00:44:21 Functions: 10 13 76.9 %
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/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             : typedef std::pair<core::identifier_string, data::variable_list> process_identifier_key_type;
      24             : 
      25             : //--- start generated class process_identifier ---//
      26             : /// \brief A process identifier
      27      331004 : class process_identifier: public atermpp::aterm_appl
      28             : {
      29             :   public:
      30             : 
      31             : 
      32             :     /// Move semantics
      33       93432 :     process_identifier(const process_identifier&) noexcept = default;
      34        7797 :     process_identifier(process_identifier&&) noexcept = default;
      35             :     process_identifier& operator=(const process_identifier&) noexcept = default;
      36             :     process_identifier& operator=(process_identifier&&) noexcept = default;
      37             : 
      38       31450 :     const core::identifier_string& name() const
      39             :     {
      40       31450 :       return atermpp::down_cast<core::identifier_string>((*this)[0]);
      41             :     }
      42             : 
      43       33183 :     const data::variable_list& variables() const
      44             :     {
      45       33183 :       return atermpp::down_cast<data::variable_list>((*this)[1]);
      46             :     }
      47             : //--- start user section process_identifier ---//
      48             :     /// \brief Default constructor.
      49      121658 :     process_identifier()
      50      121658 :       : atermpp::aterm_appl(core::detail::default_values::ProcVarId)
      51      121658 :     {}
      52             : 
      53             :     /// \brief Constructor.
      54             :     /// \param term A term
      55           0 :     explicit process_identifier(const atermpp::aterm& term)
      56           0 :       : atermpp::aterm_appl(term)
      57             :     {
      58           0 :       assert(core::detail::check_term_ProcVarId(*this));
      59           0 :     }
      60             : 
      61             :     /// \brief Constructor.
      62        8558 :     process_identifier(const core::identifier_string& name, const data::variable_list& variables)
      63        8558 :       : atermpp::aterm_appl(atermpp::aterm_appl(core::detail::function_symbol_ProcVarId(),
      64             :           name,
      65             :           variables,
      66       17116 :           atermpp::aterm_int(core::index_traits<process_identifier, process_identifier_key_type, 2>::insert(std::make_pair(name, variables)))
      67       17116 :         ))
      68        8558 :     {}
      69             : 
      70             :     /// \brief Constructor.
      71         692 :     process_identifier(const std::string& name, const data::variable_list& variables)
      72         692 :       : atermpp::aterm_appl(core::detail::function_symbol_ProcVarId(),
      73        1384 :                             core::identifier_string(name),
      74             :                             variables,
      75        2076 :                             atermpp::aterm_int(core::index_traits<process_identifier, process_identifier_key_type, 2>::insert(std::make_pair(name, variables))))
      76         692 :     {}
      77             : //--- end user section process_identifier ---//
      78             : };
      79             : 
      80             : /// \brief list of process_identifiers
      81             : typedef atermpp::term_list<process_identifier> process_identifier_list;
      82             : 
      83             : /// \brief vector of process_identifiers
      84             : typedef std::vector<process_identifier>    process_identifier_vector;
      85             : 
      86             : /// \brief Test for a process_identifier expression
      87             : /// \param x A term
      88             : /// \return True if \a x is a process_identifier expression
      89             : inline
      90           0 : bool is_process_identifier(const atermpp::aterm_appl& x)
      91             : {
      92           0 :   return x.function() == core::detail::function_symbols::ProcVarId;
      93             : }
      94             : 
      95             : // prototype declaration
      96             : std::string pp(const process_identifier& x);
      97             : 
      98             : /// \brief Outputs the object to a stream
      99             : /// \param out An output stream
     100             : /// \param x Object x
     101             : /// \return The output stream
     102             : inline
     103           0 : std::ostream& operator<<(std::ostream& out, const process_identifier& x)
     104             : {
     105           0 :   return out << process::pp(x);
     106             : }
     107             : 
     108             : /// \brief swap overload
     109             : inline void swap(process_identifier& t1, process_identifier& t2)
     110             : {
     111             :   t1.swap(t2);
     112             : }
     113             : //--- end generated class process_identifier ---//
     114             : 
     115             : // template function overloads
     116             : std::string pp(const process_identifier_list& x);
     117             : std::string pp(const process_identifier_vector& x);
     118             : void normalize_sorts(process_identifier_vector& x, const data::sort_specification& sortspec);
     119             : 
     120             : } // namespace process
     121             : 
     122             : } // namespace mcrl2
     123             : 
     124             : #include "mcrl2/process/index_traits.h"
     125             : 
     126             : #endif // MCRL2_PROCESS_PROCESS_IDENTIFIER_H

Generated by: LCOV version 1.13