OmniSciDB  c0231cc57d
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Parser::DefaultValidate< IntLiteral > Struct Template Reference

#include <ParserNode.h>

Public Member Functions

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

Detailed Description

template<>
struct Parser::DefaultValidate< IntLiteral >

Definition at line 2211 of file ParserNode.h.

Member Function Documentation

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

Definition at line 2213 of file ParserNode.h.

2213  {
2214  const std::string property_name(boost::to_upper_copy<std::string>(*t->get_name()));
2215  if (!dynamic_cast<const IntLiteral*>(t->get_value())) {
2216  throw std::runtime_error(property_name + " must be an integer literal.");
2217  }
2218  const auto val = static_cast<const IntLiteral*>(t->get_value())->get_intval();
2219  if (val <= 0) {
2220  throw std::runtime_error(property_name + " must be a positive number.");
2221  }
2222  return val;
2223  }

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