source: trunk/Lucide/SOURCE/sominc/somcm.xh @ 88

Last change on this file since 88 was 88, checked in by Eugene Romanenko, 15 years ago

UI improvements, save files, ability to compile plugins with gcc, saveAs for djvu plugin, djvu plugin compiled with gcc, get rid of ddjvuapi.dll

File size: 38.0 KB
Line 
1
2/*
3 * This file was generated by the SOM Compiler.
4 * FileName: somcm.xh.
5 * Generated using:
6 *     SOM Precompiler somipc: 2.29.1.17
7 *     SOM Emitter emitxh: 2.47
8 */
9
10/*
11 *   SOMClassMgr: System Object Model class manager
12 */
13
14
15#ifndef SOM_SOMClassMgr_xh
16#define SOM_SOMClassMgr_xh
17
18class SOMClassMgr;
19
20/*
21 *  [Basic Functions Group]
22 */
23
24#define SOMClassMgr_MajorVersion 1
25#define SOMClassMgr_MinorVersion 5
26
27/* C++ SOM defs */
28#include <somcls.xh>
29
30/* C++ parent defs */
31#ifndef SOM_SOMObject_xh
32#include <somobj.xh>
33#endif
34
35#ifndef SOMClassMgr_API
36#define SOMClassMgr_API
37/*
38 * -- The Class API
39 */
40
41/*
42 * Start of bindings for IDL types
43 */
44
45class SOMClass;
46class SOMObject;
47class Repository;
48typedef
49SOMClass** SOMClassMgr_SOMClassArray;
50/*
51 *  Used for SOM 1.0 binary compatibility
52 */
53
54#ifndef _IDL_SEQUENCE_SOMClass_defined
55#define _IDL_SEQUENCE_SOMClass_defined
56typedef struct {
57    unsigned long _maximum;
58    unsigned long _length;
59    SOMClass **_buffer;
60} _IDL_SEQUENCE_SOMClass;
61#endif /* _IDL_SEQUENCE_SOMClass_defined */
62
63#ifndef SOM_DONT_USE_SHORT_NAMES
64#ifndef SOMTGD_SOMClassArray
65    #ifdef SOMClassArray
66        #undef SOMClassArray
67        #define SOMTGD_SOMClassArray 1
68    #else
69        #define SOMClassArray SOMClassMgr_SOMClassArray
70    #endif /* SOMClassArray */
71#endif /* SOMTGD_SOMClassArray */
72#endif /* SOM_DONT_USE_SHORT_NAMES */
73
74#ifndef SOM_DONT_USE_SHORT_NAMES
75#endif /* SOM_DONT_USE_SHORT_NAMES */
76
77/*
78 * End of bindings for IDL types.
79 */
80
81/* A procedure to create the SOMClassMgr Class */
82SOMEXTERN SOMClass * SOMLINK SOMClassMgrNewClass(
83                integer4 majorVersion,
84                integer4 minorVersion);
85
86/* The API to the SOMClassMgr class object, and the methods it introduces. */
87SOMEXTERN struct SOMClassMgrClassDataStructure {
88        SOMClass *classObject;
89        somMToken somFindClsInFile;
90        somMToken somFindClass;
91        somMToken somClassFromId;
92        somMToken somRegisterClass;
93        somMToken somUnregisterClass;
94        somMToken somLocateClassFile;
95        somMToken somLoadClassFile;
96        somMToken somUnloadClassFile;
97        somMToken somGetInitFunction;
98        somMToken somMergeInto;
99        somMToken somGetRelatedClasses;
100        somMToken somSubstituteClass;
101        somMToken _get_somInterfaceRepository;
102        somMToken _set_somInterfaceRepository;
103        somMToken _get_somRegisteredClasses;
104        somMToken somBeginPersistentClasses;
105        somMToken somEndPersistentClasses;
106        somMToken somcmPrivate1;
107        somMToken somcmPrivate2;
108        somMToken somRegisterClassLibrary;
109        somMToken somJoinAffinityGroup;
110        somMToken somUnregisterClassLibrary;
111} SOMDLINK SOMClassMgrClassData;
112#define _SOMClassMgr SOMClassMgrClassData.classObject
113
114/* The API to parentMtabs for SOMClassMgr, and the instance data it introduces. */
115SOMEXTERN struct SOMClassMgrCClassDataStructure {
116        somMethodTabs parentMtab;
117        somDToken              instanceDataToken;
118} SOMDLINK SOMClassMgrCClassData;
119
120/*
121 * -- Typedefs for SOMClassMgr Method Procedures
122 */
123SOMEXTERNF {
124typedef SOMClass*   SOMLINK somTP_SOMClassMgr_somLoadClassFile(SOMClassMgr *somSelf,
125                somId classId,
126                long majorVersion,
127                long minorVersion,
128                string file);
129typedef somTP_SOMClassMgr_somLoadClassFile *somTD_SOMClassMgr_somLoadClassFile;
130typedef string   SOMLINK somTP_SOMClassMgr_somLocateClassFile(SOMClassMgr *somSelf,
131                somId classId,
132                long majorVersion,
133                long minorVersion);
134typedef somTP_SOMClassMgr_somLocateClassFile *somTD_SOMClassMgr_somLocateClassFile;
135typedef void   SOMLINK somTP_SOMClassMgr_somRegisterClass(SOMClassMgr *somSelf,
136                SOMClass* classObj);
137typedef somTP_SOMClassMgr_somRegisterClass *somTD_SOMClassMgr_somRegisterClass;
138typedef void   SOMLINK somTP_SOMClassMgr_somRegisterClassLibrary(SOMClassMgr *somSelf,
139                string libraryName,
140                somMethodPtr libraryInitRtn);
141typedef somTP_SOMClassMgr_somRegisterClassLibrary *somTD_SOMClassMgr_somRegisterClassLibrary;
142typedef void   SOMLINK somTP_SOMClassMgr_somUnregisterClassLibrary(SOMClassMgr *somSelf,
143                string libraryName);
144typedef somTP_SOMClassMgr_somUnregisterClassLibrary *somTD_SOMClassMgr_somUnregisterClassLibrary;
145typedef long   SOMLINK somTP_SOMClassMgr_somUnloadClassFile(SOMClassMgr *somSelf,
146                SOMClass* classObj);
147typedef somTP_SOMClassMgr_somUnloadClassFile *somTD_SOMClassMgr_somUnloadClassFile;
148typedef long   SOMLINK somTP_SOMClassMgr_somUnregisterClass(SOMClassMgr *somSelf,
149                SOMClass* classObj);
150typedef somTP_SOMClassMgr_somUnregisterClass *somTD_SOMClassMgr_somUnregisterClass;
151typedef void   SOMLINK somTP_SOMClassMgr_somBeginPersistentClasses(SOMClassMgr *somSelf);
152typedef somTP_SOMClassMgr_somBeginPersistentClasses *somTD_SOMClassMgr_somBeginPersistentClasses;
153typedef void   SOMLINK somTP_SOMClassMgr_somEndPersistentClasses(SOMClassMgr *somSelf);
154typedef somTP_SOMClassMgr_somEndPersistentClasses *somTD_SOMClassMgr_somEndPersistentClasses;
155typedef boolean   SOMLINK somTP_SOMClassMgr_somJoinAffinityGroup(SOMClassMgr *somSelf,
156                SOMClass* newClass,
157                SOMClass* affClass);
158typedef somTP_SOMClassMgr_somJoinAffinityGroup *somTD_SOMClassMgr_somJoinAffinityGroup;
159typedef string   SOMLINK somTP_SOMClassMgr_somGetInitFunction(SOMClassMgr *somSelf);
160typedef somTP_SOMClassMgr_somGetInitFunction *somTD_SOMClassMgr_somGetInitFunction;
161typedef Repository*   SOMLINK somTP_SOMClassMgr__get_somInterfaceRepository(SOMClassMgr *somSelf);
162typedef somTP_SOMClassMgr__get_somInterfaceRepository *somTD_SOMClassMgr__get_somInterfaceRepository;
163typedef void   SOMLINK somTP_SOMClassMgr__set_somInterfaceRepository(SOMClassMgr *somSelf,
164                Repository* somInterfaceRepository);
165typedef somTP_SOMClassMgr__set_somInterfaceRepository *somTD_SOMClassMgr__set_somInterfaceRepository;
166typedef _IDL_SEQUENCE_SOMClass   SOMLINK somTP_SOMClassMgr__get_somRegisteredClasses(SOMClassMgr *somSelf);
167typedef somTP_SOMClassMgr__get_somRegisteredClasses *somTD_SOMClassMgr__get_somRegisteredClasses;
168typedef SOMClassMgr_SOMClassArray   SOMLINK somTP_SOMClassMgr_somGetRelatedClasses(SOMClassMgr *somSelf,
169                SOMClass* classObj);
170typedef somTP_SOMClassMgr_somGetRelatedClasses *somTD_SOMClassMgr_somGetRelatedClasses;
171typedef SOMClass*   SOMLINK somTP_SOMClassMgr_somClassFromId(SOMClassMgr *somSelf,
172                somId classId);
173typedef somTP_SOMClassMgr_somClassFromId *somTD_SOMClassMgr_somClassFromId;
174typedef SOMClass*   SOMLINK somTP_SOMClassMgr_somFindClass(SOMClassMgr *somSelf,
175                somId classId,
176                long majorVersion,
177                long minorVersion);
178typedef somTP_SOMClassMgr_somFindClass *somTD_SOMClassMgr_somFindClass;
179typedef SOMClass*   SOMLINK somTP_SOMClassMgr_somFindClsInFile(SOMClassMgr *somSelf,
180                somId classId,
181                long majorVersion,
182                long minorVersion,
183                string file);
184typedef somTP_SOMClassMgr_somFindClsInFile *somTD_SOMClassMgr_somFindClsInFile;
185typedef void   SOMLINK somTP_SOMClassMgr_somMergeInto(SOMClassMgr *somSelf,
186                SOMObject* targetObj);
187typedef somTP_SOMClassMgr_somMergeInto *somTD_SOMClassMgr_somMergeInto;
188typedef long   SOMLINK somTP_SOMClassMgr_somSubstituteClass(SOMClassMgr *somSelf,
189                string origClassName,
190                string newClassName);
191typedef somTP_SOMClassMgr_somSubstituteClass *somTD_SOMClassMgr_somSubstituteClass;
192
193/*
194 * -- Typedefs for Reintroduced Wrapper Methods
195 */
196typedef void   SOMLINK somTP_SOMClassMgr_somDefaultInit(SOMClassMgr *somSelf,
197                som3InitCtrl* ctrl);
198typedef somTP_SOMClassMgr_somDefaultInit *somTD_SOMClassMgr_somDefaultInit;
199typedef void   SOMLINK somTP_SOMClassMgr_somDestruct(SOMClassMgr *somSelf,
200                octet doFree,
201                som3DestructCtrl* ctrl);
202typedef somTP_SOMClassMgr_somDestruct *somTD_SOMClassMgr_somDestruct;
203typedef void   SOMLINK somTP_SOMClassMgr_somDefaultCopyInit(SOMClassMgr *somSelf,
204                som3InitCtrl* ctrl,
205                SOMObject* fromObj);
206typedef somTP_SOMClassMgr_somDefaultCopyInit *somTD_SOMClassMgr_somDefaultCopyInit;
207typedef SOMClassMgr*   SOMLINK somTP_SOMClassMgr_somDefaultAssign(SOMClassMgr *somSelf,
208                som3AssignCtrl* ctrl,
209                SOMObject* fromObj);
210typedef somTP_SOMClassMgr_somDefaultAssign *somTD_SOMClassMgr_somDefaultAssign;
211typedef void   SOMLINK somTP_SOMClassMgr_somDefaultConstCopyInit(SOMClassMgr *somSelf,
212                som3InitCtrl* ctrl,
213                SOMObject* fromObj);
214typedef somTP_SOMClassMgr_somDefaultConstCopyInit *somTD_SOMClassMgr_somDefaultConstCopyInit;
215typedef void   SOMLINK somTP_SOMClassMgr_somDefaultVCopyInit(SOMClassMgr *somSelf,
216                som3InitCtrl* ctrl,
217                SOMObject* fromObj);
218typedef somTP_SOMClassMgr_somDefaultVCopyInit *somTD_SOMClassMgr_somDefaultVCopyInit;
219typedef void   SOMLINK somTP_SOMClassMgr_somDefaultConstVCopyInit(SOMClassMgr *somSelf,
220                som3InitCtrl* ctrl,
221                SOMObject* fromObj);
222typedef somTP_SOMClassMgr_somDefaultConstVCopyInit *somTD_SOMClassMgr_somDefaultConstVCopyInit;
223typedef SOMClassMgr*   SOMLINK somTP_SOMClassMgr_somDefaultConstAssign(SOMClassMgr *somSelf,
224                som3AssignCtrl* ctrl,
225                SOMObject* fromObj);
226typedef somTP_SOMClassMgr_somDefaultConstAssign *somTD_SOMClassMgr_somDefaultConstAssign;
227typedef SOMClassMgr*   SOMLINK somTP_SOMClassMgr_somDefaultVAssign(SOMClassMgr *somSelf,
228                som3AssignCtrl* ctrl,
229                SOMObject* fromObj);
230typedef somTP_SOMClassMgr_somDefaultVAssign *somTD_SOMClassMgr_somDefaultVAssign;
231typedef SOMClassMgr*   SOMLINK somTP_SOMClassMgr_somDefaultConstVAssign(SOMClassMgr *somSelf,
232                som3AssignCtrl* ctrl,
233                SOMObject* fromObj);
234typedef somTP_SOMClassMgr_somDefaultConstVAssign *somTD_SOMClassMgr_somDefaultConstVAssign;
235typedef void   SOMLINK somTP_SOMClassMgr_somInit(SOMClassMgr *somSelf);
236typedef somTP_SOMClassMgr_somInit *somTD_SOMClassMgr_somInit;
237typedef void   SOMLINK somTP_SOMClassMgr_somFree(SOMClassMgr *somSelf);
238typedef somTP_SOMClassMgr_somFree *somTD_SOMClassMgr_somFree;
239typedef void   SOMLINK somTP_SOMClassMgr_somUninit(SOMClassMgr *somSelf);
240typedef somTP_SOMClassMgr_somUninit *somTD_SOMClassMgr_somUninit;
241typedef SOMClass*   SOMLINK somTP_SOMClassMgr_somGetClass(SOMClassMgr *somSelf);
242typedef somTP_SOMClassMgr_somGetClass *somTD_SOMClassMgr_somGetClass;
243typedef string   SOMLINK somTP_SOMClassMgr_somGetClassName(SOMClassMgr *somSelf);
244typedef somTP_SOMClassMgr_somGetClassName *somTD_SOMClassMgr_somGetClassName;
245typedef long   SOMLINK somTP_SOMClassMgr_somGetSize(SOMClassMgr *somSelf);
246typedef somTP_SOMClassMgr_somGetSize *somTD_SOMClassMgr_somGetSize;
247typedef boolean   SOMLINK somTP_SOMClassMgr_somIsA(SOMClassMgr *somSelf,
248                SOMClass* aClassObj);
249typedef somTP_SOMClassMgr_somIsA *somTD_SOMClassMgr_somIsA;
250typedef boolean   SOMLINK somTP_SOMClassMgr_somIsInstanceOf(SOMClassMgr *somSelf,
251                SOMClass* aClassObj);
252typedef somTP_SOMClassMgr_somIsInstanceOf *somTD_SOMClassMgr_somIsInstanceOf;
253typedef boolean   SOMLINK somTP_SOMClassMgr_somRespondsTo(SOMClassMgr *somSelf,
254                somId mId);
255typedef somTP_SOMClassMgr_somRespondsTo *somTD_SOMClassMgr_somRespondsTo;
256typedef boolean   SOMLINK somTP_SOMClassMgr_somDispatch(SOMClassMgr *somSelf,
257                somToken* retValue,
258                somId methodId,
259                va_list ap);
260typedef somTP_SOMClassMgr_somDispatch *somTD_SOMClassMgr_somDispatch;
261typedef boolean   SOMLINK somTP_SOMClassMgr_somClassDispatch(SOMClassMgr *somSelf,
262                SOMClass* clsObj,
263                somToken* retValue,
264                somId methodId,
265                va_list ap);
266typedef somTP_SOMClassMgr_somClassDispatch *somTD_SOMClassMgr_somClassDispatch;
267typedef boolean   SOMLINK somTP_SOMClassMgr_somCastObj(SOMClassMgr *somSelf,
268                SOMClass* cls);
269typedef somTP_SOMClassMgr_somCastObj *somTD_SOMClassMgr_somCastObj;
270typedef boolean   SOMLINK somTP_SOMClassMgr_somResetObj(SOMClassMgr *somSelf);
271typedef somTP_SOMClassMgr_somResetObj *somTD_SOMClassMgr_somResetObj;
272typedef void   SOMLINK somTP_SOMClassMgr_somDispatchV(SOMClassMgr *somSelf,
273                somId methodId,
274                somId descriptor,
275                va_list ap);
276typedef somTP_SOMClassMgr_somDispatchV *somTD_SOMClassMgr_somDispatchV;
277typedef long   SOMLINK somTP_SOMClassMgr_somDispatchL(SOMClassMgr *somSelf,
278                somId methodId,
279                somId descriptor,
280                va_list ap);
281typedef somTP_SOMClassMgr_somDispatchL *somTD_SOMClassMgr_somDispatchL;
282typedef void*   SOMLINK somTP_SOMClassMgr_somDispatchA(SOMClassMgr *somSelf,
283                somId methodId,
284                somId descriptor,
285                va_list ap);
286typedef somTP_SOMClassMgr_somDispatchA *somTD_SOMClassMgr_somDispatchA;
287typedef double   SOMLINK somTP_SOMClassMgr_somDispatchD(SOMClassMgr *somSelf,
288                somId methodId,
289                somId descriptor,
290                va_list ap);
291typedef somTP_SOMClassMgr_somDispatchD *somTD_SOMClassMgr_somDispatchD;
292typedef SOMObject*   SOMLINK somTP_SOMClassMgr_somPrintSelf(SOMClassMgr *somSelf);
293typedef somTP_SOMClassMgr_somPrintSelf *somTD_SOMClassMgr_somPrintSelf;
294typedef void   SOMLINK somTP_SOMClassMgr_somDumpSelf(SOMClassMgr *somSelf,
295                long level);
296typedef somTP_SOMClassMgr_somDumpSelf *somTD_SOMClassMgr_somDumpSelf;
297typedef void   SOMLINK somTP_SOMClassMgr_somDumpSelfInt(SOMClassMgr *somSelf,
298                long level);
299typedef somTP_SOMClassMgr_somDumpSelfInt *somTD_SOMClassMgr_somDumpSelfInt;
300}
301
302#endif /* SOMClassMgr_API */
303
304
305/*
306 * -- This emitter treats Method Tokens as Thunks by default.
307 * -- Use the sc modifier "nothunks" to change this default
308 */
309#undef somresolve_
310#define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
311
312/*
313 * -- The C++ Wrapper Class for SOMClassMgr
314 */
315class SOMClassMgr : public SOMObject
316{
317/*
318 *  [Basic Functions Group]
319 */
320public:
321
322// SOMClassMgr::new creates the class object if necessary, and then uses somNewNoInit
323// to allocate memory and create the object. Initialization is in ctors.
324void *operator new(size_t)
325{
326   if (!_SOMClassMgr) SOMClassMgrNewClass(SOMClassMgr_MajorVersion,SOMClassMgr_MinorVersion);
327   return (void*)
328      SOM_Resolve(_SOMClassMgr,SOMClass,somNewNoInit)
329         ((SOMClass *)((void*)_SOMClassMgr));
330}
331
332// SOMClassMgr::delete uses somDestruct.
333void operator delete(void * obj)
334{
335   if (obj && *(void**)obj) {
336      SOM_Resolve(obj,SOMObject,somFree)
337         ((SOMObject*)obj);
338   }
339}
340
341SOMClassMgr& operator=(SOMClassMgr& fromObj)
342{
343   this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
344   return *this;
345}
346
347SOMClassMgr()
348{
349   if (*(void**)this !=
350       ((somParentMtabStructPtr)
351        (SOMClassMgrCClassData.parentMtab))->mtab)
352      return;
353   ((SOMObject*)((void*)this))->somDefaultInit(0);
354}
355
356SOMClassMgr(SOMClassMgr* fromObj)
357{
358   if (*(void**)this !=
359       ((somParentMtabStructPtr)
360        (SOMClassMgrCClassData.parentMtab))->mtab)
361      return;
362   ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
363}
364
365#ifdef __IBMCPP__
366#pragma info(nocnv,nopar)
367#endif
368SOMClassMgr(const SOMClassMgr* fromObj)
369{
370   if (*(void**)this !=
371       ((somParentMtabStructPtr)
372        (SOMClassMgrCClassData.parentMtab))->mtab)
373      return;
374   ((SOMObject*)((void*)this))->somDefaultConstCopyInit(0,((SOMObject*)((void*)fromObj)));
375}
376#ifdef __IBMCPP__
377#pragma info(restore)
378#endif
379
380
381/* method: somLoadClassFile */
382SOMClass*   somLoadClassFile(somId classId,
383                long majorVersion,
384                long minorVersion,
385                string file)
386{
387/*
388 *  Loads the class' code and initializes the class object.
389 */
390   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somLoadClassFile)
391        (this,classId,majorVersion,minorVersion,file);
392}
393
394
395/* method: somLocateClassFile */
396string   somLocateClassFile(somId classId,
397                long majorVersion,
398                long minorVersion)
399{
400/*
401 *  Real implementation supplied by subclasses.  Default implementation
402 *  will lookup the class name in the Interface Repository (if one is
403 *  available) to determine the implementation file name (ie, DLL name).
404 *  If this information is not available, the class name itself is
405 *  returned as the file name.   Subclasses may use version number
406 *  info to assist in deriving the file name.
407 */
408   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somLocateClassFile)
409        (this,classId,majorVersion,minorVersion);
410}
411
412
413/* method: somRegisterClass */
414void   somRegisterClass(SOMClass* classObj)
415{
416/*
417 *  Lets the class manager know that the specified class is installed
418 *  and tells it where the class object is.
419 */
420   SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somRegisterClass)
421        (this,classObj);
422}
423
424
425/* method: somRegisterClassLibrary */
426void   somRegisterClassLibrary(string libraryName,
427                somMethodPtr libraryInitRtn)
428{
429/*
430 *  Informs the class manager that a class library has been loaded.
431 *  "libraryName" is the name associated with the file containing the
432 *  implementation(s) of the class(es) in the class library.
433 *  "libraryInitRtn" is the entry point of a SOMInitModule function
434 *  that can be used to initialize the class library.  For platforms
435 *  that have the capability to automatically invoke a library
436 *  initialization function whenever a library is loaded, a call
437 *  to this method should occur within the library's automatic init
438 *  function.
439 */
440   SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somRegisterClassLibrary)
441        (this,libraryName,libraryInitRtn);
442}
443
444
445/* method: somUnregisterClassLibrary */
446void   somUnregisterClassLibrary(string libraryName)
447{
448/*
449 *  Informs the class manager that a class library has been unloaded.
450 *  "libraryName" is the name associated with the file containing the
451 *  implementation(s) of the class(es) in the class library.
452 *  For platforms that have the capability to automatically invoke a
453 *  library termination function whenever a library is unloaded, a call
454 *  to this method should occur within the library's automatic
455 *  termination function.
456 */
457   SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somUnregisterClassLibrary)
458        (this,libraryName);
459}
460
461
462/* method: somUnloadClassFile */
463long   somUnloadClassFile(SOMClass* classObj)
464{
465/*
466 *  Releases the class' code and unregisters all classes in the
467 *  same affinity group (see somGetRelatedClasses below).
468 */
469   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somUnloadClassFile)
470        (this,classObj);
471}
472
473
474/* method: somUnregisterClass */
475long   somUnregisterClass(SOMClass* classObj)
476{
477/*
478 *  Free the class object and removes the class from the SOM registry.
479 *  If the class caused dynamic loading to occur, it is also unloaded
480 *  (causing its entire affinity group to be unregistered as well).
481 */
482   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somUnregisterClass)
483        (this,classObj);
484}
485
486
487/* method: somBeginPersistentClasses */
488void   somBeginPersistentClasses()
489{
490/*
491 *  Starts a bracket for the current thread wherein all classes
492 *  that are registered are marked as permanant and cannot be
493 *  unregistered or unloaded.  Persistent classes brackets may be
494 *  nested.
495 */
496   SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somBeginPersistentClasses)
497        (this);
498}
499
500
501/* method: somEndPersistentClasses */
502void   somEndPersistentClasses()
503{
504/*
505 *  Ends a persistent classes bracket for the current thread.
506 */
507   SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somEndPersistentClasses)
508        (this);
509}
510
511
512/* method: somJoinAffinityGroup */
513boolean   somJoinAffinityGroup(SOMClass* newClass,
514                SOMClass* affClass)
515{
516/*
517 *  If <affClass> is a member of an affinity group, and <newClass> is not a
518 *  member of any affinity group, this method adds <newClass> to the
519 *  same affinity group as <affClass>.  If the method succeeds it returns
520 *  TRUE, otherwise it returns FALSE.  Adding a class to an affinity group
521 *  effectively equates its lifetime with that of the other members of
522 *  the affinity group.
523 *  [Access Group]
524 */
525   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somJoinAffinityGroup)
526        (this,newClass,affClass);
527}
528
529
530/* method: somGetInitFunction */
531string   somGetInitFunction()
532{
533/*
534 *  The name of the initialization function in the class' code file.
535 *  Default implementation returns (*SOMClassInitFuncName)().
536 */
537   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somGetInitFunction)
538        (this);
539}
540
541
542/* method: _get_somInterfaceRepository */
543Repository*   _get_somInterfaceRepository()
544{
545/*
546 *  The Repository object that provides access to the Interface Repository,
547 *  If no Interface Repository has yet been assigned to this attribute,
548 *  and the SOMClassMgr is unable to load and instantiate it, the attribute
549 *  will have the value NULL.  When finished using the Repository object
550 *  you should release your reference using the somDestruct method with
551 *  a non-zero <doFree> parameter.
552 */
553   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,_get_somInterfaceRepository)
554        (this);
555}
556
557
558/* method: _set_somInterfaceRepository */
559void   _set_somInterfaceRepository(Repository* somInterfaceRepository)
560{
561/*
562 *  The Repository object that provides access to the Interface Repository,
563 *  If no Interface Repository has yet been assigned to this attribute,
564 *  and the SOMClassMgr is unable to load and instantiate it, the attribute
565 *  will have the value NULL.  When finished using the Repository object
566 *  you should release your reference using the somDestruct method with
567 *  a non-zero <doFree> parameter.
568 */
569   SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,_set_somInterfaceRepository)
570        (this,somInterfaceRepository);
571}
572
573
574/* method: _get_somRegisteredClasses */
575_IDL_SEQUENCE_SOMClass   _get_somRegisteredClasses()
576{
577/*
578 *  A list of all classes currently registered in this process.
579 */
580   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,_get_somRegisteredClasses)
581        (this);
582}
583
584
585/* method: somGetRelatedClasses */
586SOMClassMgr_SOMClassArray   somGetRelatedClasses(SOMClass* classObj)
587{
588/*
589 *  Returns an array of class objects that were all registered during
590 *  the dynamic loading of a class.    These classes are considered to
591 *  define an affinity group.  Any class is a member of at most one
592 *  affinity group.    The affinity group returned by this call is the
593 *  one containing the class identified by classObj.  The first element
594 *  in the array is the class that caused the group to be loaded, or the
595 *  special value -1 which means that the SOMClassMgr is currently in the
596 *  process of unregistering and deleting the affinity group (only
597 *  SOMClassMgr subclasses would ever see this value).
598 *  The remainder of the array (elements one thru n) consists of
599 *  pointers to class objects ordered in reverse chronological sequence
600 *  to that in which they were originally registered.  This list includes
601 *  the given argument, classObj, as one of its elements, as well as the
602 *  class, if any, returned as element[0] above.  The array is terminated
603 *  by a NULL pointer as the last element.  Use SOMFree to release the
604 *  array when it is no longer needed.  If the supplied class was not
605 *  dynamically loaded, it is not a member of any affinity
606 *  group and NULL is returned.
607 *  [Dynamic Group]
608 */
609   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somGetRelatedClasses)
610        (this,classObj);
611}
612
613
614/* method: somClassFromId */
615SOMClass*   somClassFromId(somId classId)
616{
617/*
618 *  Finds the class object, given its Id, if it already exists.
619 *  Does not load the class.  Returns NULL if the class object does
620 *  not yet exist.
621 */
622   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somClassFromId)
623        (this,classId);
624}
625
626
627/* method: somFindClass */
628SOMClass*   somFindClass(somId classId,
629                long majorVersion,
630                long minorVersion)
631{
632/*
633 *  Returns the class object for the specified class.  This may result
634 *  in dynamic loading.  Uses somLocateClassFile to obtain the name of
635 *  the file where the class' code resides, then uses somFindClsInFile.
636 */
637   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somFindClass)
638        (this,classId,majorVersion,minorVersion);
639}
640
641
642/* method: somFindClsInFile */
643SOMClass*   somFindClsInFile(somId classId,
644                long majorVersion,
645                long minorVersion,
646                string file)
647{
648/*
649 *  Returns the class object for the specified class.  This may result
650 *  in dynamic loading.  If the class already exists <file> is ignored,
651 *  otherwise it is used to locate and dynamically load the class.
652 *  Values of 0 for major and minor version numbers bypass version checking.
653 */
654   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somFindClsInFile)
655        (this,classId,majorVersion,minorVersion,file);
656}
657
658
659/* method: somMergeInto */
660void   somMergeInto(SOMObject* targetObj)
661{
662/*
663 *  Merges the SOMClassMgr registry information from the receiver to
664 *  <targetObj>.  <targetObj> is required to be an instance of SOMClassMgr
665 *  or one of its subclasses.  At the completion of this operation,
666 *  the <targetObj> should be able to function as a replacement for the
667 *  receiver.  At the end of the operation the receiver object (which is
668 *  then in a newly uninitialized state) is freed.  Subclasses that
669 *  override this method should similarly transfer their sections of
670 *  the object and pass this method to their parent as the final step.
671 *  If the receiving object is the distinguished instance pointed to
672 *  from the global variable SOMClassMgrObject, SOMCLassMgrObject is
673 *  then reassigned to point to <targetObj>.
674 */
675   SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somMergeInto)
676        (this,targetObj);
677}
678
679
680/* method: somSubstituteClass */
681long   somSubstituteClass(string origClassName,
682                string newClassName)
683{
684/*
685 *  This method causes the somFindClass, somFindClsInFile, and
686 *  somClassFromId methods to return the class named newClassName
687 *  whenever they would have normally returned the class named
688 *  origClassName.  This effectively results in class <newClassName>
689 *  replacing or substituting itself for class <origClassName>.
690 *  Some restrictions are enforced to insure that this works well.
691 *  Both class <origClassName> and class <newClassName> must
692 *  have been already registered before issuing this method, and newClass
693 *  must be an immediate child of origClass.  In addition (although not
694 *  enforceable), no instances should exist of either class at the time
695 *  this method is invoked.    A return value of zero indicates success;
696 *  a non-zero value indicates an error was detected.
697 */
698   return SOM_ResolveD(this,SOMClassMgr,SOMClassMgr,somSubstituteClass)
699        (this,origClassName,newClassName);
700}
701
702
703/*
704 * Reintroduce inherited methods
705 */
706
707/* initializer method: somDefaultInit */
708void   somDefaultInit(som3InitCtrl* ctrl)
709{
710/*
711 *  A default initializer for a SOM object. Passing a null ctrl
712 *  indicates to the receiver that its class is the class of the
713 *  object being initialized, whereby the initializer will determine
714 *  an appropriate control structure.
715 */
716   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultInit)
717        (this,ctrl);
718}
719
720
721/* method: somDestruct */
722void   somDestruct(octet doFree,
723                som3DestructCtrl* ctrl)
724{
725/*
726 *  The default destructor for a SOM object. A nonzero <doFree>
727 *  indicates that the object storage should be freed by the
728 *  object's class (via somDeallocate) after uninitialization.
729 *  As with somDefaultInit, a null ctrl can be passed.
730 */
731   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDestruct)
732        (this,doFree,ctrl);
733}
734
735
736/* initializer method: somDefaultCopyInit */
737void   somDefaultCopyInit(som3InitCtrl* ctrl,
738                SOMObject* fromObj)
739{
740/*
741 *  A default copy constructor. Use this to make copies of objects for
742 *  calling methods with "by-value" argument semantics.
743 */
744   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultCopyInit)
745        (this,ctrl,fromObj);
746}
747
748
749/* method: somDefaultAssign */
750SOMClassMgr*  somDefaultAssign(som3AssignCtrl* ctrl,
751                SOMObject* fromObj)
752{
753/*
754 *  A default assignment operator. Use this to "assign" the state of one
755 *  object to another.
756 */
757   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultAssign)
758        (this,ctrl,fromObj);
759}
760
761
762/* initializer method: somDefaultConstCopyInit */
763void   somDefaultConstCopyInit(som3InitCtrl* ctrl,
764                SOMObject* fromObj)
765{
766/*
767 *  A default copy constructor that uses a const fromObj.
768 */
769   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultConstCopyInit)
770        (this,ctrl,fromObj);
771}
772
773
774/* initializer method: somDefaultVCopyInit */
775void   somDefaultVCopyInit(som3InitCtrl* ctrl,
776                SOMObject* fromObj)
777{
778/*
779 *  A default copy constructor that uses a volatile fromObj.
780 */
781   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultVCopyInit)
782        (this,ctrl,fromObj);
783}
784
785
786/* initializer method: somDefaultConstVCopyInit */
787void   somDefaultConstVCopyInit(som3InitCtrl* ctrl,
788                SOMObject* fromObj)
789{
790/*
791 *  A default copy constructor that uses a const volatile fromObj.
792 */
793   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultConstVCopyInit)
794        (this,ctrl,fromObj);
795}
796
797
798/* method: somDefaultConstAssign */
799SOMClassMgr*  somDefaultConstAssign(som3AssignCtrl* ctrl,
800                SOMObject* fromObj)
801{
802/*
803 *  A default assignment operator that uses a const fromObj.
804 */
805   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultConstAssign)
806        (this,ctrl,fromObj);
807}
808
809
810/* method: somDefaultVAssign */
811SOMClassMgr*  somDefaultVAssign(som3AssignCtrl* ctrl,
812                SOMObject* fromObj)
813{
814/*
815 *  A default assignment operator that uses a volatile fromObj.
816 */
817   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultVAssign)
818        (this,ctrl,fromObj);
819}
820
821
822/* method: somDefaultConstVAssign */
823SOMClassMgr*  somDefaultConstVAssign(som3AssignCtrl* ctrl,
824                SOMObject* fromObj)
825{
826/*
827 *  A default assignment operator that uses a const volatile fromObj.
828 */
829   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somDefaultConstVAssign)
830        (this,ctrl,fromObj);
831}
832
833
834/* method: somInit */
835void   somInit()
836{
837/*
838 *  Obsolete but still supported. Override somDefaultInit instead of somInit.
839 */
840   SOM_ResolveD(this,SOMClassMgr,SOMObject,somInit)
841        (this);
842}
843
844
845/* method: somFree */
846void   somFree()
847{
848/*
849 *  Use as directed by framework implementations.
850 */
851   SOM_ResolveD(this,SOMClassMgr,SOMObject,somFree)
852        (this);
853}
854
855
856/* method: somUninit */
857void   somUninit()
858{
859/*
860 *  Obsolete but still supported. Override somDestruct instead of somUninit.
861 */
862   SOM_ResolveD(this,SOMClassMgr,SOMObject,somUninit)
863        (this);
864}
865
866
867/* method: somGetClass */
868SOMClass*   somGetClass()
869{
870/*
871 *  Return the receiver's class.
872 */
873   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somGetClass)
874        (this);
875}
876
877
878/* method: somGetClassName */
879string   somGetClassName()
880{
881/*
882 *  Return the name of the receiver's class.
883 */
884   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somGetClassName)
885        (this);
886}
887
888
889/* method: somGetSize */
890long   somGetSize()
891{
892/*
893 *  Return the size of the receiver.
894 */
895   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somGetSize)
896        (this);
897}
898
899
900/* method: somIsA */
901boolean   somIsA(SOMClass* aClassObj)
902{
903/*
904 *  Returns 1 (true) if the receiver responds to methods
905 *  introduced by <aClassObj>, and 0 (false) otherwise.
906 */
907   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somIsA)
908        (this,aClassObj);
909}
910
911
912/* method: somIsInstanceOf */
913boolean   somIsInstanceOf(SOMClass* aClassObj)
914{
915/*
916 *  Returns 1 (true) if the receiver is an instance of
917 *  <aClassObj> and 0 (false) otherwise.
918 */
919   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somIsInstanceOf)
920        (this,aClassObj);
921}
922
923
924/* method: somRespondsTo */
925boolean   somRespondsTo(somId mId)
926{
927/*
928 *  Returns 1 (true) if the indicated method can be invoked
929 *  on the receiver and 0 (false) otherwise.
930 */
931   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somRespondsTo)
932        (this,mId);
933}
934
935
936/* va_list method: somDispatch */
937
938/*
939 *  This method provides a generic, class-specific dispatch mechanism.
940 *  It accepts as input <retValue> a pointer to the memory area to be
941 *  loaded with the result of dispatching the method indicated by
942 *  <methodId> using the arguments in <ap>. <ap> contains the object
943 *  on which the method is to be invoked as the first argument.
944 */
945/* the va_list invocation form */
946boolean   SOMClassMgr_somDispatch(somToken* retValue,
947                somId methodId,
948                va_list ap)
949{return SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatch)
950        (this,retValue,methodId,ap);
951}
952
953/* the varargs invocation form */
954boolean   somDispatch(somToken* retValue,
955                somId methodId,
956                ...)
957{
958/*
959 *  This method provides a generic, class-specific dispatch mechanism.
960 *  It accepts as input <retValue> a pointer to the memory area to be
961 *  loaded with the result of dispatching the method indicated by
962 *  <methodId> using the arguments in <ap>. <ap> contains the object
963 *  on which the method is to be invoked as the first argument.
964 */
965   va_list ap;
966   va_start(ap, methodId);
967   boolean __somResult =
968      SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatch)
969        (this,retValue,methodId,ap);
970   va_end(ap);
971   return __somResult;
972}
973
974
975/* va_list method: somClassDispatch */
976
977/*
978 *  Like somDispatch, but method resolution for static methods is done
979 *  according to the clsObj instance method table.
980 */
981/* the va_list invocation form */
982boolean   SOMClassMgr_somClassDispatch(SOMClass* clsObj,
983                somToken* retValue,
984                somId methodId,
985                va_list ap)
986{return SOM_ResolveD(this,SOMClassMgr,SOMObject,somClassDispatch)
987        (this,clsObj,retValue,methodId,ap);
988}
989
990/* the varargs invocation form */
991boolean   somClassDispatch(SOMClass* clsObj,
992                somToken* retValue,
993                somId methodId,
994                ...)
995{
996/*
997 *  Like somDispatch, but method resolution for static methods is done
998 *  according to the clsObj instance method table.
999 */
1000   va_list ap;
1001   va_start(ap, methodId);
1002   boolean __somResult =
1003      SOM_ResolveD(this,SOMClassMgr,SOMObject,somClassDispatch)
1004        (this,clsObj,retValue,methodId,ap);
1005   va_end(ap);
1006   return __somResult;
1007}
1008
1009
1010/* method: somCastObj */
1011boolean   somCastObj(SOMClass* cls)
1012{
1013/*
1014 *  cast the receiving object to cls (which must be an ancestor of the
1015 *  objects true class. Returns true on success.
1016 */
1017   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somCastObj)
1018        (this,cls);
1019}
1020
1021
1022/* method: somResetObj */
1023boolean   somResetObj()
1024{
1025/*
1026 *  reset an object to its true class. Returns true always.
1027 */
1028   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somResetObj)
1029        (this);
1030}
1031
1032
1033/* va_list method: somDispatchV */
1034
1035/*
1036 *  Obsolete. Use somDispatch instead.
1037 */
1038/* the va_list invocation form */
1039void   SOMClassMgr_somDispatchV(somId methodId,
1040                somId descriptor,
1041                va_list ap)
1042{   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatchV)
1043        (this,methodId,descriptor,ap);
1044}
1045
1046/* the varargs invocation form */
1047void   somDispatchV(somId methodId,
1048                somId descriptor,
1049                ...)
1050{
1051/*
1052 *  Obsolete. Use somDispatch instead.
1053 */
1054   va_list ap;
1055   va_start(ap, descriptor);
1056   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatchV)
1057        (this,methodId,descriptor,ap);
1058   va_end(ap);
1059}
1060
1061
1062/* va_list method: somDispatchL */
1063
1064/*
1065 *  Obsolete. Use somDispatch instead.
1066 */
1067/* the va_list invocation form */
1068long   SOMClassMgr_somDispatchL(somId methodId,
1069                somId descriptor,
1070                va_list ap)
1071{return SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatchL)
1072        (this,methodId,descriptor,ap);
1073}
1074
1075/* the varargs invocation form */
1076long   somDispatchL(somId methodId,
1077                somId descriptor,
1078                ...)
1079{
1080/*
1081 *  Obsolete. Use somDispatch instead.
1082 */
1083   va_list ap;
1084   va_start(ap, descriptor);
1085   long __somResult =
1086      SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatchL)
1087        (this,methodId,descriptor,ap);
1088   va_end(ap);
1089   return __somResult;
1090}
1091
1092
1093/* va_list method: somDispatchA */
1094
1095/*
1096 *  Obsolete. Use somDispatch instead.
1097 */
1098/* the va_list invocation form */
1099void*   SOMClassMgr_somDispatchA(somId methodId,
1100                somId descriptor,
1101                va_list ap)
1102{return SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatchA)
1103        (this,methodId,descriptor,ap);
1104}
1105
1106/* the varargs invocation form */
1107void*   somDispatchA(somId methodId,
1108                somId descriptor,
1109                ...)
1110{
1111/*
1112 *  Obsolete. Use somDispatch instead.
1113 */
1114   va_list ap;
1115   va_start(ap, descriptor);
1116   void* __somResult =
1117      SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatchA)
1118        (this,methodId,descriptor,ap);
1119   va_end(ap);
1120   return __somResult;
1121}
1122
1123
1124/* va_list method: somDispatchD */
1125
1126/*
1127 *  Obsolete. Use somDispatch instead.
1128 */
1129/* the va_list invocation form */
1130double   SOMClassMgr_somDispatchD(somId methodId,
1131                somId descriptor,
1132                va_list ap)
1133{return SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatchD)
1134        (this,methodId,descriptor,ap);
1135}
1136
1137/* the varargs invocation form */
1138double   somDispatchD(somId methodId,
1139                somId descriptor,
1140                ...)
1141{
1142/*
1143 *  Obsolete. Use somDispatch instead.
1144 */
1145   va_list ap;
1146   va_start(ap, descriptor);
1147   double __somResult =
1148      SOM_ResolveD(this,SOMClassMgr,SOMObject,somDispatchD)
1149        (this,methodId,descriptor,ap);
1150   va_end(ap);
1151   return __somResult;
1152}
1153
1154
1155/* method: somPrintSelf */
1156SOMObject*   somPrintSelf()
1157{
1158/*
1159 *  Uses <SOMOutCharRoutine> to write a brief string with identifying
1160 *  information about this object.  The default implementation just gives
1161 *  the object's class name and its address in memory.
1162 *  <self> is returned.
1163 */
1164   return SOM_ResolveD(this,SOMClassMgr,SOMObject,somPrintSelf)
1165        (this);
1166}
1167
1168
1169/* method: somDumpSelf */
1170void   somDumpSelf(long level)
1171{
1172/*
1173 *  Uses <SOMOutCharRoutine> to write a detailed description of this object
1174 *  and its current state.
1175 *
1176 *  <level> indicates the nesting level for describing compound objects
1177 *  it must be greater than or equal to zero.  All lines in the
1178 *  description will be preceeded by <2*level> spaces.
1179 *
1180 *  This routine only actually writes the data that concerns the object
1181 *  as a whole, such as class, and uses <somDumpSelfInt> to describe
1182 *  the object's current state.  This approach allows readable
1183 *  descriptions of compound objects to be constructed.
1184 *
1185 *  Generally it is not necessary to override this method, if it is
1186 *  overriden it generally must be completely replaced.
1187 */
1188   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDumpSelf)
1189        (this,level);
1190}
1191
1192
1193/* method: somDumpSelfInt */
1194void   somDumpSelfInt(long level)
1195{
1196/*
1197 *  Uses <SOMOutCharRoutine> to write in the current state of this object.
1198 *  Generally this method will need to be overridden.  When overriding
1199 *  it, begin by calling the parent class form of this method and then
1200 *  write in a description of your class's instance data. This will
1201 *  result in a description of all the object's instance data going
1202 *  from its root ancestor class to its specific class.
1203 */
1204   SOM_ResolveD(this,SOMClassMgr,SOMObject,somDumpSelfInt)
1205        (this,level);
1206}
1207
1208
1209
1210};   /* SOMClassMgr */
1211
1212
1213
1214#endif       /* SOM_SOMClassMgr_xh */
Note: See TracBrowser for help on using the repository browser.