alaCarte Maps
Renderer for OpenStreetMap tiles
eval::Eval< TargetType > Class Template Reference

Represents a value in a style template. More...

#include <eval.hpp>

Public Types

typedef shared_ptr< STNodenode_ptr
 
typedef boost::variant< TargetType, node_ptrvalue_type
 

Public Member Functions

 Eval (const TargetType &value)
 Creates an Eval from the value type, the eval should evaluated to. More...
 
 Eval (const string &expr, const shared_ptr< ParserLogger > &logger, const ParseInfo &info)
 Creates an eval from a string. More...
 
void overwrite (GeoObject *obj, TargetType *v) const
 Will overwrite the second parameter with an evaluated value. More...
 
bool isEval () const
 

Private Attributes

value_type value
 
shared_ptr< ParserLoggerlogger
 
bool failed
 
ParseInfo info
 

Detailed Description

template<typename TargetType>
class eval::Eval< TargetType >

Represents a value in a style template.

Can be any value or an evalueable expression

Definition at line 53 of file eval.hpp.

Member Typedef Documentation

template<typename TargetType >
typedef shared_ptr<STNode> eval::Eval< TargetType >::node_ptr

Definition at line 56 of file eval.hpp.

template<typename TargetType >
typedef boost::variant<TargetType, node_ptr> eval::Eval< TargetType >::value_type

Definition at line 57 of file eval.hpp.

Constructor & Destructor Documentation

template<typename TargetType >
eval::Eval< TargetType >::Eval ( const TargetType &  value)
inline

Creates an Eval from the value type, the eval should evaluated to.

The direct value, which should be returned, when overwrite is called

Parameters
valueused internaly by this eval

Definition at line 66 of file eval.hpp.

template<typename TargetType >
eval::Eval< TargetType >::Eval ( const string expr,
const shared_ptr< ParserLogger > &  logger,
const ParseInfo info 
)
inline

Creates an eval from a string.

First the constructor will try to parse the string ad an eval. If that does not work, the constructor will try to convert the string into the target type. If that does not work either, a ParseException is thrown.

Parameters
exprwhich should be parsed
loggerwhich should be used by this eval
infoabout the eval

Definition at line 85 of file eval.hpp.

Member Function Documentation

template<typename TargetType >
bool eval::Eval< TargetType >::isEval ( ) const
inline

Definition at line 143 of file eval.hpp.

template<typename TargetType >
void eval::Eval< TargetType >::overwrite ( GeoObject obj,
TargetType *  v 
) const
inline

Will overwrite the second parameter with an evaluated value.

Parameters
objThe geo object used for some eval expressions
vthe value, which should be overwritten

Definition at line 123 of file eval.hpp.

Member Data Documentation

template<typename TargetType >
bool eval::Eval< TargetType >::failed
mutableprivate

Definition at line 157 of file eval.hpp.

template<typename TargetType >
ParseInfo eval::Eval< TargetType >::info
private

Definition at line 160 of file eval.hpp.

template<typename TargetType >
shared_ptr<ParserLogger> eval::Eval< TargetType >::logger
private

Definition at line 154 of file eval.hpp.

template<typename TargetType >
value_type eval::Eval< TargetType >::value
private

Definition at line 151 of file eval.hpp.


The documentation for this class was generated from the following file: