-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathTclWrapper.h
65 lines (53 loc) · 2.47 KB
/
TclWrapper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* ****************************************************************** **
** OpenSees - Open System for Earthquake Engineering Simulation **
** Pacific Earthquake Engineering Research Center **
** **
** **
** (C) Copyright 1999, The Regents of the University of California **
** All Rights Reserved. **
** **
** Commercial use of this program without express permission of the **
** University of California, Berkeley, is strictly prohibited. See **
** file 'COPYRIGHT' in main directory for information on usage and **
** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
** **
** Developed by: **
** Frank McKenna ([email protected]) **
** Gregory L. Fenves ([email protected]) **
** Filip C. Filippou ([email protected]) **
** **
** ****************************************************************** */
// Written: Minjie
// Description: A tcl wrapper for OpenSees commands
//
#ifndef TclWrapper_h
#define TclWrapper_h
#include <OPS_Globals.h>
#include <tcl.h>
class TclWrapper
{
public:
TclWrapper();
~TclWrapper();
// reset command line
void resetCommandLine(int nArgs, int cArg, TCL_Char** argv);
void resetCommandLine(int cArg);
// wrapper commands
void addOpenSeesCommands(Tcl_Interp* interp);
void addCommand(Tcl_Interp* interp, const char* name, Tcl_CmdProc* proc);
// get command line arguments
TCL_Char** getCurrentArgv() {return currentArgv;}
int getCurrentArg() const {return currentArg;}
int getNumberArgs() const {return numberArgs;}
void incrCurrentArg() {currentArg++;}
// set outputs
void setOutputs(Tcl_Interp* interp, int* data, int numArgs);
void setOutputs(Tcl_Interp* interp, double* data, int numArgs);
void setOutputs(Tcl_Interp* interp, const char* str);
private:
// command line arguments
TCL_Char** currentArgv;
int currentArg;
int numberArgs;
};
#endif