1.00.26
C++ Standard Airline IT Object Library
Toggle main menu visibility
Loading...
Searching...
No Matches
BomAbstract.hpp
Go to the documentation of this file.
1
7
#ifndef __STDAIR_BOM_BOMABSTRACT_HPP
8
#define __STDAIR_BOM_BOMABSTRACT_HPP
9
10
// //////////////////////////////////////////////////////////////////////
11
// Import section
12
// //////////////////////////////////////////////////////////////////////
13
// STL
14
#include <iosfwd>
15
#include <string>
16
#include <map>
17
#include <typeinfo>
18
19
namespace
stdair
{
20
24
class
BomAbstract
{
25
public
:
26
// /////////// Display support methods /////////
32
virtual
void
toStream
(std::ostream& ioOut)
const
= 0;
33
39
virtual
void
fromStream
(std::istream& ioIn) = 0;
40
46
virtual
std::string
toString
()
const
= 0;
47
48
49
protected
:
53
BomAbstract
() {}
54
BomAbstract
(
const
BomAbstract
&) {}
55
public
:
59
virtual
~BomAbstract
() {}
60
};
61
62
/* Define the map of object holder type. */
63
typedef
std::map<const std::type_info*, BomAbstract*>
HolderMap_T
;
64
}
65
71
template
<
class
char
T,
class
traits>
72
inline
73
std::basic_ostream<charT, traits>&
74
operator<<
(std::basic_ostream<charT, traits>& ioOut,
75
const
stdair::BomAbstract
& iBom) {
81
std::basic_ostringstream<charT,traits> ostr;
82
ostr.copyfmt (ioOut);
83
ostr.width (0);
84
85
// Fill string stream
86
iBom.
toStream
(ostr);
87
88
// Print string stream
89
ioOut << ostr.str();
90
91
return
ioOut;
92
}
93
99
template
<
class
char
T,
class
traits>
100
inline
101
std::basic_istream<charT, traits>&
102
operator>>
(std::basic_istream<charT, traits>& ioIn,
103
stdair::BomAbstract
& ioBom) {
104
// Fill Bom object with input stream
105
ioBom.
fromStream
(ioIn);
106
return
ioIn;
107
}
108
109
#endif
// __STDAIR_BOM_BOMABSTRACT_HPP
operator>>
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &ioIn, stdair::BomAbstract &ioBom)
Definition
BomAbstract.hpp:102
operator<<
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &ioOut, const stdair::BomAbstract &iBom)
Definition
BomAbstract.hpp:74
stdair
Handle on the StdAir library context.
Definition
BasChronometer.cpp:9
stdair::HolderMap_T
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Definition
BomAbstract.hpp:63
stdair::BomAbstract
Base class for the Business Object Model (BOM) layer.
Definition
BomAbstract.hpp:24
stdair::BomAbstract::fromStream
virtual void fromStream(std::istream &ioIn)=0
stdair::BomAbstract::toString
virtual std::string toString() const =0
stdair::BomAbstract::BomAbstract
BomAbstract()
Definition
BomAbstract.hpp:53
stdair::BomAbstract::~BomAbstract
virtual ~BomAbstract()
Definition
BomAbstract.hpp:59
stdair::BomAbstract::BomAbstract
BomAbstract(const BomAbstract &)
Definition
BomAbstract.hpp:54
stdair::BomAbstract::toStream
virtual void toStream(std::ostream &ioOut) const =0
Generated for StdAir by
1.17.0