constraint.h
Go to the documentation of this file.
118 } else if (m_sequence.empty() && m_auto_release && 0 == m_active.load(std::memory_order_relaxed)) {
320 release_next(ord, true); // force the check for a next release even if the current ordinal hasn't changed
357 template<typename Mapper, typename = std::enable_if_t<std::is_invocable_v<Mapper, std::decay_t<std::tuple_element_t<0, boost::callable_traits::args_t<Mapper>>>>>>
363 std::enable_if_t<std::is_invocable_v<Mapper, std::decay_t<std::tuple_element_t<0, boost::callable_traits::args_t<Mapper>>>>, Mapper>
366 template<typename Mapper, typename = std::enable_if_t<std::is_invocable_v<Mapper, std::decay_t<std::tuple_element_t<0, boost::callable_traits::args_t<Mapper>>>>>>
372 std::enable_if_t<std::is_invocable_v<Mapper, std::decay_t<std::tuple_element_t<0, boost::callable_traits::args_t<Mapper>>>>, Mapper>
399 return std::make_shared<decltype(Constraint(std::forward<Args>(args)...))>(std::forward<Args>(args)...);
SequencedKeysConstraint(Mapper &&) -> SequencedKeysConstraint< std::decay_t< std::tuple_element_t< 0, boost::callable_traits::args_t< Mapper >>>, std::decay_t< boost::callable_traits::return_type_t< Mapper >>, std::less< std::decay_t< boost::callable_traits::return_type_t< Mapper >>>, std::enable_if_t< std::is_invocable_v< Mapper, std::decay_t< std::tuple_element_t< 0, boost::callable_traits::args_t< Mapper >>>>, Mapper > >
Definition: constraint.h:21
void notify_listener(const ttg::span< key_type > &keys, ttg::TTBase *tt)
Definition: constraint.h:50
ConstraintBase & operator=(ConstraintBase &&cb)
Definition: constraint.h:36
virtual ~ConstraintBase()=default
ConstraintBase(const ConstraintBase &cb)
Definition: constraint.h:32
std::function< void(const ttg::span< key_type > &)> listener_t
Definition: constraint.h:23
void add_listener(listener_t l, ttg::TTBase *tt)
Definition: constraint.h:45
ConstraintBase & operator=(const ConstraintBase &cb)
Definition: constraint.h:39
std::map< ttg::TTBase *, std::vector< key_type > > m_keys
Definition: constraint.h:82
sequence_elem_t(sequence_elem_t &&)=default
sequence_elem_t(const sequence_elem_t &)=default
sequence_elem_t()=default
sequence_elem_t & operator=(const sequence_elem_t &)=default
void add_key(const key_type &key, ttg::TTBase *tt)
Definition: constraint.h:90
sequence_elem_t & operator=(sequence_elem_t &&)=default
Definition: constraint.h:70
SequencedKeysConstraint(bool auto_release=false)
Definition: constraint.h:219
std::enable_if_t<!ttg::meta::is_void_v< Key_ > &&ttg::meta::is_void_v< Mapper_ > > complete(const key_type &key, Ordinal ord, ttg::TTBase *tt)
Definition: constraint.h:278
bool check_key_impl(const key_type &key, Ordinal ord, ttg::TTBase *tt)
Definition: constraint.h:108
std::atomic< std::size_t > m_active
Definition: constraint.h:350
requires(std::is_invocable_v< Mapper_, Key >) SequencedKeysConstraint(Mapper_ &&map
bool comp_equal(const Ordinal &a, const Ordinal &b) const
Definition: constraint.h:100
SequencedKeysConstraint & operator=(SequencedKeysConstraint &&skc)=default
std::enable_if_t<!ttg::meta::is_void_v< Key_ > &&ttg::meta::is_void_v< Mapper_ >, bool > check(const key_type &key, Ordinal ord, ttg::TTBase *tt)
Definition: constraint.h:254
SequencedKeysConstraint & operator=(const SequencedKeysConstraint &skc)=default
virtual ~SequencedKeysConstraint()=default
std::conditional_t< ttg::meta::is_void_v< Key >, ttg::Void, Key > key_type
Definition: constraint.h:72
std::enable_if_t< ttg::meta::is_void_v< Key_ > &&!ttg::meta::is_void_v< Mapper_ >, bool > check(ttg::TTBase *tt)
Definition: constraint.h:260
std::map< ordinal_type, sequence_elem_t, compare_t > m_sequence
Definition: constraint.h:344
std::enable_if_t<!ttg::meta::is_void_v< Key_ > &&ttg::meta::is_void_v< Mapper_ > > complete(Ordinal ord, ttg::TTBase *tt)
Definition: constraint.h:284
std::enable_if_t< ttg::meta::is_void_v< Key_ > &&ttg::meta::is_void_v< Mapper_ >, bool > check(ordinal_type ord, ttg::TTBase *tt)
Definition: constraint.h:266
void release_next(ordinal_type ord, bool force_check=false)
Definition: constraint.h:183
SequencedKeysConstraint(const SequencedKeysConstraint &skc)=default
std::function< Ordinal(const key_type &)> keymap_t
Definition: constraint.h:74
std::enable_if_t<!ttg::meta::is_void_v< Key_ > &&!ttg::meta::is_void_v< Mapper_ > > complete(ttg::TTBase *tt)
Definition: constraint.h:290
std::enable_if_t<!ttg::meta::is_void_v< Key_ > &&!ttg::meta::is_void_v< Mapper_ > > complete(const key_type &key, ttg::TTBase *tt)
Definition: constraint.h:272
std::enable_if_t<!ttg::meta::is_void_v< Key_ > &&!ttg::meta::is_void_v< Mapper_ >, bool > check(const key_type &key, ttg::TTBase *tt)
Definition: constraint.h:247
bool eligible(const Ordinal &ord) const
Definition: constraint.h:104