DGtal  0.9.2
FrontInsertionSequenceToStackAdapter.h
1 
17 #pragma once
18 
31 #if defined(FrontInsertionSequenceToStackAdapter_RECURSES)
32 #error Recursive header files inclusion detected in FrontInsertionSequenceToStackAdapter.h
33 #else // defined(FrontInsertionSequenceToStackAdapter_RECURSES)
34 
35 #define FrontInsertionSequenceToStackAdapter_RECURSES
36 
37 #if !defined FrontInsertionSequenceToStackAdapter_h
38 
39 #define FrontInsertionSequenceToStackAdapter_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/Alias.h"
47 
48 namespace DGtal
49 {
50 
52  // template class FrontInsertionSequenceToStackAdapter
61  template <typename TSequence>
63  {
64 
65  // ----------------------- Inner types ------------------------------------
66  public:
67 
71  typedef TSequence Container;
73 
74 
78  typedef typename Container::value_type value_type;
82  typedef typename Container::value_type Value;
83 
87  typedef typename Container::size_type size_type;
91  typedef typename Container::size_type Size;
92 
93 
94  // ----------------------- Standard services ------------------------------
95  public:
96 
102 
107  Size size() const;
108 
113  bool empty() const;
114 
122  Value& top();
130  const Value& top() const;
131 
138  void push(const Value& aValue);
139 
145  void pop();
146 
147  // ----------------------- Interface --------------------------------------
148  public:
149 
154  void selfDisplay ( std::ostream & out ) const;
155 
160  bool isValid() const;
161 
162  // ------------------------- Private Datas --------------------------------
163  private:
167  Container* myContainerPtr;
168 
169 
170 
171  }; // end of class FrontInsertionSequenceToStackAdapter
172 
173 
180  template <typename TSequence>
181  std::ostream&
182  operator<< ( std::ostream & out, const FrontInsertionSequenceToStackAdapter<TSequence> & object );
183 
190  template <typename TSequence>
192  frontStack ( TSequence& aSequence );
193 
194 } // namespace DGtal
195 
196 
198 // Includes inline functions.
199 #include "DGtal/base/FrontInsertionSequenceToStackAdapter.ih"
200 
201 // //
203 
204 #endif // !defined FrontInsertionSequenceToStackAdapter_h
205 
206 #undef FrontInsertionSequenceToStackAdapter_RECURSES
207 #endif // else defined(FrontInsertionSequenceToStackAdapter_RECURSES)
void selfDisplay(std::ostream &out) const
Go to http://www.sgi.com/tech/stl/FrontInsertionSequence.html.
Definition: Boost.dox:131
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: Alias.h:182
Aim: This class implements a dynamic adapter to an instance of a model of front insertion sequence in...
DGtal is the top-level namespace which contains all DGtal functions and types.
FrontInsertionSequenceToStackAdapter(Alias< Container > aContainer)
BOOST_CONCEPT_ASSERT((boost::FrontInsertionSequence< Container >))
FrontInsertionSequenceToStackAdapter< TSequence > frontStack(TSequence &aSequence)