0.08.01
C++ Open Travel Request Parsing Library
Toggle main menu visibility
Loading...
Searching...
No Matches
KeyAbstract.hpp
Go to the documentation of this file.
1
#ifndef __OPENTREP_KEY_KEYABSTRACT_HPP
2
#define __OPENTREP_KEY_KEYABSTRACT_HPP
3
4
// //////////////////////////////////////////////////////////////////////
5
// Import section
6
// //////////////////////////////////////////////////////////////////////
7
// STL
8
#include <iosfwd>
9
#include <sstream>
10
#include <string>
11
12
namespace
OPENTREP
{
13
17
class
KeyAbstract
{
18
public
:
19
// /////////// Display support methods /////////
25
virtual
void
toStream
(std::ostream&)
const
= 0;
26
32
virtual
void
fromStream
(std::istream&) = 0;
33
37
virtual
std::string
toString
()
const
= 0;
38
43
virtual
std::string
describe
()
const
= 0;
44
45
46
protected
:
50
KeyAbstract
() {}
51
KeyAbstract
(
const
KeyAbstract
&) {}
52
56
virtual
~KeyAbstract
() {}
57
};
58
}
59
65
template
<
class
char
T,
class
traits>
66
inline
67
std::basic_ostream<charT, traits>&
68
operator<<
(std::basic_ostream<charT, traits>& ioOut,
69
const
OPENTREP::KeyAbstract
& iKey) {
75
std::basic_ostringstream<charT,traits> ostr;
76
ostr.copyfmt (ioOut);
77
ostr.width (0);
78
79
// Fill string stream
80
iKey.
toStream
(ostr);
81
82
// Print string stream
83
ioOut << ostr.str();
84
85
return
ioOut;
86
}
87
93
template
<
class
char
T,
class
traits>
94
inline
95
std::basic_istream<charT, traits>&
96
operator>>
(std::basic_istream<charT, traits>& ioIn,
97
OPENTREP::KeyAbstract
& ioKey) {
98
// Fill Key object with input stream
99
ioKey.
fromStream
(ioIn);
100
return
ioIn;
101
}
102
103
#endif
// __OPENTREP_KEY_KEYABSTRACT_HPP
operator>>
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &ioIn, OPENTREP::KeyAbstract &ioKey)
Definition
KeyAbstract.hpp:96
operator<<
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &ioOut, const OPENTREP::KeyAbstract &iKey)
Definition
KeyAbstract.hpp:68
OPENTREP::KeyAbstract
Base class for the Business Object Model (KEY) layer.
Definition
KeyAbstract.hpp:17
OPENTREP::KeyAbstract::KeyAbstract
KeyAbstract(const KeyAbstract &)
Definition
KeyAbstract.hpp:51
OPENTREP::KeyAbstract::~KeyAbstract
virtual ~KeyAbstract()
Definition
KeyAbstract.hpp:56
OPENTREP::KeyAbstract::KeyAbstract
KeyAbstract()
Definition
KeyAbstract.hpp:50
OPENTREP::KeyAbstract::toStream
virtual void toStream(std::ostream &) const =0
OPENTREP::KeyAbstract::fromStream
virtual void fromStream(std::istream &)=0
OPENTREP::KeyAbstract::toString
virtual std::string toString() const =0
OPENTREP::KeyAbstract::describe
virtual std::string describe() const =0
OPENTREP
Definition
BasChronometer.cpp:10
Generated on
for OpenTREP by
1.17.0