Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/polyconvert/PCTypeDefHandler.h
169667 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4
// This program and the accompanying materials are made available under the
5
// terms of the Eclipse Public License 2.0 which is available at
6
// https://www.eclipse.org/legal/epl-2.0/
7
// This Source Code may also be made available under the following Secondary
8
// Licenses when the conditions for such availability set forth in the Eclipse
9
// Public License 2.0 are satisfied: GNU General Public License, version 2
10
// or later which is available at
11
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
/****************************************************************************/
14
/// @file PCTypeDefHandler.h
15
/// @author Daniel Krajzewicz
16
/// @author Jakob Erdmann
17
/// @author Michael Behrisch
18
/// @date Thu, 16.03.2006
19
///
20
// A handler for loading polygon type maps
21
/****************************************************************************/
22
#pragma once
23
#include <config.h>
24
25
#include <string>
26
#include <utils/xml/SUMOSAXHandler.h>
27
#include <utils/options/OptionsCont.h>
28
#include "PCTypeDefHandler.h"
29
30
31
// ===========================================================================
32
// class declarations
33
// ===========================================================================
34
class PCTypeToDef;
35
36
37
// ===========================================================================
38
// class definitions
39
// ===========================================================================
40
/**
41
* @class PCTypeDefHandler
42
* @brief A handler for loading polygon type maps
43
*/
44
class PCTypeDefHandler : public SUMOSAXHandler {
45
public:
46
/** @brief Constructor
47
* @param[in] oc The options used while loading the type map
48
* @param[out] con The container to fill
49
*/
50
PCTypeDefHandler(OptionsCont& oc, PCTypeMap& con);
51
52
53
/// @brief Destructor
54
virtual ~PCTypeDefHandler();
55
56
57
protected:
58
/// @name inherited from GenericSAXHandler
59
//@{
60
61
/** @brief Called on the opening of a tag;
62
*
63
* @param[in] element ID of the currently opened element
64
* @param[in] attrs Attributes within the currently opened element
65
* @exception ProcessError If something fails
66
* @see GenericSAXHandler::myStartElement
67
* @todo Completely unsecure currently (invalid values may force abortion with no error message)
68
*/
69
void myStartElement(int element,
70
const SUMOSAXAttributes& attrs);
71
//@}
72
73
74
protected:
75
/// @brief The options (program settings)
76
OptionsCont& myOptions;
77
78
/// @brief The type map to fill
79
PCTypeMap& myContainer;
80
81
/// @brief whether to replace the loaded type with a custom value
82
bool myOverwriteType;
83
84
85
private:
86
/// @brief Invalidated copy constructor
87
PCTypeDefHandler(const PCTypeDefHandler& src);
88
89
/// @brief Invalidated assignment operator
90
PCTypeDefHandler& operator=(const PCTypeDefHandler& src);
91
92
};
93
94