Go to the documentation of this file.00001 #ifndef __RMOL_FLD_FLDABSTRACT_HPP
00002 #define __RMOL_FLD_FLDABSTRACT_HPP
00003
00004
00005
00006
00007
00008 #include <istream>
00009 #include <ostream>
00010 #include <sstream>
00011 #include <string>
00012
00013 namespace RMOL {
00014
00016 class FldAbstract {
00017 public:
00018
00021 virtual void toStream (std::ostream& ioOut) const = 0;
00022
00025 virtual void fromStream (std::istream& ioIn) = 0;
00026
00027 protected:
00029 FldAbstract() {}
00030 FldAbstract(const FldAbstract&) {}
00031
00033 virtual ~FldAbstract() {}
00034 };
00035 }
00036
00042 template <class charT, class traits>
00043 inline
00044 std::basic_ostream<charT, traits>&
00045 operator<< (std::basic_ostream<charT, traits>& ioOut,
00046 const RMOL::FldAbstract& iBom) {
00052 std::basic_ostringstream<charT,traits> ostr;
00053 ostr.copyfmt (ioOut);
00054 ostr.width (0);
00055
00056
00057 iBom.toStream (ostr);
00058
00059
00060 ioOut << ostr.str();
00061
00062 return ioOut;
00063 }
00064
00070 template <class charT, class traits>
00071 inline
00072 std::basic_istream<charT, traits>&
00073 operator>> (std::basic_istream<charT, traits>& ioIn,
00074 RMOL::FldAbstract& ioBom) {
00075
00076 ioBom.fromStream (ioIn);
00077 return ioIn;
00078 }
00079
00080 #endif // __RMOL_FLD_FLDABSTRACT_HPP