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

Last change on this file since 265 was 250, checked in by cinc, 19 years ago

Improvements for the documentation.

File size: 8.3 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
54 NOMCLASSVERSION(1, 0 );
55
56 /**
57 Find the class with the given nomId in the internal class list managed by the
58 class manager.
59
60 \remark This method is only a stub for now.
61
62 \par How to override
63 This method is usually not overriden.
64
65 \param classId The id of the class to be found.
66 \param ulMajorVersion This parameter is not used at the moment and should be set to 0.
67 \param ulMinorVersion This parameter is not used at the moment and should be set to 0.
68 \return
69 The class with the given name or NULL if not found.
70 */
71 Object nomFindClassFromId(in long classId,
72 in long ulMajorVersion,
73 in long ulMinorVersion);
74
75 /**
76 Find the class with the given name in the internal class list managed by the
77 class manager.
78
79 \remark
80 This method will return classes and metaclasses.
81
82 \par How to override
83 This method is usually not overriden.
84
85 \param className The name of the class to be found as a C string.
86 \param ulMajorVersion This parameter is not used at the moment and should be set to 0.
87 \param ulMinorVersion This parameter is not used at the moment and should be set to 0.
88 \return
89 The class with the given name or NULL if not found.
90 */
91 PNOMObject nomFindClassFromName(in string className,
92 in long ulMajorVersion,
93 in long ulNinorVersion);
94
95 /**
96 Register a given class in the internal list of classes.
97
98 We register mtabs as unique pointers to classes. It's possible to get every
99 information from an mtab. We don't use the class name because in case of
100 meta classes several different meta classes for creating different objects
101 may have the same name because the default meta class is always NOMClass.
102 The mtab of each of this meta classes is different.
103
104 In addition to maintaining a list of registered classes we also register the
105 mtab in a balanced binary tree for fast retrieval. The data in this tree is
106 used by nomIsObject() to check if a block of memory is actually an object by
107 checking the memories mtab pointer against the registered list of mtabs.
108
109 \remarks Classes are registered usually from within nomClassReady().
110
111 \par How to override
112 This method is usually not overriden.
113
114 \param classMtab The mtab of the class to be registered.
115 */
116 void nomRegisterClass(in gpointer classMtab);
117
118 /**
119 Get the internal list of classes.
120
121 \remarks This method is only for NOM kernel implemeters. You can gather all
122 information of this list by using provided methods.
123
124 \par How to override:
125 This method is usually not overriden.
126
127 \return
128 A pointer on the head of a GData list. Note that this is not a copy.
129
130 */
131 PGData nomGetClassList();
132
133 /**
134 This method returns a pointer to a class specific private structure holding additional
135 information. The structure is only used by the NOM kernel.
136
137 \remarks This method is only for NOM kernel implemeters.
138
139 \par How to override:
140 This method is usually not overriden.
141
142 \param className The class name as a C string.
143 \return A nomClsInfo pointer for the given class. This structure is private and only used
144 internally.
145 */
146 gpointer nomGetClassInfoPtrFromName(in string className);
147
148 /**
149 Register a method with the class manager. The data is used to find the class
150 implementing a method from the method name.
151
152 \param classMtab The mtab of a class.
153 \param chrMethodName Method to be registered.
154 */
155 void nomRegisterMethod(in gpointer classMtab, in string chrMethodName);
156
157 /**
158 Method to check if the given object is indeed an object or just arbitrary
159 storage. This is done by checking the mtab in the given object against a registered
160 list of mtabs.
161
162 \remarks You probably want to use the function nomIsObj() instead which subsequently
163 calls this method.
164
165 \par How to override:
166 This method is usually not overriden.
167
168 \param nomObject The object to be checked.
169
170 \returns True if the given object is a NOMObject.
171 */
172 boolean nomIsObject(in PNOMObject nomObject);
173
174 /**
175 This method substitutes \e oldClass with \e replacementClass. This means that after
176 replacing whenever class \e oldClass is requested \e replacementClass is returned.
177 \e oldClassNew() will create \e replacementClass objects etc.
178
179 The class \e replacementClass must be a direct subclass of \e oldClass.
180
181 \remark Both classes must already be registered with the class manager when calling this
182 method.
183
184 \par How to override:
185 This method is usually not overriden.
186
187 \param oldClass The class to be replaced
188 \param replacementClass The class which will be used instead of \e oldClass
189 \returns TRUE if replacement succeeded.
190
191 \warning
192 This method is not implemented yet.
193
194 */
195 boolean nomSubstituteClass(in string oldClass, in string replacementClass);
196
197 /**
198 Query the name of the DLL in which the class can be found. The name can be used to
199 dynamically load the DLL get the class exports and finally create the class.
200
201 \remark The returned path is in the system encoding.
202
203 \warning
204 This method is not implemented yet.
205 */
206 string nomQueryDLLForClass(in string chrClassName);
207 /**
208 Override of nomInit(). The list of methods and the list of classes are initialized
209 in that method. In addition the balanced binary tree for registering mtabs is created.
210 */
211 NOMOVERRIDE(nomInit);
212
213 /**
214 The list of registered classes. Normal classes and metaclasses are registered.
215 The method nomGetClassList() can be used to get it.
216 If doing so be aware that it's the real thing no copy.
217 */
218 NOMINSTANCEVAR(PGData gdataClassList);
219
220 /**
221 The list of registered methods.
222 */
223 NOMINSTANCEVAR(PGData gdataMethodList);
224
225 /**
226 Balanced binary tree holding the mtabs of all known classes. You can't access
227 this from the outside. It's entirely private to NOMClassMgr.
228 */
229 NOMINSTANCEVAR(PGTree pClassListTree);
230 /* nomInit : override;*/
231
232};
233
234#endif /* nomcm_idl */
235
236
237
238
239
240
241
242
243
244
Note: See TracBrowser for help on using the repository browser.