OmniSciDB  cde582ebc3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
import_export::anonymous_namespace{ExpressionParser.cpp}::Function_float Class Reference
+ Inheritance diagram for import_export::anonymous_namespace{ExpressionParser.cpp}::Function_float:
+ Collaboration diagram for import_export::anonymous_namespace{ExpressionParser.cpp}::Function_float:

Public Member Functions

 Function_float ()
 
const mup::char_type * GetDesc () const final
 
mup::IToken * Clone () const final
 
void Eval (mup::ptr_val_type &ret, const mup::ptr_val_type *args, int argc) final
 

Detailed Description

Definition at line 223 of file ExpressionParser.cpp.

Constructor & Destructor Documentation

import_export::anonymous_namespace{ExpressionParser.cpp}::Function_float::Function_float ( )
inline

Definition at line 225 of file ExpressionParser.cpp.

225 : mup::ICallback(mup::cmFUNC, _T("float"), 1) {}

Member Function Documentation

mup::IToken* import_export::anonymous_namespace{ExpressionParser.cpp}::Function_float::Clone ( ) const
inlinefinal
void import_export::anonymous_namespace{ExpressionParser.cpp}::Function_float::Eval ( mup::ptr_val_type &  ret,
const mup::ptr_val_type *  args,
int  argc 
)
inlinefinal

Definition at line 228 of file ExpressionParser.cpp.

References run_benchmark_import::args, CHECK_EQ, import_export::anonymous_namespace{ExpressionParser.cpp}::ms_to_ss(), and THROW_INVALID_PARAMETER.

228  {
229  CHECK_EQ(argc, 1);
230  switch (args[0]->GetType()) {
231  case 'i':
232  *ret = static_cast<mup::float_type>(args[0]->GetInteger());
233  break;
234  case 'f':
235  *ret = args[0]->GetFloat();
236  break;
237  case 's':
238  *ret = static_cast<mup::float_type>(std::stod(ms_to_ss(args[0]->GetString())));
239  break;
240  default: {
241  THROW_INVALID_PARAMETER(0, "unsupported type");
242  }
243  }
244  }
#define CHECK_EQ(x, y)
Definition: Logger.h:230
#define THROW_INVALID_PARAMETER(arg, what)

+ Here is the call graph for this function:

const mup::char_type* import_export::anonymous_namespace{ExpressionParser.cpp}::Function_float::GetDesc ( ) const
inlinefinal

Definition at line 226 of file ExpressionParser.cpp.

226 { return _T("cast a value to a float"); };

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