OmniSciDB  ca0c39ec8f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Parser::PositiveOrZeroValidate Struct Reference

#include <ParserNode.h>

Public Member Functions

template<typename T >
decltype(auto) operator() (T t)
 

Detailed Description

Definition at line 2226 of file ParserNode.h.

Member Function Documentation

template<typename T >
decltype(auto) Parser::PositiveOrZeroValidate::operator() ( t)
inline

Definition at line 2228 of file ParserNode.h.

2228  {
2229  const std::string property_name(boost::to_upper_copy<std::string>(*t->get_name()));
2230  if (!dynamic_cast<const IntLiteral*>(t->get_value())) {
2231  throw std::runtime_error(property_name + " must be an integer literal.");
2232  }
2233  const auto val = static_cast<const IntLiteral*>(t->get_value())->get_intval();
2234  if (val < 0) {
2235  throw std::runtime_error(property_name + " must be greater than or equal to 0.");
2236  }
2237  return val;
2238  }

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