osrm-backend/include/osrm/error_codes.hpp
Michael Bell db7946d762
Add support for disabling feature datasets (#6666)
This change adds support for disabling datasets, such that specific
files are not loaded into memory when running OSRM. This enables users
to not pay the memory cost for features they do not intend to use.

Initially, there are two options:
- ROUTE_GEOMETRY, for disabling overview, steps, annotations and waypoints.
- ROUTE_STEPS, for disabling steps only.

Attempts to query features for which the datasets are disabled will
lead to a DisabledDatasetException being returned.
2023-08-04 18:43:37 +01:00

38 lines
1.0 KiB
C++

#ifndef OSRM_ERRORCODES_HPP
#define OSRM_ERRORCODES_HPP
#include <string>
namespace osrm
{
/**
* Various error codes that can be returned by OSRM internal functions.
* Note: often, these translate into return codes from `int main()` functions.
* Thus, do not change the order - if adding new codes, append them to the
* end, so the code values do not change for users that are checking for
* certain values.
*/
enum ErrorCode
{
InvalidFingerprint = 2, // Start at 2 to avoid colliding with POSIX EXIT_FAILURE
IncompatibleFileVersion,
FileOpenError,
FileReadError,
FileWriteError,
FileIOError,
UnexpectedEndOfFile,
IncompatibleDataset,
UnknownAlgorithm,
UnknownFeatureDataset
#ifndef NDEBUG
// Leave this at the end. In debug mode, we assert that the size of
// this enum matches the number of messages we have documented, and __ENDMARKER__
// is used as the "count" value.
,
__ENDMARKER__
#endif
};
} // namespace osrm
#endif // OSRM_ERRORCODES_HPP