Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. /** \file deffile.h deffiles, which speed up loading.
  2.  *  This module adds support for loading files which specify
  3.  *  which script file to look for when trying to use a specific
  4.  *  function.
  5.  */
  6.  
  7. #ifndef __deffile_h__
  8. #define __deffile_h__
  9.  
  10. #include "yacasbase.h"
  11. #include "lisphash.h"
  12.  
  13. /** LispDefFile represents one file that can be loaded just-in-time.
  14.  */
  15. class LispDefFile : public YacasBase
  16. {
  17. public:
  18.     LispDefFile(LispString * aFile);
  19.     LispDefFile(const LispDefFile& aOther);
  20.     ~LispDefFile();
  21.     void SetLoaded();
  22.     inline LispBoolean IsLoaded();
  23.     inline LispString * FileName();
  24.  
  25.     LispStringSmartPtr iFileName;
  26.     LispBoolean   iIsLoaded;
  27. };
  28.  
  29. /** LispDefFiles maintains an array of files that can be defloaded.
  30.  * When the user invokes a DefLoad on a file, an entry is added to the
  31.  * array of deffiles in the LispEnvironment class. When the function
  32.  * is called, and there is no body of rules defined for this function,
  33.  * the engine looks up the correct file to load from this associated
  34.  * has class.
  35.  */
  36. class LispEnvironment;
  37. class LispDefFiles : public LispAssociatedHash<LispDefFile>
  38. {
  39. public:
  40.     LispDefFile* File(LispString * aFileName);
  41. };
  42.  
  43. void LoadDefFile(LispEnvironment& aEnvironment, LispString * aFileName);
  44.  
  45. #include "deffile.inl"
  46.  
  47. #endif
  48.