source: trunk/nom/idl/nomcls.idl@ 321

Last change on this file since 321 was 294, checked in by cinc, 19 years ago

Added ID to object mtab.

File size: 6.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-2006
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 nomcls.idl
35
36Class definition file for NOM class NOMClass the root metaclass.
37*/
38#ifndef NOMCLS_IDL_INCLUDED
39#define NOMCLS_IDL_INCLUDED
40
41#include "nomobj.idl"
42
43//NOMCLASSNAME(NOMClass);
44
45/** \interface NOMClass
46
47 This is the root class for metaclasses.
48
49 */
50interface NOMClass:NOMObject
51{
52#ifdef __NOM_IDL_COMPILER__
53 filestem=nomcls;
54#endif
55
56 NOMCLASSVERSION(1, 0 );
57
58 /**
59 This method is called to create an object of the class this metaclass
60 is the class object for.
61 The method uses nomAllocate() to get the amount of storage necessary to
62 hold one instance of the object to be built. When successful nomRenew()
63 is called with the allocated storage block to initalize the object.
64
65 \sa nomRenew(), nomRenewNoInit(), impl_NOMClass_nomNew()
66 */
67 PNOMObject nomNew();
68
69 /**
70 This method returns the name of the class this class object is the meta class of. This
71 means the returned string is the name of the class the metaclass creates instances of.
72
73 \remarks This method used to be called nomGetName().
74
75 \par How to override:
76 This method is usually not overriden.
77
78 \sa nomGetClassName()
79 */
80 string nomGetCreatedClassName();
81
82 /**
83 This method is called for example by nomNew() when creating a new object. It may be
84 used to create an object from a given memory block. If doing so be sure the storage
85 area is big enough to hold an objects instance.
86
87 The method first calls nomRenewNoInit() to set important object info on the memory block
88 and then calls nomInit() on the newly created object.
89
90 \par How to override:
91 This method is usually not overriden.
92
93 \sa nomNew, nomRenewNoInit(), impl_NOMClass_nomRenew()
94 */
95 PNOMObject nomRenew(in gpointer nomObj);
96
97 /**
98 Most of object creation is done in this method which is indirectly called by nomNew().
99 The block of storage given to the method is set to zero first. Setting the pointer to the
100 mtab actually makes an object from the memory.
101 If the class this object is an instance of (or any of the parent classes) did override
102 nomUnInit() the object is registered for finalization with the garbage collector. By doing
103 so it is ensured that nomUnInit() is called on the object when it's collected eventually.
104
105 This method can be used to create an object from any block of memory. It may be faster
106 creating numerous objects from one huge memory area than calling nomNew() for every single
107 object.
108
109 \remark This method does not call nomInit() on the new object. It is guaranteed that this
110 method is always called during object creation.
111
112 \par How to override:
113 This method can be overriden to track the creation of objects. When doing so
114 the parent should be called first.
115
116 \sa nomNew, nomRenew(), impl_NOMClass_nomRenewNoInit()
117 */
118 PNOMObject nomRenewNoInit(in gpointer nomObj);
119
120 /**
121 Allocate size bytes for using when creating objects.
122
123 This method uses NOMMalloc() to allocate the memory. Because NOMMalloc() is just a wrapper
124 around g_malloc() which is replaced by a garbage collected memory allocation routine the returned block of
125 memory is zeroed similar to using NOMCalloc().
126
127 \par How to override:
128 This method is usually not overriden.
129
130 \sa impl_NOMClass_nomAllocate()
131 */
132 gpointer nomAllocate(in long size);
133
134 /**
135 Free a block of memory allocated using nomAllocate(). Because NOM is using a garbage collector
136 this method does nothing. It's for compatibility with ported code.
137
138 \par How to override:
139 This method is usually not overriden.
140
141 \sa impl_NOMClass_nomDeallocate()
142 */
143 void nomDeallocate(in gpointer memptr);
144 void nomSetObjectCreateInfo(in gpointer ncpObject);
145
146 /**
147 Query the structure holding all the info needed for creating new objects.
148
149 \remarks
150 You should know what you're doing if you want to use the structure returned by this method...
151 The return type may change.
152 */
153 gpointer nomGetObjectCreateInfo();
154
155 /**
156 This method is called after the class object is built. It registers the new
157 class with the NOMClassMgrObj.
158 In addition to registering the class object the class this metaclass can create will
159 also be registered.
160
161 \remarks This method is only called by the system during class creation.
162
163 \par How to override:
164 This method is usually not overriden.
165
166 \sa impl_NOMClass_nomClassReady()
167 */
168 void nomClassReady();
169
170 /**
171 \warning
172 The type of this variable will change!
173 */
174 NOMINSTANCEVAR(gpointer ncpObject); //NOMClassPriv structure holding info about the object this class can create
175 NOMOVERRIDE(nomInit);
176
177};
178
179#endif /* NOMCLS_IDL_INCLUDED */
Note: See TracBrowser for help on using the repository browser.