-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from naviqore/feature/clean-up-project-structure
Feature/clean up project structure
- Loading branch information
Showing
141 changed files
with
4,267 additions
and
2,210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,14 +10,14 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macos-latest] # | ||
os: [windows-latest, ubuntu-latest] # , macos-latest | ||
include: | ||
- os: windows-latest | ||
compiler: msvc | ||
- os: ubuntu-latest | ||
compiler: gcc | ||
- os: macos-latest | ||
compiler: clang | ||
# - os: macos-latest | ||
# compiler: clang | ||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
@@ -42,3 +42,7 @@ jobs: | |
- name: Build | ||
run: | | ||
cmake --build build --config Release | ||
- name: Test | ||
run: | | ||
cmake --build build --target test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
project(gtfsRaptorConfig) | ||
|
||
add_executable(gtfsSubsetWriter | ||
src/agencySubsetWriter/gtfsSubsetWriter.cpp | ||
) | ||
|
||
find_path(P_RANAV_CSV2_INCLUDE_DIRS "csv2/mio.hpp") | ||
|
||
add_library(${PROJECT_NAME} SHARED ) | ||
|
||
target_sources(${PROJECT_NAME} PRIVATE | ||
src/GtfsToRaptorConverter.cpp | ||
src/RoutePartitioner.cpp | ||
src/TimetableManager.cpp | ||
src/SubRoute.cpp | ||
PUBLIC | ||
include/GtfsToRaptorConverter.h | ||
include/RoutePartitioner.h | ||
include/TimetableManager.h | ||
include/SubRoute.h | ||
) | ||
|
||
target_include_directories(gtfsSubsetWriter PRIVATE ${CMAKE_SOURCE_DIR}/logging/include) | ||
target_include_directories(gtfsSubsetWriter PRIVATE ${CMAKE_SOURCE_DIR}/gtfsRaptorConfig/src) | ||
target_include_directories(gtfsSubsetWriter PRIVATE ${CMAKE_SOURCE_DIR}/gtfsRaptorConfig/include) | ||
target_include_directories(gtfsSubsetWriter PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> | ||
) | ||
target_include_directories(gtfsSubsetWriter PRIVATE ${P_RANAV_CSV2_INCLUDE_DIRS}) | ||
|
||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/gtfsRaptorConfig/src) | ||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/gtfsRaptorConfig/include) # check if public is needed | ||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/schedule/include) | ||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/logging/include) | ||
target_include_directories(${PROJECT_NAME} PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> | ||
) | ||
|
||
target_link_libraries(${PROJECT_NAME} PRIVATE | ||
logging | ||
geometry | ||
schedule | ||
) | ||
|
||
target_link_libraries(gtfsSubsetWriter PRIVATE | ||
logging | ||
geometry | ||
schedule | ||
) | ||
|
||
set(CMAKE_CXX_VISIBILITY_PRESET hidden) | ||
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) | ||
|
||
include(GenerateExportHeader) | ||
generate_export_header(${PROJECT_NAME} | ||
BASE_NAME ${PROJECT_NAME} | ||
EXPORT_MACRO_NAME GTFS_RAPTOR_API | ||
EXPORT_FILE_NAME ${PROJECT_NAME}_export.h | ||
STATIC_DEFINE ${PROJECT_NAME}_BUILT_AS_STATIC | ||
) | ||
|
||
set(INCLUDE_INSTALL_DIR include) | ||
|
||
install(FILES | ||
${PROJECT_BINARY_DIR}/${PROJECT_NAME}_export.h | ||
DESTINATION | ||
${INCLUDE_INSTALL_DIR} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// Created by MichaelBrunner on 26/07/2024. | ||
// | ||
|
||
#pragma once | ||
|
||
#include <gtfsRaptorConfig_export.h> | ||
|
||
namespace converter { | ||
|
||
class GTFS_RAPTOR_API GtfsToRaptorConverter | ||
{ | ||
}; | ||
|
||
} // converter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// Created by MichaelBrunner on 19/07/2024. | ||
// | ||
|
||
#ifndef ROUTEPARTITIONER_H | ||
#define ROUTEPARTITIONER_H | ||
|
||
#include "GtfsData.h" | ||
#include "model/Route.h" | ||
|
||
#include <functional> | ||
#include <map> | ||
#include <utility> | ||
#include <gtfsRaptorConfig_export.h> | ||
|
||
namespace converter { | ||
class SubRoute; | ||
|
||
class GTFS_RAPTOR_API RoutePartitioner | ||
{ | ||
|
||
public: | ||
explicit RoutePartitioner(schedule::gtfs::GtfsData* data); | ||
|
||
[[nodiscard]] std::vector<SubRoute> getSubRoutes(std::string const& routeId) const; | ||
|
||
[[nodiscard]] const SubRoute& getSubRoute(std::string const& tripId) const; | ||
|
||
|
||
private: | ||
std::unordered_map<std::string, std::unordered_map<std::string, SubRoute> /*, decltype(routeHash), decltype(routeEqual)*/> subRoutes{}; | ||
schedule::gtfs::GtfsData* data; | ||
|
||
void processRoute(schedule::gtfs::Route const& route); | ||
|
||
[[nodiscard]] std::string generateStopSequenceKey(const std::string& tripId) const; | ||
|
||
[[nodiscard]] std::vector<schedule::gtfs::Stop> extractStopSequence(schedule::gtfs::Trip const& aTrip) const; | ||
}; | ||
|
||
} // gtfs | ||
// schedule | ||
|
||
#endif //ROUTEPARTITIONER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// | ||
// Created by MichaelBrunner on 02/08/2024. | ||
// | ||
|
||
#pragma once | ||
|
||
#include "GtfsData.h" | ||
|
||
#include <functional> | ||
#include <gtfsRaptorConfig_export.h> | ||
|
||
namespace converter { | ||
|
||
class GTFS_RAPTOR_API SubRoute | ||
{ | ||
std::string SubRouteId{}; | ||
std::string routeId{}; | ||
std::string stopSequenceKey{}; | ||
std::vector<schedule::gtfs::Stop> stopsSequence{}; | ||
std::vector<schedule::gtfs::Trip> trips{}; | ||
|
||
public: | ||
explicit SubRoute(std::string&& subRouteId, std::string routeId, std::string stopSequenceKey, std::vector<schedule::gtfs::Stop>&& stopsSequence); | ||
|
||
SubRoute(const SubRoute& aSubRoute); | ||
|
||
SubRoute(SubRoute&& aSubRoute) noexcept = default; | ||
SubRoute& operator=(const SubRoute& aSubRoute) = default; | ||
SubRoute& operator=(SubRoute&& aSubRoute) noexcept = default; | ||
|
||
void addTrip(schedule::gtfs::Trip const& trip); | ||
|
||
[[nodiscard]] const std::string& getSubRouteId() const ; | ||
|
||
[[nodiscard]] const std::string& getRouteId() const; | ||
|
||
[[nodiscard]] const std::string& getStopSequenceKey() const { | ||
return stopSequenceKey; | ||
} | ||
|
||
[[nodiscard]] const std::vector<schedule::gtfs::Stop>& getStopsSequence() const; | ||
|
||
[[nodiscard]] size_t stopIndex(std::string_view stopId) const ; | ||
|
||
[[nodiscard]] const std::vector<schedule::gtfs::Trip>& getTrips() const; | ||
|
||
bool operator==(const SubRoute& aSubRoute) const; | ||
|
||
std::function<size_t(const SubRoute&)> SubRouteHash = [](const SubRoute& aSubRoute) { | ||
return std::hash<std::string>{}(aSubRoute.getSubRouteId()); | ||
}; | ||
|
||
std::function<bool(const SubRoute&, const SubRoute&)> SubRouteEqual = [](const SubRoute& aSubRoute, const SubRoute& anotherSubRoute) { | ||
return aSubRoute == anotherSubRoute; | ||
}; | ||
}; | ||
|
||
|
||
|
||
} // converter |
Oops, something went wrong.