-
Notifications
You must be signed in to change notification settings - Fork 0
/
sli_function.h
65 lines (56 loc) · 1.32 KB
/
sli_function.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
/*
* slifunction.h
*
* This file is part of NEST
*
* Copyright (C) 2004 by
* The NEST Initiative
*
* See the file AUTHORS for details.
*
* Permission is granted to compile and modify
* this file for non-commercial use.
* See the file LICENSE for details.
*
*/
#ifndef SLI_FUNCTION_H
#define SLI_FUNCTION_H
/*
Base class for all SLI functions.
*/
#include "sli_name.h"
namespace sli3
{
class SLIInterpreter;
class SLIFunction
{
public:
SLIFunction(){}
SLIFunction(Name n):name_(n){}
virtual void execute(SLIInterpreter *) const = 0;
virtual ~SLIFunction(){}
/**
* Show stack backtrace information on error.
* This function tries to extract and display useful
* information from the execution stack if an error occurs.
* This function should be implemented for all functions which
* store administrative information on the execution stack.
* Examples are: loops and procedure iterations.
* backtrace() is only called, if the interpreter flag
* show_backtrace is set.
*/
virtual void backtrace(SLIInterpreter *, int) const
{}
Name get_name() const
{
return name_;
}
void set_name(Name n)
{
name_=n;
}
private:
Name name_;
};
}
#endif