BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
pyInterpreter.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: pyInterpreter.h,v 1.15.18.1 2007/03/25 21:25:21 oliver Exp $
5 //
6 
7 #ifndef BALL_PYTHON_PYINTERPRETER_H
8 #define BALL_PYTHON_PYINTERPRETER_H
9 
10 #ifndef BALL_COMMON_H
11 # include <BALL/common.h>
12 #endif
13 
14 #ifndef BALL_DATAYPE_STRING_H
15 # include <BALL/DATATYPE/string.h>
16 #endif
17 
18 #ifndef BALL_SYSTEM_PATH_H
19 # include <BALL/SYSTEM/path.h>
20 #endif
21 
22 #include <vector>
23 
24 #include <QtCore/QList>
25 #include <QtCore/QPair>
26 #include <QtCore/QString>
27 
28 namespace BALL
29 {
37  {
38  private:
39  // We don't want anybody to instantiate this!
40  PyInterpreter();
41  ~PyInterpreter() {}
42 
43  public:
46  typedef std::vector<String> PathStrings;
49 
52 
61  static void initialize();
62 
67  static void finalize();
68 
72  static bool isInitialized();
73 
75  static void setSysPath(const PathStrings& path_strings);
76 
78  static const PathStrings& getSysPath();
79 
81  static bool isValid() { return valid_;}
82 
84  static String getStartupLog() { return start_log_;}
85 
87 
88 
96  static String run(const String& s, bool& result);
97 
101  static String runFile(const String& filename)
103 
110  static bool importModule(const String& module_name);
112 
113  static bool execute(const QString& module, const QString& func, const QList<QPair<QString, QString> >& params);
114 
115  protected:
117  static bool valid_;
119  };
120 
121 } // namespace BALL
122 
123 #endif // BALL_PYTHON_PYINTERPRETER_H
static PathStrings sys_path_
static String start_log_
static String getStartupLog()
Definition: pyInterpreter.h:84
std::vector< String > PathStrings
Used to encode the individual paths appended to sys.path for dynamic loading of modules.
Definition: pyInterpreter.h:47
static bool isValid()
Definition: pyInterpreter.h:81
#define BALL_EXPORT
Definition: COMMON/global.h:50