11 #ifndef __PY_CompiledCode_h__
12 #define __PY_CompiledCode_h__
25 #define ALLOW_DIFFERENT_CONSTRUCTOR_AND_EVAL_THREADS
52 const char *python_code,
54 const char *as_file = NULL,
55 bool allow_function_bodies =
false);
71 void setEvaluationCacheStackForCurrentThread();
76 int64 getMemoryUsage(
bool inclusive) const;
79 bool hasSyntaxErrors() const;
91 bool saveCompiledCode(std::ostream &os);
103 void evaluateWithDict(
109 evaluateUsingDicts(desired_result_type,
110 opaque_dict, opaque_dict, result);
123 evaluateUsingDicts(desired_result_type,
124 context.myOpaqueGlobalsDict, context.myOpaqueGlobalsDict, result);
133 void* opaque_locals_dict,
137 evaluateUsingDicts(desired_result_type,
138 context.myOpaqueGlobalsDict, opaque_locals_dict, result);
147 evaluate(desired_result_type, result);
156 evaluateInContext(desired_result_type, context, result);
162 return !myCode.isstring() && !mySyntaxErrors.isstring() && myOpaqueCodeObject;
172 void initializeThreadInfoAndEvalCache();
176 void *opaque_globals_dict,
177 void *opaque_locals_dict)
const;
178 void evaluateUsingDicts(
180 void *opaque_globals_dict,
181 void *opaque_locals_dict,
184 int startInterruptableEvaluation()
const;
185 void endInterruptableEvaluation(
int id)
const;
187 void *myOpaqueCodeObject;
192 #ifndef ALLOW_DIFFERENT_CONSTRUCTOR_AND_EVAL_THREADS
void evaluateInContext(PY_Result::Type desired_result_type, PY_EvaluationContext &context, void *opaque_locals_dict, PY_Result &result) const
CodeType codeType() const
void evaluateInContext(PY_Result::Type desired_result_type, PY_EvaluationContext &context, PY_Result &result) const
**But if you need a result
PY_Result evaluateInContext(PY_Result::Type desired_result_type, PY_EvaluationContext &context) const
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
PY_Result evaluate(PY_Result::Type desired_result_type) const