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

Public Member Functions

 Function_double ()
 
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 247 of file ExpressionParser.cpp.

Constructor & Destructor Documentation

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

Definition at line 249 of file ExpressionParser.cpp.

249 : mup::ICallback(mup::cmFUNC, _T("double"), 1) {}

Member Function Documentation

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

Definition at line 252 of file ExpressionParser.cpp.

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

252  {
253  CHECK_EQ(argc, 1);
254  switch (args[0]->GetType()) {
255  case 'i':
256  *ret = static_cast<mup::float_type>(args[0]->GetInteger());
257  break;
258  case 'f':
259  *ret = args[0]->GetFloat();
260  break;
261  case 's':
262  *ret = static_cast<mup::float_type>(std::stod(ms_to_ss(args[0]->GetString())));
263  break;
264  default: {
265  THROW_INVALID_PARAMETER(0, "unsupported type");
266  }
267  }
268  }
#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_double::GetDesc ( ) const
inlinefinal

Definition at line 250 of file ExpressionParser.cpp.

250 { return _T("cast a value to a double"); };

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