#ifndef somcm_DTS_HH_INCLUDED
#define somcm_DTS_HH_INCLUDED
/* Start Class SOMClassMgr */

// This file was generated by the IBM "DirectToSOM" emitter for C++ (V1.69)
// Generated at 08/27/95 07:19:29 EDT
// This is class: SOMClassMgr
// Mangled class name: SOMClassMgr
// SE: May 19/94

#include <som.hh>

     #pragma SOMAsDefault(on)
class SOMClass;
     #pragma SOMAsDefault(pop)
     #pragma SOMAsDefault(on)
class SOMObject;
     #pragma SOMAsDefault(pop)
     #pragma SOMAsDefault(on)
class Repository;
     #pragma SOMAsDefault(pop)
#include <somobj.hh>
#pragma SOMNonDTS(on)

#pragma SOMAsDefault(on)
class SOMClassMgr : public SOMObject {

	#pragma SOMClassName(*, "SOMClassMgr")
	#pragma SOMNoMangling(*)
	#pragma SOMNoDataDirect(*)
	#pragma SOMNonDTS(*)

     #pragma SOMClassVersion (SOMClassMgr, 1, 4)
     #pragma SOMCallstyle (oidl)
     #pragma SOMAsDefault(off)
  public :
     typedef SOMClass *SOMClassArray;
     Repository *somInterfaceRepository;

     #pragma SOMAttribute(somInterfaceRepository, virtualaccessors, nodata)
     typedef struct {
        unsigned long _maximum;
	unsigned long _length;
	SOMClass **_buffer;
     } _IDL_SEQUENCE_SOMClass;
     /* seq<         0> */ _IDL_SEQUENCE_SOMClass somRegisteredClasses;

     #pragma SOMAttribute(somRegisteredClasses, readonly, virtualaccessors, nodata)
     #pragma SOMAsDefault(pop)
     
     // Loads the class' code and initializes the class object.
     virtual SOMClass* somLoadClassFile(somId classId, long majorVersion, 
                                        long minorVersion, string file);
     
     // Real implementation supplied by subclasses.  Default implementation
     // will lookup the class name in the Interface Repository (if one is
     // available) to determine the implementation file name (ie, DLL name).
     // If this information is not available, the class name itself is
     // returned as the file name.   Subclasses may use version number
     // info to assist in deriving the file name.
     virtual string somLocateClassFile(somId classId, long majorVersion, 
                                       long minorVersion);
     
     // Lets the class manager know that the specified class is installed
     // and tells it where the class object is.
     virtual void somRegisterClass(SOMClass* classObj);
     
     // Informs the class manager that a class library has been loaded.
     // "libraryName" is the name associated with the file containing the
     // implementation(s) of the class(es) in the class library.
     // "libraryInitRtn" is the entry point of a SOMInitModule function
     // that can be used to initialize the class library.  For platforms
     // that have the capability to automatically invoke a library
     // initialization function whenever a library is loaded, a call
     // to this method should occur within the library's automatic init
     // function.
     virtual void somRegisterClassLibrary(string libraryName, 
                                          somMethodPtr libraryInitRtn);
     
     // Releases the class' code and unregisters all classes in the
     // same affinity group (see somGetRelatedClasses below).
     virtual long somUnloadClassFile(SOMClass* classObj);
     
     // Free the class object and removes the class from the SOM registry.
     // If the class caused dynamic loading to occur, it is also unloaded
     // (causing its entire affinity group to be unregistered as well).
     virtual long somUnregisterClass(SOMClass* classObj);
     
     // Starts a bracket for the current thread wherein all classes
     // that are registered are marked as permanant and cannot be
     // unregistered or unloaded.  Persistent classes brackets may be
     // nested.
     virtual void somBeginPersistentClasses();
     
     // Ends a persistent classes bracket for the current thread.
     virtual void somEndPersistentClasses();
     
     // If <affClass> is a member of an affinity group, and <newClass> is not a
     // member of any affinity group, this method adds <newClass> to the
     // same affinity group as <affClass>.  If the method succeeds it returns
     // TRUE, otherwise it returns FALSE.  Adding a class to an affinity group
     // effectively equates its lifetime with that of the other members of
     // the affinity group.
     // [Access Group]
     virtual boolean somJoinAffinityGroup(SOMClass* newClass, 
                                          SOMClass* affClass);
     
     // The name of the initialization function in the class' code file.
     // Default implementation returns (*SOMClassInitFuncName)().
     virtual string somGetInitFunction();
     
