17 #ifndef VCSN_AUTOMATA_IMPLEMENTATION_BMIG_BMIG_SUPPORT_HH
18 # define VCSN_AUTOMATA_IMPLEMENTATION_BMIG_BMIG_SUPPORT_HH
21 # include <vaucanson/automata/implementation/bmig/initial_container.hh>
22 # include <boost/shared_ptr.hpp>
33 typedef boost::shared_ptr<std::size_t> data_type;
34 typedef vcsn::handler<state_h, data_type> handler_t;
35 typedef std::vector<data_type> container_t;
36 typedef container_t::const_iterator vector_iterator;
39 typedef vector_iterator::iterator_category iterator_category;
40 typedef vector_iterator::difference_type difference_type;
41 typedef data_type value_type;
42 typedef data_type* pointer;
43 typedef data_type& reference;
48 handler_t operator* ()
const;
49 self_t& operator++ ();
50 self_t& operator-- ();
51 self_t operator++ (
int);
57 std::size_t container_size_;
58 const container_t* container_;
63 class Support<std::vector<boost::shared_ptr<std::size_t> > >
66 typedef boost::shared_ptr<std::size_t> value_type;
67 typedef vcsn::handler<state_h, value_type> handler_t;
72 Support (
const std::vector<value_type>&);
76 unsigned size ()
const;
79 iterator find (
const handler_t& k)
const;
84 handler_t back ()
const;
86 const std::vector<value_type>& m_;
96 struct iterator_traits<vcsn::misc::SupportIterator<std::vector<boost::shared_ptr<std::size_t> > > >
98 typedef input_iterator_tag iterator_category;
99 typedef boost::shared_ptr<size_t> value_type;
100 typedef int difference_type;
101 typedef int* pointer;
102 typedef int& reference;
112 class SupportIterator<std::set<boost::shared_ptr<std::size_t> > >
115 typedef boost::shared_ptr<std::size_t> data_type;
116 typedef vcsn::handler<state_h, data_type> handler_t;
117 typedef std::set<data_type> container_t;
118 typedef container_t::const_iterator set_iterator;
119 typedef SupportIterator<container_t> self_t;
121 typedef set_iterator::iterator_category iterator_category;
122 typedef set_iterator::difference_type difference_type;
123 typedef data_type value_type;
124 typedef data_type* pointer;
125 typedef data_type& reference;
127 SupportIterator () {}
128 SupportIterator (
const container_t* c, set_iterator it);
130 handler_t operator* ()
const;
131 self_t& operator++ ();
132 self_t& operator-- ();
133 self_t operator++ (
int);
134 bool operator!= (
const SupportIterator&)
const;
135 bool operator== (
const SupportIterator&)
const;
138 set_iterator current_;
139 std::size_t container_size_;
140 const container_t* container_;
145 class Support<std::set<boost::shared_ptr<std::size_t> > >
148 typedef boost::shared_ptr<std::size_t> value_type;
149 typedef vcsn::handler<state_h, value_type> handler_t;
154 Support (
const std::set<value_type>&);
158 unsigned size ()
const;
161 iterator find (
const handler_t& k)
const;
166 handler_t back ()
const;
168 const std::set<value_type>& m_;
178 struct iterator_traits<vcsn::misc::SupportIterator<std::set<boost::shared_ptr<std::size_t> > > >
180 typedef input_iterator_tag iterator_category;
181 typedef boost::shared_ptr<std::size_t> value_type;
182 typedef int difference_type;
183 typedef int* pointer;
184 typedef int& reference;
192 template <
typename U,
typename HState>
193 class SupportIterator<vcsn::bmig::InitialContainer<U, HState> >
196 typedef typename vcsn::bmig::InitialContainer<U, HState>::Type container_t;
197 typedef typename container_t::key_type key_type;
198 typedef typename container_t::const_iterator container_iterator;
199 typedef SupportIterator<vcsn::bmig::InitialContainer<U, HState> > self_t;
200 typedef vcsn::handler<state_h, HState> handler_t;
201 typedef typename container_iterator::iterator_category iterator_category;
202 typedef typename container_iterator::difference_type difference_type;
203 typedef key_type value_type;
204 typedef key_type* pointer;
205 typedef key_type& reference;
207 SupportIterator () {}
208 SupportIterator (
const container_t* c, container_iterator);
210 handler_t operator* ()
const;
211 self_t& operator++ ();
212 self_t& operator-- ();
213 self_t operator++ (
int);
214 bool operator!= (
const SupportIterator&)
const;
215 bool operator== (
const SupportIterator&)
const;
219 container_iterator i_;
220 container_iterator next_;
221 const container_t* container_;
226 template <
typename U,
typename HState>
230 typedef typename vcsn::bmig::InitialContainer<U, HState>::Type container_t;
233 typedef vcsn::handler<state_h, HState> handler_t;
235 Support (
const container_t&);
236 Support (
const Support&);
238 iterator begin ()
const;
239 iterator end ()
const;
240 unsigned size ()
const;
243 iterator find (
const HState& k)
const;
248 handler_t back ()
const;
250 const container_t& m_;
259 template <
class T,
class U>
260 struct iterator_traits<vcsn::misc::SupportIterator<std::vector<vcsn::handler<T, U> > > >
262 typedef input_iterator_tag iterator_category;
263 typedef U value_type;
264 typedef int difference_type;
265 typedef int* pointer;
266 typedef int& reference;
270 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
271 # include <vaucanson/automata/implementation/bmig/bmig_support.hxx>
272 # endif // VCSN_USE_INTERFACE_ONLY
274 #endif // !VCSN_AUTOMATA_IMPLEMENTATION_BMIG_BMIG_SUPPORT_HH