Go to the documentation of this file.00001 #ifndef __AIRSCHED_SERVICEABSTRACT_HPP
00002 #define __AIRSCHED_SERVICEABSTRACT_HPP
00003
00004
00005
00006
00007
00008 #include <iostream>
00009 #include <sstream>
00010
00011 namespace AIRSCHED {
00012
00014 class ServiceAbstract {
00015 public:
00016
00018 virtual ~ServiceAbstract() {}
00019
00022 virtual void toStream (std::ostream& ioOut) const {}
00023
00026 virtual void fromStream (std::istream& ioIn) {}
00027
00028 protected:
00030 ServiceAbstract() {}
00031 };
00032 }
00033
00039 template <class charT, class traits>
00040 inline
00041 std::basic_ostream<charT, traits>&
00042 operator<< (std::basic_ostream<charT, traits>& ioOut,
00043 const AIRSCHED::ServiceAbstract& iService) {
00049 std::basic_ostringstream<charT,traits> ostr;
00050 ostr.copyfmt (ioOut);
00051 ostr.width (0);
00052
00053
00054 iService.toStream (ostr);
00055
00056
00057 ioOut << ostr.str();
00058
00059 return ioOut;
00060 }
00061
00067 template <class charT, class traits>
00068 inline
00069 std::basic_istream<charT, traits>&
00070 operator>> (std::basic_istream<charT, traits>& ioIn,
00071 AIRSCHED::ServiceAbstract& ioService) {
00072
00073 ioService.fromStream (ioIn);
00074 return ioIn;
00075 }
00076
00077 #endif // __AIRSCHED_SERVICEABSTRACT_HPP