1.00.26
C++ Standard Airline IT Object Library
Toggle main menu visibility
Loading...
Searching...
No Matches
StructAbstract.hpp
Go to the documentation of this file.
1
#ifndef __STDAIR_BAS_STRUCTABSTRACT_HPP
2
#define __STDAIR_BAS_STRUCTABSTRACT_HPP
3
4
// //////////////////////////////////////////////////////////////////////
5
// Import section
6
// //////////////////////////////////////////////////////////////////////
7
// STL
8
#include <iosfwd>
9
#include <string>
10
11
namespace
stdair
{
12
16
struct
StructAbstract
{
17
public
:
18
22
virtual
~StructAbstract
() {}
23
29
void
toStream
(std::ostream& ioOut)
const
{
30
ioOut <<
describe
();
31
}
32
38
virtual
void
fromStream
(std::istream& ioIn) {}
39
43
virtual
const
std::string
describe
()
const
= 0;
44
45
protected
:
49
StructAbstract
() {}
50
};
51
}
52
58
template
<
class
char
T,
class
traits>
59
inline
60
std::basic_ostream<charT, traits>&
61
operator<<
(std::basic_ostream<charT, traits>& ioOut,
62
const
stdair::StructAbstract
& iStruct) {
68
std::basic_ostringstream<charT,traits> ostr;
69
ostr.copyfmt (ioOut);
70
ostr.width (0);
71
72
// Fill string stream
73
iStruct.
toStream
(ostr);
74
75
// Print string stream
76
ioOut << ostr.str();
77
78
return
ioOut;
79
}
80
86
template
<
class
char
T,
class
traits>
87
inline
88
std::basic_istream<charT, traits>&
89
operator>>
(std::basic_istream<charT, traits>& ioIn,
90
stdair::StructAbstract
& ioStruct) {
91
// Fill the Structure object with the input stream.
92
ioStruct.
fromStream
(ioIn);
93
return
ioIn;
94
95
}
96
#endif
// __STDAIR_BAS_STRUCTABSTRACT_HPP
operator<<
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &ioOut, const stdair::StructAbstract &iStruct)
Definition
StructAbstract.hpp:61
operator>>
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &ioIn, stdair::StructAbstract &ioStruct)
Definition
StructAbstract.hpp:89
stdair
Handle on the StdAir library context.
Definition
BasChronometer.cpp:9
stdair::StructAbstract
Base class for the light structures.
Definition
StructAbstract.hpp:16
stdair::StructAbstract::StructAbstract
StructAbstract()
Definition
StructAbstract.hpp:49
stdair::StructAbstract::describe
virtual const std::string describe() const =0
stdair::StructAbstract::fromStream
virtual void fromStream(std::istream &ioIn)
Definition
StructAbstract.hpp:38
stdair::StructAbstract::toStream
void toStream(std::ostream &ioOut) const
Definition
StructAbstract.hpp:29
stdair::StructAbstract::~StructAbstract
virtual ~StructAbstract()
Definition
StructAbstract.hpp:22
Generated for StdAir by
1.17.0