2010-07-20 05:46:52 -04:00
|
|
|
/*
|
2013-10-14 07:42:28 -04:00
|
|
|
|
|
|
|
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
|
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without modification,
|
|
|
|
are permitted provided that the following conditions are met:
|
|
|
|
|
|
|
|
Redistributions of source code must retain the above copyright notice, this list
|
|
|
|
of conditions and the following disclaimer.
|
|
|
|
Redistributions in binary form must reproduce the above copyright notice, this
|
|
|
|
list of conditions and the following disclaimer in the documentation and/or
|
|
|
|
other materials provided with the distribution.
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
|
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
|
|
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
*/
|
2010-07-20 05:46:52 -04:00
|
|
|
|
|
|
|
#ifndef EXTRACTORSTRUCTS_H_
|
|
|
|
#define EXTRACTORSTRUCTS_H_
|
|
|
|
|
2012-04-24 12:00:47 -04:00
|
|
|
#include "../DataStructures/HashTable.h"
|
2012-08-27 11:40:59 -04:00
|
|
|
#include "../DataStructures/ImportNode.h"
|
2011-11-17 12:56:45 -05:00
|
|
|
#include "../typedefs.h"
|
2011-04-15 12:33:37 -04:00
|
|
|
|
2013-06-26 19:48:02 -04:00
|
|
|
#include <string>
|
|
|
|
|
2013-01-18 15:28:13 -05:00
|
|
|
struct ExtractorRelation {
|
|
|
|
ExtractorRelation() : type(unknown){}
|
2010-08-12 12:49:59 -04:00
|
|
|
enum {
|
2011-07-06 08:33:41 -04:00
|
|
|
unknown = 0, ferry, turnRestriction
|
2010-08-12 12:49:59 -04:00
|
|
|
} type;
|
2011-07-06 08:33:41 -04:00
|
|
|
HashTable<std::string, std::string> keyVals;
|
2010-07-20 05:46:52 -04:00
|
|
|
};
|
|
|
|
|
2011-07-06 08:33:41 -04:00
|
|
|
struct _WayIDStartAndEndEdge {
|
|
|
|
unsigned wayID;
|
|
|
|
NodeID firstStart;
|
|
|
|
NodeID firstTarget;
|
|
|
|
NodeID lastStart;
|
|
|
|
NodeID lastTarget;
|
2014-01-09 10:13:35 -05:00
|
|
|
_WayIDStartAndEndEdge()
|
|
|
|
:
|
|
|
|
wayID(UINT_MAX),
|
|
|
|
firstStart(UINT_MAX),
|
|
|
|
firstTarget(UINT_MAX),
|
|
|
|
lastStart(UINT_MAX),
|
|
|
|
lastTarget(UINT_MAX)
|
|
|
|
{ }
|
|
|
|
|
|
|
|
explicit _WayIDStartAndEndEdge(
|
|
|
|
unsigned w,
|
|
|
|
NodeID fs,
|
|
|
|
NodeID ft,
|
|
|
|
NodeID ls,
|
|
|
|
NodeID lt
|
|
|
|
) :
|
|
|
|
wayID(w),
|
|
|
|
firstStart(fs),
|
|
|
|
firstTarget(ft),
|
|
|
|
lastStart(ls),
|
|
|
|
lastTarget(lt)
|
|
|
|
{ }
|
2011-07-06 08:33:41 -04:00
|
|
|
|
|
|
|
static _WayIDStartAndEndEdge min_value() {
|
2012-12-29 15:02:26 -05:00
|
|
|
return _WayIDStartAndEndEdge((std::numeric_limits<unsigned>::min)(), (std::numeric_limits<unsigned>::min)(), (std::numeric_limits<unsigned>::min)(), (std::numeric_limits<unsigned>::min)(), (std::numeric_limits<unsigned>::min)());
|
2011-07-06 08:33:41 -04:00
|
|
|
}
|
|
|
|
static _WayIDStartAndEndEdge max_value() {
|
2012-12-29 15:02:26 -05:00
|
|
|
return _WayIDStartAndEndEdge((std::numeric_limits<unsigned>::max)(), (std::numeric_limits<unsigned>::max)(), (std::numeric_limits<unsigned>::max)(), (std::numeric_limits<unsigned>::max)(), (std::numeric_limits<unsigned>::max)());
|
2011-07-06 08:33:41 -04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-01-09 10:13:35 -05:00
|
|
|
struct CmpWayByID {
|
2011-07-06 08:33:41 -04:00
|
|
|
typedef _WayIDStartAndEndEdge value_type;
|
2014-01-09 10:13:35 -05:00
|
|
|
bool operator ()(
|
|
|
|
const _WayIDStartAndEndEdge & a,
|
|
|
|
const _WayIDStartAndEndEdge & b
|
|
|
|
) const {
|
2011-07-06 08:33:41 -04:00
|
|
|
return a.wayID < b.wayID;
|
|
|
|
}
|
|
|
|
value_type max_value() {
|
|
|
|
return _WayIDStartAndEndEdge::max_value();
|
|
|
|
}
|
|
|
|
value_type min_value() {
|
|
|
|
return _WayIDStartAndEndEdge::min_value();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-01-09 10:13:35 -05:00
|
|
|
struct Cmp {
|
2010-08-12 12:49:59 -04:00
|
|
|
typedef NodeID value_type;
|
2014-01-09 10:13:35 -05:00
|
|
|
bool operator ()(
|
|
|
|
const NodeID a,
|
|
|
|
const NodeID b
|
|
|
|
) const {
|
2010-08-12 12:49:59 -04:00
|
|
|
return a < b;
|
|
|
|
}
|
2011-03-22 13:38:18 -04:00
|
|
|
value_type max_value() {
|
2010-08-12 12:49:59 -04:00
|
|
|
return 0xffffffff;
|
|
|
|
}
|
2011-03-22 13:38:18 -04:00
|
|
|
value_type min_value() {
|
2010-08-12 12:49:59 -04:00
|
|
|
return 0x0;
|
|
|
|
}
|
2010-08-10 13:06:37 -04:00
|
|
|
};
|
|
|
|
|
2014-01-09 10:13:35 -05:00
|
|
|
struct CmpNodeByID {
|
2013-11-12 18:23:09 -05:00
|
|
|
typedef ExternalMemoryNode value_type;
|
|
|
|
bool operator () (
|
|
|
|
const ExternalMemoryNode & a,
|
|
|
|
const ExternalMemoryNode & b
|
|
|
|
) const {
|
2011-03-22 13:38:18 -04:00
|
|
|
return a.id < b.id;
|
2010-08-12 12:49:59 -04:00
|
|
|
}
|
2011-03-22 13:38:18 -04:00
|
|
|
value_type max_value() {
|
2013-11-12 18:23:09 -05:00
|
|
|
return ExternalMemoryNode::max_value();
|
2010-08-12 12:49:59 -04:00
|
|
|
}
|
2011-03-22 13:38:18 -04:00
|
|
|
value_type min_value() {
|
2013-11-12 18:23:09 -05:00
|
|
|
return ExternalMemoryNode::min_value();
|
2010-08-12 12:49:59 -04:00
|
|
|
}
|
2010-08-10 13:06:37 -04:00
|
|
|
};
|
|
|
|
|
2010-07-20 05:46:52 -04:00
|
|
|
#endif /* EXTRACTORSTRUCTS_H_ */
|