source: trunk/nom/idl/nomclassmanager.idl@ 286

Last change on this file since 286 was 281, checked in by cinc, 19 years ago

Some minor changes for the new IDL compiler

File size: 8.4 KB
Line 
1/* ***** BEGIN LICENSE BLOCK *****
2* Version: CDDL 1.0/LGPL 2.1
3*
4* The contents of this file are subject to the COMMON DEVELOPMENT AND
5* DISTRIBUTION LICENSE (CDDL) Version 1.0 (the "License"); you may not use
6* this file except in compliance with the License. You may obtain a copy of
7* the License at http://www.sun.com/cddl/
8*
9* Software distributed under the License is distributed on an "AS IS" basis,
10* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11* for the specific language governing rights and limitations under the
12* License.
13*
14* The Original Code is "NOM" Netlabs Object Model
15*
16* The Initial Developer of the Original Code is
17* netlabs.org: Chris Wohlgemuth <cinc-ml@netlabs.org>.
18* Portions created by the Initial Developer are Copyright (C) 2005-2007
19* the Initial Developer. All Rights Reserved.
20*
21* Contributor(s):
22*
23* Alternatively, the contents of this file may be used under the terms of
24* the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which
25* case the provisions of the LGPL are applicable instead of those above. If
26* you wish to allow use of your version of this file only under the terms of
27* the LGPL, and not to allow others to use your version of this file under
28* the terms of the CDDL, indicate your decision by deleting the provisions
29* above and replace them with the notice and other provisions required by the
30* LGPL. If you do not delete the provisions above, a recipient may use your
31* version of this file under the terms of any one of the CDDL or the LGPL.
32*
33* ***** END LICENSE BLOCK ***** */
34/** \file nomclassmanager.idl
35
36Class definition file for the NOM class NOMClassMgr
37*/
38
39#ifndef nomcm_idl
40#define nomcm_idl
41
42#include "nomobj.idl"
43
44/** \interface NOMClassMgr
45
46 The NOMClassMgr class provides methods for managing the whole
47 object system. One single instance is created and a pointer is to it is
48 put into the global variable \i NOMClassMgrObject.
49
50 */
51interface NOMClassMgr : NOMObject
52{
53#ifdef __NOM_IDL_COMPILER__
54 filestem=nomclassmanager;
55#endif
56 NOMCLASSVERSION(1, 0 );
57
58 /**
59 Find the class with the given nomId in the internal class list managed by the
60 class manager.
61
62 \remark This method is only a stub for now.
63
64 \par How to override
65 This method is usually not overriden.
66
67 \param classId The id of the class to be found.
68 \param ulMajorVersion This parameter is not used at the moment and should be set to 0.
69 \param ulMinorVersion This parameter is not used at the moment and should be set to 0.
70 \return
71 The class with the given name or NULL if not found.
72 */
73 PNOMObject nomFindClassFromId(in long classId,
74 in long ulMajorVersion,
75 in long ulMinorVersion);
76
77 /**
78 Find the class with the given name in the internal class list managed by the
79 class manager.
80
81 \remark
82 This method will return classes and metaclasses.
83
84 \par How to override
85 This method is usually not overriden.
86
87 \param className The name of the class to be found as a C string.
88 \param ulMajorVersion This parameter is not used at the moment and should be set to 0.
89 \param ulMinorVersion This parameter is not used at the moment and should be set to 0.
90 \return
91 The class with the given name or NULL if not found.
92 */
93 PNOMObject nomFindClassFromName(in string className,
94 in long ulMajorVersion,
95 in long ulNinorVersion);
96
97 /**
98 Register a given class in the internal list of classes.
99
100 We register mtabs as unique pointers to classes. It's possible to get every
101 information from an mtab. We don't use the class name because in case of
102 meta classes several different meta classes for creating different objects
103 may have the same name because the default meta class is always NOMClass.
104 The mtab of each of this meta classes is different.
105
106 In addition to maintaining a list of registered classes we also register the
107 mtab in a balanced binary tree for fast retrieval. The data in this tree is
108 used by nomIsObject() to check if a block of memory is actually an object by
109 checking the memories mtab pointer against the registered list of mtabs.
110
111 \remarks Classes are registered usually from within nomClassReady().
112
113 \par How to override
114 This method is usually not overriden.
115
116 \param classMtab The mtab of the class to be registered.
117 */
118 void nomRegisterClass(in gpointer classMtab);
119
120 /**
121 Get the internal list of classes.
122
123 \remarks This method is only for NOM kernel implemeters. You can gather all
124 information of this list by using provided methods.
125
126 \par How to override:
127 This method is usually not overriden.
128
129 \return
130 A pointer on the head of a GData list. Note that this is not a copy.
131
132 */
133 PGData nomGetClassList();
134
135 /**
136 This method returns a pointer to a class specific private structure holding additional
137 information. The structure is only used by the NOM kernel.
138
139 \remarks This method is only for NOM kernel implemeters.
140
141 \par How to override:
142 This method is usually not overriden.
143
144 \param className The class name as a C string.
145 \return A nomClsInfo pointer for the given class. This structure is private and only used
146 internally.
147 */
148 gpointer nomGetClassInfoPtrFromName(in string className);
149
150 /**
151 Register a method with the class manager. The data is used to find the class
152 implementing a method from the method name.
153
154 \param classMtab The mtab of a class.
155 \param chrMethodName Method to be registered.
156 */
157 void nomRegisterMethod(in gpointer classMtab, in string chrMethodName);
158
159 /**
160 Method to check if the given object is indeed an object or just arbitrary
161 storage. This is done by checking the mtab in the given object against a registered
162 list of mtabs.
163
164 \remarks You probably want to use the function nomIsObj() instead which subsequently
165 calls this method.
166
167 \par How to override:
168 This method is usually not overriden.
169
170 \param nomObject The object to be checked.
171
172 \returns True if the given object is a NOMObject.
173 */
174 boolean nomIsObject(in PNOMObject nomObject);
175
176 /**
177 This method substitutes \e oldClass with \e replacementClass. This means that after
178 replacing whenever class \e oldClass is requested \e replacementClass is returned.
179 \e oldClassNew() will create \e replacementClass objects etc.
180
181 The class \e replacementClass must be a direct subclass of \e oldClass.
182
183 \remark Both classes must already be registered with the class manager when calling this
184 method.
185
186 \par How to override:
187 This method is usually not overriden.
188
189 \param oldClass The class to be replaced
190 \param replacementClass The class which will be used instead of \e oldClass
191 \returns TRUE if replacement succeeded.
192
193 \warning
194 This method is not implemented yet.
195
196 */
197 boolean nomSubstituteClass(in string oldClass, in string replacementClass);
198
199 /**
200 Query the name of the DLL in which the class can be found. The name can be used to
201 dynamically load the DLL get the class exports and finally create the class.
202
203 \remark The returned path is in the system encoding.
204
205 \warning
206 This method is not implemented yet.
207 */
208 string nomQueryDLLForClass(in string chrClassName);
209 /**
210 Override of nomInit(). The list of methods and the list of classes are initialized
211 in that method. In addition the balanced binary tree for registering mtabs is created.
212 */
213 NOMOVERRIDE(nomInit);
214
215 /**
216 The list of registered classes. Normal classes and metaclasses are registered.
217 The method nomGetClassList() can be used to get it.
218 If doing so be aware that it's the real thing no copy.
219 */
220 NOMINSTANCEVAR(PGData gdataClassList);
221
222 /**
223 The list of registered methods.
224 */
225 NOMINSTANCEVAR(PGData gdataMethodList);
226
227 /**
228 Balanced binary tree holding the mtabs of all known classes. You can't access
229 this from the outside. It's entirely private to NOMClassMgr.
230 */
231 NOMINSTANCEVAR(PGTree pClassListTree);
232 /* nomInit : override;*/
233
234};
235
236#endif /* nomcm_idl */
237
238
239
240
241
242
243
244
245
246
Note: See TracBrowser for help on using the repository browser.