DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
MPolynomialReader.ih
1 
30 
31 #include <cstdlib>
32 #include <iomanip>
33 #include <string>
35 
36 
37 
39 // Interface - public :
40 
45 template <int n, typename TRing, typename TAlloc, typename TIterator>
46 inline
47 void
48 DGtal::MPolynomialReader<n, TRing, TAlloc, TIterator>::
49 selfDisplay ( std::ostream & out ) const
50 {
51  out << "[MPolynomialReader";
52 }
53 
58 template <int n, typename TRing, typename TAlloc, typename TIterator>
59 inline
60 bool
61 DGtal::MPolynomialReader<n, TRing, TAlloc, TIterator>::isValid() const
62 {
63  return true;
64 }
65 
66 
67 
69 // Implementation of inline functions //
70 
71 template <int n, typename TRing, typename TAlloc, typename TIterator>
72 inline
73 std::ostream&
74 DGtal::operator<< ( std::ostream & out,
75  const MPolynomialReader<n, TRing, TAlloc, TIterator> & object )
76 {
77  object.selfDisplay( out );
78  return out;
79 }
80 
81 template < int n, typename TRing, class TAlloc >
82 std::istream&
83 DGtal::operator>> ( std::istream & in,
84  MPolynomial<n,TRing,TAlloc> & aMPolynomial )
85 {
86  typedef std::string::const_iterator ConstIterator;
87  typedef MPolynomialReader<n, TRing, TAlloc, ConstIterator> MyReader;
88  std::string s;
89  getline( in, s );
90  MyReader reader;
91  ConstIterator it = reader.read( aMPolynomial, s.begin(), s.end() );
92  while ( it != s.end() )
93  {
94  in.unget();
95  ++it;
96  }
97 
98  return in;
99 }
100 
101 // //
103 
104