1 |
// -*- C++ -*- |
2 |
// AID-GENERATED |
3 |
// ========================================================================= |
4 |
// This class was generated by AID - Abstract Interface Definition |
5 |
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it. |
6 |
// ========================================================================= |
7 |
#ifndef AIDA_IFUNCTIONFACTORY_H |
8 |
#define AIDA_IFUNCTIONFACTORY_H 1 |
9 |
|
10 |
// This file is part of the AIDA library |
11 |
// Copyright (C) 2002 by the AIDA team. All rights reserved. |
12 |
// This library is free software and under the terms of the |
13 |
// GNU Library General Public License described in the LGPL.txt |
14 |
|
15 |
#include <string> |
16 |
|
17 |
namespace AIDA { |
18 |
|
19 |
class IFunction; |
20 |
class IFunctionCatalog; |
21 |
|
22 |
/** @interface IFunctionFactory |
23 |
* |
24 |
* Function factory. |
25 |
* |
26 |
* @author The AIDA team (http://aida.freehep.org/) |
27 |
* |
28 |
* @stereotype abstractfactory |
29 |
*/ |
30 |
|
31 |
class IFunctionFactory { |
32 |
|
33 |
public: |
34 |
/// Destructor. |
35 |
virtual ~IFunctionFactory() { /* nop */; } |
36 |
|
37 |
/** |
38 |
* Create function from a model registered in the catalog. |
39 |
* This is the easiest way to create simple model functions for fitting. |
40 |
* Every AIDA compliant implementation should predefine "G", "E", "Pn" |
41 |
* (n is an integer, e.e "P0","P5"). Simple operations are permitted, |
42 |
* e.g. "G+P2". |
43 |
* @param path The path of the IFunction. The path can either be a relative or full path. |
44 |
* ("/folder1/folder2/functionName" and "../folder/functionName" are valid paths). |
45 |
* All the directories in the path must exist. The characther `/` cannot be used |
46 |
* in names; it is only used to delimit directories within paths. |
47 |
* @param model The model of the function to be created. |
48 |
* @return The newly created function. |
49 |
* |
50 |
*/ |
51 |
virtual IFunction * createFunctionByName(const std::string & path, const std::string & model) = 0; |
52 |
|
53 |
/** |
54 |
* Create function from script. Script conventions: |
55 |
* createFunctionFromScript("f1", 2, "a*x[0]*x[0] + b*x[1]", "a,b","this is my function", "x[0]*x[0],x[1]") |
56 |
* @param path The path of the IFunction. The path can either be a relative or full path. |
57 |
* ("/folder1/folder2/functionName" and "../folder/functionName" are valid paths). |
58 |
* All the directories in the path must exist. The characther `/` cannot be used |
59 |
* in names; it is only used to delimit directories within paths. |
60 |
* @param dim The dimension of the function, i.e. the number of variables. |
61 |
* @param valexpr The expression of the scripted function. |
62 |
* @param parameters A comma separeted list of what has to be considered as a parameter in the valexpr expression. |
63 |
* @param description The description of the function. |
64 |
* @param gradexpr A comma separated list of the expressions for the derivatives of the function with respect to the parameters. |
65 |
* @return The newly created function |
66 |
* provided expressions is illigal. |
67 |
* |
68 |
*/ |
69 |
virtual IFunction * createFunctionFromScript(const std::string & name, int dim, const std::string & valexpr, const std::string & parameters, const std::string & description, const std::string & gradexpr = "") = 0; |
70 |
|
71 |
/** |
72 |
* Create a clone of an existing function. |
73 |
* @param path The path of the IFunction. The path can either be a relative or full path. |
74 |
* ("/folder1/folder2/functionName" and "../folder/functionName" are valid paths). |
75 |
* All the directories in the path must exist. The characther `/` cannot be used |
76 |
* in names; it is only used to delimit directories within paths. |
77 |
* @param f The IFunction to be cloned. |
78 |
* @return The clone of the provided IFunction. |
79 |
* |
80 |
*/ |
81 |
virtual IFunction * cloneFunction(const std::string & path, IFunction & f) = 0; |
82 |
|
83 |
/** |
84 |
* get access to the function catalog |
85 |
*/ |
86 |
virtual IFunctionCatalog * catalog() = 0; |
87 |
|
88 |
/** @link association |
89 |
* @directed*/ |
90 |
/*# IFunctionCatalog lnkIFunctionCatalog; */ |
91 |
}; // class |
92 |
} // namespace AIDA |
93 |
#endif /* ifndef AIDA_IFUNCTIONFACTORY_H */ |