TvlSim Logo  1.01.6
C++ Simulated Travel-Oriented Distribution System Library
Loading...
Searching...
No Matches
BomAbstract.hpp
Go to the documentation of this file.
1#ifndef __TVLSIM_BOM_BOMABSTRACT_HPP
2#define __TVLSIM_BOM_BOMABSTRACT_HPP
3
4// //////////////////////////////////////////////////////////////////////
5// Import section
6// //////////////////////////////////////////////////////////////////////
7// STL
8#include <iosfwd>
9#include <string>
10
11namespace TVLSIM {
12
15 friend class FacBomAbstract;
16 public:
17 // /////////// Display support methods /////////
20 virtual void toStream (std::ostream& ioOut) const = 0;
21
24 virtual void fromStream (std::istream& ioIn) = 0;
25
27 virtual std::string toString() const = 0;
28
31 virtual std::string describeKey() const = 0;
32
35 virtual std::string describeShortKey() const = 0;
36
37
38 protected:
42
44 virtual ~BomAbstract() {}
45 };
46}
47
53template <class charT, class traits>
54inline
55std::basic_ostream<charT, traits>&
56operator<< (std::basic_ostream<charT, traits>& ioOut,
57 const TVLSIM::BomAbstract& iBom) {
63 std::basic_ostringstream<charT,traits> ostr;
64 ostr.copyfmt (ioOut);
65 ostr.width (0);
66
67 // Fill string stream
68 iBom.toStream (ostr);
69
70 // Print string stream
71 ioOut << ostr.str();
72
73 return ioOut;
74}
75
81template <class charT, class traits>
82inline
83std::basic_istream<charT, traits>&
84operator>> (std::basic_istream<charT, traits>& ioIn,
85 TVLSIM::BomAbstract& ioBom) {
86 // Fill Bom object with input stream
87 ioBom.fromStream (ioIn);
88 return ioIn;
89}
90
91#endif // __TVLSIM_BOM_BOMABSTRACT_HPP
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &ioIn, TVLSIM::BomAbstract &ioBom)
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &ioOut, const TVLSIM::BomAbstract &iBom)
virtual std::string describeKey() const =0
virtual std::string describeShortKey() const =0
virtual std::string toString() const =0
BomAbstract(const BomAbstract &)
virtual void toStream(std::ostream &ioOut) const =0
virtual void fromStream(std::istream &ioIn)=0
friend class FacBomAbstract