MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
privpgin.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/base/privpgin.h,v 1.17 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 PRIVPGIN_H
33 #define PRIVPGIN_H
34 
35 #include "mathp.h"
36 #include "dataman.h"
37 
39  friend std::ostream& operator << (std::ostream& out, const PrivPlugIn& p);
40 
41 protected:
43  unsigned int iIndex;
44  std::string sIndexName;
46 
47 public:
49  virtual ~PrivPlugIn(void);
50  virtual const char *sName(void) const = 0;
51  int Read(int argc, char *argv[]);
52  TypedValue::Type GetType(void) const;
53  TypedValue GetVal(void) const;
54 
55 protected:
56  unsigned int ReadLabel(const char* s);
57  virtual void ReadSE(unsigned int uLabel, const char *s) = 0;
58  void ReadIndex(unsigned int iMaxIndex, const char *s);
59  virtual std::ostream& Err(std::ostream& out) const = 0;
60 };
61 
62 class NodePrivPlugIn : public PrivPlugIn {
63 public:
65  virtual ~NodePrivPlugIn(void);
66  const char *sName(void) const;
67 
68 protected:
69  virtual void ReadSE(unsigned int uLabel, const char *s);
70  virtual std::ostream& Err(std::ostream& out) const;
71 };
72 
73 class ElemPrivPlugIn : public PrivPlugIn {
74 public:
76  virtual ~ElemPrivPlugIn(void);
77  const char *sName(void) const;
78 
79 protected:
80  virtual void ReadSE(unsigned int uLabel, const char *s);
81  virtual std::ostream& Err(std::ostream& out) const;
82 };
83 
84 extern std::ostream&
85 operator << (std::ostream& out, const PrivPlugIn& p);
86 
87 extern MathParser::PlugIn *
88 node_priv_plugin(MathParser& mp, void *arg);
89 
90 extern MathParser::PlugIn *
91 elem_priv_plugin(MathParser& mp, void *arg);
92 
93 #endif /* PRIVPGIN_H */
94 
virtual void ReadSE(unsigned int uLabel, const char *s)
Definition: privpgin.cc:188
virtual void ReadSE(unsigned int uLabel, const char *s)=0
PrivPlugIn(MathParser &mp, DataManager *pDM)
Definition: privpgin.cc:37
virtual std::ostream & Err(std::ostream &out) const
Definition: privpgin.cc:220
NodePrivPlugIn(MathParser &mp, DataManager *pDM)
Definition: privpgin.cc:170
virtual ~NodePrivPlugIn(void)
Definition: privpgin.cc:176
void ReadIndex(unsigned int iMaxIndex, const char *s)
Definition: privpgin.cc:124
int Read(int argc, char *argv[])
Definition: privpgin.cc:49
unsigned int iIndex
Definition: privpgin.h:43
unsigned int ReadLabel(const char *s)
Definition: privpgin.cc:109
const char * sName(void) const
Definition: privpgin.cc:243
virtual ~ElemPrivPlugIn(void)
Definition: privpgin.cc:237
std::ostream & operator<<(std::ostream &out, const PrivPlugIn &p)
Definition: privpgin.cc:293
std::string sIndexName
Definition: privpgin.h:44
ElemPrivPlugIn(MathParser &mp, DataManager *pDM)
Definition: privpgin.cc:231
virtual void ReadSE(unsigned int uLabel, const char *s)
Definition: privpgin.cc:249
TypedValue::Type GetType(void) const
Definition: privpgin.cc:97
MathParser::PlugIn * elem_priv_plugin(MathParser &mp, void *arg)
Definition: privpgin.cc:308
MathParser::PlugIn * node_priv_plugin(MathParser &mp, void *arg)
Definition: privpgin.cc:299
TypedValue GetVal(void) const
Definition: privpgin.cc:103
virtual std::ostream & Err(std::ostream &out) const
Definition: privpgin.cc:281
virtual ~PrivPlugIn(void)
Definition: privpgin.cc:43
virtual const char * sName(void) const =0
const char * sName(void) const
Definition: privpgin.cc:182
virtual std::ostream & Err(std::ostream &out) const =0
DataManager * pDM
Definition: privpgin.h:45
SimulationEntity * pSE
Definition: privpgin.h:42
friend std::ostream & operator<<(std::ostream &out, const PrivPlugIn &p)
Definition: privpgin.cc:293
MathParser & mp
Definition: mathp.h:224