2012-08-29 12:33:18 -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.
|
|
|
|
|
|
|
|
*/
|
2012-08-29 12:33:18 -04:00
|
|
|
|
|
|
|
#ifndef EXTRACTIONCONTAINERS_H_
|
|
|
|
#define EXTRACTIONCONTAINERS_H_
|
|
|
|
|
|
|
|
#include "ExtractorStructs.h"
|
2013-08-08 08:17:01 -04:00
|
|
|
#include "../Util/SimpleLogger.h"
|
2013-08-06 08:27:36 -04:00
|
|
|
#include "../Util/TimingUtil.h"
|
2013-07-22 10:34:06 -04:00
|
|
|
#include "../Util/UUID.h"
|
2012-08-29 12:33:18 -04:00
|
|
|
|
2013-06-26 09:43:13 -04:00
|
|
|
#include <boost/foreach.hpp>
|
2013-08-20 11:05:36 -04:00
|
|
|
#include <boost/filesystem.hpp>
|
|
|
|
#include <boost/filesystem/fstream.hpp>
|
2013-11-12 17:33:03 -05:00
|
|
|
#include <stxxl/vector>
|
2013-06-26 09:43:13 -04:00
|
|
|
|
2012-08-29 12:33:18 -04:00
|
|
|
class ExtractionContainers {
|
|
|
|
public:
|
2013-08-20 11:05:36 -04:00
|
|
|
typedef stxxl::vector<NodeID> STXXLNodeIDVector;
|
2013-11-12 18:23:09 -05:00
|
|
|
typedef stxxl::vector<ExternalMemoryNode> STXXLNodeVector;
|
2013-08-20 11:05:36 -04:00
|
|
|
typedef stxxl::vector<InternalExtractorEdge> STXXLEdgeVector;
|
|
|
|
typedef stxxl::vector<std::string> STXXLStringVector;
|
2012-08-29 12:33:18 -04:00
|
|
|
typedef stxxl::vector<_RawRestrictionContainer> STXXLRestrictionsVector;
|
2013-08-20 11:05:36 -04:00
|
|
|
typedef stxxl::vector<_WayIDStartAndEndEdge> STXXLWayIDStartEndVector;
|
|
|
|
|
|
|
|
|
|
|
|
STXXLNodeIDVector usedNodeIDs;
|
|
|
|
STXXLNodeVector allNodes;
|
|
|
|
STXXLEdgeVector allEdges;
|
|
|
|
STXXLStringVector name_list;
|
|
|
|
STXXLRestrictionsVector restrictionsVector;
|
|
|
|
STXXLWayIDStartEndVector wayStartEndVector;
|
|
|
|
const UUID uuid;
|
2012-08-29 12:33:18 -04:00
|
|
|
|
2012-08-30 11:34:06 -04:00
|
|
|
ExtractionContainers() {
|
|
|
|
//Check if another instance of stxxl is already running or if there is a general problem
|
2013-08-05 11:28:57 -04:00
|
|
|
stxxl::vector<unsigned> testForRunningInstance;
|
2013-08-20 11:05:36 -04:00
|
|
|
name_list.push_back("");
|
2012-08-30 11:34:06 -04:00
|
|
|
}
|
2013-08-05 11:28:57 -04:00
|
|
|
|
2012-08-29 12:33:18 -04:00
|
|
|
virtual ~ExtractionContainers() {
|
|
|
|
usedNodeIDs.clear();
|
|
|
|
allNodes.clear();
|
|
|
|
allEdges.clear();
|
2013-08-20 11:05:36 -04:00
|
|
|
name_list.clear();
|
2012-08-29 12:33:18 -04:00
|
|
|
restrictionsVector.clear();
|
|
|
|
wayStartEndVector.clear();
|
|
|
|
}
|
|
|
|
|
2013-08-20 11:05:36 -04:00
|
|
|
void PrepareData(
|
|
|
|
const std::string & output_file_name,
|
|
|
|
const std::string restrictionsFileName,
|
|
|
|
const unsigned amountOfRAM
|
|
|
|
);
|
2012-08-29 12:33:18 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* EXTRACTIONCONTAINERS_H_ */
|