     // Returns an array of class objects that were all registered during
     // the dynamic loading of a class.	These classes are considered to
     // define an affinity group.  Any class is a member of at most one
     // affinity group.	The affinity group returned by this call is the
     // one containing the class identified by classObj.  The first element
     // in the array is the class that caused the group to be loaded, or the
     // special value -1 which means that the SOMClassMgr is currently in the
     // process of unregistering and deleting the affinity group (only
     // SOMClassMgr subclasses would ever see this value).
     // The remainder of the array (elements one thru n) consists of
     // pointers to class objects ordered in reverse chronological sequence
     // to that in which they were originally registered.  This list includes
     // the given argument, classObj, as one of its elements, as well as the
     // class, if any, returned as element[0] above.  The array is terminated
     // by a NULL pointer as the last element.  Use SOMFree to release the
     // array when it is no longer needed.  If the supplied class was not
     // dynamically loaded, it is not a member of any affinity
     // group and NULL is returned.
     // [Dynamic Group]
     virtual SOMClassArray somGetRelatedClasses(SOMClass* classObj);
     
     // Finds the class object, given its Id, if it already exists.
     // Does not load the class.  Returns NULL if the class object does
     // not yet exist.
     virtual SOMClass* somClassFromId(somId classId);
     
     // Returns the class object for the specified class.  This may result
     // in dynamic loading.  Uses somLocateClassFile to obtain the name of
     // the file where the class' code resides, then uses somFindClsInFile.
     virtual SOMClass* somFindClass(somId classId, long majorVersion, 
                                    long minorVersion);
     
     // Returns the class object for the specified class.  This may result
     // in dynamic loading.  If the class already exists <file> is ignored,
     // otherwise it is used to locate and dynamically load the class.
     // Values of 0 for major and minor version numbers bypass version checking.
     virtual SOMClass* somFindClsInFile(somId classId, long majorVersion, 
                                        long minorVersion, string file);
     
     // Merges the SOMClassMgr registry information from the receiver to
     // <targetObj>.  <targetObj> is required to be an instance of SOMClassMgr
     // or one of its subclasses.  At the completion of this operation,
     // the <targetObj> should be able to function as a replacement for the
     // receiver.  At the end of the operation the receiver object (which is
     // then in a newly uninitialized state) is freed.  Subclasses that
     // override this method should similarly transfer their sections of
     // the object and pass this method to their parent as the final step.
     // If the receiving object is the distinguished instance pointed to
     // from the global variable SOMClassMgrObject, SOMCLassMgrObject is
     // then reassigned to point to <targetObj>.
     virtual void somMergeInto(SOMObject* targetObj);
     
     // This method causes the somFindClass, somFindClsInFile, and
     // somClassFromId methods to return the class named newClassName
     // whenever they would have normally returned the class named
     // origClassName.  This effectively results in class <newClassName>
     // replacing or substituting itself for class <origClassName>.
     // Some restrictions are enforced to insure that this works well.
     // Both class <origClassName> and class <newClassName> must
     // have been already registered before issuing this method, and newClass
     // must be an immediate child of origClass.  In addition (although not
     // enforceable), no instances should exist of either class at the time
     // this method is invoked.	A return value of zero indicates success;
     // a non-zero value indicates an error was detected.
     virtual long somSubstituteClass(string origClassName, string newClassName);
     SOMClassMgr();  
     virtual ~SOMClassMgr();  
     virtual void somDumpSelfInt(long level);
     #pragma SOMReleaseOrder ( \
			      "somFindClsInFile", \
			      "somFindClass", \
			      "somClassFromId", \
			      "somRegisterClass", \
			      "somUnregisterClass", \
			      "somLocateClassFile", \
			      "somLoadClassFile", \
			      "somUnloadClassFile", \
			      "somGetInitFunction", \
			      "somMergeInto", \
			      "somGetRelatedClasses", \
			      "somSubstituteClass", \
			      "_get_somInterfaceRepository", \
			      "_set_somInterfaceRepository", \
			      "_get_somRegisteredClasses", \
			      "somBeginPersistentClasses", \
			      "somEndPersistentClasses", \
			      *, \
			      *, \
			      "somRegisterClassLibrary", \
			      "somJoinAffinityGroup")
};
#pragma SOMAsDefault(pop)

     #pragma SOMNonDTS(pop)
/* End SOMClassMgr */
#endif /* somcm_DTS_HH_INCLUDED */
