#ifndef ROOT_TInterpreter
#define ROOT_TInterpreter
#ifndef ROOT_TDictionary
#include "TDictionary.h"
#endif
class TClass;
class TEnv;
class TFunction;
class TMethod;
class TObjArray;
class TVirtualMutex;
extern "C" { struct G__value; }
R__EXTERN TVirtualMutex *gCINTMutex;
class TInterpreter : public TNamed {
protected:
virtual void Execute(TMethod *method, TObjArray *params, int *error = 0) = 0;
public:
enum EErrorCode {
kNoError = 0,
kRecoverable = 1,
kDangerous = 2,
kFatal = 3,
kProcessing = 99
};
TInterpreter() { }
TInterpreter(const char *name, const char *title = "Generic Interpreter");
virtual ~TInterpreter() { }
virtual void AddIncludePath(const char *path) = 0;
virtual Int_t AutoLoad(const char *classname) = 0;
virtual void ClearFileBusy() = 0;
virtual void ClearStack() = 0;
virtual void EnableAutoLoading() = 0;
virtual void EndOfLineAction() = 0;
virtual void EnableWrappers(bool value) = 0;
virtual Int_t GetExitCode() const = 0;
virtual TEnv *GetMapfile() const { return 0; }
virtual Int_t GetMore() const = 0;
virtual char *GetPrompt() = 0;
virtual const char *GetSharedLibs() = 0;
virtual const char *GetClassSharedLibs(const char *cls) = 0;
virtual const char *GetSharedLibDeps(const char *lib) = 0;
virtual const char *GetIncludePath() = 0;
virtual const char *GetSTLIncludePath() const { return ""; }
virtual TObjArray *GetRootMapFiles() const = 0;
virtual Int_t InitializeDictionaries() = 0;
virtual Bool_t IsLoaded(const char *filename) const = 0;
virtual Int_t Load(const char *filenam, Bool_t system = kFALSE) = 0;
virtual void LoadMacro(const char *filename, EErrorCode *error = 0) = 0;
virtual Int_t LoadLibraryMap(const char *rootmapfile = 0) = 0;
virtual Int_t RescanLibraryMap() = 0;
virtual Int_t ReloadAllSharedLibraryMaps() = 0;
virtual Int_t UnloadAllSharedLibraryMaps() = 0;
virtual Int_t UnloadLibraryMap(const char *library) = 0;
virtual Long_t ProcessLine(const char *line, EErrorCode *error = 0) = 0;
virtual Long_t ProcessLineSynch(const char *line, EErrorCode *error = 0) = 0;
virtual void PrintIntro() = 0;
virtual void SetGetline(char*(*getlineFunc)(const char* prompt),
void (*histaddFunc)(char* line)) = 0;
virtual void Reset() = 0;
virtual void ResetAll() = 0;
virtual void ResetGlobals() = 0;
virtual void RewindDictionary() = 0;
virtual Int_t DeleteGlobal(void *obj) = 0;
virtual void SaveContext() = 0;
virtual void SaveGlobalsContext() = 0;
virtual void UpdateListOfGlobals() = 0;
virtual void UpdateListOfGlobalFunctions() = 0;
virtual void UpdateListOfTypes() = 0;
virtual void SetClassInfo(TClass *cl, Bool_t reload = kFALSE) = 0;
virtual Bool_t CheckClassInfo(const char *name, Bool_t autoload = kTRUE) = 0;
virtual Long_t Calc(const char *line, EErrorCode* error = 0) = 0;
virtual void CreateListOfBaseClasses(TClass *cl) = 0;
virtual void CreateListOfDataMembers(TClass *cl) = 0;
virtual void CreateListOfMethods(TClass *cl) = 0;
virtual void CreateListOfMethodArgs(TFunction *m) = 0;
virtual void UpdateListOfMethods(TClass *cl) = 0;
virtual TString GetMangledName(TClass *cl, const char *method, const char *params) = 0;
virtual TString GetMangledNameWithPrototype(TClass *cl, const char *method, const char *proto) = 0;
virtual const char *GetInterpreterTypeName(const char *name,Bool_t full = kFALSE) = 0;
virtual void *GetInterfaceMethod(TClass *cl, const char *method, const char *params) = 0;
virtual void *GetInterfaceMethodWithPrototype(TClass *cl, const char *method, const char *proto) = 0;
virtual void Execute(const char *function, const char *params, int *error = 0) = 0;
virtual void Execute(TObject *obj, TClass *cl, const char *method, const char *params, int *error = 0) = 0;
virtual void Execute(TObject *obj, TClass *cl, TMethod *method, TObjArray *params, int *error = 0) = 0;
virtual Long_t ExecuteMacro(const char *filename, EErrorCode *error = 0) = 0;
virtual Bool_t IsErrorMessagesEnabled() const = 0;
virtual Bool_t SetErrorMessages(Bool_t enable = kTRUE) = 0;
virtual Bool_t IsProcessLineLocked() const = 0;
virtual void SetProcessLineLock(Bool_t lock = kTRUE) = 0;
virtual const char *TypeName(const char *s) = 0;
virtual int DisplayClass(FILE * ,char * ,int ,int ) const {return 0;}
virtual int DisplayIncludePath(FILE * ) const {return 0;}
virtual void *FindSym(const char * ) const {return 0;}
virtual void GenericError(const char * ) const {;}
virtual Long_t GetExecByteCode() const {return 0;}
virtual Long_t Getgvp() const {return 0;}
virtual const char *Getp2f2funcname(void * ) const {return 0;}
virtual const char *GetTopLevelMacroName() const {return 0;};
virtual const char *GetCurrentMacroName() const {return 0;};
virtual int GetSecurityError() const{return 0;}
virtual int LoadFile(const char * ) const {return 0;}
virtual void LoadText(const char * ) const {;}
virtual const char *MapCppName(const char*) const {return 0;}
virtual void SetAlloclockfunc(void (*)()) const {;}
virtual void SetAllocunlockfunc(void (*)()) const {;}
virtual int SetClassAutoloading(int) const {return 0;}
virtual void SetErrmsgcallback(void * ) const {;}
virtual void Setgvp(Long_t) const {;}
virtual void SetRTLD_NOW() const {;}
virtual void SetRTLD_LAZY() const {;}
virtual void SetTempLevel(int ) const {;}
virtual int UnloadFile(const char * ) const {return 0;}
virtual void CallFunc_Delete(void * ) const {;}
virtual void CallFunc_Exec(CallFunc_t * , void * ) const {;}
virtual Long_t CallFunc_ExecInt(CallFunc_t * , void * ) const {return 0;}
virtual Long_t CallFunc_ExecInt64(CallFunc_t * , void * ) const {return 0;}
virtual Double_t CallFunc_ExecDouble(CallFunc_t * , void * ) const {return 0;}
virtual CallFunc_t *CallFunc_Factory() const {return 0;}
virtual CallFunc_t *CallFunc_FactoryCopy(CallFunc_t * ) const {return 0;}
virtual MethodInfo_t *CallFunc_FactoryMethod(CallFunc_t * ) const {return 0;}
virtual void CallFunc_Init(CallFunc_t * ) const {;}
virtual bool CallFunc_IsValid(CallFunc_t * ) const {return 0;}
virtual void CallFunc_ResetArg(CallFunc_t * ) const {;}
virtual void CallFunc_SetArg(CallFunc_t * , Long_t ) const {;}
virtual void CallFunc_SetArg(CallFunc_t * , Double_t ) const {;}
virtual void CallFunc_SetArg(CallFunc_t * , Long64_t ) const {;}
virtual void CallFunc_SetArg(CallFunc_t * , ULong64_t ) const {;}
virtual void CallFunc_SetArgArray(CallFunc_t * , Long_t * , Int_t ) const {;}
virtual void CallFunc_SetArgs(CallFunc_t * , const char * ) const {;}
virtual void CallFunc_SetFunc(CallFunc_t * , ClassInfo_t * , const char * , const char * , Long_t * ) const {;}
virtual void CallFunc_SetFunc(CallFunc_t * , MethodInfo_t * ) const {;}
virtual void CallFunc_SetFuncProto(CallFunc_t * , ClassInfo_t * , const char * , const char * , Long_t * ) const {;}
virtual Long_t ClassInfo_ClassProperty(ClassInfo_t * ) const {return 0;}
virtual void ClassInfo_Delete(ClassInfo_t * ) const {;}
virtual void ClassInfo_Delete(ClassInfo_t * , void * ) const {;}
virtual void ClassInfo_DeleteArray(ClassInfo_t * , void * , bool ) const {;}
virtual void ClassInfo_Destruct(ClassInfo_t * , void * ) const {;}
virtual ClassInfo_t *ClassInfo_Factory() const {return 0;}
virtual ClassInfo_t *ClassInfo_Factory(G__value * ) const {return 0;}
virtual ClassInfo_t *ClassInfo_Factory(ClassInfo_t * ) const {return 0;}
virtual ClassInfo_t *ClassInfo_Factory(const char * ) const {return 0;}
virtual int ClassInfo_GetMethodNArg(ClassInfo_t * , const char * ,const char * ) const {return 0;}
virtual bool ClassInfo_HasDefaultConstructor(ClassInfo_t * ) const {return 0;}
virtual bool ClassInfo_HasMethod(ClassInfo_t * , const char * ) const {return 0;}
virtual void ClassInfo_Init(ClassInfo_t * , const char * ) const {;}
virtual void ClassInfo_Init(ClassInfo_t * , int ) const {;}
virtual bool ClassInfo_IsBase(ClassInfo_t * , const char * ) const {return 0;}
virtual bool ClassInfo_IsEnum(const char * ) const {return 0;}
virtual bool ClassInfo_IsLoaded(ClassInfo_t * ) const {return 0;}
virtual bool ClassInfo_IsValid(ClassInfo_t * ) const {return 0;}
virtual bool ClassInfo_IsValidMethod(ClassInfo_t * , const char * ,const char * , Long_t * ) const {return 0;}
virtual int ClassInfo_Next(ClassInfo_t * ) const {return 0;}
virtual void *ClassInfo_New(ClassInfo_t * ) const {return 0;}
virtual void *ClassInfo_New(ClassInfo_t * , int ) const {return 0;}
virtual void *ClassInfo_New(ClassInfo_t * , int , void * ) const {return 0;}
virtual void *ClassInfo_New(ClassInfo_t * , void * ) const {return 0;}
virtual Long_t ClassInfo_Property(ClassInfo_t * ) const {return 0;}
virtual int ClassInfo_RootFlag(ClassInfo_t * ) const {return 0;}
virtual int ClassInfo_Size(ClassInfo_t * ) const {return 0;}
virtual Long_t ClassInfo_Tagnum(ClassInfo_t * ) const {return 0;}
virtual const char *ClassInfo_FileName(ClassInfo_t * ) const {return 0;}
virtual const char *ClassInfo_FullName(ClassInfo_t * ) const {return 0;}
virtual const char *ClassInfo_Name(ClassInfo_t * ) const {return 0;}
virtual const char *ClassInfo_Title(ClassInfo_t * ) const {return 0;}
virtual const char *ClassInfo_TmpltName(ClassInfo_t * ) const {return 0;}
virtual void BaseClassInfo_Delete(BaseClassInfo_t * ) const {;}
virtual BaseClassInfo_t *BaseClassInfo_Factory(ClassInfo_t * ) const {return 0;}
virtual int BaseClassInfo_Next(BaseClassInfo_t * ) const {return 0;}
virtual int BaseClassInfo_Next(BaseClassInfo_t * , int ) const {return 0;}
virtual Long_t BaseClassInfo_Offset(BaseClassInfo_t * ) const {return 0;}
virtual Long_t BaseClassInfo_Property(BaseClassInfo_t * ) const {return 0;}
virtual Long_t BaseClassInfo_Tagnum(BaseClassInfo_t * ) const {return 0;}
virtual const char *BaseClassInfo_FullName(BaseClassInfo_t * ) const {return 0;}
virtual const char *BaseClassInfo_Name(BaseClassInfo_t * ) const {return 0;}
virtual const char *BaseClassInfo_TmpltName(BaseClassInfo_t * ) const {return 0;}
virtual int DataMemberInfo_ArrayDim(DataMemberInfo_t * ) const {return 0;}
virtual void DataMemberInfo_Delete(DataMemberInfo_t * ) const {;}
virtual DataMemberInfo_t *DataMemberInfo_Factory(ClassInfo_t * = 0) const {return 0;}
virtual DataMemberInfo_t *DataMemberInfo_FactoryCopy(DataMemberInfo_t * ) const {return 0;}
virtual bool DataMemberInfo_IsValid(DataMemberInfo_t * ) const {return 0;}
virtual int DataMemberInfo_MaxIndex(DataMemberInfo_t * , Int_t ) const {return 0;}
virtual int DataMemberInfo_Next(DataMemberInfo_t * ) const {return 0;}
virtual Long_t DataMemberInfo_Offset(DataMemberInfo_t * ) const {return 0;}
virtual Long_t DataMemberInfo_Property(DataMemberInfo_t * ) const {return 0;}
virtual Long_t DataMemberInfo_TypeProperty(DataMemberInfo_t * ) const {return 0;}
virtual int DataMemberInfo_TypeSize(DataMemberInfo_t * ) const {return 0;}
virtual const char *DataMemberInfo_TypeName(DataMemberInfo_t * ) const {return 0;}
virtual const char *DataMemberInfo_TypeTrueName(DataMemberInfo_t * ) const {return 0;}
virtual const char *DataMemberInfo_Name(DataMemberInfo_t * ) const {return 0;}
virtual const char *DataMemberInfo_Title(DataMemberInfo_t * ) const {return 0;}
virtual const char *DataMemberInfo_ValidArrayIndex(DataMemberInfo_t * ) const {return 0;}
virtual void MethodInfo_CreateSignature(MethodInfo_t * , TString & ) const {;}
virtual void MethodInfo_Delete(MethodInfo_t * ) const {;}
virtual MethodInfo_t *MethodInfo_Factory() const {return 0;}
virtual MethodInfo_t *MethodInfo_FactoryCopy(MethodInfo_t * ) const {return 0;}
virtual MethodInfo_t *MethodInfo_InterfaceMethod(MethodInfo_t * ) const {return 0;}
virtual bool MethodInfo_IsValid(MethodInfo_t * ) const {return 0;}
virtual int MethodInfo_NArg(MethodInfo_t * ) const {return 0;}
virtual int MethodInfo_NDefaultArg(MethodInfo_t * ) const {return 0;}
virtual int MethodInfo_Next(MethodInfo_t * ) const {return 0;}
virtual Long_t MethodInfo_Property(MethodInfo_t * ) const {return 0;}
virtual TypeInfo_t *MethodInfo_Type(MethodInfo_t * ) const {return 0;}
virtual const char *MethodInfo_GetMangledName(MethodInfo_t * ) const {return 0;}
virtual const char *MethodInfo_GetPrototype(MethodInfo_t * ) const {return 0;}
virtual const char *MethodInfo_Name(MethodInfo_t * ) const {return 0;}
virtual const char *MethodInfo_TypeName(MethodInfo_t * ) const {return 0;}
virtual const char *MethodInfo_Title(MethodInfo_t * ) const {return 0;}
virtual void MethodArgInfo_Delete(MethodArgInfo_t * ) const {;}
virtual MethodArgInfo_t *MethodArgInfo_Factory() const {return 0;}
virtual MethodArgInfo_t *MethodArgInfo_FactoryCopy(MethodArgInfo_t * ) const {return 0;}
virtual bool MethodArgInfo_IsValid(MethodArgInfo_t * ) const {return 0;}
virtual int MethodArgInfo_Next(MethodArgInfo_t * ) const {return 0;}
virtual Long_t MethodArgInfo_Property(MethodArgInfo_t * ) const {return 0;}
virtual const char *MethodArgInfo_DefaultValue(MethodArgInfo_t * ) const {return 0;}
virtual const char *MethodArgInfo_Name(MethodArgInfo_t * ) const {return 0;}
virtual const char *MethodArgInfo_TypeName(MethodArgInfo_t * ) const {return 0;}
virtual void TypeInfo_Delete(TypeInfo_t * ) const {;}
virtual TypeInfo_t *TypeInfo_Factory() const {return 0;}
virtual TypeInfo_t *TypeInfo_Factory(G__value * ) const {return 0;}
virtual TypeInfo_t *TypeInfo_FactoryCopy(TypeInfo_t * ) const {return 0;}
virtual void TypeInfo_Init(TypeInfo_t * , const char * ) const {;}
virtual bool TypeInfo_IsValid(TypeInfo_t * ) const {return 0;}
virtual const char *TypeInfo_Name(TypeInfo_t * ) const {return 0;}
virtual Long_t TypeInfo_Property(TypeInfo_t * ) const {return 0;}
virtual int TypeInfo_RefType(TypeInfo_t * ) const {return 0;}
virtual int TypeInfo_Size(TypeInfo_t * ) const {return 0;}
virtual const char *TypeInfo_TrueName(TypeInfo_t * ) const {return 0;}
virtual void TypedefInfo_Delete(TypedefInfo_t * ) const {;}
virtual TypedefInfo_t *TypedefInfo_Factory() const {return 0;}
virtual TypedefInfo_t *TypedefInfo_FactoryCopy(TypedefInfo_t * ) const {return 0;}
virtual void TypedefInfo_Init(TypedefInfo_t * , const char * ) const {;}
virtual bool TypedefInfo_IsValid(TypedefInfo_t * ) const {return 0;}
virtual Long_t TypedefInfo_Property(TypedefInfo_t * ) const {return 0;}
virtual int TypedefInfo_Size(TypedefInfo_t * ) const {return 0;}
virtual const char *TypedefInfo_TrueName(TypedefInfo_t * ) const {return 0;}
virtual const char *TypedefInfo_Name(TypedefInfo_t * ) const {return 0;}
virtual const char *TypedefInfo_Title(TypedefInfo_t * ) const {return 0;}
static TInterpreter *&Instance();
ClassDef(TInterpreter,0)
};
#ifndef __CINT__
#define gInterpreter (TInterpreter::Instance())
R__EXTERN TInterpreter* (*gPtr2Interpreter)();
R__EXTERN TInterpreter* gCint;
#endif
#endif