
/*
 * This file was generated by the SOM Compiler.
 * FileName: somcm.xh.
 * Generated using:
 *     SOM Precompiler somipc: 2.29.1.17
 *     SOM Emitter emitxh: 2.47
 */

/*
 *   SOMClassMgr: System Object Model class manager
 */


#ifndef SOM_SOMClassMgr_xh
#define SOM_SOMClassMgr_xh

class SOMClassMgr;

/*
 *  [Basic Functions Group]
 */

#define SOMClassMgr_MajorVersion 1
#define SOMClassMgr_MinorVersion 5

/* C++ SOM defs */
#include <somcls.xh>

/* C++ parent defs */
#ifndef SOM_SOMObject_xh
#include <somobj.xh>
#endif

#ifndef SOMClassMgr_API
#define SOMClassMgr_API
/*
 * -- The Class API
 */

/*
 * Start of bindings for IDL types
 */

class SOMClass;
class SOMObject;
class Repository;
typedef
SOMClass** SOMClassMgr_SOMClassArray;
/*
 *  Used for SOM 1.0 binary compatibility
 */

#ifndef _IDL_SEQUENCE_SOMClass_defined
#define _IDL_SEQUENCE_SOMClass_defined
typedef struct {
    unsigned long _maximum;
    unsigned long _length;
    SOMClass **_buffer;
} _IDL_SEQUENCE_SOMClass;
#endif /* _IDL_SEQUENCE_SOMClass_defined */ 

#ifndef SOM_DONT_USE_SHORT_NAMES
#ifndef SOMTGD_SOMClassArray
    #ifdef SOMClassArray
        #undef SOMClassArray
        #define SOMTGD_SOMClassArray 1
    #else
        #define SOMClassArray SOMClassMgr_SOMClassArray
    #endif /* SOMClassArray */
#endif /* SOMTGD_SOMClassArray */
#endif /* SOM_DONT_USE_SHORT_NAMES */

#ifndef SOM_DONT_USE_SHORT_NAMES
#endif /* SOM_DONT_USE_SHORT_NAMES */

/*
 * End of bindings for IDL types.
 */

/* A procedure to create the SOMClassMgr Class */
SOMEXTERN SOMClass * SOMLINK SOMClassMgrNewClass(
		integer4 majorVersion,
		integer4 minorVersion);

/* The API to the SOMClassMgr class object, and the methods it introduces. */
SOMEXTERN struct SOMClassMgrClassDataStructure {
	SOMClass *classObject;
	somMToken somFindClsInFile;
	somMToken somFindClass;
	somMToken somClassFromId;
	somMToken somRegisterClass;
	somMToken somUnregisterClass;
	somMToken somLocateClassFile;
	somMToken somLoadClassFile;
	somMToken somUnloadClassFile;
	somMToken somGetInitFunction;
	somMToken somMergeInto;
	somMToken somGetRelatedClasses;
	somMToken somSubstituteClass;
	somMToken _get_somInterfaceRepository;
	somMToken _set_somInterfaceRepository;
	somMToken _get_somRegisteredClasses;
	somMToken somBeginPersistentClasses;
	somMToken somEndPersistentClasses;
	somMToken somcmPrivate1;
	somMToken somcmPrivate2;
	somMToken somRegisterClassLibrary;
	somMToken somJoinAffinityGroup;
	somMToken somUnregisterClassLibrary;
} SOMDLINK SOMClassMgrClassData;
#define _SOMClassMgr SOMClassMgrClassData.classObject

/* The API to parentMtabs for SOMClassMgr, and the instance data it introduces. */
SOMEXTERN struct SOMClassMgrCClassDataStructure {
	somMethodTabs parentMtab;
	somDToken              instanceDataToken;
} SOMDLINK SOMClassMgrCClassData;

/*
 * -- Typedefs for SOMClassMgr Method Procedures
 */
