Go to the documentation of this file.00001 #ifndef __AIRINV_BOM_BOMABSTRACT_HPP
00002 #define __AIRINV_BOM_BOMABSTRACT_HPP
00003
00004
00005
00006
00007
00008 #include <iosfwd>
00009 #include <string>
00010
00011 namespace AIRINV {
00012
00014 class BomAbstract {
00015 friend class FacBomAbstract;
00016 public:
00017
00020 virtual void toStream (std::ostream& ioOut) const = 0;
00021
00024 virtual void fromStream (std::istream& ioIn) = 0;
00025
00027 virtual std::string toString() const = 0;
00028
00031 virtual std::string describeKey() const = 0;
00032
00035 virtual std::string describeShortKey() const = 0;
00036
00037
00038 protected:
00040 BomAbstract() {}
00041 BomAbstract(const BomAbstract&) {}
00042
00044 virtual ~BomAbstract() {}
00045 };
00046 }
00047
00053 template <class charT, class traits>
00054 inline
00055 std::basic_ostream<charT, traits>&
00056 operator<< (std::basic_ostream<charT, traits>& ioOut,
00057 const AIRINV::BomAbstract& iBom) {
00063 std::basic_ostringstream<charT,traits> ostr;
00064 ostr.copyfmt (ioOut);
00065 ostr.width (0);
00066
00067
00068 iBom.toStream (ostr);
00069
00070
00071 ioOut << ostr.str();
00072
00073 return ioOut;
00074 }
00075
00081 template <class charT, class traits>
00082 inline
00083 std::basic_istream<charT, traits>&
00084 operator>> (std::basic_istream<charT, traits>& ioIn,
00085 AIRINV::BomAbstract& ioBom) {
00086
00087 ioBom.fromStream (ioIn);
00088 return ioIn;
00089 }
00090
00091 #endif // __AIRINV_BOM_BOMABSTRACT_HPP