MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
modelns.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/base/modelns.h,v 1.22 2017/01/12 14:46:10 masarati Exp $ */
2 /*
3  * MBDyn (C) is a multibody analysis code.
4  * http://www.mbdyn.org
5  *
6  * Copyright (C) 1996-2017
7  *
8  * Pierangelo Masarati <masarati@aero.polimi.it>
9  * Paolo Mantegazza <mantegazza@aero.polimi.it>
10  *
11  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
12  * via La Masa, 34 - 20156 Milano, Italy
13  * http://www.aero.polimi.it
14  *
15  * Changing this copyright notice is forbidden.
16  *
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation (version 2 of the License).
20  *
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */
31 
32 #ifndef MODELNS_H
33 #define MODELNS_H
34 
35 #include "mathp.h"
36 #include "dataman.h"
37 
39 protected:
40  const DataManager *pDM;
41 
42 public:
51 
52 protected:
53  typedef std::map<std::string, MathParser::MathFunc_t *> funcType;
55 
60 
61  typedef std::map<std::string, TypedValue> currDataType;
63 
64  bool
65  FindFunc(const std::string& fname, MathParser::MathFunc_t** fpp = 0) const;
66 
67 public:
69  ~ModelNameSpace(void);
70 
71  bool IsFunc(const std::string& fname) const;
72  MathParser::MathFunc_t* GetFunc(const std::string& fname) const;
74  virtual Table* GetTable(void);
75 
76  bool PushCurrData(const std::string& name, const TypedValue& value);
77  bool PopCurrData(const std::string& name);
78  bool GetCurrData(const std::string& name, TypedValue& value) const;
79 };
80 
81 #endif /* MODELNS_H */
82 
bool PopCurrData(const std::string &name)
Definition: modelns.cc:2944
funcType func
Definition: modelns.h:54
MathParser::MathArgPriv_t< Node::Type > MathArgNode
Definition: modelns.h:46
MathParser::MathFunc_t unique_elem_func
Definition: modelns.h:59
const DataManager * pDM
Definition: modelns.h:40
MathParser::MathFunc_t * GetFunc(const std::string &fname) const
Definition: modelns.cc:2831
bool IsFunc(const std::string &fname) const
Definition: modelns.cc:2734
MathParser::MathFunc_t node_func
Definition: modelns.h:57
bool GetCurrData(const std::string &name, TypedValue &value) const
Definition: modelns.cc:2957
MathParser::MathArgPriv_t< const DataManager * > MathArgDM
Definition: modelns.h:43
MathParser::MathArgPriv_t< const BasicScalarFunction * > MathArgSF
Definition: modelns.h:45
TypedValue EvalFunc(MathParser::MathFunc_t *f) const
Definition: modelns.cc:2901
MathParser::MathFunc_t elem_func
Definition: modelns.h:58
ModelNameSpace(const DataManager *pDM)
Definition: modelns.cc:1090
MathParser::MathArgPriv_t< const DriveCaller * > MathArgDCPtr
Definition: modelns.h:50
MathParser::MathArgPriv_t< unsigned int > MathArgSEIdx
Definition: modelns.h:49
MathParser::MathArgPriv_t< const SimulationEntity * > MathArgSEPtr
Definition: modelns.h:48
virtual Table * GetTable(void)
Definition: modelns.cc:2932
std::string name
Definition: mathp.h:192
bool PushCurrData(const std::string &name, const TypedValue &value)
Definition: modelns.cc:2938
MathParser::MathArgPriv_t< Elem::Type > MathArgElem
Definition: modelns.h:47
Definition: table.h:43
bool FindFunc(const std::string &fname, MathParser::MathFunc_t **fpp=0) const
Definition: modelns.cc:2740
std::map< std::string, TypedValue > currDataType
Definition: modelns.h:61
~ModelNameSpace(void)
Definition: modelns.cc:2726
std::map< std::string, MathParser::MathFunc_t * > funcType
Definition: modelns.h:53
MathParser::MathArgPriv_t< const ModelNameSpace * > MathArgMNS
Definition: modelns.h:44
MathParser::MathFunc_t sf_func
Definition: modelns.h:56
currDataType currData
Definition: modelns.h:62