openETCS
case study for the European Train Control System developed for the authors dissertation
Property.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010-2011
3  Johannes Feuser <feuser@uni-bremen.de>
4  This file is part of the openETCS library.
5 
6  The openETCS library is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  any later version.
10 
11  The openETCS library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with the openETCS library. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 /*!
21  * \author Johannes Feuser <feuser@uni-bremen.de>
22  * \brief
23  */
24 
25 #include "Property.h"
26 #include "NonProperty.h"
27 
28 
29 namespace GOPPRR {
30 
31 
32 CProperty::CProperty(const ::std::string& OID, const ::std::string& Type, const ::std::string& Value, const std::map< ::std::string, ::GOPPRR::CNonProperty* >& NonProperties) throw()
33 :CConcept(OID, Type),
34  m_Value(Value),
35  m_NonProperties(NonProperties)
36 {
37  // Bouml preserved body begin 00026382
38  // Bouml preserved body end 00026382
39 
40 } // CProperty::CProperty() throw()
41 
42 
43 
44 
45 CProperty::CProperty(const GOPPRR::CProperty & Source) throw()
46 :CConcept(Source),
47  m_Value(Source.m_Value),
48  m_NonProperties(Source.m_NonProperties)
49 {
50  // Bouml preserved body begin 00026482
51  // Bouml preserved body end 00026482
52 
53 } // CProperty::CProperty() throw()
54 
55 
56 
57 
59 {
60  // Bouml preserved body begin 00026402
61  // Bouml preserved body end 00026402
62 
63 } // CProperty::~CProperty() throw()
64 
65 
66 
67 
69 {
70  // Bouml preserved body begin 00048A82
71  // assign member values from source
72  m_Value = Source.m_Value;
73  m_NonProperties = Source.m_NonProperties;;
74 
75  // call operator of base class
76  ::GOPPRR::CConcept::operator =(Source);
77 
78  // return reference to this instance
79  return *this;
80  // Bouml preserved body end 00048A82
81 
82 } // GOPPRR::CProperty CProperty::operator=() throw()
83 
84 
85 
86 
87 ::std::map< ::std::string, GOPPRR::CNonProperty* > CProperty::NonProperties(const ::std::string& Type, const bool& bSubString) const throw()
88 {
89  // Bouml preserved body begin 000A5202
90  ::std::map< ::std::string, ::GOPPRR::CNonProperty* >::const_iterator NonProperty;
91  ::std::map< ::std::string, ::GOPPRR::CNonProperty* > NonProperties;
92 
93 
94 
95  // process all non properties of this instance
96  for (NonProperty = this->m_NonProperties.begin(); NonProperty != this->m_NonProperties.end(); NonProperty++)
97  {
98  // check, if current type of property is searched one
99  if ((!bSubString && NonProperty->second->m_Type == Type) || (bSubString && NonProperty->second->m_Type.find(Type) != ::std::string::npos))
100  {
101  // add property to map
102  NonProperties[ NonProperty->second->m_OID ] = NonProperty->second;
103 
104  } // if ((!bSubString && Property->second->m_Type == Type) || (bSubString && Property->second->m_Type.find(Type) != ::std::string::npos))
105 
106  } // for (NonProperty = this->m_NonProperties.begin(); NonProperty != this->m_NonProperties.end(); NonProperty++)
107 
108  // return map of found non properties
109  return NonProperties;
110  // Bouml preserved body end 000A5202
111 
112 } // GOPPRR::CNonProperty CProperty::NonProperties() const throw()
113 
114 
115 
116 
117 
118 
119 } // namespace GOPPRR

Copyright (C) 2010-2012 Johannes Feuser (feuser@uni-bremen.de)
The openETCS library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
The openETCS library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the openETCS library. If not, see "http://www.gnu.org/licenses/.