MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
table.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/libraries/libmbutil/table.h,v 1.26 2017/01/12 14:44:05 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 /* Tabella dei simboli; richiamata da table.cc, parser.h */
33 
34 #ifndef TABLE_H
35 #define TABLE_H
36 
37 #include <cstring>
38 #include <map>
39 
40 #include "except.h"
41 #include "mathtyp.h"
42 
43 class Table {
44  friend std::ostream& operator << (std::ostream& out, const Table& T);
45 
46 public:
48  public:
51  };
52 
53  typedef std::map<std::string, NamedValue *> VM;
54 
55 private:
56  VM vm;
57 
58 public:
59  Table(bool bSetConstants);
60  virtual ~Table(void);
61  Var* Put(const std::string& name, const TypedValue& v);
62  const NamedValue* Put(NamedValue* p);
63  NamedValue* Get(const std::string& name) const;
64  VM::const_iterator begin(void) const { return vm.begin(); };
65  VM::const_iterator end(void) const { return vm.end(); };
66 };
67 
68 extern std::ostream& operator << (std::ostream& out, const Table& T);
69 
70 #endif // TABLE_H
71 
Definition: mathtyp.h:175
Var * Put(const std::string &name, const TypedValue &v)
Definition: table.cc:110
#define MBDYN_EXCEPT_ARGS_PASSTHRU
Definition: except.h:55
#define MBDYN_EXCEPT_ARGS_DECL
Definition: except.h:43
virtual ~Table(void)
Definition: table.cc:102
VM::const_iterator end(void) const
Definition: table.h:65
ErrNameAlreadyDefined(const char *file, int line, const char *func, const std::string r=std::string())
Definition: table.h:49
Table(bool bSetConstants)
Definition: table.cc:82
std::map< std::string, NamedValue * > VM
Definition: table.h:53
NamedValue * Get(const std::string &name) const
Definition: table.cc:150
std::ostream & operator<<(std::ostream &out, const Table &T)
Definition: table.cc:160
friend std::ostream & operator<<(std::ostream &out, const Table &T)
Definition: table.cc:160
Definition: table.h:43
VM::const_iterator begin(void) const
Definition: table.h:64
VM vm
Definition: table.h:56