1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
10 /// @file    NIImporter_RobocupRescue.h
11 /// @author  Daniel Krajzewicz
12 /// @author  Michael Behrisch
13 /// @date    Mon, 14.04.2008
14 /// @version $Id$
15 ///
16 // Importer for networks stored in robocup rescue league format
17 /****************************************************************************/
18 #ifndef NIImporter_RobocupRescue_h
19 #define NIImporter_RobocupRescue_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
28 #include <map>
29 #include <utils/xml/SUMOSAXHandler.h>
30 
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class NBNetBuilder;
36 class NBEdge;
37 class OptionsCont;
38 
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
43 /**
44  * @class NIImporter_RobocupRescue
45  * @brief Importer for networks stored in robocup rescue league format
46  *
47  */
48 class NIImporter_RobocupRescue {
49 public:
50     /** @brief Loads content of the optionally given RoboCup Rescue League files
51      *
52      * If the option "robocup-dir" is set, the files contained in the folder are read.
53      *
54      * If the option "robocup-dir" is not set, this method simply returns.
55      *
56      * @param[in] oc The options to use
57      * @param[in] nb The network builder to fill
58      */
59     static void loadNetwork(const OptionsCont& oc, NBNetBuilder& nb);
60 
61 
62 protected:
63     /** @brief Constructor
64      *
65      * @param[in] nc The node control to fill
66      * @param[in] ec The edge control to fill
67      */
68     NIImporter_RobocupRescue(NBNodeCont& nc, NBEdgeCont& ec);
69 
70 
71     /// @brief Destructor
72     ~NIImporter_RobocupRescue();
73 
74 
75     /** @brief Loads nodes from the given file
76      * @param[in] file The file to read nodes from
77      */
78     void loadNodes(const std::string& file);
79 
80 
81     /** @brief Loads edges from the given file
82      * @param[in] file The file to read edges from
83      */
84     void loadEdges(const std::string& file);
85 
86 
87 protected:
88     /// @brief The node container to fill
89     NBNodeCont& myNodeCont;
90 
91     /// @brief The edge container to fill
92     NBEdgeCont& myEdgeCont;
93 
94 private:
95     /// @brief Invalidated assignment operator
96     NIImporter_RobocupRescue& operator=(const NIImporter_RobocupRescue& s);
97 };
98 
99 
100 #endif
101 
102 /****************************************************************************/
103 
104