14 #ifndef _ENTITY_ENTITYITERATOR_H_INCLUDED_
15 #define _ENTITY_ENTITYITERATOR_H_INCLUDED_
17 #include <boost/iterator/iterator_facade.hpp>
19 #include "entity/config.hpp"
25 struct forward_traversal_tag;
35 template<
typename EntityListIterator,
typename ZippedComponentWindows>
37 :
public boost::iterator_facade<
38 entity_incremental_iterator<EntityListIterator, ZippedComponentWindows>
39 , ZippedComponentWindows
40 , boost::forward_traversal_tag
41 , ZippedComponentWindows
64 if(entity_iter_ != end_)
66 windows_.increment(*entity_iter_);
72 return entity_iter_ == other.entity_iter_;
75 ZippedComponentWindows dereference()
const
80 EntityListIterator entity_iter_;
81 EntityListIterator end_;
82 ZippedComponentWindows windows_;
88 template<
typename EntityListIterator,
typename ZippedComponentWindows>
90 :
public boost::iterator_facade<
91 entity_skipping_iterator<EntityListIterator, ZippedComponentWindows>
92 , ZippedComponentWindows
93 , boost::forward_traversal_tag
94 , ZippedComponentWindows
100 : entity_iter_(begin)
104 if(entity_iter_ != end_)
106 windows_.advance(*entity_iter_);
112 return *entity_iter_;
122 if(entity_iter_ != end_)
124 windows_.advance(*entity_iter_);
130 return entity_iter_ == other.entity_iter_;
133 ZippedComponentWindows dereference()
const
138 EntityListIterator entity_iter_;
139 EntityListIterator end_;
140 ZippedComponentWindows windows_;
146 template<
typename Iterator,
typename EndIterator = Iterator>
152 : begin_(
std::move(begin))
153 , end_(
std::move(end))
172 template<
typename Iterator,
typename EndIterator>
178 template<
typename Iterator,
typename EndIterator>
186 template<
typename EntityList,
typename ZippedComponentWindows>
188 decltype(
begin(entities)),
189 ZippedComponentWindows>
192 decltype(
begin(entities)),
193 ZippedComponentWindows
194 >(
begin(entities),
end(entities), std::move(windows));
197 template<
typename EntityList,
typename ZippedComponentWindows>
199 decltype(
end(entities)),
200 ZippedComponentWindows>
203 decltype(
begin(entities)),
204 ZippedComponentWindows
205 >(
end(entities),
end(entities), std::move(windows));
210 template<
typename EntityList,
typename ZippedComponentWindows>
212 decltype(entities.begin()),
213 ZippedComponentWindows>
216 decltype(entities.begin()),
217 ZippedComponentWindows
218 >(entities.begin(), entities.end(), std::move(windows));
221 template<
typename EntityList,
typename ZippedComponentWindows>
223 decltype(entities.end()),
224 ZippedComponentWindows>
227 decltype(entities.begin()),
228 ZippedComponentWindows
229 >(entities.end(), entities.end(), std::move(windows));
234 template<
typename EntityList,
typename ZippedComponentWindows>
244 template<
typename EntityList,
typename ZippedComponentWindows>
256 template<
typename EntityList,
typename ZippedComponentWindows>
269 #endif // _ENTITY_ENTITYITERATOR_H_INCLUDED_
entity_pool::iterator end(entity_pool const &p)
auto make_entity_begin(iterator_traits::is_skipping_tag, EntityList const &entities, ZippedComponentWindows windows) -> entity_skipping_iterator< decltype(begin(entities)), ZippedComponentWindows >
auto make_entity_end(iterator_traits::is_skipping_tag, EntityList const &entities, ZippedComponentWindows windows) -> entity_skipping_iterator< decltype(end(entities)), ZippedComponentWindows >
entity_range(Iterator begin, EndIterator end)
entity get_entity() const
entity_pool::iterator begin(entity_pool const &p)
auto make_entity_range(EntityList const &list, ZippedComponentWindows windows) -> entity_range< decltype(make_entity_begin(list, windows)), decltype(make_entity_end(list, windows))>
entity get_entity() const
friend class boost::iterator_core_access
entity_skipping_iterator(EntityListIterator begin, EntityListIterator end, ZippedComponentWindows windows)
friend class boost::iterator_core_access
entity_incremental_iterator(EntityListIterator begin, EntityListIterator end, ZippedComponentWindows windows)