2018-10-12 09:09:45 +00:00
|
|
|
interface ClassInterface
|
|
|
|
{
|
|
|
|
method name.
|
|
|
|
method superclass.
|
|
|
|
}
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
//
|
|
|
|
// the Class object should be a variable-pointer object because
|
|
|
|
// it needs to accomodate class instance variables.
|
|
|
|
//
|
2019-09-22 15:59:09 +00:00
|
|
|
class(#pointer,#limited,#uncopyable) Class(Apex) [ClassInterface]
|
2015-10-08 14:26:04 +00:00
|
|
|
{
|
2019-10-12 04:21:23 +00:00
|
|
|
var name, instmthdic, classmthdic, nsup, nsdic.
|
|
|
|
var spec, selfspec, superclass, subclasses, modname.
|
2017-04-24 14:32:21 +00:00
|
|
|
var instvars, classinstvars, classvars, pooldics.
|
2017-06-16 09:45:22 +00:00
|
|
|
var trsize, trgc, initv, initv_ci.
|
2016-05-03 10:10:28 +00:00
|
|
|
|
2017-05-20 02:27:48 +00:00
|
|
|
method(#class) initialize { ^self }
|
2016-05-03 10:10:28 +00:00
|
|
|
|
2019-06-19 12:38:09 +00:00
|
|
|
/* most of the following methods can actually become class methods of Apex.
|
|
|
|
* if the instance varibles can be made accessible from the Apex class. */
|
2017-05-20 02:27:48 +00:00
|
|
|
method name { ^self.name }
|
|
|
|
method superclass { ^self.superclass }
|
2016-05-03 10:10:28 +00:00
|
|
|
|
2017-01-06 09:53:40 +00:00
|
|
|
method specNumInstVars
|
2016-05-03 10:10:28 +00:00
|
|
|
{
|
2019-06-27 06:29:09 +00:00
|
|
|
// shift right by 8 bits.
|
|
|
|
// see MOO_CLASS_SPEC_NAMED_INSTVARS in moo-prv.h for details.
|
2017-05-08 16:00:55 +00:00
|
|
|
^self.spec bitShift: -8
|
2016-05-03 10:10:28 +00:00
|
|
|
}
|
|
|
|
|
2019-06-19 12:38:09 +00:00
|
|
|
/*method inheritsFrom: aSuperclass
|
2016-05-03 10:10:28 +00:00
|
|
|
{
|
|
|
|
| c |
|
|
|
|
c := self superclass.
|
|
|
|
[c notNil] whileTrue: [
|
|
|
|
[ c == aSuperclass ] ifTrue: [^true].
|
|
|
|
c := c superclass.
|
|
|
|
].
|
|
|
|
^false
|
2019-06-19 12:38:09 +00:00
|
|
|
}*/
|
2017-03-23 16:14:22 +00:00
|
|
|
|
2017-05-20 02:27:48 +00:00
|
|
|
method nsup { ^self.nsup }
|
|
|
|
method nsdic { ^self.nsdic }
|
2015-10-08 14:26:04 +00:00
|
|
|
}
|
2018-07-08 17:13:10 +00:00
|
|
|
|
2019-09-22 15:59:09 +00:00
|
|
|
class(#pointer,#limited,#uncopyable) Interface(Apex)
|
2018-07-08 17:13:10 +00:00
|
|
|
{
|
2019-10-12 04:21:23 +00:00
|
|
|
var name, instmthdic, classmthdic, nsup, nsdic.
|
2018-07-08 17:13:10 +00:00
|
|
|
}
|