alaCarte Maps
Renderer for OpenStreetMap tiles
eval Namespace Reference

This file is part of alaCarte. More...

Namespaces

 op
 

Classes

class  BinaryOperationNode
 represents and executes a binary operation in the eval syntax tree More...
 
class  Eval
 Represents a value in a style template. More...
 
class  Eval< std::vector< TargetType > >
 Same as eval but with more than one value. More...
 
struct  EvalGrammer
 Grammar used to parse eval expressions. More...
 
class  FunctionOperationNode
 Represents a node which executes a certain operation on 1 to n subexpressions. More...
 
struct  FunctionOperators
 Symbol parser for the function operations. More...
 
struct  Lvl1Operator
 Symbol parser for level 1 operations. More...
 
struct  Lvl2Operator
 Symbol parser for level 2 operations. More...
 
struct  Lvl3Operator
 Symbol parser for level 3 operations. More...
 
struct  Lvl4Operator
 Symbol parser for level 4 operations. More...
 
class  STLeaf
 Represents a leaf in the eval syntax tree. More...
 
class  STNode
 The interface for nodes in the syntax tree. More...
 
class  UnaryOperationNode
 

Functions

template<typename FloatOperator , typename IntOperation >
string calculation (const string &left, const string &right, FloatOperator fop, IntOperation iop)
 
shared_ptr< STNodeparseEval (string::const_iterator begin, string::const_iterator end, const shared_ptr< ParserLogger > &logger)
 Creates a new eval. More...
 
template<>
bool Conv (const string &str, bool *out, bool tryToCache)
 Use some extra function for bool conversion. More...
 
template<>
bool Conv (const string &str, Color *out, bool tryToCache)
 Use some extra function for color conversion. More...
 
template<>
bool Conv (const string &str, string *out, bool tryToCache)
 Use some extra function for string conversion. More...
 
template<>
bool Conv (const string &str, MaybeCachedString *out, bool tryToCache)
 Use some extra function for MaybeCachedString conversion. More...
 
template<>
string ToString (const bool &v)
 
template<typename T >
bool Conv (const string &str, T *out, bool tryToCache=false)
 Converts a string into another type. More...
 
template<typename T >
string ToString (const T &v)
 Converts a value into a string. More...
 
template<typename Iter1 , typename Iter2 >
string ToString (Iter1 begin, Iter2 end)
 Converts a value list into a string. More...
 

Variables

ColorGrammar color_
 
eval::Lvl1Operator Lvl1OpSymbols
 
eval::Lvl2Operator Lvl2OpSymbols
 
eval::Lvl3Operator Lvl3OpSymbols
 
eval::Lvl4Operator Lvl4OpSymbols
 
eval::FunctionOperators FuncOpSymbols
 

Detailed Description

This file is part of alaCarte.

alaCarte 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 (at your option) any later version.

alaCarte 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 Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with alaCarte. If not, see http://www.gnu.org/licenses/.

Copyright alaCarte 2012-2013 Simon Dreher, Florian Jacob, Tobias Kahlert, Patrick Niklaus, Bernhard Scheirle, Lisa Winter Maintainer: Tobias Kahlert

Function Documentation

template<typename FloatOperator , typename IntOperation >
string eval::calculation ( const string left,
const string right,
FloatOperator  fop,
IntOperation  iop 
)

Definition at line 30 of file binary_operation_node.cpp.

template<>
bool eval::Conv ( const string str,
bool *  out,
bool  tryToCache 
)

Use some extra function for bool conversion.

Definition at line 37 of file eval_helpers.cpp.

template<typename T >
bool eval::Conv ( const string str,
T *  out,
bool  tryToCache = false 
)

Converts a string into another type.

Parameters
strstring to be converted
outTarget for the conversion
Returns
if the conversion was successful

Definition at line 40 of file eval_helpers.hpp.

template<>
bool eval::Conv ( const string str,
Color out,
bool  tryToCache 
)

Use some extra function for color conversion.

Definition at line 62 of file eval_helpers.cpp.

template<>
bool eval::Conv ( const string str,
string out,
bool  tryToCache 
)

Use some extra function for string conversion.

Definition at line 75 of file eval_helpers.cpp.

template<>
bool eval::Conv ( const string str,
MaybeCachedString out,
bool  tryToCache 
)

Use some extra function for MaybeCachedString conversion.

Definition at line 96 of file eval_helpers.cpp.

shared_ptr< STNode > eval::parseEval ( string::const_iterator  begin,
string::const_iterator  end,
const shared_ptr< ParserLogger > &  logger 
)

Creates a new eval.

Parameters
valueThe internal value Overwrites the double if the internal value can be resolved into a double
objwhich will be used to execute an eval expression
dvThe value to overwrite Overwrites the int if the internal value can be resolved into a int
objwhich will be used to execute an eval expression
ivThe value to overwrite Overwrites the Color if the internal value can be resolved into a Color
objwhich will be used to execute an eval expression
cvThe value to overwrite Overwrites the string if the internal value can be resolved into a string
objwhich will be used to execute an eval expression
svThe value to overwrite parses an eval
beginof the parseable string
endof the parseable string
loggerused for output
Returns
the root node for the expression or null, if something failed.

Definition at line 193 of file eval.cpp.

template<typename T >
string eval::ToString ( const T &  v)

Converts a value into a string.

Parameters
vThe value
Returns
The converted string

Definition at line 73 of file eval_helpers.hpp.

template<typename Iter1 , typename Iter2 >
string eval::ToString ( Iter1  begin,
Iter2  end 
)

Converts a value list into a string.

Parameters
vThe values
Returns
The converted string

Definition at line 92 of file eval_helpers.hpp.

template<>
string eval::ToString ( const bool &  v)

Definition at line 117 of file eval_helpers.cpp.

Variable Documentation

ColorGrammar eval::color_

Definition at line 59 of file eval_helpers.cpp.

eval::FunctionOperators eval::FuncOpSymbols
eval::Lvl1Operator eval::Lvl1OpSymbols
eval::Lvl2Operator eval::Lvl2OpSymbols
eval::Lvl3Operator eval::Lvl3OpSymbols
eval::Lvl4Operator eval::Lvl4OpSymbols