Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/ElmerGUI/netgen/libsrc/general/symbolta.cpp
3206 views
1
/**************************************************************************/
2
/* File: symbolta.cc */
3
/* Author: Joachim Schoeberl */
4
/* Date: 01. Jun. 95 */
5
/**************************************************************************/
6
7
/*
8
Abstract data type Symbol Table
9
*/
10
11
#include <mystdlib.h>
12
#include <myadt.hpp>
13
14
15
#ifndef FILE_SYMBOLTABLECC
16
#define FILE_SYMBOLTABLECC
17
// necessary for SGI ????
18
19
20
namespace netgen
21
{
22
//using namespace netgen;
23
24
BASE_SYMBOLTABLE :: BASE_SYMBOLTABLE ()
25
{
26
;
27
}
28
29
30
BASE_SYMBOLTABLE :: ~BASE_SYMBOLTABLE()
31
{
32
DelNames();
33
}
34
35
36
void BASE_SYMBOLTABLE :: DelNames()
37
{
38
for (int i = 0; i < names.Size(); i++)
39
delete [] names[i];
40
names.SetSize (0);
41
}
42
43
int BASE_SYMBOLTABLE :: Index (const char * name) const
44
{
45
if (!name) return 0;
46
for (int i = 0; i < names.Size(); i++)
47
if (strcmp (names[i], name) == 0) return i+1;
48
return 0;
49
}
50
}
51
52
#endif
53
54