17 #ifndef VCSN_AUTOMATA_IMPLEMENTATION_BMIG_BMIG_SUPPORT_HXX
18 # define VCSN_AUTOMATA_IMPLEMENTATION_BMIG_BMIG_SUPPORT_HXX
20 # include <vaucanson/automata/implementation/bmig/bmig_support.hh>
28 SupportIterator<std::vector<boost::shared_ptr<std::size_t> > >::SupportIterator (
const container_t* c,
30 : current_(i), container_size_(c->size()), container_(c)
34 SupportIterator<std::vector<boost::shared_ptr<std::size_t> > >::handler_t
35 SupportIterator<std::vector<boost::shared_ptr<std::size_t> > >::operator* ()
const
37 return handler_t((*container_)[current_]);
41 SupportIterator<std::vector<boost::shared_ptr<std::size_t> > >&
42 SupportIterator<std::vector<boost::shared_ptr<std::size_t> > >::operator++ ()
44 if (container_->size() == container_size_)
47 container_size_ = container_->size();
52 SupportIterator<std::vector<boost::shared_ptr<std::size_t> > >&
53 SupportIterator<std::vector<boost::shared_ptr<std::size_t> > >::operator-- ()
55 if (container_->size() == container_size_)
58 container_size_ = container_->size();
63 SupportIterator<std::vector<boost::shared_ptr<std::size_t> > >
64 SupportIterator<std::vector<boost::shared_ptr<std::size_t> > >::operator++ (int)
66 SupportIterator<std::vector<boost::shared_ptr<std::size_t> > > tmp = *
this;
73 SupportIterator<std::vector<boost::shared_ptr<std::size_t> > >::operator!= (
const SupportIterator& o)
const
75 return o.current_ != current_;
80 SupportIterator<std::vector<boost::shared_ptr<std::size_t> > >::operator== (
const SupportIterator& o)
const
82 return ! (*
this != o);
87 SupportIterator<std::set<boost::shared_ptr<std::size_t> > >::SupportIterator (
const container_t* c, set_iterator it)
88 : current_(it), container_size_(c->size()), container_(c)
92 SupportIterator<std::set<boost::shared_ptr<std::size_t> > >::handler_t
93 SupportIterator<std::set<boost::shared_ptr<std::size_t> > >::operator* ()
const
95 return handler_t(*current_);
99 SupportIterator<std::set<boost::shared_ptr<std::size_t> > >&
100 SupportIterator<std::set<boost::shared_ptr<std::size_t> > >::operator++ ()
102 if (container_->size() == container_size_)
105 container_size_ = container_->size();
110 SupportIterator<std::set<boost::shared_ptr<std::size_t> > >&
111 SupportIterator<std::set<boost::shared_ptr<std::size_t> > >::operator-- ()
113 if (container_->size() == container_size_)
116 container_size_ = container_->size();
121 SupportIterator<std::set<boost::shared_ptr<std::size_t> > >
122 SupportIterator<std::set<boost::shared_ptr<std::size_t> > >::operator++ (int)
124 SupportIterator<std::set<boost::shared_ptr<std::size_t> > > tmp = *
this;
131 SupportIterator<std::set<boost::shared_ptr<std::size_t> > >::operator!= (
const SupportIterator& o)
const
133 return o.current_ != current_;
138 SupportIterator<std::set<boost::shared_ptr<std::size_t> > >::operator== (
const SupportIterator& o)
const
140 return ! (*
this != o);
148 template <
typename U,
typename HState>
149 SupportIterator<vcsn::bmig::InitialContainer<U, HState> >
150 ::SupportIterator (
const container_t* c, container_iterator i)
165 template <
typename U,
typename HState>
166 typename SupportIterator<vcsn::bmig::InitialContainer<U, HState> >::handler_t
167 SupportIterator<vcsn::bmig::InitialContainer<U, HState> >::operator* ()
const
169 return handler_t(i_->first);
172 template <
typename U,
typename HState>
173 SupportIterator<vcsn::bmig::InitialContainer<U, HState> >&
174 SupportIterator<vcsn::bmig::InitialContainer<U, HState> >::operator++ ()
176 if (next_ != container_->end())
183 template <
typename U,
typename HState>
184 SupportIterator<vcsn::bmig::InitialContainer<U, HState> >
185 SupportIterator<vcsn::bmig::InitialContainer<U, HState> >::operator++ (int)
187 SupportIterator<vcsn::bmig::InitialContainer<U, HState> > tmp = *
this;
192 template <
typename U,
typename HState>
194 SupportIterator<vcsn::bmig::InitialContainer<U, HState> >::operator!= (
const SupportIterator& o)
const
199 template <
typename U,
typename HState>
201 SupportIterator<vcsn::bmig::InitialContainer<U, HState> >::operator== (
const SupportIterator& o)
const
203 return ! (*
this != o);
213 template <
class U,
class HState>
214 Support<vcsn::bmig::InitialContainer<U, HState> >::Support (
const Support& s)
219 template <
class U,
class HState>
220 Support<vcsn::bmig::InitialContainer<U, HState> >::Support (
const Support::container_t& m)
225 template <
class U,
class HState>
227 Support<vcsn::bmig::InitialContainer<U, HState> >::size ()
const
232 template <
class U,
class HState>
233 typename Support<vcsn::bmig::InitialContainer<U, HState> >::iterator
234 Support<vcsn::bmig::InitialContainer<U, HState> >::find (
const HState& k)
const
236 return m_.find (k.value());
239 template <
class U,
class HState>
241 Support<vcsn::bmig::InitialContainer<U, HState> >::empty ()
const
246 template <
class U,
class HState>
247 typename Support<vcsn::bmig::InitialContainer<U, HState> >::iterator
248 Support<vcsn::bmig::InitialContainer<U, HState> >::begin ()
const
250 return iterator (&m_, m_.begin ());
253 template <
class U,
class HState>
254 typename Support<vcsn::bmig::InitialContainer<U, HState> >::iterator
255 Support<vcsn::bmig::InitialContainer<U, HState> >::end ()
const
257 return iterator (&m_, m_.end ());
260 template <
class U,
class HState>
261 typename Support<vcsn::bmig::InitialContainer<U, HState> >::handler_t
262 Support<vcsn::bmig::InitialContainer<U, HState> >::back ()
const
264 return handler_t(*max_element (begin (), end ()));
281 Support<std::vector<boost::shared_ptr<std::size_t> > >
282 ::Support (
const std::vector<boost::shared_ptr<std::size_t> >& m)
289 Support<std::vector<boost::shared_ptr<std::size_t> > >
296 Support<std::vector<boost::shared_ptr<std::size_t> > >::iterator
297 Support<std::vector<boost::shared_ptr<std::size_t> > >
298 ::find (
const handler<state_h, boost::shared_ptr<std::size_t> >& k)
const
301 return iterator(&m_, k);
303 return iterator(&m_, m_.size());
308 Support<std::vector<boost::shared_ptr<std::size_t> > >
315 Support<std::vector<boost::shared_ptr<std::size_t> > >::const_iterator
316 Support<std::vector<boost::shared_ptr<std::size_t> > >
319 return iterator (&m_, 0);
323 Support<std::vector<boost::shared_ptr<std::size_t> > >::const_iterator
324 Support<std::vector<boost::shared_ptr<std::size_t> > >
327 return iterator (&m_, m_.size());
331 Support<std::vector<boost::shared_ptr<std::size_t> > >::handler_t
332 Support<std::vector<boost::shared_ptr<std::size_t> > >
335 return handler_t(m_.back());
340 Support<std::set<boost::shared_ptr<std::size_t> > >
341 ::Support (
const std::set<boost::shared_ptr<std::size_t> >& m)
348 Support<std::set<boost::shared_ptr<std::size_t> > >
355 Support<std::set<boost::shared_ptr<std::size_t> > >::iterator
356 Support<std::set<boost::shared_ptr<std::size_t> > >
357 ::find (
const handler<state_h, boost::shared_ptr<std::size_t> >& k)
const
359 return iterator(&m_, m_.find(k.value()));
364 Support<std::set<boost::shared_ptr<std::size_t> > >
371 Support<std::set<boost::shared_ptr<std::size_t> > >::const_iterator
372 Support<std::set<boost::shared_ptr<std::size_t> > >
375 return iterator (&m_, m_.begin());
379 Support<std::set<boost::shared_ptr<std::size_t> > >::const_iterator
380 Support<std::set<boost::shared_ptr<std::size_t> > >
383 return iterator (&m_, m_.end());
387 Support<std::set<boost::shared_ptr<std::size_t> > >::handler_t
388 Support<std::set<boost::shared_ptr<std::size_t> > >
392 return handler_t(*max_element (begin (), end ()));
400 #endif // !VCSN_AUTOMATA_IMPLEMENTATION_BMIG_BMIG_SUPPORT_HXX