2013-06-24 14:11:53 -04:00
|
|
|
/*
|
|
|
|
open source routing machine
|
|
|
|
Copyright (C) Dennis Luxen, others 2010
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU AFFERO General Public License as published by
|
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
or see http://www.gnu.org/licenses/agpl.txt.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "SearchEngineData.h"
|
|
|
|
|
2013-09-19 12:52:42 -04:00
|
|
|
void SearchEngineData::InitializeOrClearFirstThreadLocalStorage(const unsigned number_of_nodes) {
|
2013-06-24 14:11:53 -04:00
|
|
|
if(!forwardHeap.get()) {
|
2013-09-19 12:52:42 -04:00
|
|
|
forwardHeap.reset(new QueryHeap(number_of_nodes));
|
2013-06-24 14:11:53 -04:00
|
|
|
} else {
|
|
|
|
forwardHeap->Clear();
|
|
|
|
}
|
|
|
|
if(!backwardHeap.get()) {
|
2013-09-19 12:52:42 -04:00
|
|
|
backwardHeap.reset(new QueryHeap(number_of_nodes));
|
2013-06-24 14:11:53 -04:00
|
|
|
} else {
|
|
|
|
backwardHeap->Clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-19 12:52:42 -04:00
|
|
|
void SearchEngineData::InitializeOrClearSecondThreadLocalStorage(const unsigned number_of_nodes) {
|
2013-06-24 14:11:53 -04:00
|
|
|
if(!forwardHeap2.get()) {
|
2013-09-19 12:52:42 -04:00
|
|
|
forwardHeap2.reset(new QueryHeap(number_of_nodes));
|
2013-06-24 14:11:53 -04:00
|
|
|
} else {
|
|
|
|
forwardHeap2->Clear();
|
|
|
|
}
|
|
|
|
if(!backwardHeap2.get()) {
|
2013-09-19 12:52:42 -04:00
|
|
|
backwardHeap2.reset(new QueryHeap(number_of_nodes));
|
2013-06-24 14:11:53 -04:00
|
|
|
} else {
|
|
|
|
backwardHeap2->Clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-19 12:52:42 -04:00
|
|
|
void SearchEngineData::InitializeOrClearThirdThreadLocalStorage(const unsigned number_of_nodes) {
|
2013-06-24 14:11:53 -04:00
|
|
|
if(!forwardHeap3.get()) {
|
2013-09-19 12:52:42 -04:00
|
|
|
forwardHeap3.reset(new QueryHeap(number_of_nodes));
|
2013-06-24 14:11:53 -04:00
|
|
|
} else {
|
|
|
|
forwardHeap3->Clear();
|
|
|
|
}
|
|
|
|
if(!backwardHeap3.get()) {
|
2013-09-19 12:52:42 -04:00
|
|
|
backwardHeap3.reset(new QueryHeap(number_of_nodes));
|
2013-06-24 14:11:53 -04:00
|
|
|
} else {
|
|
|
|
backwardHeap3->Clear();
|
|
|
|
}
|
|
|
|
}
|