Line data Source code
1 : // Author(s): Sjoerd Cranen, Jan Friso Groote 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/detail/rewrite/nfs_array.h 10 : /// \brief This is an array in which it is recorded which arguments 11 : /// are normal forms and which are not. 12 : 13 : #ifndef MCRL2_DATA_NFS_ARRAY_H 14 : #define MCRL2_DATA_NFS_ARRAY_H 15 : 16 : #include <cstddef> 17 : #include <cstring> 18 : #include <cassert> 19 : #include <vector> 20 : 21 : 22 : namespace mcrl2 23 : { 24 : namespace data 25 : { 26 : namespace detail 27 : { 28 : 29 : class nfs_array : public std::vector<bool> 30 : { 31 : public: 32 2014 : nfs_array(std::size_t size) 33 2014 : : std::vector<bool>(size, false) 34 2014 : { } 35 : 36 1230 : void fill(bool val) 37 : { 38 1230 : assign(size(), val); 39 1230 : } 40 : 41 238 : operator bool() const 42 : { 43 238 : for (const bool b: *this) 44 : { 45 238 : if (b) 46 : { 47 238 : return true; 48 : } 49 : } 50 0 : return false; 51 : } 52 : }; 53 : 54 : } 55 : } 56 : } 57 : 58 : #endif // MCRL2_DATA_NFS_ARRAY_H