mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2024-11-10 08:55:37 +00:00
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
#ifndef LATAN_FUNCTION_HPP_
|
|
#define LATAN_FUNCTION_HPP_
|
|
|
|
#include <latan/Global.hpp>
|
|
#include <stack>
|
|
#include <vector>
|
|
#include <cstdarg>
|
|
|
|
LATAN_BEGIN_CPPDECL
|
|
|
|
/******************************************************************************
|
|
* Base function class *
|
|
******************************************************************************/
|
|
class Function
|
|
{
|
|
public:
|
|
// constructor/destructor
|
|
explicit Function(const unsigned nArg);
|
|
virtual ~Function(void);
|
|
// access
|
|
unsigned int getNArg(void) const;
|
|
private:
|
|
const unsigned int nArg_;
|
|
};
|
|
|
|
/******************************************************************************
|
|
* Double function class *
|
|
******************************************************************************/
|
|
class DoubleFunction: public Function
|
|
{
|
|
public:
|
|
// constructor/destructor
|
|
explicit DoubleFunction(const unsigned nArg);
|
|
virtual ~DoubleFunction(void);
|
|
// function call
|
|
virtual double operator()(std::vector<double> &arg) = 0;
|
|
double operator()(std::stack<double> &arg);
|
|
double operator()(const double x0, ...);
|
|
private:
|
|
std::vector<double> buffer_;
|
|
};
|
|
|
|
LATAN_END_CPPDECL
|
|
|
|
#endif
|