LCOV - code coverage report
Current view: top level - bes/include/mcrl2/bes - index_traits.h (source / functions) Hit Total Coverage
Test: mcrl2_coverage.info.cleaned Lines: 8 12 66.7 %
Date: 2020-10-20 00:45:57 Functions: 2 3 66.7 %
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/bes/index_traits.h
      10             : /// \brief add your file description here.
      11             : 
      12             : #ifndef MCRL2_BES_INDEX_TRAITS_H
      13             : #define MCRL2_BES_INDEX_TRAITS_H
      14             : 
      15             : #include "mcrl2/bes/boolean_expression.h"
      16             : 
      17             : namespace mcrl2 {
      18             : 
      19             : namespace bes {
      20             : 
      21             : inline
      22          59 : void on_create_boolean_variable(const atermpp::aterm& t)
      23             : {
      24          59 :   const boolean_variable& v = atermpp::down_cast<const boolean_variable>(t);
      25          59 :   core::index_traits<boolean_variable, boolean_variable_key_type, 1>::insert(v.name());
      26          59 : }
      27             : 
      28             : inline
      29           0 : void on_delete_boolean_variable(const atermpp::aterm& t)
      30             : {
      31           0 :   const boolean_variable& v = atermpp::down_cast<const boolean_variable>(t);
      32           0 :   core::index_traits<boolean_variable, boolean_variable_key_type, 1>::erase(v.name());
      33           0 : }
      34             : 
      35             : inline
      36           8 : void register_boolean_variable_hooks()
      37             : {
      38           8 :   add_creation_hook(core::detail::function_symbol_BooleanVariable(), on_create_boolean_variable);
      39           8 :   add_deletion_hook(core::detail::function_symbol_BooleanVariable(), on_delete_boolean_variable);
      40           8 : }
      41             : 
      42             : } // namespace bes
      43             : 
      44             : } // namespace mcrl2
      45             : 
      46             : #endif // MCRL2_BES_INDEX_TRAITS_H

Generated by: LCOV version 1.13