home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 November / VPR9611B.ISO / vabasic / ntclnt.exe / DISK8 / data.8 / datab / INCLUDE / LIBBASE.HH < prev    next >
Text File  |  1996-07-29  |  2KB  |  60 lines

  1. //----------------------------------------------------------------
  2. // $Source: /rcs/crcs/general/libbase.hh,v $
  3. // Checked in by: $Author: alaind $
  4. // $Date: 1996/04/17 17:50:34 $            $Revision: 1.5 $
  5. //----------------------------------------------------------------
  6. //       Copyright(c) 1992, Visual Edge Software Ltd.
  7. //
  8. // ALL RIGHTS RESERVED. This notice is intended as a precaution
  9. // against inadvertent publication, and shall not be deemed to
  10. // consitute an acknowledgment that publication has occurred
  11. // nor to imply any waiver of confidentiality. The year included
  12. // in the notice is the year of the creation of the work.
  13. //----------------------------------------------------------------------
  14. // DESCRIPTION:
  15. //      This file contains the definition of the VeLibrary base
  16. //    class.  To use libraries include libmgr.hh instead
  17. //    of using VeCreateLibrary directly
  18. //----------------------------------------------------------------------
  19. #ifndef LIBBASE_HH
  20. #define LIBBASE_HH
  21.  
  22. #include <visedge.hh>
  23. #include <dllclass.hh>
  24. #include <vthread.hh>    //For VeRefCount
  25.  
  26. class VeLibraryMgr;
  27.  
  28. class VeLibrary: public VeDllBasedClass
  29. {
  30.     public:
  31.  
  32.     VVIRTUALDECL(void *) Address (const char *funcName) = 0;
  33.  
  34.     VMETHODDECL( unsigned long ) Acquire ();
  35.     VMETHODDECL( unsigned long ) Release ();
  36.  
  37.     const char *Name()    { return itsName; }
  38.  
  39.     friend class VeLibraryMgr;
  40.  
  41.     protected:
  42.  
  43.     VOPERDECL VeLibrary(const char *libName, VeLibraryMgr *myManager);
  44.     virtual VOPERDECL ~VeLibrary();
  45.  
  46.     VMETHODDECL( unsigned long ) Release (int forceUnload);
  47.  
  48.     VeLibraryMgr    *itsManager;
  49.     VeRefCount    itsRefCount;
  50.     char        *itsName;
  51. };
  52.  
  53. //
  54. // VeCreateLibrary should only be used inside VeLibraryMgr
  55. // To create a library otherwise, use a VeLibraryMgr.
  56.  
  57. VFUNCDECL(VeLibrary *) VeCreateLibrary(const char *fname, VeLibraryMgr *manager);
  58.  
  59. #endif // LIBBASE_HH
  60.