1.00.26
C++ Standard Airline IT Object Library
Toggle main menu visibility
Loading...
Searching...
No Matches
KeyAbstract.hpp
Go to the documentation of this file.
1
7
#ifndef __STDAIR_BOM_KEYABSTRACT_HPP
8
#define __STDAIR_BOM_KEYABSTRACT_HPP
9
10
// //////////////////////////////////////////////////////////////////////
11
// Import section
12
// //////////////////////////////////////////////////////////////////////
13
// STL
14
#include <iosfwd>
15
#include <string>
16
17
namespace
stdair
{
18
27
struct
KeyAbstract
{
28
public
:
29
30
// /////////// Display support methods /////////
36
virtual
void
toStream
(std::ostream& ioOut)
const
{}
37
43
virtual
void
fromStream
(std::istream& ioIn) {}
44
56
virtual
const
std::string
toString
()
const
{
return
std::string(
"Hello!"
); }
57
61
virtual
~KeyAbstract
() {}
62
};
63
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::KeyAbstract
& iKey) {
81
std::basic_ostringstream<charT,traits> ostr;
82
ostr.copyfmt (ioOut);
83
ostr.width (0);
84
85
// Fill string stream
86
iKey.
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::KeyAbstract
& ioKey) {
104
// Fill Key object with input stream
105
ioKey.
fromStream
(ioIn);
106
return
ioIn;
107
}
108
109
#endif
// __STDAIR_BOM_KEYABSTRACT_HPP
operator>>
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &ioIn, stdair::KeyAbstract &ioKey)
Definition
KeyAbstract.hpp:102
operator<<
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &ioOut, const stdair::KeyAbstract &iKey)
Definition
KeyAbstract.hpp:74
stdair
Handle on the StdAir library context.
Definition
BasChronometer.cpp:9
stdair::KeyAbstract
Base class for the keys of Business Object Model (BOM) layer.
Definition
KeyAbstract.hpp:27
stdair::KeyAbstract::fromStream
virtual void fromStream(std::istream &ioIn)
Read a Business Object Key from an input stream.
Definition
KeyAbstract.hpp:43
stdair::KeyAbstract::toString
virtual const std::string toString() const
Get the serialised version of the Business Object Key.
Definition
KeyAbstract.hpp:56
stdair::KeyAbstract::~KeyAbstract
virtual ~KeyAbstract()
Default destructor.
Definition
KeyAbstract.hpp:61
stdair::KeyAbstract::toStream
virtual void toStream(std::ostream &ioOut) const
Dump a Business Object Key into an output stream.
Definition
KeyAbstract.hpp:36
Generated for StdAir by
1.17.0