home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 6.ddi / MWHC.006 / 41 < prev    next >
Encoding:
Text File  |  1992-06-07  |  1.7 KB  |  64 lines

  1. #ifndef __RWFACTORY_H__
  2. #define __RWFACTORY_H__
  3. pragma push_align_members(64);
  4.  
  5. /*
  6.  * RWFactory --- can create an instance of a registered class
  7.  *
  8.  * $Header:   E:/vcs/rw/factory.h_v   1.4   18 Mar 1992 11:28:32   KEFFER  $
  9.  *
  10.  ****************************************************************************
  11.  *
  12.  * Rogue Wave Software, Inc.
  13.  * P.O. Box 2328
  14.  * Corvallis, OR 97339
  15.  * Voice: (503) 754-3010    FAX: (503) 757-6650
  16.  *
  17.  * Copyright (C) 1989, 1990, 1991. This software is subject to copyright 
  18.  * protection under the laws of the United States and other countries.
  19.  *
  20.  ***************************************************************************
  21.  *
  22.  * $Log:   E:/vcs/rw/factory.h_v  $
  23.  * 
  24.  *    Rev 1.4   18 Mar 1992 11:28:32   KEFFER
  25.  * Initializes instance manager.
  26.  * 
  27.  *    Rev 1.3   18 Feb 1992 09:54:20   KEFFER
  28.  * 
  29.  *    Rev 1.2   12 Nov 1991 13:15:00   keffer
  30.  * Factory can now live in the DLL.
  31.  * 
  32.  *    Rev 1.1   28 Oct 1991 09:08:14   keffer
  33.  * Changed inclusions to <rw/xxx.h>
  34.  * 
  35.  */
  36.  
  37. #include "rw/rwset.h"
  38. #include "rw/procinit.h"    /* Uses instance manager */
  39.  
  40. class RWExport RWCollectable;
  41.  
  42. class RWExport RWFactory : public RWSet {
  43. public:
  44.   RWFactory();
  45.   ~RWFactory();    
  46.  
  47.   void             addFunction(userCreator, ClassID);
  48.   RWCollectable*    create(ClassID) const; // Create an instance of type ClassID
  49.   userCreator        getFunction(ClassID) const;
  50.   void            removeFunction(ClassID);
  51. };
  52.  
  53. RWFactory* rwexport    getRWFactory();
  54.  
  55. #ifdef RW_MULTI_THREAD
  56.   /* MT situation; get the proper factory from the instance manager. */
  57. # define theFactory (getRWFactory())
  58. #else
  59.   extern RWFactory* theFactory;    // The one-of-a-kind global factory.
  60. #endif
  61.  
  62. pragma pop_align_members();
  63. #endif /* __RWFACTORY_H__ */
  64.