2011-11-17 12:56:45 -05:00
|
|
|
/*
|
|
|
|
open source routing machine
|
|
|
|
Copyright (C) Dennis Luxen, 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef BASE_DESCRIPTOR_H_
|
|
|
|
#define BASE_DESCRIPTOR_H_
|
|
|
|
|
|
|
|
#include "../DataStructures/HashTable.h"
|
2013-06-24 14:12:25 -04:00
|
|
|
#include "../DataStructures/PhantomNodes.h"
|
2013-08-14 07:54:59 -04:00
|
|
|
#include "../DataStructures/RawRouteData.h"
|
|
|
|
#include "../Server/BasicDatastructures.h"
|
2011-11-17 12:56:45 -05:00
|
|
|
#include "../Util/StringUtil.h"
|
2013-06-26 19:48:22 -04:00
|
|
|
#include "../typedefs.h"
|
2011-11-17 12:56:45 -05:00
|
|
|
|
2013-06-26 19:48:22 -04:00
|
|
|
#include <cassert>
|
|
|
|
#include <cmath>
|
|
|
|
#include <cstdio>
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2011-11-17 12:56:45 -05:00
|
|
|
|
2013-09-19 16:10:49 -04:00
|
|
|
struct DescriptorConfig {
|
2013-09-19 16:28:02 -04:00
|
|
|
DescriptorConfig() :
|
|
|
|
instructions(true),
|
|
|
|
geometry(true),
|
|
|
|
encode_geometry(true),
|
|
|
|
zoom_level(18)
|
|
|
|
{ }
|
2011-11-17 12:56:45 -05:00
|
|
|
bool instructions;
|
|
|
|
bool geometry;
|
2013-09-19 16:28:02 -04:00
|
|
|
bool encode_geometry;
|
|
|
|
unsigned short zoom_level;
|
2011-11-17 12:56:45 -05:00
|
|
|
};
|
|
|
|
|
2013-09-19 12:54:30 -04:00
|
|
|
template<class DataFacadeT>
|
2011-11-17 12:56:45 -05:00
|
|
|
class BaseDescriptor {
|
|
|
|
public:
|
|
|
|
BaseDescriptor() { }
|
|
|
|
//Maybe someone can explain the pure virtual destructor thing to me (dennis)
|
|
|
|
virtual ~BaseDescriptor() { }
|
2013-09-19 16:28:02 -04:00
|
|
|
virtual void Run(
|
|
|
|
http::Reply & reply,
|
|
|
|
const RawRouteData &rawRoute,
|
|
|
|
PhantomNodes &phantomNodes,
|
|
|
|
const DataFacadeT * facade
|
|
|
|
) = 0;
|
2013-09-19 16:10:49 -04:00
|
|
|
virtual void SetConfig(const DescriptorConfig & config) = 0;
|
2011-11-17 12:56:45 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* BASE_DESCRIPTOR_H_ */
|