1.00.16
C++ Simulated Travel Demand Generation Library
Toggle main menu visibility
Loading...
Searching...
No Matches
TRADEMGEN_Abstract.hpp
Go to the documentation of this file.
1
#ifndef __TRADEMGEN_TRADEMGEN_ABSTRACT_HPP
2
#define __TRADEMGEN_TRADEMGEN_ABSTRACT_HPP
3
4
// //////////////////////////////////////////////////////////////////////
5
// Import section
6
// //////////////////////////////////////////////////////////////////////
7
// STL
8
#include <istream>
9
#include <ostream>
10
#include <sstream>
11
#include <string>
12
13
namespace
TRADEMGEN
{
14
16
struct
TRADEMGEN_Abstract
{
17
public
:
18
// /////////// Display support methods /////////
21
virtual
void
toStream
(std::ostream& ioOut)
const
= 0;
22
25
virtual
void
fromStream
(std::istream& ioIn) = 0;
26
28
virtual
std::string
toString
()
const
= 0;
29
30
31
protected
:
33
TRADEMGEN_Abstract
() {}
34
TRADEMGEN_Abstract
(
const
TRADEMGEN_Abstract
&) {}
35
37
virtual
~TRADEMGEN_Abstract
() {}
38
};
39
}
40
46
template
<
class
char
T,
class
traits>
47
inline
48
std::basic_ostream<charT, traits>&
49
operator<<
(std::basic_ostream<charT, traits>& ioOut,
50
const
TRADEMGEN::TRADEMGEN_Abstract
& iStructure) {
56
std::basic_ostringstream<charT,traits> ostr;
57
ostr.copyfmt (ioOut);
58
ostr.width (0);
59
60
// Fill string stream
61
iStructure.
toStream
(ostr);
62
63
// Print string stream
64
ioOut << ostr.str();
65
66
return
ioOut;
67
}
68
74
template
<
class
char
T,
class
traits>
75
inline
76
std::basic_istream<charT, traits>&
77
operator>>
(std::basic_istream<charT, traits>& ioIn,
78
TRADEMGEN::TRADEMGEN_Abstract
& ioStucture) {
79
// Fill Bom object with input stream
80
ioStucture.
fromStream
(ioIn);
81
return
ioIn;
82
}
83
84
#endif
// __TRADEMGEN_TRADEMGEN_ABSTRACT_HPP
operator>>
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &ioIn, TRADEMGEN::TRADEMGEN_Abstract &ioStucture)
Definition
TRADEMGEN_Abstract.hpp:77
operator<<
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &ioOut, const TRADEMGEN::TRADEMGEN_Abstract &iStructure)
Definition
TRADEMGEN_Abstract.hpp:49
TRADEMGEN
Definition
BasConst.cpp:10
TRADEMGEN::TRADEMGEN_Abstract
Definition
TRADEMGEN_Abstract.hpp:16
TRADEMGEN::TRADEMGEN_Abstract::fromStream
virtual void fromStream(std::istream &ioIn)=0
TRADEMGEN::TRADEMGEN_Abstract::toStream
virtual void toStream(std::ostream &ioOut) const =0
TRADEMGEN::TRADEMGEN_Abstract::toString
virtual std::string toString() const =0
TRADEMGEN::TRADEMGEN_Abstract::~TRADEMGEN_Abstract
virtual ~TRADEMGEN_Abstract()
Definition
TRADEMGEN_Abstract.hpp:37
TRADEMGEN::TRADEMGEN_Abstract::TRADEMGEN_Abstract
TRADEMGEN_Abstract(const TRADEMGEN_Abstract &)
Definition
TRADEMGEN_Abstract.hpp:34
TRADEMGEN::TRADEMGEN_Abstract::TRADEMGEN_Abstract
TRADEMGEN_Abstract()
Definition
TRADEMGEN_Abstract.hpp:33
Generated on
for TraDemGen by
1.17.0