libmoldeo (Moldeo 1.0 Core)  1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
moMathFunctionIndex.h
Go to the documentation of this file.
1 /*******************************************************************************
2 
3  moMathFunctionIndex.h
4 
5  ****************************************************************************
6  * *
7  * This source is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This code is distributed in the hope that it will be useful, but *
13  * WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15  * General Public License for more details. *
16  * *
17  * A copy of the GNU General Public License is available on the World *
18  * Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
19  * obtain it by writing to the Free Software Foundation, *
20  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  * *
22  ****************************************************************************
23 
24  Copyright(C) 2006 Fabricio Costa
25 
26  Authors:
27  Fabricio Costa
28  Andrés Colubri
29 
30 *******************************************************************************/
31 
32 #include "moTypes.h"
33 #include "moAbstract.h"
34 #include "moConfig.h"
35 #include "moParam.h"
36 #include "moMathManager.h"
37 
38 #ifndef __MO_MATHFUNCTION_INDEX_H
39 #define __MO_MATHFUNCTION_INDEX_H
40 
48 {
49 public:
53  moMathFunctionIndex() { m_functions_array.Init(0, NULL); }
57  virtual ~moMathFunctionIndex() { Finish(); }
58 
67  virtual MOboolean Init(moConfig* p_cfg, moMathManager* p_math_man, MOint p_param_idx, MOuint p_subvalue_idx = 0)
68  { LoadFunctions( p_cfg, p_math_man, p_param_idx, p_subvalue_idx); return true; }
77  virtual MOboolean Init(moConfig* p_cfg, moMathManager* p_math_man, moParamIndex p_param_idx, MOuint p_subvalue_idx = 0)
78  { LoadFunctions( p_cfg, p_math_man, p_param_idx.index, p_subvalue_idx); return true; }
87  virtual MOboolean Init(moConfig* p_cfg, moMathManager* p_math_man, moParamReference p_param_ref, MOuint p_subvalue_idx = 0)
88  { LoadFunctions( p_cfg, p_math_man, p_cfg->GetConfigDefinition()->ParamIndexes().Get(p_param_ref.reference).index, p_subvalue_idx); return true; }
93  virtual MOboolean Finish() { m_functions_array.Finish(); return true; }
94 
101  MOint Add(moText p_name, moMathManager* p_math_man);
102 
108  MOint Add( moMathFunction* p_func);
109 
115  moMathFunction* GetFunction(MOuint p_idx);
116 
122  MOboolean ValidIndex(MOuint p_idx);
127  MOuint Count() { return m_functions_array.Count(); }
133  moMathFunction* operator [](MOuint p_idx) { return GetFunction(p_idx); }
134 
141  moMathFunction* Fun( MOint p_value_index = MO_SELECTED );
142 private:
143  moMathFunctionArray m_functions_array;
144 
145  moConfig* m_pConfig;
146  moParamIndex m_ParamIndex;
147  MOuint m_SubValueIndex;
148 
149  MOuint LoadFunctions( moConfig* p_cfg, moMathManager* p_math_man, MOuint p_param_idx, MOuint p_subvalue_idx = 0);
150 };
151 
152 #endif
153 
virtual MOboolean Finish()
virtual MOboolean Finish()
Finaliza el objeto, libera recursos.
Definition: moAbstract.cpp:147
virtual MOboolean Init(moConfig *p_cfg, moMathManager *p_math_man, moParamIndex p_param_idx, MOuint p_subvalue_idx=0)
#define MOboolean
Definition: moTypes.h:385
MOlong index
Definition: moParam.h:124
Clase base abstracta de donde deben derivar los objetos [virtual pura].
Definition: moAbstract.h:191
#define LIBMOLDEO_API
Definition: moTypes.h:180
clase de para manejar textos
Definition: moText.h:75
moParamIndexes & ParamIndexes()
Devuelve el puntero al arreglo de índices de los parámetros.
Definition: moConfig.h:97
#define MOint
Definition: moTypes.h:388
moConfigDefinition * GetConfigDefinition()
Devuelve el puntero al objeto de definición de la configuración
Definition: moConfig.cpp:1572
MOlong reference
Definition: moParam.h:98
#define MO_SELECTED
Definition: moConfig.h:44
#define MOuint
Definition: moTypes.h:387
virtual MOboolean Init(moConfig *p_cfg, moMathManager *p_math_man, moParamReference p_param_ref, MOuint p_subvalue_idx=0)
virtual MOboolean Init(moConfig *p_cfg, moMathManager *p_math_man, MOint p_param_idx, MOuint p_subvalue_idx=0)
moMathFunction
almacena la configuración de los parámetros de un objeto en un archivo XML
Definition: moConfig.h:193
const Real * operator[](int iRow) const