SCalc
Public Types | Public Member Functions | Protected Attributes | List of all members
SCalc::CFuncParam Class Reference

#include <functions.hh>

Inheritance diagram for SCalc::CFuncParam:
Inheritance graph
[legend]
Collaboration diagram for SCalc::CFuncParam:
Collaboration graph
[legend]

Public Types

typedef double(* c_function_t) (void *, double)
 The type of arguments it accepts.
 
- Public Types inherited from SCalc::CFunc
typedef double(* c_function_t) (double)
 The type of arguments it accepts.
 

Public Member Functions

 CFuncParam (Session *s, const char *n, c_function_t func, void *param, FuncDef *derivat=NULL)
 
virtual double evaluate (const double *vars, const double *args)
 The function doing the actual job...
 
void * param ()
 
void set_param (void *p)
 
- Public Member Functions inherited from SCalc::CFunc
 CFunc (Session *s, const char *n, c_function_t func, FuncDef *derivat=NULL)
 
void set_derivative (FuncDef *d)
 
virtual void destroy_anonymous_derivatives ()
 Delete the derivative if anonymous.
 
virtual FuncDefderivative (int nb)
 Gets the derivative.
 
- Public Member Functions inherited from SCalc::FuncDef
 FuncDef (Session *s, int nb)
 
virtual int is_func_def ()
 Yes, this is a function definition.
 
virtual std::string pretty_print ()
 Pretty printing of the result ?
 
int register_self ()
 Register the function to the session if it has a name.
 
int nb_params ()
 The number of params the function takes.
 
void set_name (const char *name)
 
std::string name ()
 
virtual int can_delete ()
 
- Public Member Functions inherited from SCalc::ParserResult
 ParserResult (Session *s)
 Constructors/desctructors:
 
Sessionsession ()
 The SCalc::Session object used. More...
 
virtual int is_expression ()
 Is it a SCalc::Expression ? More...
 
Expressionto_expression ()
 Converts to SCalc::Expression. More...
 
virtual int is_syntax_error ()
 Is it a SCalc::SyntaxError ? More...
 
SyntaxErrorto_syntax_error ()
 Converts to SCalc::SyntaxError. More...
 
FuncDefto_func_def ()
 Converts to SCalc::FuncDef. More...
 

Protected Attributes

c_function_t func
 The C function to be called.
 
FuncDefderiv
 
void * _param
 The parameter !
 
- Protected Attributes inherited from SCalc::CFunc
c_function_t func
 The C function to be called.
 
FuncDefderiv
 
- Protected Attributes inherited from SCalc::FuncDef
int _nb_params
 
std::string _name
 

Additional Inherited Members

- Static Public Member Functions inherited from SCalc::FuncDef
static void register_common_functions (Session *sess)
 This function registers common functions to the given session.
 

Detailed Description

A basic C function with one argument and one external parameter

Member Data Documentation

◆ deriv

FuncDef* SCalc::CFuncParam::deriv
protected

The derivative. A pointer to a function. If NULL, then the function has to take care to provide it when necessary (or fail) and to free it when it dies.


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