Forward decl to cut compile times
This commit is contained in:
parent
09c76939f1
commit
2a64297506
@ -75,13 +75,13 @@ inline unsigned parseDuration(const std::string &s) {
|
|||||||
return UINT_MAX;
|
return UINT_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int parseMaxspeed(std::string input) { //call-by-value on purpose.
|
// inline int parseMaxspeed(std::string input) { //call-by-value on purpose.
|
||||||
boost::algorithm::to_lower(input);
|
// boost::algorithm::to_lower(input);
|
||||||
int n = stringToInt(input);
|
// int n = stringToInt(input);
|
||||||
if (input.find("mph") != std::string::npos || input.find("mp/h") != std::string::npos) {
|
// if (input.find("mph") != std::string::npos || input.find("mp/h") != std::string::npos) {
|
||||||
n = (n*1609)/1000;
|
// n = (n*1609)/1000;
|
||||||
}
|
// }
|
||||||
return n;
|
// return n;
|
||||||
}
|
// }
|
||||||
|
|
||||||
#endif /* EXTRACTIONHELPERFUNCTIONS_H_ */
|
#endif /* EXTRACTIONHELPERFUNCTIONS_H_ */
|
||||||
|
@ -28,32 +28,28 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "ExtractorCallbacks.h"
|
#include "ExtractorCallbacks.h"
|
||||||
|
|
||||||
#include "ExtractionContainers.h"
|
#include "ExtractionContainers.h"
|
||||||
#include "ExtractionHelperFunctions.h"
|
|
||||||
#include "ExtractionWay.h"
|
#include "ExtractionWay.h"
|
||||||
|
|
||||||
#include "../DataStructures/Restriction.h"
|
#include "../DataStructures/Restriction.h"
|
||||||
|
#include "../DataStructures/ImportNode.h"
|
||||||
#include "../Util/SimpleLogger.h"
|
#include "../Util/SimpleLogger.h"
|
||||||
|
|
||||||
#include <osrm/Coordinate.h>
|
#include <osrm/Coordinate.h>
|
||||||
|
|
||||||
#include <boost/algorithm/string.hpp>
|
|
||||||
#include <boost/algorithm/string/regex.hpp>
|
|
||||||
#include <boost/regex.hpp>
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
ExtractorCallbacks::ExtractorCallbacks()
|
ExtractorCallbacks::ExtractorCallbacks()
|
||||||
:
|
:
|
||||||
stringMap(NULL),
|
string_map(NULL),
|
||||||
externalMemory(NULL)
|
externalMemory(NULL)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
ExtractorCallbacks::ExtractorCallbacks(
|
ExtractorCallbacks::ExtractorCallbacks(
|
||||||
ExtractionContainers * ext,
|
ExtractionContainers * ext,
|
||||||
StringMap * strMap
|
boost::unordered_map<std::string, NodeID> * string_map
|
||||||
) :
|
) :
|
||||||
stringMap(strMap),
|
string_map(string_map),
|
||||||
externalMemory(ext)
|
externalMemory(ext)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
@ -93,11 +89,11 @@ void ExtractorCallbacks::wayFunction(ExtractionWay &parsed_way) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Get the unique identifier for the street name
|
//Get the unique identifier for the street name
|
||||||
const StringMap::const_iterator & string_map_iterator = stringMap->find(parsed_way.name);
|
const boost::unordered_map<std::string, NodeID>::const_iterator & string_map_iterator = string_map->find(parsed_way.name);
|
||||||
if(stringMap->end() == string_map_iterator) {
|
if(string_map->end() == string_map_iterator) {
|
||||||
parsed_way.nameID = externalMemory->name_list.size();
|
parsed_way.nameID = externalMemory->name_list.size();
|
||||||
externalMemory->name_list.push_back(parsed_way.name);
|
externalMemory->name_list.push_back(parsed_way.name);
|
||||||
stringMap->insert(std::make_pair(parsed_way.name, parsed_way.nameID));
|
string_map->insert(std::make_pair(parsed_way.name, parsed_way.nameID));
|
||||||
} else {
|
} else {
|
||||||
parsed_way.nameID = string_map_iterator->second;
|
parsed_way.nameID = string_map_iterator->second;
|
||||||
}
|
}
|
||||||
|
@ -28,29 +28,27 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef EXTRACTORCALLBACKS_H_
|
#ifndef EXTRACTORCALLBACKS_H_
|
||||||
#define EXTRACTORCALLBACKS_H_
|
#define EXTRACTORCALLBACKS_H_
|
||||||
|
|
||||||
#include "ExtractorStructs.h"
|
|
||||||
#include "../typedefs.h"
|
#include "../typedefs.h"
|
||||||
|
|
||||||
#include <boost/unordered_map.hpp>
|
#include <boost/unordered_map.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
struct ExternalMemoryNode;
|
||||||
class ExtractionContainers;
|
class ExtractionContainers;
|
||||||
struct ExtractionWay;
|
struct ExtractionWay;
|
||||||
struct InputRestrictionContainer;
|
struct InputRestrictionContainer;
|
||||||
|
|
||||||
typedef boost::unordered_map<std::string, NodeID> StringMap;
|
|
||||||
|
|
||||||
class ExtractorCallbacks{
|
class ExtractorCallbacks{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
StringMap * stringMap;
|
boost::unordered_map<std::string, NodeID> * string_map;
|
||||||
ExtractionContainers * externalMemory;
|
ExtractionContainers * externalMemory;
|
||||||
|
|
||||||
ExtractorCallbacks();
|
ExtractorCallbacks();
|
||||||
public:
|
public:
|
||||||
explicit ExtractorCallbacks(
|
explicit ExtractorCallbacks(
|
||||||
ExtractionContainers * ext,
|
ExtractionContainers * ext,
|
||||||
StringMap * strMap
|
boost::unordered_map<std::string, NodeID> * string_map
|
||||||
);
|
);
|
||||||
|
|
||||||
~ExtractorCallbacks();
|
~ExtractorCallbacks();
|
||||||
|
@ -32,6 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "ScriptingEnvironment.h"
|
#include "ScriptingEnvironment.h"
|
||||||
|
|
||||||
#include "../DataStructures/HashTable.h"
|
#include "../DataStructures/HashTable.h"
|
||||||
|
#include "../DataStructures/ImportNode.h"
|
||||||
#include "../DataStructures/Restriction.h"
|
#include "../DataStructures/Restriction.h"
|
||||||
#include "../Util/MachineInfo.h"
|
#include "../Util/MachineInfo.h"
|
||||||
#include "../Util/OpenMPWrapper.h"
|
#include "../Util/OpenMPWrapper.h"
|
||||||
|
@ -28,6 +28,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "XMLParser.h"
|
#include "XMLParser.h"
|
||||||
|
|
||||||
#include "ExtractionWay.h"
|
#include "ExtractionWay.h"
|
||||||
|
#include "ExtractorCallbacks.h"
|
||||||
|
|
||||||
#include "../DataStructures/HashTable.h"
|
#include "../DataStructures/HashTable.h"
|
||||||
#include "../DataStructures/ImportNode.h"
|
#include "../DataStructures/ImportNode.h"
|
||||||
#include "../DataStructures/InputReaderFactory.h"
|
#include "../DataStructures/InputReaderFactory.h"
|
||||||
|
@ -33,13 +33,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#include <libxml/xmlreader.h>
|
#include <libxml/xmlreader.h>
|
||||||
|
|
||||||
|
|
||||||
class XMLParser : public BaseParser {
|
class XMLParser : public BaseParser {
|
||||||
public:
|
public:
|
||||||
XMLParser(
|
XMLParser(
|
||||||
const char* filename,
|
const char* filename,
|
||||||
ExtractorCallbacks* ec,
|
ExtractorCallbacks * ec,
|
||||||
ScriptingEnvironment& se
|
ScriptingEnvironment & se
|
||||||
);
|
);
|
||||||
bool ReadHeader();
|
bool ReadHeader();
|
||||||
bool Parse();
|
bool Parse();
|
||||||
|
Loading…
Reference in New Issue
Block a user