|
Last change
on this file since 3382 was 3379, checked in by cmv, 18 years ago |
|
new class of abstract func , cmv 12/11/2007
|
|
File size:
1.3 KB
|
| Line | |
|---|
| 1 | #ifndef GENERICFUNC_H
|
|---|
| 2 | #define GENERICFUNC_H
|
|---|
| 3 |
|
|---|
| 4 | #include "pexceptions.h"
|
|---|
| 5 | #include <vector>
|
|---|
| 6 |
|
|---|
| 7 | namespace SOPHYA {
|
|---|
| 8 |
|
|---|
| 9 | //! Abstract interface definition for functions viewed as classes
|
|---|
| 10 | class GenericFunc {
|
|---|
| 11 | public:
|
|---|
| 12 | GenericFunc(void) { }
|
|---|
| 13 | virtual ~GenericFunc(void) { }
|
|---|
| 14 |
|
|---|
| 15 | virtual double operator()(double x) {
|
|---|
| 16 | cout<<"GenericFunc::operator(double) not implemented"<<endl;
|
|---|
| 17 | throw NotAvailableOperation("GenericFunc::operator(double) not implemented");
|
|---|
| 18 | }
|
|---|
| 19 |
|
|---|
| 20 | virtual double operator()(double x,double y) {
|
|---|
| 21 | cout<<"GenericFunc::operator(double,double) not implemented"<<endl;
|
|---|
| 22 | throw NotAvailableOperation("GenericFunc::operator(double,double) not implemented");
|
|---|
| 23 | }
|
|---|
| 24 |
|
|---|
| 25 | virtual double operator()(double x,double y,double z) {
|
|---|
| 26 | cout<<"GenericFunc::operator(double,double,double) not implemented"<<endl;
|
|---|
| 27 | throw NotAvailableOperation("GenericFunc::operator(double,double,double) not implemented");
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | virtual double operator()(double* x) {
|
|---|
| 31 | cout<<"GenericFunc::operator(double*) not implemented"<<endl;
|
|---|
| 32 | throw NotAvailableOperation("GenericFunc::operator(double*) not implemented");
|
|---|
| 33 | }
|
|---|
| 34 |
|
|---|
| 35 | virtual double operator()(vector<double>& x) {
|
|---|
| 36 | cout<<"GenericFunc::operator(vector<double>&) not implemented"<<endl;
|
|---|
| 37 | throw NotAvailableOperation("GenericFunc::operator(vector<double>&) not implemented");
|
|---|
| 38 | }
|
|---|
| 39 |
|
|---|
| 40 | };
|
|---|
| 41 |
|
|---|
| 42 | } // Fin namespace SOPHYA
|
|---|
| 43 |
|
|---|
| 44 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.