OpenTREP Logo  0.07.18
C++ Open Travel Request Parsing Library
Loading...
Searching...
No Matches
BomAbstract.hpp
Go to the documentation of this file.
1#ifndef __OPENTREP_BOM_BOMABSTRACT_HPP
2#define __OPENTREP_BOM_BOMABSTRACT_HPP
3
4// //////////////////////////////////////////////////////////////////////
5// Import section
6// //////////////////////////////////////////////////////////////////////
7// STL
8#include <iosfwd>
9#include <sstream>
10#include <string>
11
12namespace OPENTREP {
13
18 friend class FacBomAbstract;
19 public:
20 // /////////// Display support methods /////////
26 virtual void toStream (std::ostream&) const = 0;
27
33 virtual void fromStream (std::istream&) = 0;
34
38 virtual std::string toString() const = 0;
39
44 virtual std::string describeKey() const = 0;
45
50 virtual std::string describeShortKey() const = 0;
51
52
53 protected:
59
63 virtual ~BomAbstract() {}
64 };
65}
66
72template <class charT, class traits>
73inline
74std::basic_ostream<charT, traits>&
75operator<< (std::basic_ostream<charT, traits>& ioOut,
76 const OPENTREP::BomAbstract& iBom) {
82 std::basic_ostringstream<charT,traits> ostr;
83 ostr.copyfmt (ioOut);
84 ostr.width (0);
85
86 // Fill string stream
87 iBom.toStream (ostr);
88
89 // Print string stream
90 ioOut << ostr.str();
91
92 return ioOut;
93}
94
100template <class charT, class traits>
101inline
102std::basic_istream<charT, traits>&
103operator>> (std::basic_istream<charT, traits>& ioIn,
104 OPENTREP::BomAbstract& ioBom) {
105 // Fill Bom object with input stream
106 ioBom.fromStream (ioIn);
107 return ioIn;
108}
109
110#endif // __OPENTREP_BOM_BOMABSTRACT_HPP
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &ioOut, const OPENTREP::BomAbstract &iBom)
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &ioIn, OPENTREP::BomAbstract &ioBom)
Base class for the Business Object Model (BOM) layer.
virtual std::string toString() const =0
BomAbstract(const BomAbstract &)
virtual std::string describeKey() const =0
virtual void toStream(std::ostream &) const =0
virtual void fromStream(std::istream &)=0
virtual std::string describeShortKey() const =0
friend class FacBomAbstract