1 #ifndef BARRY_RULES_BONES_HPP
2 #define BARRY_RULES_BONES_HPP 1
4 template <
typename Array_Type,
typename Data_Type>
19 template<
typename Array_Type = BArray<>,
typename Data_Type =
bool>
26 std::string name =
"";
27 std::string desc =
"";
45 std::string
name_ =
"",
46 std::string
desc_ =
""
54 bool operator()(
const Array_Type & a,
size_t i,
size_t j);
70 template<
typename Array_Type,
typename Data_Type>
74 std::vector< Rule<Array_Type,Data_Type> > data;
98 std::string
name_ =
"",
99 std::string description_ =
""
113 bool operator()(
const Array_Type & a,
size_t i,
size_t j);
125 const Array_Type & a,
126 std::vector< size_t > * free,
127 std::vector< size_t > * locked =
nullptr
130 std::vector< std::string >
get_names()
const;
134 typename std::vector< Rule<Array_Type,Data_Type> >::iterator
begin() {
137 typename std::vector< Rule<Array_Type,Data_Type> >::iterator
end() {
Rule for determining if a cell should be included in a sequence.
bool operator()(const Array_Type &a, size_t i, size_t j)
Data_Type & D()
Read/Write access to the data.
Rule(Rule_fun_type< Array_Type, Data_Type > fun_, Data_Type dat_, std::string name_="", std::string desc_="")
std::string & get_description()
Vector of objects of class Rule.
size_t size() const noexcept
bool operator()(const Array_Type &a, size_t i, size_t j)
Check whether a given cell is free or locked.
void add_rule(Rule< Array_Type, Data_Type > rule)
std::vector< std::string > get_descriptions() const
void get_seq(const Array_Type &a, std::vector< size_t > *free, std::vector< size_t > *locked=nullptr)
Computes the sequence of free and locked cells in an BArray.
std::vector< std::string > get_names() const
std::vector< Rule< Array_Type, Data_Type > >::iterator end()
Rules< Array_Type, Data_Type > operator=(const Rules< Array_Type, Data_Type > &rules_)
std::vector< Rule< Array_Type, Data_Type > >::iterator begin()
Data_Type &&counter_ desc(std::move(counter_.desc))
Move constructor.
Data_Type &&counter_ name(std::move(counter_.name))
Data_Type &&counter_ data(std::move(counter_.data))
Data_Type Counter_fun_type< Array_Type, Data_Type > Hasher_fun_type< Array_Type, Data_Type > Data_Type std::string std::string desc_
Data_Type Counter_fun_type< Array_Type, Data_Type > Hasher_fun_type< Array_Type, Data_Type > Data_Type std::string name_
Data_Type &&counter_ noexcept
Data_Type Counter_fun_type< Array_Type, Data_Type > Hasher_fun_type< Array_Type, Data_Type > Data_Type data_
bool rule_fun_default(const Array_Type *array, size_t i, size_t j, Data_Type *dat)
std::function< bool(const Array_Type &, size_t, size_t, Data_Type &)> Rule_fun_type