Line data Source code
1 : /****************************************************************************/
2 : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 : // Copyright (C) 2001-2024 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 LineHandler.h
15 : /// @author Daniel Krajzewicz
16 : /// @author Michael Behrisch
17 : /// @date Fri, 19 Jul 2002
18 : ///
19 : // Interface definition for a class which retrieves lines from a LineHandler
20 : /****************************************************************************/
21 : #pragma once
22 : #include <config.h>
23 :
24 : #include <vector>
25 : #include <string>
26 : #include <utils/common/UtilExceptions.h>
27 :
28 :
29 : // ===========================================================================
30 : // class definitions
31 : // ===========================================================================
32 : /**
33 : * @class LineHandler
34 : * @brief Interface definition for a class which retrieves lines from a LineHandler
35 : *
36 : * The LineHandler is an interface for a class which retrieves information
37 : * from a file linewise. The lines are suppoted to this class using the
38 : * "report"-method. The LineHandler is used together with the LineReader
39 : * which reads the lines from a file.
40 : * @see LineReader
41 : */
42 : class LineHandler {
43 : public:
44 : /// @brief constructor
45 52 : LineHandler() { }
46 :
47 :
48 : /// @brief (virtual) destructor
49 : virtual ~LineHandler() { }
50 :
51 :
52 : /** @brief Method that obatins a line read by the LineReader
53 : *
54 : * Real interface method, used by a LineReader, which retrieves lines from a file
55 : *
56 : * @param[in] result The read line
57 : * @return Whether the caller shall continue with reading
58 : */
59 : virtual bool report(const std::string& result) = 0;
60 :
61 : };
|