SOMEXTERN {
typedef SOMClass*   SOMLINK somTP_SOMClassMgr_somLoadClassFile(SOMClassMgr *somSelf, 
		somId classId, 
		long majorVersion, 
		long minorVersion, 
		string file);
typedef somTP_SOMClassMgr_somLoadClassFile *somTD_SOMClassMgr_somLoadClassFile;
typedef string   SOMLINK somTP_SOMClassMgr_somLocateClassFile(SOMClassMgr *somSelf, 
		somId classId, 
		long majorVersion, 
		long minorVersion);
typedef somTP_SOMClassMgr_somLocateClassFile *somTD_SOMClassMgr_somLocateClassFile;
typedef void   SOMLINK somTP_SOMClassMgr_somRegisterClass(SOMClassMgr *somSelf, 
		SOMClass* classObj);
typedef somTP_SOMClassMgr_somRegisterClass *somTD_SOMClassMgr_somRegisterClass;
typedef void   SOMLINK somTP_SOMClassMgr_somRegisterClassLibrary(SOMClassMgr *somSelf, 
		string libraryName, 
		somMethodPtr libraryInitRtn);
typedef somTP_SOMClassMgr_somRegisterClassLibrary *somTD_SOMClassMgr_somRegisterClassLibrary;
typedef void   SOMLINK somTP_SOMClassMgr_somUnregisterClassLibrary(SOMClassMgr *somSelf, 
		string libraryName);
typedef somTP_SOMClassMgr_somUnregisterClassLibrary *somTD_SOMClassMgr_somUnregisterClassLibrary;
typedef long   SOMLINK somTP_SOMClassMgr_somUnloadClassFile(SOMClassMgr *somSelf, 
		SOMClass* classObj);
typedef somTP_SOMClassMgr_somUnloadClassFile *somTD_SOMClassMgr_somUnloadClassFile;
typedef long   SOMLINK somTP_SOMClassMgr_somUnregisterClass(SOMClassMgr *somSelf, 
		SOMClass* classObj);
typedef somTP_SOMClassMgr_somUnregisterClass *somTD_SOMClassMgr_somUnregisterClass;
typedef void   SOMLINK somTP_SOMClassMgr_somBeginPersistentClasses(SOMClassMgr *somSelf);
typedef somTP_SOMClassMgr_somBeginPersistentClasses *somTD_SOMClassMgr_somBeginPersistentClasses;
typedef void   SOMLINK somTP_SOMClassMgr_somEndPersistentClasses(SOMClassMgr *somSelf);
typedef somTP_SOMClassMgr_somEndPersistentClasses *somTD_SOMClassMgr_somEndPersistentClasses;
typedef boolean   SOMLINK somTP_SOMClassMgr_somJoinAffinityGroup(SOMClassMgr *somSelf, 
		SOMClass* newClass, 
		SOMClass* affClass);
typedef somTP_SOMClassMgr_somJoinAffinityGroup *somTD_SOMClassMgr_somJoinAffinityGroup;
typedef string   SOMLINK somTP_SOMClassMgr_somGetInitFunction(SOMClassMgr *somSelf);
typedef somTP_SOMClassMgr_somGetInitFunction *somTD_SOMClassMgr_somGetInitFunction;
typedef Repository*   SOMLINK somTP_SOMClassMgr__get_somInterfaceRepository(SOMClassMgr *somSelf);
typedef somTP_SOMClassMgr__get_somInterfaceRepository *somTD_SOMClassMgr__get_somInterfaceRepository;
typedef void   SOMLINK somTP_SOMClassMgr__set_somInterfaceRepository(SOMClassMgr *somSelf, 
		Repository* somInterfaceRepository);
typedef somTP_SOMClassMgr__set_somInterfaceRepository *somTD_SOMClassMgr__set_somInterfaceRepository;
typedef _IDL_SEQUENCE_SOMClass   SOMLINK somTP_SOMClassMgr__get_somRegisteredClasses(SOMClassMgr *somSelf);
typedef somTP_SOMClassMgr__get_somRegisteredClasses *somTD_SOMClassMgr__get_somRegisteredClasses;
typedef SOMClassMgr_SOMClassArray   SOMLINK somTP_SOMClassMgr_somGetRelatedClasses(SOMClassMgr *somSelf, 
		SOMClass* classObj);
typedef somTP_SOMClassMgr_somGetRelatedClasses *somTD_SOMClassMgr_somGetRelatedClasses;
typedef SOMClass*   SOMLINK somTP_SOMClassMgr_somClassFromId(SOMClassMgr *somSelf, 
		somId classId);
typedef somTP_SOMClassMgr_somClassFromId *somTD_SOMClassMgr_somClassFromId;
typedef SOMClass*   SOMLINK somTP_SOMClassMgr_somFindClass(SOMClassMgr *somSelf, 
		somId classId, 
		long majorVersion, 
		long minorVersion);
typedef somTP_SOMClassMgr_somFindClass *somTD_SOMClassMgr_somFindClass;
typedef SOMClass*   SOMLINK somTP_SOMClassMgr_somFindClsInFile(SOMClassMgr *somSelf, 
		somId classId, 
		long majorVersion, 
		long minorVersion, 
		string file);
typedef somTP_SOMClassMgr_somFindClsInFile *somTD_SOMClassMgr_somFindClsInFile;
typedef void   SOMLINK somTP_SOMClassMgr_somMergeInto(SOMClassMgr *somSelf, 
		SOMObject* targetObj);
typedef somTP_SOMClassMgr_somMergeInto *somTD_SOMClassMgr_somMergeInto;
typedef long   SOMLINK somTP_SOMClassMgr_somSubstituteClass(SOMClassMgr *somSelf, 
		string origClassName, 
		string newClassName);
typedef somTP_SOMClassMgr_somSubstituteClass *somTD_SOMClassMgr_somSubstituteClass;

/*
 * -- Typedefs for Reintroduced Wrapper Methods
 */
typedef void   SOMLINK somTP_SOMClassMgr_somDefaultInit(SOMClassMgr *somSelf, 
		som3InitCtrl* ctrl);
typedef somTP_SOMClassMgr_somDefaultInit *somTD_SOMClassMgr_somDefaultInit;
typedef void   SOMLINK somTP_SOMClassMgr_somDestruct(SOMClassMgr *somSelf, 
		octet doFree, 
		som3DestructCtrl* ctrl);
typedef somTP_SOMClassMgr_somDestruct *somTD_SOMClassMgr_somDestruct;
typedef void   SOMLINK somTP_SOMClassMgr_somDefaultCopyInit(SOMClassMgr *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMClassMgr_somDefaultCopyInit *somTD_SOMClassMgr_somDefaultCopyInit;
typedef SOMClassMgr*   SOMLINK somTP_SOMClassMgr_somDefaultAssign(SOMClassMgr *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMClassMgr_somDefaultAssign *somTD_SOMClassMgr_somDefaultAssign;
typedef void   SOMLINK somTP_SOMClassMgr_somDefaultConstCopyInit(SOMClassMgr *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMClassMgr_somDefaultConstCopyInit *somTD_SOMClassMgr_somDefaultConstCopyInit;
typedef void   SOMLINK somTP_SOMClassMgr_somDefaultVCopyInit(SOMClassMgr *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMClassMgr_somDefaultVCopyInit *somTD_SOMClassMgr_somDefaultVCopyInit;
typedef void   SOMLINK somTP_SOMClassMgr_somDefaultConstVCopyInit(SOMClassMgr *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMClassMgr_somDefaultConstVCopyInit *somTD_SOMClassMgr_somDefaultConstVCopyInit;
typedef SOMClassMgr*   SOMLINK somTP_SOMClassMgr_somDefaultConstAssign(SOMClassMgr *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMClassMgr_somDefaultConstAssign *somTD_SOMClassMgr_somDefaultConstAssign;
typedef SOMClassMgr*   SOMLINK somTP_SOMClassMgr_somDefaultVAssign(SOMClassMgr *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMClassMgr_somDefaultVAssign *somTD_SOMClassMgr_somDefaultVAssign;
typedef SOMClassMgr*   SOMLINK somTP_SOMClassMgr_somDefaultConstVAssign(SOMClassMgr *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMClassMgr_somDefaultConstVAssign *somTD_SOMClassMgr_somDefaultConstVAssign;
typedef void   SOMLINK somTP_SOMClassMgr_somInit(SOMClassMgr *somSelf);
typedef somTP_SOMClassMgr_somInit *somTD_SOMClassMgr_somInit;
typedef void   SOMLINK somTP_SOMClassMgr_somFree(SOMClassMgr *somSelf);
typedef somTP_SOMClassMgr_somFree *somTD_SOMClassMgr_somFree;
typedef void   SOMLINK somTP_SOMClassMgr_somUninit(SOMClassMgr *somSelf);
typedef somTP_SOMClassMgr_somUninit *somTD_SOMClassMgr_somUninit;
typedef SOMClass*   SOMLINK somTP_SOMClassMgr_somGetClass(SOMClassMgr *somSelf);
typedef somTP_SOMClassMgr_somGetClass *somTD_SOMClassMgr_somGetClass;
typedef string   SOMLINK somTP_SOMClassMgr_somGetClassName(SOMClassMgr *somSelf);
typedef somTP_SOMClassMgr_somGetClassName *somTD_SOMClassMgr_somGetClassName;
typedef long   SOMLINK somTP_SOMClassMgr_somGetSize(SOMClassMgr *somSelf);
typedef somTP_SOMClassMgr_somGetSize *somTD_SOMClassMgr_somGetSize;
typedef boolean   SOMLINK somTP_SOMClassMgr_somIsA(SOMClassMgr *somSelf, 
		SOMClass* aClassObj);
typedef somTP_SOMClassMgr_somIsA *somTD_SOMClassMgr_somIsA;
typedef boolean   SOMLINK somTP_SOMClassMgr_somIsInstanceOf(SOMClassMgr *somSelf, 
		SOMClass* aClassObj);
typedef somTP_SOMClassMgr_somIsInstanceOf *somTD_SOMClassMgr_somIsInstanceOf;
typedef boolean   SOMLINK somTP_SOMClassMgr_somRespondsTo(SOMClassMgr *somSelf, 
		somId mId);
typedef somTP_SOMClassMgr_somRespondsTo *somTD_SOMClassMgr_somRespondsTo;
typedef boolean   SOMLINK somTP_SOMClassMgr_somDispatch(SOMClassMgr *somSelf, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_SOMClassMgr_somDispatch *somTD_SOMClassMgr_somDispatch;
typedef boolean   SOMLINK somTP_SOMClassMgr_somClassDispatch(SOMClassMgr *somSelf, 
		SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_SOMClassMgr_somClassDispatch *somTD_SOMClassMgr_somClassDispatch;
typedef boolean   SOMLINK somTP_SOMClassMgr_somCastObj(SOMClassMgr *somSelf, 
		SOMClass* cls);
typedef somTP_SOMClassMgr_somCastObj *somTD_SOMClassMgr_somCastObj;
typedef boolean   SOMLINK somTP_SOMClassMgr_somResetObj(SOMClassMgr *somSelf);
typedef somTP_SOMClassMgr_somResetObj *somTD_SOMClassMgr_somResetObj;
typedef void   SOMLINK somTP_SOMClassMgr_somDispatchV(SOMClassMgr *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_SOMClassMgr_somDispatchV *somTD_SOMClassMgr_somDispatchV;
typedef long   SOMLINK somTP_SOMClassMgr_somDispatchL(SOMClassMgr *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_SOMClassMgr_somDispatchL *somTD_SOMClassMgr_somDispatchL;
typedef void*   SOMLINK somTP_SOMClassMgr_somDispatchA(SOMClassMgr *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_SOMClassMgr_somDispatchA *somTD_SOMClassMgr_somDispatchA;
typedef double   SOMLINK somTP_SOMClassMgr_somDispatchD(SOMClassMgr *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_SOMClassMgr_somDispatchD *somTD_SOMClassMgr_somDispatchD;
typedef SOMObject*   SOMLINK somTP_SOMClassMgr_somPrintSelf(SOMClassMgr *somSelf);
typedef somTP_SOMClassMgr_somPrintSelf *somTD_SOMClassMgr_somPrintSelf;
typedef void   SOMLINK somTP_SOMClassMgr_somDumpSelf(SOMClassMgr *somSelf, 
		long level);
typedef somTP_SOMClassMgr_somDumpSelf *somTD_SOMClassMgr_somDumpSelf;
typedef void   SOMLINK somTP_SOMClassMgr_somDumpSelfInt(SOMClassMgr *somSelf, 
		long level);
typedef somTP_SOMClassMgr_somDumpSelfInt *somTD_SOMClassMgr_somDumpSelfInt;
}

#endif /* SOMClassMgr_API */


/*
 * -- This emitter treats Method Tokens as Thunks by default.
 * -- Use the sc modifier "nothunks" to change this default
 */
#undef somresolve_
#define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))

/*
 * -- The C++ Wrapper Class for SOMClassMgr
 */
class SOMClassMgr : public SOMObject
{
/*
 *  [Basic Functions Group]
 */
public:

// SOMClassMgr::new creates the class object if necessary, and then uses somNewNoInit
// to allocate memory and create the object. Initialization is in ctors.
void *operator new(size_t)
{
   if (!_SOMClassMgr) SOMClassMgrNewClass(SOMClassMgr_MajorVersion,SOMClassMgr_MinorVersion);
   return (void*)
      SOM_Resolve(_SOMClassMgr,SOMClass,somNewNoInit)
         ((SOMClass *)((void*)_SOMClassMgr));
}

// SOMClassMgr::delete uses somDestruct.
void operator delete(void * obj)
{
   if (obj && *(void**)obj) {
      SOM_Resolve(obj,SOMObject,somFree)
         ((SOMObject*)obj);
   }
}

SOMClassMgr& operator=(SOMClassMgr& fromObj)
{
   this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
   return *this;
}

SOMClassMgr()
{
   if (*(void**)this != 
       ((somParentMtabStructPtr)
        (SOMClassMgrCClassData.parentMtab))->mtab)
      return;
   ((SOMObject*)((void*)this))->somDefaultInit(0);
}

SOMClassMgr(SOMClassMgr* fromObj)
{
   if (*(void**)this != 
       ((somParentMtabStructPtr)
        (SOMClassMgrCClassData.parentMtab))->mtab)
      return;
   ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
}

#ifdef __IBMCPP__
#pragma info(nocnv,nopar)
#endif
SOMClassMgr(const SOMClassMgr* fromObj)
{
   if (*(void**)this != 
       ((somParentMtabStructPtr)
        (SOMClassMgrCClassData.parentMtab))->mtab)
      return;
   ((SOMObject*)((void*)this))->somDefaultConstCopyInit(0,((SOMObject*)((void*)fromObj)));
}
#ifdef __IBMCPP__
#pragma info(restore)
#endif


/* method: somLoadClassFile */
SOMClass*   somLoadClassFile(somId classId, 
		long majorVersion, 
		long minorVersion, 
		string file)
{
/*
 *  Loads the class' code and initializes the class object.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somLoadClassFile)
	(this,classId,majorVersion,minorVersion,file);
}


/* method: somLocateClassFile */
string   somLocateClassFile(somId classId, 
		long majorVersion, 
		long minorVersion)
{
/*
 *  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.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somLocateClassFile)
	(this,classId,majorVersion,minorVersion);
}


/* method: somRegisterClass */
void   somRegisterClass(SOMClass* classObj)
{
/*
 *  Lets the class manager know that the specified class is installed
 *  and tells it where the class object is.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somRegisterClass)
	(this,classObj);
}


/* method: somRegisterClassLibrary */
void   somRegisterClassLibrary(string libraryName, 
		somMethodPtr libraryInitRtn)
{
/*
 *  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.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somRegisterClassLibrary)
	(this,libraryName,libraryInitRtn);
}


/* method: somUnregisterClassLibrary */
void   somUnregisterClassLibrary(string libraryName)
{
/*
 *  Informs the class manager that a class library has been unloaded.
 *  "libraryName" is the name associated with the file containing the
 *  implementation(s) of the class(es) in the class library.
 *  For platforms that have the capability to automatically invoke a
 *  library termination function whenever a library is unloaded, a call
 *  to this method should occur within the library's automatic
 *  termination function.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somUnregisterClassLibrary)
	(this,libraryName);
}


/* method: somUnloadClassFile */
long   somUnloadClassFile(SOMClass* classObj)
{
/*
 *  Releases the class' code and unregisters all classes in the
 *  same affinity group (see somGetRelatedClasses below).
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somUnloadClassFile)
	(this,classObj);
}


/* method: somUnregisterClass */
long   somUnregisterClass(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).
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somUnregisterClass)
	(this,classObj);
}


/* method: somBeginPersistentClasses */
void   somBeginPersistentClasses()
{
/*
 *  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.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somBeginPersistentClasses)
	(this);
}


/* method: somEndPersistentClasses */
void   somEndPersistentClasses()
{
/*
 *  Ends a persistent classes bracket for the current thread.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somEndPersistentClasses)
	(this);
}


/* method: somJoinAffinityGroup */
boolean   somJoinAffinityGroup(SOMClass* newClass, 
		SOMClass* affClass)
{
/*
 *  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]
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somJoinAffinityGroup)
	(this,newClass,affClass);
}


/* method: somGetInitFunction */
string   somGetInitFunction()
{
/*
 *  The name of the initialization function in the class' code file.
 *  Default implementation returns (*SOMClassInitFuncName)().
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somGetInitFunction)
	(this);
}


/* method: _get_somInterfaceRepository */
Repository*   _get_somInterfaceRepository()
{
/*
 *  The Repository object that provides access to the Interface Repository,
 *  If no Interface Repository has yet been assigned to this attribute,
 *  and the SOMClassMgr is unable to load and instantiate it, the attribute
 *  will have the value NULL.  When finished using the Repository object
 *  you should release your reference using the somDestruct method with
 *  a non-zero <doFree> parameter.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,_get_somInterfaceRepository)
	(this);
}


/* method: _set_somInterfaceRepository */
void   _set_somInterfaceRepository(Repository* somInterfaceRepository)
{
/*
 *  The Repository object that provides access to the Interface Repository,
 *  If no Interface Repository has yet been assigned to this attribute,
 *  and the SOMClassMgr is unable to load and instantiate it, the attribute
 *  will have the value NULL.  When finished using the Repository object
 *  you should release your reference using the somDestruct method with
 *  a non-zero <doFree> parameter.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,_set_somInterfaceRepository)
	(this,somInterfaceRepository);
}


/* method: _get_somRegisteredClasses */
_IDL_SEQUENCE_SOMClass   _get_somRegisteredClasses()
{
/*
 *  A list of all classes currently registered in this process.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,_get_somRegisteredClasses)
	(this);
}


/* method: somGetRelatedClasses */
SOMClassMgr_SOMClassArray   somGetRelatedClasses(SOMClass* classObj)
{
/*
 *  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]
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somGetRelatedClasses)
	(this,classObj);
}


/* method: somClassFromId */
SOMClass*   somClassFromId(somId classId)
{
/*
 *  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.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somClassFromId)
	(this,classId);
}


/* method: somFindClass */
SOMClass*   somFindClass(somId classId, 
		long majorVersion, 
		long minorVersion)
{
/*
 *  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.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somFindClass)
	(this,classId,majorVersion,minorVersion);
}


/* method: somFindClsInFile */
SOMClass*   somFindClsInFile(somId classId, 
		long majorVersion, 
		long minorVersion, 
		string file)
{
/*
 *  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.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somFindClsInFile)
	(this,classId,majorVersion,minorVersion,file);
}


/* method: somMergeInto */
void   somMergeInto(SOMObject* targetObj)
{
/*
 *  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>.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somMergeInto)
	(this,targetObj);
}


/* method: somSubstituteClass */
long   somSubstituteClass(string origClassName, 
		string newClassName)
{
/*
 *  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.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somSubstituteClass)
	(this,origClassName,newClassName);
}


/*
 * Reintroduce inherited methods
 */

/* initializer method: somDefaultInit */
void   somDefaultInit(som3InitCtrl* ctrl)
{
/*
 *  A default initializer for a SOM object. Passing a null ctrl
 *  indicates to the receiver that its class is the class of the
 *  object being initialized, whereby the initializer will determine
 *  an appropriate control structure.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultInit)
	(this,ctrl);
}


/* method: somDestruct */
void   somDestruct(octet doFree, 
		som3DestructCtrl* ctrl)
{
/*
 *  The default destructor for a SOM object. A nonzero <doFree>
 *  indicates that the object storage should be freed by the
 *  object's class (via somDeallocate) after uninitialization.
 *  As with somDefaultInit, a null ctrl can be passed.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDestruct)
	(this,doFree,ctrl);
}


/* initializer method: somDefaultCopyInit */
void   somDefaultCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor. Use this to make copies of objects for
 *  calling methods with "by-value" argument semantics.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultCopyInit)
	(this,ctrl,fromObj);
}


/* method: somDefaultAssign */
SOMClassMgr*  somDefaultAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator. Use this to "assign" the state of one
 *  object to another.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultAssign)
	(this,ctrl,fromObj);
}


/* initializer method: somDefaultConstCopyInit */
void   somDefaultConstCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a const fromObj.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultConstCopyInit)
	(this,ctrl,fromObj);
}


/* initializer method: somDefaultVCopyInit */
void   somDefaultVCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a volatile fromObj.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultVCopyInit)
	(this,ctrl,fromObj);
}


/* initializer method: somDefaultConstVCopyInit */
void   somDefaultConstVCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a const volatile fromObj.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultConstVCopyInit)
	(this,ctrl,fromObj);
}


/* method: somDefaultConstAssign */
SOMClassMgr*  somDefaultConstAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a const fromObj.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultConstAssign)
	(this,ctrl,fromObj);
}


/* method: somDefaultVAssign */
SOMClassMgr*  somDefaultVAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a volatile fromObj.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultVAssign)
	(this,ctrl,fromObj);
}


/* method: somDefaultConstVAssign */
SOMClassMgr*  somDefaultConstVAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a const volatile fromObj.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultConstVAssign)
	(this,ctrl,fromObj);
}


/* method: somInit */
void   somInit()
{
/*
 *  Obsolete but still supported. Override somDefaultInit instead of somInit.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMObject,somInit)
	(this);
}


/* method: somFree */
void   somFree()
{
/*
 *  Use as directed by framework implementations.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMObject,somFree)
	(this);
}


/* method: somUninit */
void   somUninit()
{
/*
 *  Obsolete but still supported. Override somDestruct instead of somUninit.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMObject,somUninit)
	(this);
}


/* method: somGetClass */
SOMClass*   somGetClass()
{
/*
 *  Return the receiver's class.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somGetClass)
	(this);
}


/* method: somGetClassName */
string   somGetClassName()
{
/*
 *  Return the name of the receiver's class.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somGetClassName)
	(this);
}


/* method: somGetSize */
long   somGetSize()
{
/*
 *  Return the size of the receiver.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somGetSize)
	(this);
}


/* method: somIsA */
boolean   somIsA(SOMClass* aClassObj)
{
/*
 *  Returns 1 (true) if the receiver responds to methods
 *  introduced by <aClassObj>, and 0 (false) otherwise.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somIsA)
	(this,aClassObj);
}


/* method: somIsInstanceOf */
boolean   somIsInstanceOf(SOMClass* aClassObj)
{
/*
 *  Returns 1 (true) if the receiver is an instance of
 *  <aClassObj> and 0 (false) otherwise.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somIsInstanceOf)
	(this,aClassObj);
}


/* method: somRespondsTo */
boolean   somRespondsTo(somId mId)
{
/*
 *  Returns 1 (true) if the indicated method can be invoked
 *  on the receiver and 0 (false) otherwise.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somRespondsTo)
	(this,mId);
}


/* va_list method: somDispatch */

/*
 *  This method provides a generic, class-specific dispatch mechanism.
 *  It accepts as input <retValue> a pointer to the memory area to be
 *  loaded with the result of dispatching the method indicated by
 *  <methodId> using the arguments in <ap>. <ap> contains the object
 *  on which the method is to be invoked as the first argument.
 */
/* the va_list invocation form */
boolean   SOMClassMgr_somDispatch(somToken* retValue, 
		somId methodId, 
		va_list ap)
{return SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatch)
	(this,retValue,methodId,ap);
}

/* the varargs invocation form */
boolean   somDispatch(somToken* retValue, 
		somId methodId, 
		...)
{
/*
 *  This method provides a generic, class-specific dispatch mechanism.
 *  It accepts as input <retValue> a pointer to the memory area to be
 *  loaded with the result of dispatching the method indicated by
 *  <methodId> using the arguments in <ap>. <ap> contains the object
 *  on which the method is to be invoked as the first argument.
 */
   va_list ap;
   va_start(ap, methodId);
   boolean __somResult = 
      SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatch)
	(this,retValue,methodId,ap);
   va_end(ap);
   return __somResult;
}


/* va_list method: somClassDispatch */

/*
 *  Like somDispatch, but method resolution for static methods is done
 *  according to the clsObj instance method table.
 */
/* the va_list invocation form */
boolean   SOMClassMgr_somClassDispatch(SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap)
{return SOM_ResolveD(this,SOMClassMgr,SOMObject,somClassDispatch)
	(this,clsObj,retValue,methodId,ap);
}

/* the varargs invocation form */
boolean   somClassDispatch(SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		...)
{
/*
 *  Like somDispatch, but method resolution for static methods is done
 *  according to the clsObj instance method table.
 */
   va_list ap;
   va_start(ap, methodId);
   boolean __somResult = 
      SOM_ResolveD(this,SOMClassMgr,SOMObject,somClassDispatch)
	(this,clsObj,retValue,methodId,ap);
   va_end(ap);
   return __somResult;
}


/* method: somCastObj */
boolean   somCastObj(SOMClass* cls)
{
/*
 *  cast the receiving object to cls (which must be an ancestor of the
 *  objects true class. Returns true on success.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somCastObj)
	(this,cls);
}


/* method: somResetObj */
boolean   somResetObj()
{
/*
 *  reset an object to its true class. Returns true always.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somResetObj)
	(this);
}


/* va_list method: somDispatchV */

/*
 *  Obsolete. Use somDispatch instead.
 */
/* the va_list invocation form */
void   SOMClassMgr_somDispatchV(somId methodId, 
		somId descriptor, 
		va_list ap)
{   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatchV)
	(this,methodId,descriptor,ap);
}

/* the varargs invocation form */
void   somDispatchV(somId methodId, 
		somId descriptor, 
		...)
{
/*
 *  Obsolete. Use somDispatch instead.
 */
   va_list ap;
   va_start(ap, descriptor);
   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatchV)
	(this,methodId,descriptor,ap);
   va_end(ap);
}


/* va_list method: somDispatchL */

/*
 *  Obsolete. Use somDispatch instead.
 */
/* the va_list invocation form */
long   SOMClassMgr_somDispatchL(somId methodId, 
		somId descriptor, 
		va_list ap)
{return SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatchL)
	(this,methodId,descriptor,ap);
}

/* the varargs invocation form */
long   somDispatchL(somId methodId, 
		somId descriptor, 
		...)
{
/*
 *  Obsolete. Use somDispatch instead.
 */
   va_list ap;
   va_start(ap, descriptor);
   long __somResult = 
      SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatchL)
	(this,methodId,descriptor,ap);
   va_end(ap);
   return __somResult;
}


/* va_list method: somDispatchA */

/*
 *  Obsolete. Use somDispatch instead.
 */
/* the va_list invocation form */
void*   SOMClassMgr_somDispatchA(somId methodId, 
		somId descriptor, 
		va_list ap)
{return SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatchA)
	(this,methodId,descriptor,ap);
}

/* the varargs invocation form */
void*   somDispatchA(somId methodId, 
		somId descriptor, 
		...)
{
/*
 *  Obsolete. Use somDispatch instead.
 */
   va_list ap;
   va_start(ap, descriptor);
   void* __somResult = 
      SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatchA)
	(this,methodId,descriptor,ap);
   va_end(ap);
   return __somResult;
}


/* va_list method: somDispatchD */

/*
 *  Obsolete. Use somDispatch instead.
 */
/* the va_list invocation form */
double   SOMClassMgr_somDispatchD(somId methodId, 
		somId descriptor, 
		va_list ap)
{return SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatchD)
	(this,methodId,descriptor,ap);
}

/* the varargs invocation form */
double   somDispatchD(somId methodId, 
		somId descriptor, 
		...)
{
/*
 *  Obsolete. Use somDispatch instead.
 */
   va_list ap;
   va_start(ap, descriptor);
   double __somResult = 
      SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatchD)
	(this,methodId,descriptor,ap);
   va_end(ap);
   return __somResult;
}


/* method: somPrintSelf */
SOMObject*   somPrintSelf()
{
/*
 *  Uses <SOMOutCharRoutine> to write a brief string with identifying
 *  information about this object.  The default implementation just gives
 *  the object's class name and its address in memory.
 *  <self> is returned.
 */
   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somPrintSelf)
	(this);
}


/* method: somDumpSelf */
void   somDumpSelf(long level)
{
/*
 *  Uses <SOMOutCharRoutine> to write a detailed description of this object
 *  and its current state.
 * 
 *  <level> indicates the nesting level for describing compound objects
 *  it must be greater than or equal to zero.  All lines in the
 *  description will be preceeded by <2*level> spaces.
 * 
 *  This routine only actually writes the data that concerns the object
 *  as a whole, such as class, and uses <somDumpSelfInt> to describe
 *  the object's current state.  This approach allows readable
 *  descriptions of compound objects to be constructed.
 * 
 *  Generally it is not necessary to override this method, if it is
 *  overriden it generally must be completely replaced.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDumpSelf)
	(this,level);
}


/* method: somDumpSelfInt */
void   somDumpSelfInt(long level)
{
/*
 *  Uses <SOMOutCharRoutine> to write in the current state of this object.
 *  Generally this method will need to be overridden.  When overriding
 *  it, begin by calling the parent class form of this method and then
 *  write in a description of your class's instance data. This will
 *  result in a description of all the object's instance data going
 *  from its root ancestor class to its specific class.
 */
   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDumpSelfInt)
	(this,level);
}



};   /* SOMClassMgr */



#endif       /* SOM_SOMClassMgr_xh */
