0.08.01
C++ Open Travel Request Parsing Library
Toggle main menu visibility
Loading...
Searching...
No Matches
PlaceHolder.cpp
Go to the documentation of this file.
1
// //////////////////////////////////////////////////////////////////////
2
// Import section
3
// //////////////////////////////////////////////////////////////////////
4
// C
5
#include <cassert>
6
#include <sstream>
7
// OpenTREP
8
#include <
opentrep/bom/Place.hpp
>
9
#include <
opentrep/bom/PlaceHolder.hpp
>
10
#include <
opentrep/service/Logger.hpp
>
11
12
namespace
OPENTREP
{
13
14
// //////////////////////////////////////////////////////////////////////
15
PlaceHolder::PlaceHolder () {
16
init();
17
}
18
19
// //////////////////////////////////////////////////////////////////////
20
PlaceHolder::~PlaceHolder () {
21
}
22
23
// //////////////////////////////////////////////////////////////////////
24
void
PlaceHolder::init () {
25
_placeList.clear();
26
_placeOrderedList.clear();
27
}
28
29
// //////////////////////////////////////////////////////////////////////
30
std::string
PlaceHolder::describeShortKey
()
const
{
31
std::ostringstream oStr;
32
return
oStr.str();
33
}
34
35
// //////////////////////////////////////////////////////////////////////
36
std::string
PlaceHolder::describeKey
()
const
{
37
return
describeShortKey
();
38
}
39
40
// //////////////////////////////////////////////////////////////////////
41
std::string
PlaceHolder::toString
()
const
{
42
std::ostringstream oStr;
43
oStr <<
describeShortKey
() << std::endl;
44
45
for
(PlaceOrderedList_T::const_iterator itPlace = _placeOrderedList.begin();
46
itPlace != _placeOrderedList.end(); ++itPlace) {
47
const
Place
* lPlace_ptr = *itPlace;
48
assert (lPlace_ptr != NULL);
49
50
oStr << lPlace_ptr->
toString
() << std::endl;
51
}
52
53
return
oStr.str();
54
}
55
56
// //////////////////////////////////////////////////////////////////////
57
std::string
PlaceHolder::toShortString
()
const
{
58
std::ostringstream oStr;
59
oStr <<
describeShortKey
() << std::endl;
60
61
for
(PlaceOrderedList_T::const_iterator itPlace = _placeOrderedList.begin();
62
itPlace != _placeOrderedList.end(); ++itPlace) {
63
const
Place
* lPlace_ptr = *itPlace;
64
assert (lPlace_ptr != NULL);
65
66
oStr << lPlace_ptr->
toShortString
() << std::endl;
67
}
68
69
return
oStr.str();
70
}
71
72
// //////////////////////////////////////////////////////////////////////
73
void
PlaceHolder::toStream
(std::ostream& ioOut)
const
{
74
ioOut <<
toString
();
75
}
76
77
// //////////////////////////////////////////////////////////////////////
78
void
PlaceHolder::fromStream
(std::istream& ioIn) {
79
}
80
81
// //////////////////////////////////////////////////////////////////////
82
void
PlaceHolder::createLocations
(
LocationList_T
& ioLocationList)
const
{
83
84
for
(PlaceOrderedList_T::const_iterator itPlace = _placeOrderedList.begin();
85
itPlace != _placeOrderedList.end(); ++itPlace) {
86
Place
* lPlace_ptr = *itPlace;
87
assert (lPlace_ptr != NULL);
88
89
const
Location
& lLocation = lPlace_ptr->
completeLocation
();
90
ioLocationList.push_back (lLocation);
91
}
92
}
93
94
95
}
Logger.hpp
PlaceHolder.hpp
Place.hpp
OPENTREP::PlaceHolder::describeShortKey
std::string describeShortKey() const
Definition
PlaceHolder.cpp:30
OPENTREP::PlaceHolder::toString
std::string toString() const
Definition
PlaceHolder.cpp:41
OPENTREP::PlaceHolder::toStream
void toStream(std::ostream &ioOut) const
Definition
PlaceHolder.cpp:73
OPENTREP::PlaceHolder::toShortString
std::string toShortString() const
Definition
PlaceHolder.cpp:57
OPENTREP::PlaceHolder::describeKey
std::string describeKey() const
Definition
PlaceHolder.cpp:36
OPENTREP::PlaceHolder::fromStream
void fromStream(std::istream &ioIn)
Definition
PlaceHolder.cpp:78
OPENTREP::PlaceHolder::createLocations
void createLocations(LocationList_T &) const
Definition
PlaceHolder.cpp:82
OPENTREP::Place
Class modelling a place/POR (point of reference).
Definition
Place.hpp:29
OPENTREP::Place::completeLocation
const Location & completeLocation()
Definition
Place.cpp:761
OPENTREP::Place::toShortString
std::string toShortString() const
Definition
Place.cpp:126
OPENTREP::Place::toString
std::string toString() const
Definition
Place.cpp:85
OPENTREP
Definition
BasChronometer.cpp:10
OPENTREP::LocationList_T
std::list< Location > LocationList_T
Definition
LocationList.hpp:18
OPENTREP::Location
Structure modelling a (geographical) location.
Definition
Location.hpp:25
Generated on
for OpenTREP by
1.17.0