home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / somcm.hh < prev    next >
Encoding:
Text File  |  1996-02-22  |  11.0 KB  |  242 lines

  1. #ifndef _DTS_HH_INCLUDED_somcm
  2. #define _DTS_HH_INCLUDED_somcm
  3.  
  4. /* Start Interface SOMClassMgr */
  5.  
  6. // This file was generated by the IBM "DirectToSOM" emitter for C++ (V1.116)
  7. // Generated at 02/22/96 12:05:46 
  8. // The efw file is version 1.57
  9.  
  10. #ifndef som3AssignCtrl
  11. #define som3AssignCtrl somAssignCtrl
  12. #endif
  13.  
  14. #include <som.hh>
  15.  
  16.      #pragma SOMAsDefault(on)
  17. class SOMClass;
  18.      #pragma SOMAsDefault(pop)
  19.      #pragma SOMAsDefault(on)
  20. class SOMObject;
  21.      #pragma SOMAsDefault(pop)
  22.      #pragma SOMAsDefault(on)
  23. class Repository;
  24.      #pragma SOMAsDefault(pop)
  25. #ifndef _IDL_SEQUENCE_SOMClass_defined
  26. #define _IDL_SEQUENCE_SOMClass_defined
  27.      #pragma SOMAsDefault(on)
  28. class SOMClass;
  29.      #pragma SOMAsDefault(pop)
  30.      typedef struct {
  31.         unsigned long _maximum;
  32.     unsigned long _length;
  33.     SOMClass **_buffer;
  34.      } _IDL_SEQUENCE_SOMClass;
  35. #endif // _IDL_SEQUENCE_SOMClass_defined
  36. #include <somobj.hh>
  37. #pragma SOMNonDTS(on)
  38.  
  39. class
  40. #if !(defined(SOM_SOMClassMgr_Class_Source) || defined(SOM_DONT_IMPORT_CLASS_SOMClassMgr))
  41. WIN32_DLLIMPORT
  42. #else
  43. WIN32_DLLEXPORT
  44. #endif
  45. SOMClassMgr : public ::SOMObject {
  46.  
  47.      #pragma SOMClassName(*, "SOMClassMgr")
  48.      #pragma SOMNoMangling(*)
  49.      #pragma SOMNonDTS(*)
  50.  
  51.      #pragma SOMClassVersion (SOMClassMgr, 1, 4)
  52.      #pragma SOMCallstyle (oidl)
  53.      #pragma SOMAsDefault(off)
  54.  
  55.   public :
  56.      typedef ::SOMClass *SOMClassArray;
  57.      ::Repository *somInterfaceRepository;
  58.  
  59.      #pragma SOMAttribute(somInterfaceRepository, virtualaccessors, nodata)
  60.      /* seq<         0> */ _IDL_SEQUENCE_SOMClass somRegisteredClasses;
  61.  
  62.      #pragma SOMAttribute(somRegisteredClasses, readonly, virtualaccessors, nodata)
  63.      #pragma SOMAsDefault(pop)
  64.      SOMClassMgr();
  65.      SOMClassMgr(SOMClassMgr&);
  66.      virtual ~SOMClassMgr();
  67. #ifdef __EXTENDED__SOM__ASSIGNMENTS__
  68.      virtual SOMClassMgr& somAssign(SOMClassMgr&);
  69. #else
  70.      virtual SOMObject* somDefaultAssign(som3AssignCtrl*, SOMObject*);
  71. #endif
  72.  
  73.      
  74.      // Returns the class object for the specified class.  This may result
  75.      // in dynamic loading.  If the class already exists <file> is ignored,
  76.      // otherwise it is used to locate and dynamically load the class.
  77.      // Values of 0 for major and minor version numbers bypass version checking.
  78.      virtual ::SOMClass* somFindClsInFile(::somId classId, long majorVersion, 
  79.                                           long minorVersion, 
  80.                                           string file);
  81.      
  82.      // Returns the class object for the specified class.  This may result
  83.      // in dynamic loading.  Uses somLocateClassFile to obtain the name of
  84.      // the file where the class' code resides, then uses somFindClsInFile.
  85.      virtual ::SOMClass* somFindClass(::somId classId, long majorVersion, 
  86.                                       long minorVersion);
  87.      
  88.      // Finds the class object, given its Id, if it already exists.
  89.      // Does not load the class.  Returns NULL if the class object does
  90.      // not yet exist.
  91.      virtual ::SOMClass* somClassFromId(::somId classId);
  92.      
  93.      // Lets the class manager know that the specified class is installed
  94.      // and tells it where the class object is.
  95.      virtual void somRegisterClass(::SOMClass* classObj);
  96.      
  97.      // Free the class object and removes the class from the SOM registry.
  98.      // If the class caused dynamic loading to occur, it is also unloaded
  99.      // (causing its entire affinity group to be unregistered as well).
  100.      virtual long somUnregisterClass(::SOMClass* classObj);
  101.      
  102.      // Real implementation supplied by subclasses.  Default implementation
  103.      // will lookup the class name in the Interface Repository (if one is
  104.      // available) to determine the implementation file name (ie, DLL name).
  105.      // If this information is not available, the class name itself is
  106.      // returned as the file name.   Subclasses may use version number
  107.      // info to assist in deriving the file name.
  108.      virtual string somLocateClassFile(::somId classId, long majorVersion, 
  109.                                        long minorVersion);
  110.      
  111.      // Loads the class' code and initializes the class object.
  112.      virtual ::SOMClass* somLoadClassFile(::somId classId, long majorVersion, 
  113.                                           long minorVersion, 
  114.                                           string file);
  115.      
  116.      // Releases the class' code and unregisters all classes in the
  117.      // same affinity group (see somGetRelatedClasses below).
  118.      virtual long somUnloadClassFile(::SOMClass* classObj);
  119.      
  120.      // The name of the initialization function in the class' code file.
  121.      // Default implementation returns (*SOMClassInitFuncName)().
  122.      virtual string somGetInitFunction();
  123.      
  124.      // Merges the SOMClassMgr registry information from the receiver to
  125.      // <targetObj>.  <targetObj> is required to be an instance of SOMClassMgr
  126.      // or one of its subclasses.  At the completion of this operation,
  127.      // the <targetObj> should be able to function as a replacement for the
  128.      // receiver.  At the end of the operation the receiver object (which is
  129.      // then in a newly uninitialized state) is freed.  Subclasses that
  130.      // override this method should similarly transfer their sections of
  131.      // the object and pass this method to their parent as the final step.
  132.      // If the receiving object is the distinguished instance pointed to
  133.      // from the global variable SOMClassMgrObject, SOMCLassMgrObject is
  134.      // then reassigned to point to <targetObj>.
  135.      virtual void somMergeInto(::SOMObject* targetObj);
  136.      
  137.      // Returns an array of class objects that were all registered during
  138.      // the dynamic loading of a class.    These classes are considered to
  139.      // define an affinity group.  Any class is a member of at most one
  140.      // affinity group.    The affinity group returned by this call is the
  141.      // one containing the class identified by classObj.  The first element
  142.      // in the array is the class that caused the group to be loaded, or the
  143.      // special value -1 which means that the SOMClassMgr is currently in the
  144.      // process of unregistering and deleting the affinity group (only
  145.      // SOMClassMgr subclasses would ever see this value).
  146.      // The remainder of the array (elements one thru n) consists of
  147.      // pointers to class objects ordered in reverse chronological sequence
  148.      // to that in which they were originally registered.  This list includes
  149.      // the given argument, classObj, as one of its elements, as well as the
  150.      // class, if any, returned as element[0] above.  The array is terminated
  151.      // by a NULL pointer as the last element.  Use SOMFree to release the
  152.      // array when it is no longer needed.  If the supplied class was not
  153.      // dynamically loaded, it is not a member of any affinity
  154.      // group and NULL is returned.
  155.      // [Dynamic Group]
  156.      virtual SOMClassArray somGetRelatedClasses(::SOMClass* classObj);
  157.      
  158.      // This method causes the somFindClass, somFindClsInFile, and
  159.      // somClassFromId methods to return the class named newClassName
  160.      // whenever they would have normally returned the class named
  161.      // origClassName.  This effectively results in class <newClassName>
  162.      // replacing or substituting itself for class <origClassName>.
  163.      // Some restrictions are enforced to insure that this works well.
  164.      // Both class <origClassName> and class <newClassName> must
  165.      // have been already registered before issuing this method, and newClass
  166.      // must be an immediate child of origClass.  In addition (although not
  167.      // enforceable), no instances should exist of either class at the time
  168.      // this method is invoked.    A return value of zero indicates success;
  169.      // a non-zero value indicates an error was detected.
  170.      virtual long somSubstituteClass(string origClassName, string newClassName);
  171.      
  172.      // Starts a bracket for the current thread wherein all classes
  173.      // that are registered are marked as permanant and cannot be
  174.      // unregistered or unloaded.  Persistent classes brackets may be
  175.      // nested.
  176.      virtual void somBeginPersistentClasses();
  177.      
  178.      // Ends a persistent classes bracket for the current thread.
  179.      virtual void somEndPersistentClasses();
  180.      
  181.      // Informs the class manager that a class library has been loaded.
  182.      // "libraryName" is the name associated with the file containing the
  183.      // implementation(s) of the class(es) in the class library.
  184.      // "libraryInitRtn" is the entry point of a SOMInitModule function
  185.      // that can be used to initialize the class library.  For platforms
  186.      // that have the capability to automatically invoke a library
  187.      // initialization function whenever a library is loaded, a call
  188.      // to this method should occur within the library's automatic init
  189.      // function.
  190.      virtual void somRegisterClassLibrary(string libraryName, 
  191.                                           ::somMethodPtr libraryInitRtn);
  192.      
  193.      // If <affClass> is a member of an affinity group, and <newClass> is not a
  194.      // member of any affinity group, this method adds <newClass> to the
  195.      // same affinity group as <affClass>.  If the method succeeds it returns
  196.      // TRUE, otherwise it returns FALSE.  Adding a class to an affinity group
  197.      // effectively equates its lifetime with that of the other members of
  198.      // the affinity group.
  199.      // [Access Group]
  200.      virtual boolean somJoinAffinityGroup(::SOMClass* newClass, 
  201.                                           ::SOMClass* affClass);
  202.      
  203.      // Informs the class manager that a class library has been unloaded.
  204.      // "libraryName" is the name associated with the file containing the
  205.      // implementation(s) of the class(es) in the class library.
  206.      // For platforms that have the capability to automatically invoke a
  207.      // library termination function whenever a library is unloaded, a call
  208.      // to this method should occur within the library's automatic
  209.      // termination function.
  210.      virtual void somUnregisterClassLibrary(string libraryName);
  211.      virtual void somInit();
  212.      virtual void somUninit();
  213.      virtual void somDumpSelfInt(long level);
  214.      #pragma SOMReleaseOrder ( \
  215.                   "somFindClsInFile", \
  216.                   "somFindClass", \
  217.                   "somClassFromId", \
  218.                   "somRegisterClass", \
  219.                   "somUnregisterClass", \
  220.                   "somLocateClassFile", \
  221.                   "somLoadClassFile", \
  222.                   "somUnloadClassFile", \
  223.                   "somGetInitFunction", \
  224.                   "somMergeInto", \
  225.                   "somGetRelatedClasses", \
  226.                   "somSubstituteClass", \
  227.                   "_get_somInterfaceRepository", \
  228.                   "_set_somInterfaceRepository", \
  229.                   "_get_somRegisteredClasses", \
  230.                   "somBeginPersistentClasses", \
  231.                   "somEndPersistentClasses", \
  232.                   *, \
  233.                   *, \
  234.                   "somRegisterClassLibrary", \
  235.                   "somJoinAffinityGroup", \
  236.                   "somUnregisterClassLibrary")
  237. };
  238.  
  239.      #pragma SOMNonDTS(pop)
  240. /* End SOMClassMgr */
  241. #endif /* _DTS_HH_INCLUDED_somcm */
  242.