alaCarte Maps
Renderer for OpenStreetMap tiles
binary_operation_node.hpp
Go to the documentation of this file.
1 
21 #pragma once
22 #ifndef _BINARY_OPERATION_NODE_HPP
23 #define _BINARY_OPERATION_NODE_HPP
24 
25 
26 
27 #include "settings.hpp"
28 #include "server/eval/stnode.hpp"
29 
30 
31 
32 class GeoObject;
33 
34 namespace eval {
35 
36 
37 namespace op {
38 
44 {
45  // 1. lvl
54 
55  // 2. lvl
56  Add,
58 
59  // 3. lvl
60  Mul,
61  Div,
63 };
64 }
65 
66 
72  : public STNode
73 {
74 public:
75  typedef STNode base_type;
77 
78  BinaryOperationNode(const node_ptr& left, op::BinaryOperationEnum operation, const node_ptr& right);
79 
80  virtual string eval(GeoObject* obj) const;
81 private:
83  node_ptr left;
87  node_ptr right;
88 };
89 
90 
91 }
92 
93 
94 
95 #endif
BinaryOperationEnum
Enumeration for all binary operations.
node_ptr left
The left expression of the operator.
op::BinaryOperationEnum operation
The type of the operation.
This file is part of alaCarte.
represents and executes a binary operation in the eval syntax tree
The interface for nodes in the syntax tree.
Definition: stnode.hpp:37
node_ptr right
The right expression of the operator.
shared_ptr< STNode > node_ptr
Shared ptr to this node.
Definition: stnode.hpp:41