00001 // @(#)root/meta:$Id: TInterpreter.cxx 24077 2008-05-31 19:39:09Z brun $ 00002 // Author: Fons Rademakers 01/03/96 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 ////////////////////////////////////////////////////////////////////////// 00013 // // 00014 // TInterpreter // 00015 // // 00016 // This class defines an abstract interface to a generic command line // 00017 // interpreter. // 00018 // // 00019 ////////////////////////////////////////////////////////////////////////// 00020 00021 #include "TInterpreter.h" 00022 00023 TInterpreter* (*gPtr2Interpreter)() = 0; // returns pointer to global object 00024 TInterpreter* gCint = 0; // returns pointer to global TCint object 00025 00026 ClassImp(TInterpreter) 00027 00028 //______________________________________________________________________________ 00029 TInterpreter::TInterpreter(const char *name, const char *title) 00030 : TNamed(name, title) 00031 { 00032 // TInterpreter ctor only called by derived classes. 00033 00034 gInterpreter = this; 00035 gCint = this; 00036 } 00037 00038 //______________________________________________________________________________ 00039 TInterpreter *&TInterpreter::Instance() 00040 { 00041 // returns gInterpreter global 00042 00043 static TInterpreter *instance = 0; 00044 if (gPtr2Interpreter) instance = gPtr2Interpreter(); 00045 return instance; 00046 }