34 explicit WeakEntry(
const std::shared_ptr< const details::Entry > &entry ) ;
36 explicit WeakEntry(
const std::shared_ptr< details::Entry > &entry ) ;
44 [[nodiscard]]
bool valid()
const ;
67 std::weak_ptr< const details::Entry >
_entry {};
85 template <
typename T >
94 template <
typename T >
129 [[nodiscard]]
const Condition &condition()
const ;
138 [[nodiscard]] std::size_t size()
const ;
152 const WeakEntry &
get( std::size_t i ) {
return _entries[i]; }
158 void remove( std::size_t i ) ;
165 void remove( std::size_t i, std::size_t n ) ;
183 std::vector< WeakEntry > _entries{} ;
190 template <
typename T >
195 auto dst = std::back_inserter( res._entries ) ;
197 auto fn = [&c = cond](
const typename T::value_type &i ) ->
bool {
202 for (
auto itr = begin; itr != end; ++itr ) {
204 *dst++ =
static_cast< WeakEntry >( *itr ) ;
212 template <
typename T >
214 using value_type = std::remove_cv_t<std::remove_reference_t<decltype(*begin)>>;
216 std::is_same_v< value_type, std::shared_ptr<details::Entry>>
217 || std::is_same_v<value_type, std::shared_ptr<const details::Entry>>,
"needs container of shared pointer to Entry");
218 for (
auto itr = begin; itr != end; ++itr ) {
219 if(cond((*itr)->key())) {
Data selection to identify and manage an Entry.
typename std::vector< WeakEntry >::const_iterator const_iterator
random access const_iterator for Selections.
bool valid() const
check if WeakEntry is usable.
const EntryKey & key() const
get key from Entry.
std::weak_ptr< const details::Entry > _entry
wake reference to Entry
#define MARLIN_BOOK_THROW(message)
Handle< Entry< T > > handle() const
create new Handle for Entry.
static Selection find(T begin, T end, const Condition &cond)
Construct Selection from range of Entries.
Wrapper for weak pointer to Entry.
Contains references to entries.
Condition _condition
condition which every entry fulfill.
ComposeStrategy
Possibilities to compose Conditions when creating sub selections.
static WeakEntry findFirst(T begin, T end, const Condition &cond)
Search for first Entry which matches condition.
wrapper class for an Entry filter function.