26#ifndef PDI_EXPRESSION_H_
27#define PDI_EXPRESSION_H_
35#include <pdi/paraconf_wrapper.h>
37#include <pdi/pdi_fwd.h>
41class PDI_EXPORT Expression
43 struct PDI_NO_EXPORT Impl;
45 std::unique_ptr<Impl> m_impl;
47 Expression(std::unique_ptr<Impl>);
113 Expression& operator= (
const Expression& expr);
120 Expression& operator= (Expression&& expr);
127 Expression operator+ (
const Expression& expr)
const;
134 Expression operator* (
const Expression& expr)
const;
141 Expression operator- (
const Expression& expr)
const;
148 Expression operator/ (
const Expression& expr)
const;
155 Expression operator% (
const Expression& expr)
const;
161 operator bool ()
const;
Ref to_ref(Context &ctx, Datatype_sptr type) const
Evaluates an expression as a data reference.
Expression()
Builds an empty expression.
static std::pair< Expression, long > parse_reference(const char *reference_str)
Parses a string that starts with ‘$’ and represents a reference expression.
double to_double(Context &ctx) const
Evaluates an expression as a float.
std::string to_string(Context &ctx) const
Evaluates an expression as a string.
Expression(long expr)
Builds an expression that represents an integer.
Expression(const std::string &expr)
Builds (i.e.
Expression(const char *expr)
Builds (i.e.
Expression(double expr)
Builds an expression that represents a float.
Expression(Expression &&expr)
Moves an expression.
long to_long(Context &ctx) const
Evaluates an expression as an integer.
~Expression()
Destroys an expression.
Expression(const Expression &expr)
Copies an expression.
Expression(PC_tree_t expr)
Builds an expression that is parsed from PC_tree_t.
Ref to_ref(Context &ctx) const
Evaluates an expression as a data reference.
Definition array_datatype.h:38
std::shared_ptr< const Datatype > Datatype_sptr
Definition pdi_fwd.h:80
Ref_any< false, false > Ref
Definition pdi_fwd.h:94