ooRexx  4.2.0-source
About: ooRexx (Open Object Rexx) is a free implementation of Object Rexx. Object Rexx is an enhancement of the classic Rexx interpreter; a full-featured programming language with a human-oriented syntax.
  Fossies Dox: ooRexx-4.2.0-source.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

ClassClass.cpp
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.oorexx.org/license.html */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*----------------------------------------------------------------------------*/
38 /******************************************************************************/
39 /* REXX Kernel */
40 /* */
41 /* Primitive Class Class */
42 /* */
43 /******************************************************************************/
44 
45 #include <stdarg.h>
46 #include <string.h>
47 #include "RexxCore.h"
48 #include "StringClass.hpp"
49 #include "ListClass.hpp"
50 #include "TableClass.hpp"
51 #include "DirectoryClass.hpp"
52 #include "ArrayClass.hpp"
53 #include "SupplierClass.hpp"
54 #include "ClassClass.hpp"
55 #include "MethodClass.hpp"
56 #include "RexxActivity.hpp"
57 #include "ActivityManager.hpp"
58 #include "ProtectedObject.hpp"
59 #include "WeakReferenceClass.hpp"
60 
61 
62 // singleton class instance
64 
65 
66 void RexxClass::live(size_t liveMark)
67 /******************************************************************************/
68 /* Function: Normal garbage collection live marking */
69 /******************************************************************************/
70 {
71  memory_mark(this->objectVariables);
72  memory_mark(this->id);
76  memory_mark(this->baseClass);
77  memory_mark(this->metaClass);
82  memory_mark(this->subClasses);
83 }
84 
85 void RexxClass::liveGeneral(int reason)
86 /******************************************************************************/
87 /* Function: Generalized object marking */
88 /******************************************************************************/
89 {
90  memory_mark_general(this->objectVariables);
91  memory_mark_general(this->id);
102 }
103 
105 /******************************************************************************/
106 /* Function: Flatten an object */
107 /******************************************************************************/
108 {
109  ;
110 }
111 
113 /******************************************************************************/
114 /* Function: unflaatten an object */
115 /******************************************************************************/
116 {
117  return this;
118 }
119 
121 /******************************************************************************/
122 /* Function: Make a proxy object */
123 /******************************************************************************/
124 {
125 
126  /* Following code is pulled from */
127  /* object_primitive, to get class id*/
128  /* as a string object. */
129  /* get the class id */
130  return new_proxy(this->id->getStringData());
131 }
132 
133 
142 {
143  // always, always, always return the hash value, which will be the
144  // hash value of our id string. This is important, since we need to
145  // have a hash value that will be the same before and after the image save
146  return getHashValue();
147 }
148 
149 
156 {
157  // always, always, always return the hash value, which will be the
158  // hash value of our id string. This is important, since we need to
159  // have a hash value that will be the same before and after the image save
160  return id->getHashValue();
161 }
162 
163 
165  RexxObject *other) /* other comparison object */
166 /******************************************************************************/
167 /* Function: Compare two classes */
168 /******************************************************************************/
169 {
170  return this->equal(other); /* this is direct object equality */
171 }
172 
174  RexxObject *other) /* other comparison object */
175 /******************************************************************************/
176 /* Function: Compare two class objects as a strict compare (==) */
177 /******************************************************************************/
178 {
179  /* If a non-copied (Primitive) */
180  /*behaviour Then we can directly */
181  /*call primitive method */
182  if (this->behaviour->isPrimitive())
183  {
184  /* can compare at primitive level */
185  return this->equal(other) == TheTrueObject;
186  }
187  else
188  {
189  ProtectedObject r;
190  /* other wise giveuser version a */
191  /*chance */
192  this->sendMessage(OREF_STRICT_EQUAL, other, r);
193  return((RexxObject *)r)->truthValue(Error_Logical_value_method);
194  }
195 }
196 
198  RexxObject *other) /* other comparison object */
199 /******************************************************************************/
200 /* Function: Compare two classes */
201 /******************************************************************************/
202 {
203  requiredArgument(other, ARG_ONE); /* must have the other argument */
204  /* this is direct object equality */
205 
206  /* comparing string/int/numstr to */
207  /* string/int/numstr? */
208  if ((this == TheStringClass || this == TheIntegerClass || this == TheNumberStringClass) &&
209  (other == (RexxObject *)TheStringClass || other == (RexxObject *)TheIntegerClass || other == (RexxObject *)TheNumberStringClass))
210  {
211  return TheTrueObject; /* YES, then equal.... */
212  }
213  else /* other wise, do a direct compare */
214  {
215  return((this == other) ? TheTrueObject: TheFalseObject);
216  }
217 }
218 
220  RexxObject *other) /* other comparison object */
221 /******************************************************************************/
222 /* Function: Compare two classes */
223 /******************************************************************************/
224 {
225  requiredArgument(other, ARG_ONE); /* must have the other argument */
226  /* this is direct object equality */
227 
228  /* comparing string/int/numstr to */
229  /* string/int/numstr? */
230  if ((this == TheStringClass || this == TheIntegerClass || this == TheNumberStringClass) &&
231  (other == (RexxObject *)TheStringClass || other == (RexxObject *)TheIntegerClass || other == (RexxObject *)TheNumberStringClass))
232  {
233  return TheFalseObject; /* YES, then equal.... */
234  }
235  else /* other wise, do a direct compare */
236  {
237  return((this != other) ? TheTrueObject: TheFalseObject);
238  }
239 }
240 
242 /*****************************************************************************/
243 /* Function: To check if class_info MIXIN has been set */
244 /*****************************************************************************/
245 {
246  /* return true/false indicator */
247  return this->isMixinClass() ? TheTrueObject : TheFalseObject;
248 }
249 
251 /*****************************************************************************/
252 /* Function: Return the ID for the class */
253 /*****************************************************************************/
254 {
255  return this->id;
256 }
257 
259 /*****************************************************************************/
260 /* Function: Set a class as a Rexx defined class */
261 /*****************************************************************************/
262 {
263  this->classFlags |= REXX_DEFINED; /* flag the class */
264  return OREF_NULL;
265 }
266 
268 /*****************************************************************************/
269 /* Function: Return the classes base class */
270 /*****************************************************************************/
271 {
272  return this->baseClass; /* return the base class for this */
273 }
274 
276 /*****************************************************************************/
277 /* Function: return the classes metaclass */
278 /*****************************************************************************/
279 {
280  if (this->isPrimitiveClass()) /* primitive class? */
281  {
282  return TheClassClass; /* this is always .class */
283  }
284  else /* return first member of the list */
285  {
286  return(RexxClass *)this->metaClass->get(1);
287  }
288 }
289 
291  RexxBehaviour *b) /* new instance behaviour */
292 /*****************************************************************************/
293 /* Function: Give a class a new instance behaviour */
294 /*****************************************************************************/
295 {
296  OrefSet(this, this->instanceBehaviour, b);
297 }
298 
300 /*****************************************************************************/
301 /* Function: Return the first superclass in the superclass list */
302 /*****************************************************************************/
303 {
304  // object has no superclasses
305  if (this == TheObjectClass)
306  {
307  return (RexxClass *)TheNilObject;
308  }
309  // get the first item from the immediate list.
310  return (RexxClass *)this->instanceSuperClasses->get(1);
311 }
312 
313 
315 /*****************************************************************************/
316 /* Function: Return an array of the superclasses */
317 /*****************************************************************************/
318 {
319  /* return a copy of the list */
320  return (RexxArray *)this->instanceSuperClasses->copy();
321 }
322 
323 
325 /*****************************************************************************/
326 /* Function: Return an array of the subclasses */
327 /*****************************************************************************/
328 {
329  // remove any gc classes from the list now, and return the array
330  return subClasses->weakReferenceArray();
331 }
332 
334 /*****************************************************************************/
335 /* Function: Add a subclass to a class */
336 /*****************************************************************************/
337 {
338  // wrap a weak reference around the subclass
339  WeakReference *ref = new WeakReference(subClass);
340  // add this to the front of the subclass list
341  subClasses->addFirst((RexxObject *)ref);
342 }
343 
345  RexxTable *newMethods) /* methods to add */
346 /*****************************************************************************/
347 /* Function: Add a table of methods to a primitive class behaviour */
348 /*****************************************************************************/
349 {
350  /* loop through the list of methods */
351  for (HashLink i = newMethods->first(); newMethods->available(i); i = newMethods->next(i))
352  {
353  /* get the method name */
354  RexxString *method_name = (RexxString *)newMethods->index(i);
355  /* add this method to the classes */
356  /* class behaviour */
357 
358  // if this is the Nil object, that's an override. Make it OREF_NULL.
359  RexxObject *_method = (RexxMethod *)newMethods->value(i);
360  if (_method == TheNilObject)
361  {
362  _method = OREF_NULL;
363  }
364 
365  this->behaviour->define(method_name, OREF_NULL);
366  }
367 }
368 
370 /******************************************************************************/
371 /* Function: retrieve a classes default name value */
372 /******************************************************************************/
373 {
374  RexxString *defaultname = this->id; /* use the id directly */
375  /* prefix with "The" */
376  defaultname = defaultname->concatToCstring("The ");
377  /* add on "class" */
378  defaultname = defaultname->concatWithCstring(" class");
379  return defaultname; /* return that value */
380 }
381 
383 /*****************************************************************************/
384 /* Function: Return the instance behaviour's method dictionary */
385 /*****************************************************************************/
386 {
387  /* get the method dictionary */
388  RexxTable *methodTable = this->instanceBehaviour->getMethodDictionary();
389  if (methodTable == OREF_NULL) /* no methods defined yet? */
390  {
391  return new_table(); /* create a new method table */
392  }
393  else
394  {
395  /* just copy the method dictionary */
396  return(RexxTable *)methodTable->copy();
397  }
398 }
399 
401 /*****************************************************************************/
402 /* Function: Return the class behaviour's method dictionary */
403 /*****************************************************************************/
404 {
405  /* get the method dictionary */
406  RexxTable *methodTable = this->behaviour->getMethodDictionary();
407  if (methodTable == OREF_NULL) /* no methods defined yet? */
408  {
409  return new_table(); /* create a new method table */
410  }
411  else
412  {
413  /* just copy the method dictionary */
414  return(RexxTable *)methodTable->copy();
415  }
416 }
417 
418 
427 void RexxClass::subClassable(bool restricted)
428 {
429  /* get a copy of the class instance */
430  /* behaviour mdict before the merge */
431  /* with OBJECT. This unmerged mdict */
432  /* is kept in this class's */
433  /* class_instance_mdict field. */
435  /* Add OBJECT to the behaviour scope */
436  /* table */
438  if (this != TheObjectClass) /* if this isn't the OBJECT class */
439  {
440  /* Add OBJECT to the behaviour scope */
441  /* table */
443  /* and merge this class's instance */
444  /* behaviour with that of OBJECT's */
446  }
447  /* add self to the scope table */
448  this->instanceBehaviour->addScope(this);
449  /* get a copy of the class behaviour */
450  /* mdict before the merge with the */
451  /* CLASS instance behaviour. This */
452  /* unmerged mdict is kept in the */
453  /* class_mdict field */
455  /* The merge of the mdict's is order */
456  /* specific. By processing OBJECT */
457  /* first then CLASS and then the */
458  /* rest of the subclassable classes */
459  /* the mdict's will be set up */
460  /* correctly. */
461  /* In this way merging the CLASS */
462  /* behaviour will only be the CLASS */
463  /* instance methods when OBJECT is */
464  /* processed, but will be CLASS's */
465  /* and OBJECT's after CLASS is */
466  /* processed */
468  /* now add the scope levels to this */
469  /* class behaviour */
470  /* If this isn't OBJECT put OBJECT */
471  /* in first */
472  if (this != TheObjectClass)
473  {
475  }
476  /* if this is OBJECT - merge the */
477  /* object instance methods with the */
478  /* object class methods */
479  else
480  {
482  /* and put them into the class mdict */
483  /* so all the classes will inherit */
485  }
486  /* if this isn't CLASS put CLASS in */
487  /* next */
488  if (this != TheClassClass)
489  {
491  }
492  this->behaviour->addScope(this); /* put self into the scope table */
493  /* That finishes the class behaviour */
494  /* initialization. */
495  /* Now fill in the state data */
496 
497  if (TheObjectClass != this )
498  {
499  /* set up the new metaclass list */
500  OrefSet(this, this->metaClass, new_array(TheClassClass));
501  /* the metaclass mdict list */
502  OrefSet(this, this->metaClassMethodDictionary, new_array(TheClassClass->instanceMethodDictionary->copy()));
503  /* and the metaclass scopes list */
504  OrefSet(this, this->metaClassScopes, (RexxIdentityTable *)TheClassClass->behaviour->getScopes()->copy());
505  }
506 
507  /* The Baseclass for non-mixin classes*/
508  /* is self */
509  OrefSet(this, this->baseClass, this);
510  /* The class superclasses list for */
511  /* OBJECT is an empty list. */
512  OrefSet(this, this->classSuperClasses, new_array((size_t)0));
513  /* as is the instance superclasses */
514  /* list. */
515  OrefSet(this, this->instanceSuperClasses, new_array((size_t)0));
516  // create the subclasses list
517  OrefSet(this, this->subClasses, new_list());
518  if (this != TheObjectClass) /* not .object? */
519  {
520  /* add object to the list */
522  /* The instance superclasses for all */
523  /* except OBJECT is OBJECT */
525  /* and for OBJECT we need to add all */
526  /* the other classes */
527  /* except integer and numberstring */
528  if (this != TheIntegerClass && this != TheNumberStringClass)
529  {
530  TheObjectClass->addSubClass(this);
531  }
532  }
533  /* and point the instance behaviour */
534  /* back to this class */
535  this->instanceBehaviour->setOwningClass(this);
536  /* and the class behaviour to CLASS */
538  /* these are primitive classes */
539  this->classFlags |= PRIMITIVE_CLASS;
540 
541  if (this == TheClassClass) /* mark CLASS as a meta class */
542  {
543  this->setMetaClass();
544  }
545 }
546 
547 
559 void RexxClass::subClassable(RexxClass *superClass, bool restricted)
560 {
561  // get a copy of the class instance behaviour mdict before the merge
562  // with OBJECT. This unmerged mdict is kept in this class's
563  // class_instance_mdict field.
565 
566  // set up the superclass/subclass relationships
567  OrefSet(this, this->classSuperClasses, new_array(superClass));
568  OrefSet(this, this->instanceSuperClasses, new_array(superClass));
569  // create the subclasses list
570  OrefSet(this, this->subClasses, new_list());
571  // and add this as a subclass to our superclass
572  superClass->addSubClass(this);
573 
574  // create the merged method dictionary for the instancebehavior
575  // and update all of the scopes.
577 
578  /* add self to the scope table */
579  this->instanceBehaviour->addScope(this);
580 
581  // get a copy of the class behaviour mdict before the merge with the
582  // CLASS instance behaviour. This unmerged mdict is kept in the
583  // class_mdict field
585  // The merge of the mdict's is order specific. By processing OBJECT
586  // first then CLASS and then the rest of the subclassable classes
587  // the mdict's will be set up correctly.In this way merging the CLASS
588  // behaviour will only be the CLASS instance methods when OBJECT is
589  // processed, but will be CLASS's and OBJECT's after CLASS is
590  // processed */
592  // now add the scope levels to this class behaviour
594  // add the class scope levels
596  // and finally the new class.
597  this->behaviour->addScope(this);
598 
599  // now fill in some state data for the class object.
600  // set up the new metaclass list
601  OrefSet(this, this->metaClass, new_array(TheClassClass));
602  // the metaclass mdict list
603  OrefSet(this, this->metaClassMethodDictionary, new_array(TheClassClass->instanceMethodDictionary->copy()));
604  // and the metaclass scopes list
605  OrefSet(this, this->metaClassScopes, (RexxIdentityTable *)TheClassClass->behaviour->getScopes()->copy());
606 
607  // The Baseclass for non-mixin classes is self
608  OrefSet(this, this->baseClass, this);
609  // and point the instance behaviour back to this class
610  this->instanceBehaviour->setOwningClass(this);
611  // and the class behaviour to CLASS
613  // these are primitive classes
614  this->classFlags |= PRIMITIVE_CLASS;
615 }
616 
617 
619  RexxString * method_name, /*define method name */
620  RexxMethod *method_object) /* returned method object */
621 /*****************************************************************************/
622 /* Function: Define an instance method on this class object */
623 /*****************************************************************************/
624 {
625  /* check if this is a rexx class */
626  if ( this->isRexxDefined())
627  {
628  /* report as a nomethod condition */
630  }
631  /* make sure there is at least one */
632  /* parameter */
633  method_name = stringArgument(method_name, ARG_ONE)->upper();
634  if ( OREF_NULL == method_object) /* 2nd arg omitted? */
635  {
636  /* Yes, remove all message with this */
637  /* name from our instanceMdict */
638  /* (method lookup) */
639  /* done by defining the method */
640  /* to be .nil at this class level, so*/
641  /* when message lookup is attempted */
642  /* we get .nil, telling us not found */
643  method_object = (RexxMethod *)TheNilObject;
644  }
645  /* not a method type already? */
646  /* and not TheNilObject */
647  else if (TheNilObject != method_object && !isOfClass(Method, method_object))
648  {
649  /* make one from a string */
650  method_object = RexxMethod::newMethodObject(method_name, method_object, IntegerTwo, OREF_NULL);
651  }
652  if (TheNilObject != method_object) /* if the method is not TheNilObject */
653  {
654  /* set the scope of the method to self*/
655  method_object = method_object->newScope(this);
656  /* Installing UNINIT? */
657  if (method_name->strCompare(CHAR_UNINIT))
658  {
659  this->setHasUninitDefined(); /* and turn on uninit if so */
660  }
661  }
662 
663  /* make a copy of the instance */
664  /* behaviour so any previous objects */
665  /* aren't enhanced */
667  /* add method to the instance mdict */
668  this->instanceMethodDictionary->stringPut((RexxObject *)method_object, method_name);
669  /* any subclasses that we have need */
670  /* to redo their instance behaviour */
671  /* this also updates our own */
672  this->updateInstanceSubClasses(); /* behaviour table */
673  return OREF_NULL; /* returns nothing */
674 }
675 
677  RexxTable * newMethods) /* new table of methods to define */
678 /*****************************************************************************/
679 /* Function: Define instance methods on this class object */
680 /*****************************************************************************/
681 {
682  RexxString * index; /* method name */
683  /* loop thru the methods setting the */
684  /* method scopes to SELF and then */
685  /* adding them to SELF's instance */
686  /* mdict */
687  for (HashLink i = newMethods->first(); (index = (RexxString *)newMethods->index(i)) != OREF_NULL; i = newMethods->next(i))
688  {
689  /* get the method */
690  RexxMethod *newMethod = (RexxMethod *)newMethods->value(i);
691  if (isOfClass(Method, newMethod)) /* if this is a method object */
692  {
693  newMethod->setScope(this); /* change the scope */
694  }
695  /* add method to the instance mdict */
696  this->instanceMethodDictionary->stringPut(newMethod, index);
697  /* Installing UNINIT? */
698  if (index->strCompare(CHAR_UNINIT))
699  {
700  this->setHasUninitDefined(); /* and turn on uninit if so */
701  }
702  }
703  /* create the instance behaviour from */
704  /* the instance superclass list */
708 
709  return OREF_NULL; /* returns nothing */
710 }
711 
723 {
724  // validate the arguments
725  method_name = stringArgument(method_name, ARG_ONE)->upper();
726  requiredArgument(newMethod, ARG_TWO);
727  newMethod->setScope(this); // change the scope to the class
728  /* now add this to the behaviour */
729  this->behaviour->getMethodDictionary()->stringPut(newMethod, method_name);
730  this->classMethodDictionary->stringAdd(newMethod, method_name);
731  return OREF_NULL; /* returns nothing */
732 }
733 
741 {
742  // remove from our behaviour
743  this->behaviour->deleteMethod(method_name);
744 
745  // propagate to all subclasses
746  RexxArray *subclass_list = getSubClasses();
747  for (size_t i = 1; i < subclass_list->size(); i++)
748  {
749  ((RexxClass *)subclass_list->get(i))->removeClassMethod(method_name);
750  }
751 }
752 
753 
755  RexxString *method_name) /* deleted method name */
756 /*****************************************************************************/
757 /* Function: Delete an instance method on this class object */
758 /*****************************************************************************/
759 {
760  if (this->isRexxDefined()) /* check if this is a rexx class */
761  {
762  /* report as a nomethod condition */
764  }
765  /* and that it can be a string */
766  method_name = stringArgument(method_name, ARG_ONE)->upper();
767  /* make a copy of the instance */
768  /* behaviour so any previous objects */
769  /* aren't enhanced */
771  /* if there is a method to remove */
772  /* from the instance mdict */
773  /* remove it */
774  if (OREF_NULL != this->instanceMethodDictionary->remove(method_name))
775  {
776  /* and update our instance behaviour */
777  this->updateInstanceSubClasses(); /* along with our subclasses */
778  }
779  return OREF_NULL; /* returns nothing */
780 }
781 
783  RexxString *method_name)
784 /*****************************************************************************/
785 /* Function: Return the method object for the method name */
786 /*****************************************************************************/
787 {
788  /* make sure we have a proper name */
789  method_name = stringArgument(method_name, ARG_ONE)->upper();
790  RexxMethod *method_object = (RexxMethod *)this->instanceBehaviour->getMethodDictionary()->stringGet(method_name);
791  /* check if it is in the mdict */
792  if ( OREF_NULL == method_object)
793  {
794  /* if not return an error */
795  reportException(Error_No_method_name, this, method_name);
796  }
797  return method_object; /* if it was - return the value */
798 }
799 
801  RexxClass *class_object) /* target class object */
802 /*****************************************************************************/
803 /* Function: If no qualification parameter entered */
804 /* return all the methods that an instance of this class */
805 /* will inherit */
806 /* If TheNilObject is the qualification parameter */
807 /* return just the methods introduced at this class scope */
808 /* For any other qualification parameter */
809 /* return just the methods introduced at that class scope */
810 /*****************************************************************************/
811 {
812  /* if no parameter specified */
813  /* return my behaviour mdict as a */
814  /* supplier object */
815  if (class_object == OREF_NULL)
816  {
818  }
819  /* if TheNilObject specified */
820  /* return my instance mdict as a */
821  /* supplier object */
822  if (class_object == TheNilObject)
823  {
824  return this->instanceMethodDictionary->supplier();
825  }
826  /* if not one of the above */
827  /* check if it is a superclass */
828  if (this->behaviour->checkScope(class_object))
829  {
830  /* let the class specified return */
831  /* it's own methods */
832  ProtectedObject r;
833  class_object->sendMessage(OREF_METHODS, TheNilObject, r);
834  return(RexxSupplier *)(RexxObject *)r;
835  }
836  /* or just return a null supplier */
837  return(RexxSupplier *)TheNullArray->supplier();
838 }
839 
841 /******************************************************************************/
842 /* Function: Update my behaviours and call each subclass to do the same */
843 /******************************************************************************/
844 {
845  /* start out the class mdict with */
846  /* a clear mdict and scopes tables */
848  this->behaviour->setScopes(OREF_NULL);
849  /* create the instance behaviour from*/
850  /* the instance superclass list */
854  // This time, we update the class behaviour
855  // after building the instance behaviour
856  // because the added methods may have an
857  // impact on metaclasses.
858  this->createClassBehaviour(this->behaviour);
859 
860  RexxArray *subClassList = this->getSubClasses(); /* get the subclasses list */
861  ProtectedObject p(subClassList);
862  /* loop thru the subclass doing the */
863  /* same for each of them */
864  for (size_t index = 1; index <= subClassList->size(); index++)
865  {
866  /* get the next subclass */
867  /* and recursively update them */
868  ((RexxClass *)subClassList->get(index))->updateSubClasses();
869  }
870 }
871 
873 /******************************************************************************/
874 /* Function: Update my instance behaviour and have the subclasses do the same */
875 /******************************************************************************/
876 {
877  /* create the instance behaviour from*/
878  /* the instance superclass list */
882  RexxArray *subClassList = this->getSubClasses(); /* get the subclasses list */
883  ProtectedObject p(subClassList);
884  /* loop thru the subclass doing the */
885  /* same for each of them */
886  for (size_t index = 1; index <= subClassList->size(); index++)
887  {
888  /* get the next subclass */
889  /* recursively update these */
890  ((RexxClass *)subClassList->get(index))->updateInstanceSubClasses();
891  }
892 }
893 
895  RexxBehaviour *target_class_behaviour)
896 /*****************************************************************************/
897 /* Funcion: To call the superclasses and have them update this classes */
898 /* class behaviour mdict and scopes table */
899 /*****************************************************************************/
900 {
901  RexxClass * superclass; /* superclass being called */
902  RexxClass * metaclass; /* metaclass to use */
903 
904 
905  /* Call each of the superclasses in */
906  /* this superclass list starting from*/
907  /* the last to the first */
908  for (HashLink index = this->classSuperClasses->size(); index > 0; index--)
909  {
910  /* get the next superclass */
911  superclass = (RexxClass *)this->classSuperClasses->get(index);
912  /* if there is a superclass and */
913  /* it hasn't been added into this */
914  /* behaviour yet, call and have it */
915  /* add itself */
916  if (superclass != TheNilObject && !target_class_behaviour->checkScope(superclass))
917  {
918  superclass->createClassBehaviour(target_class_behaviour);
919  }
920  }
921  /* If this class mdict has not been */
922  /* merged into this target behaviour */
923  if (!target_class_behaviour->checkScope(this))
924  {
925  if (TheObjectClass != this) /* if this isn't OBJECT */
926  {
927  // we only process the first item in the metaclass list, since it
928  // will properly pull in the scopes for all of the rest, in the correct order.
929  metaclass = (RexxClass *)this->metaClass->get(1);
930  /* add which ever metaclasses have */
931  /* not been added yet */
932  if (metaclass != TheNilObject && !target_class_behaviour->checkScope(metaclass))
933  {
934  /* merge in the meta class mdict */
935  target_class_behaviour->methodDictionaryMerge(metaclass->instanceBehaviour->getMethodDictionary());
936  // now we need to merge in the scopes. For each metaclass, starting
937  // from the bottom of the hierarchy down, merge in each of the scope
938  // values.
939  RexxArray *addedScopes = metaclass->behaviour->getScopes()->allAt(TheNilObject);
940  ProtectedObject p(addedScopes);
941 
942  // these need to be processed in reverse order
943  for (size_t i = addedScopes->size(); i > 0; i--)
944  {
945  RexxClass *scope = (RexxClass *)addedScopes->get(i);
946  target_class_behaviour->mergeScope(scope);
947  }
948  }
949  }
950  /* only merge the mdict for CLASS */
951  /* if this is a capable of being a */
952  /* metaclass */
953  if ((this != TheClassClass) || (this == TheClassClass && this->isMetaClass()))
954  {
955  /* Merge this class mdict with the */
956  /* target behaviour class mdict */
957  target_class_behaviour->methodDictionaryMerge(this->classMethodDictionary);
958  }
959  /* And update the target behaviour */
960  /* scopes table with this class */
961  if (this != TheClassClass && !target_class_behaviour->checkScope(this))
962  {
963  target_class_behaviour->addScope(this);
964  }
965  }
966 }
967 
968 
970  /* target behaviour to create */
971  RexxBehaviour *target_instance_behaviour)
972 /*****************************************************************************/
973 /* Funcion: To call the superclasses and have them update this classes */
974 /* instance behaviour mdict and scopes table */
975 /*****************************************************************************/
976 {
977  /* Call each of the superclasses in */
978  /* this superclass list starting from*/
979  /* the last going to the first */
980  for (HashLink index = this->instanceSuperClasses->size(); index > 0; index--)
981  {
982  /* get the next super class */
983  RexxClass *superclass = (RexxClass *)this->instanceSuperClasses->get(index);
984  /* if there is a superclass and */
985  /* it hasn't been added into this */
986  /* behaviour yet, call and have it */
987  /* add itself */
988  if (superclass != TheNilObject && !target_instance_behaviour->checkScope(superclass))
989  {
990  superclass->createInstanceBehaviour(target_instance_behaviour);
991  }
992  }
993  /* If this class mdict has not been */
994  /* merged into this target behaviour */
995  if (!target_instance_behaviour->checkScope(this))
996  {
997  /* Merge this class mdict with the */
998  /* target behaviour class mdict */
999  target_instance_behaviour->methodDictionaryMerge(this->instanceMethodDictionary);
1000  /* And update the target behaviour */
1001  /* scopes table with this class */
1002  target_instance_behaviour->addScope(this);
1003  }
1004 }
1005 
1006 
1013 void RexxClass::mergeSuperClassScopes(RexxBehaviour *target_instance_behaviour)
1014 {
1015  // Call each of the superclasses in this superclass list starting from
1016  // the last going to the first
1017  for (HashLink index = this->instanceSuperClasses->size(); index > 0; index--)
1018  {
1019  RexxClass *superclass = (RexxClass *)this->instanceSuperClasses->get(index);
1020  // if there is a superclass and it hasn't been added into this
1021  // behaviour yet, call and have it add itself */
1022  if (superclass != TheNilObject && !target_instance_behaviour->checkScope(superclass))
1023  {
1024  superclass->mergeSuperClassScopes(target_instance_behaviour);
1025  }
1026  }
1027  // now add in the scope for this class, if still needed.
1028  if (!target_instance_behaviour->checkScope(this))
1029  {
1030  /* Merge this class mdict with the */
1031  /* target behaviour class mdict */
1032  target_instance_behaviour->merge(this->instanceBehaviour);
1033  /* And update the target behaviour */
1034  /* scopes table with this class */
1035  target_instance_behaviour->addScope(this);
1036  }
1037 }
1038 
1040  RexxTable *source_mdict, /* source method dictionary */
1041  RexxTable *target_mdict) /* target method dictionary */
1042 /*****************************************************************************/
1043 /* Function: Merge the source mdict methods into the target mdict after */
1044 /* getting copies of the methods with a new scope */
1045 /* After this merge the method search order will find the source */
1046 /* mdict methods prior to the target methods */
1047 /*****************************************************************************/
1048 {
1049  if (source_mdict == OREF_NULL) /* check for a source mdict */
1050  {
1051  return; /* there isn't anything to do */
1052  }
1053  /* just loop through the entries */
1054  for (HashLink i = source_mdict->first(); source_mdict->available(i); i = source_mdict->next(i))
1055  {
1056  /* get the method name */
1057  RexxString *method_name = REQUEST_STRING(source_mdict->index(i));
1058  /* get the method */
1059  RexxMethod *method_instance = (RexxMethod *)source_mdict->value(i);
1060  /* add the method to the target mdict */
1061  target_mdict->stringAdd(method_instance, method_name);
1062  /* check if the method that was added */
1063  /* is the uninit method */
1064  if ( method_name->strCompare(CHAR_UNINIT))
1065  {
1066  this->setHasUninitDefined(); /* and turn on uninit if so */
1067  }
1068  }
1069 }
1070 
1072  RexxTable *sourceCollection, /* source method collection */
1073  RexxClass *scope ) /* required method scope */
1074 /*****************************************************************************/
1075 /* Function: Process a collection of methods that will be added to a class */
1076 /* as class methods, or will be added to an enhanced object. In */
1077 /* either case, this is an arbitrary collection of objects that */
1078 /* may need conversion into method objects and given a scope. */
1079 /*****************************************************************************/
1080 {
1081  RexxTable *newDictionary = new_table(); /* get a new table for this */
1082  ProtectedObject p(newDictionary);
1083  /* loop thru the supplier object */
1084  /* obtained from the source mdict */
1085  ProtectedObject p2;
1086  sourceCollection->sendMessage(OREF_SUPPLIERSYM, p2);
1087  RexxSupplier *supplier = (RexxSupplier *)(RexxObject *)p2;
1088  for (; supplier->available() == TheTrueObject; supplier->next())
1089  {
1090  /* get the method name (uppercased) */
1091  RexxString *method_name = REQUEST_STRING(supplier->index())->upper();
1092  /* get the method */
1093  RexxMethod *newMethod = (RexxMethod *)supplier->value();
1094  /* if the method is not TheNilObject */
1095  if (newMethod != (RexxMethod *)TheNilObject)
1096  {
1097  /* and it isn't a primitive method */
1098  if (!isOfClass(Method, newMethod)) /* object */
1099  {
1100  /* make it into a method object */
1101  newMethod = RexxMethod::newMethodObject(method_name, newMethod, IntegerOne, OREF_NULL);
1102  newMethod->setScope(scope); /* and set the scope to the given */
1103  }
1104  else
1105  {
1106  /* if it is a primitive method object */
1107  /* let the newscope method copy it */
1108  newMethod = newMethod->newScope(scope);
1109  }
1110  }
1111  /* add the method to the target mdict */
1112  newDictionary->stringAdd(newMethod, method_name);
1113  }
1114  return newDictionary; /* and return the new version */
1115 }
1116 
1117 
1119  RexxClass *mixin_class, /* target class */
1120  RexxClass *position) /* target inherit position */
1121 /*****************************************************************************/
1122 /* Function: To add the mixin class (parameter one) to the superclass */
1123 /* hierarchy of the receiver class (this), at the last position */
1124 /* or the specified position (parameter two). */
1125 /*****************************************************************************/
1126 {
1127  /* make sure this isn't a rexx */
1128  if (this->isRexxDefined()) /* defined class being changed */
1129  {
1130  /* report as a nomethod condition */
1132  }
1133  requiredArgument(mixin_class, ARG_ONE); /* make sure it was passed in */
1134 
1135  /* check the mixin class is really a */
1136  /* good class for this */
1137  if (!mixin_class->isInstanceOf(TheClassClass) || !mixin_class->isMixinClass())
1138  {
1139  /* if it isn't raise an error */
1141  }
1142 
1143  /* if the mixin class is also the */
1144  if (this == mixin_class ) /* reciever class */
1145  {
1146  /* raise an error */
1148  }
1149  /* check that the mixin class is not */
1150  /* a superclass of the reciever */
1151  if (this->behaviour->checkScope(mixin_class))
1152  {
1153  /* if it is raise an error */
1155  }
1156  /* check if the reciever class is a */
1157  /* superclass of the mixin class */
1158  if (mixin_class->behaviour->checkScope(this))
1159  {
1160  /* if it is it's an error */
1162  }
1163 
1164  /* Now ensure the mixin class */
1165  /* baseclass is in the reciever's */
1166  /* class superclass hierarchy */
1167  if (!this->behaviour->checkScope(mixin_class->getBaseClass()))
1168  {
1169  /* if it isn't raise an error */
1170  reportException(Error_Execution_baseclass, this, mixin_class, mixin_class->getBaseClass());
1171  }
1172 
1173  /* and the reciever's */
1174  /* instance superclass hierarchy */
1175  if (!this->instanceBehaviour->checkScope(mixin_class->getBaseClass()))
1176  {
1177  /* if it isn't raise an error */
1178  reportException(Error_Execution_baseclass, this, mixin_class, mixin_class->getBaseClass());
1179  }
1180  if ( position == OREF_NULL ) /* if position was not specified */
1181  {
1182  /* insert the mixin class last in the*/
1183  /* reciever's superclasses list */
1184  this->classSuperClasses->addLast(mixin_class);
1185  this->instanceSuperClasses->addLast(mixin_class);
1186  }
1187  else /* if it was specified */
1188  {
1189  /* check that it's a valid superclass*/
1190  /* in the class superclasses list */
1191  /* and the reciever's */
1192  /* instance superclasses list */
1193  HashLink class_index = this->classSuperClasses->indexOf(position);
1194  HashLink instance_index = this->instanceSuperClasses->indexOf(position);
1195  if (class_index == 0 || instance_index == 0)
1196  {
1197  /* if it isn't raise an error */
1198  reportException(Error_Execution_uninherit, this, position);
1199  }
1200  /* insert the mixin class into the */
1201  /* superclasses list's */
1202  this->classSuperClasses->insertAfter(mixin_class, class_index);
1203  this->instanceSuperClasses->insertAfter(mixin_class, instance_index);
1204  }
1205 
1206  /* update the mixin class subclass */
1207  mixin_class->addSubClass(this); /* list to reflect this class */
1208  /* any subclasses that we have need */
1209  /* to redo their behaviour's */
1210  /* this also updates our own */
1211  /* behaviour tables. */
1212  this->updateSubClasses();
1213  /* If the mixin class has an uninit defined, the new class must have one, too */
1214  if (mixin_class->hasUninitDefined() || mixin_class->parentHasUninitDefined())
1215  {
1216  this->setParentHasUninitDefined();
1217  }
1218  return OREF_NULL; /* returns nothing */
1219 }
1220 
1222  RexxClass *mixin_class) /* target subclass to remove */
1223 /*****************************************************************************/
1224 /* Function: To remove a mixin class (parameter one) from the superclass */
1225 /* hierarchy of the receiver class (this). */
1226 /*****************************************************************************/
1227 {
1228  HashLink class_index; /* index for class superclasses list */
1229  HashLink instance_index; /* index for instance superclasses */
1230  /* make sure this isn't rexx defined */
1231  if (this->isRexxDefined()) /* class that is being changed */
1232  {
1233  /* report as a nomethod condition */
1235  }
1236  requiredArgument(mixin_class, ARG_ONE); /* make sure it was passed in */
1237 
1238  /* check that the mixin class is a */
1239  /* superclass of the receiver class */
1240  /* and not the superclass */
1241  if ( ((class_index = this->classSuperClasses->indexOf(mixin_class)) > 1) &&
1242  ((instance_index = this->instanceSuperClasses->indexOf(mixin_class)) > 1))
1243  {
1244  /* and remove it */
1245  this->classSuperClasses->deleteItem(class_index);
1246  this->instanceSuperClasses->deleteItem(instance_index);
1247  }
1248  else
1249  {
1250  /* else raise an error */
1251  reportException(Error_Execution_uninherit, this, mixin_class);
1252  }
1253  /* update the mixin class subclass */
1254  /* list to not have this class */
1255  removeSubclass(mixin_class);
1256  /* any subclasses that we have need */
1257  /* to redo their behaviour's */
1258  /* this also updates our own behaviour*/
1259  this->updateSubClasses(); /* tables. */
1260  return OREF_NULL; /* returns nothing */
1261 }
1262 
1263 
1271 {
1272  size_t index = subClasses->firstIndex();
1273  // scan the subclasses list looking for the removed class
1274  while (index != LIST_END)
1275  {
1276  WeakReference *ref = (WeakReference *)subClasses->getValue(index);
1277  RexxObject *sc = ref->get();
1278  if (sc == c)
1279  {
1280  subClasses->removeIndex(index);
1281  return;
1282  }
1283  index = subClasses->nextIndex(index);
1284  }
1285 }
1286 
1288  RexxObject **args, /* enhanced arguments */
1289  size_t argCount) /* the number of arguments */
1290 /*****************************************************************************/
1291 /* Function: Create a new object that is an instance of the receiver class */
1292 /* object that has had it's instance mdict enhanced. */
1293 /*****************************************************************************/
1294 {
1295  if (argCount == 0) /* make sure an arg was passed in */
1296  {
1297  /* if not report an error */
1299  }
1300  /* get the value of the arg */
1301  RexxTable *enhanced_instance_mdict = (RexxTable *)args[0];
1302  /* make sure it was a real value */
1303  requiredArgument(enhanced_instance_mdict, ARG_ONE);
1304  /* subclass the reciever class */
1305  RexxClass *dummy_subclass = this->subclass(new_string("Enhanced Subclass"), OREF_NULL, OREF_NULL);
1306  ProtectedObject p(dummy_subclass);
1307  /* turn into a real method dictionary*/
1308  enhanced_instance_mdict = dummy_subclass->methodDictionaryCreate(enhanced_instance_mdict, (RexxClass *)TheNilObject);
1309  /* enhance the instance behaviour */
1310  dummy_subclass->methodDictionaryMerge(enhanced_instance_mdict, dummy_subclass->instanceMethodDictionary);
1311  /* and record the changes in behavior*/
1312  dummy_subclass->instanceBehaviour->setInstanceMethodDictionary(enhanced_instance_mdict);
1313  /* recreate the instance behaviour */
1315  dummy_subclass->instanceBehaviour->setScopes(OREF_NULL);
1316  dummy_subclass->createInstanceBehaviour(dummy_subclass->instanceBehaviour);
1317  ProtectedObject r;
1318  /* get an instance of the enhanced */
1319  /* subclass */
1320  dummy_subclass->sendMessage(OREF_NEW, args + 1, argCount - 1, r);
1321  RexxObject *enhanced_object = (RexxObject *)r;
1322  /* change the create_class in the */
1323  /* instance behaviour to point to the*/
1324  /* original class object */
1325  enhanced_object->behaviour->setOwningClass(this);
1326  /* remember it was enhanced */
1327  enhanced_object->behaviour->setEnhanced();
1328 
1329  return enhanced_object; /* send back the new improved version*/
1330 }
1331 
1333  RexxString * mixin_id, /* ID name of the class */
1334  RexxClass * meta_class, /* source meta class */
1335  /* extra class methods */
1336  RexxTable * enhancing_class_methods)
1337 /*****************************************************************************/
1338 /* Function: Create a new class object containng class and instance methods */
1339 /* to be used for multiple inheritance . */
1340 /*****************************************************************************/
1341 {
1342  /* call subclass with the parameters */
1343  RexxClass *mixin_subclass = this->subclass(mixin_id, meta_class, enhancing_class_methods);
1344  mixin_subclass->setMixinClass(); /* turn on the mixin info */
1345  /* change the base class to the base */
1346  /* class of the reciever */
1347  OrefSet(mixin_subclass, mixin_subclass->baseClass, this->baseClass);
1348  /* If the mixin's parent class has an uninit defined, the new mixin class must have one, too */
1349  if (this->hasUninitDefined() || this->parentHasUninitDefined())
1350  {
1351  mixin_subclass->setParentHasUninitDefined();
1352  }
1353  return mixin_subclass; /* return the new mixin class */
1354 }
1355 
1356 
1358  RexxString * class_id, /* ID name of the class */
1359  RexxClass * meta_class, /* source meta class */
1360  /* extra class methods */
1361  RexxTable * enhancing_class_methods)
1362 /*****************************************************************************/
1363 /* Function: Create a new class object that is a subclass of this class */
1364 /* object. */
1365 /*****************************************************************************/
1366 {
1367  if (meta_class == OREF_NULL) /* if there is no metaclass specified*/
1368  {
1369  meta_class = this->getMetaClass(); /* use the default metaclass */
1370  }
1371 
1372  /* check that it is a meta class */
1373  if (!meta_class->isInstanceOf(TheClassClass) || !meta_class->isMetaClass())
1374  {
1376  }
1377  ProtectedObject p;
1378  /* get a copy of the metaclass class */
1379  meta_class->sendMessage(OREF_NEW, class_id, p);
1380  RexxClass *new_class = (RexxClass *)(RexxObject *)p;
1381  if (this->isMetaClass()) /* if the superclass is a metaclass */
1382  {
1383  new_class->setMetaClass(); /* mark the new class as a meta class*/
1384  /* and if the metaclass lists haven't */
1385  /* been updated yet */
1386  if (new_class->metaClassScopes->get(this) == OREF_NULL)
1387  {
1388  /* add the class instance info to the */
1389  /* metaclass lists */
1390  new_class->metaClass->addFirst(this);
1391  /* the metaclass mdict list */
1393  /* and the metaclass scopes list */
1394  /* this is done by adding all the */
1395  /* scope information of the new class */
1396  new_class->metaClassScopes->add(this, TheNilObject);
1397  /* add the scope list for this scope */
1398  new_class->metaClassScopes->add(new_class->metaClassScopes->allAt(TheNilObject), this);
1399  }
1400  }
1401  /* set up the new_class behaviour */
1402  /* to match the subclass reciever */
1403  new_class->instanceBehaviour->subclass(this->instanceBehaviour);
1404  /* set this class as the superclass */
1405  /* for the new class' */
1406  /* class_superclasses list */
1407  OrefSet(new_class, new_class->classSuperClasses, new_array(this));
1408  /* make the receiver class the */
1409  /* superclass for the instance behav */
1410  OrefSet(new_class, new_class->instanceSuperClasses, new_array(this));
1411  /* if there was enhancing methods */
1412  /* specified */
1413  if (enhancing_class_methods != OREF_NULL && enhancing_class_methods != TheNilObject)
1414  {
1415  /* convert into a real method dict. */
1416  enhancing_class_methods = new_class->methodDictionaryCreate(enhancing_class_methods, new_class);
1417  /* merge them into the class mdict */
1418  new_class->methodDictionaryMerge(enhancing_class_methods, new_class->classMethodDictionary);
1419  }
1420  /* start out the class behaviour clean*/
1422  new_class->behaviour->setScopes(OREF_NULL);
1423  /* create the class behaviour from */
1424  /* the class superclass list */
1425  new_class->createClassBehaviour(new_class->behaviour);
1426  /* set the class behaviour created */
1427  /* class to the meta class */
1428  new_class->behaviour->setOwningClass(meta_class);
1429  /* create the instance behaviour from */
1430  /* the instance superclass list */
1432  new_class->instanceBehaviour->setScopes(OREF_NULL);
1433  new_class->createInstanceBehaviour(new_class->instanceBehaviour);
1434  /* set the instance behaviour created */
1435  /* class to the reciever class */
1436  new_class->instanceBehaviour->setOwningClass(new_class);
1437  /* update the receiver class' subclass*/
1438 
1439  this->addSubClass(new_class); /* list to reflect the new class */
1440  /* if the class object has an UNINIT method defined, make sure we */
1441  /* add this to the table of classes to be processed. */
1442  if (new_class->hasUninitMethod())
1443  {
1444  new_class->hasUninit();
1445  }
1446  new_class->sendMessage(OREF_INIT); /* now drive any user INIT methods */
1447  /* now the new class object should */
1448  /* If the parent class has an uninit defined, the new child class must have one, too */
1449  if (this->hasUninitDefined() || this->parentHasUninitDefined())
1450  {
1451  new_class->setParentHasUninitDefined();
1452  }
1453  /* notify activity this object has an UNINIT that needs to be called
1454  when collecting the object */
1455  if (new_class->hasUninitDefined())
1456  {
1457  new_class->setHasUninitDefined();
1458  }
1459 
1460  return new_class; /* return the new class */
1461 }
1462 
1464  RexxClass *new_metaClass ) /* new meta class to add */
1465 /******************************************************************************/
1466 /* Function: Set a metaclass for a class */
1467 /******************************************************************************/
1468 {
1469  OrefSet(this, this->metaClass, new_array(TheClassClass));
1470  this->metaClass->addFirst(new_metaClass);
1471  /* the metaclass mdict list */
1472  OrefSet(this, this->metaClassMethodDictionary, new_array(TheClassClass->instanceMethodDictionary->copy()));
1474  /* and the metaclass scopes list */
1475  OrefSet(this, this->metaClassScopes, (RexxIdentityTable *)TheClassClass->behaviour->getScopes()->copy());
1476  /* add the scope list for this scope */
1477  this->metaClassScopes->add(new_metaClass, TheNilObject);
1478  this->metaClassScopes->add(this->metaClassScopes->allAt(TheNilObject), new_metaClass);
1479 }
1480 
1481 
1494 {
1495  // if asking for a match here, this is true
1496  if (other == this)
1497  {
1498  return true;
1499  }
1500 
1501  // if this is .object, there are no superclasses. Otherwise, ask each of the superclasses
1502  // the same question.
1504  {
1505  for (size_t i = 1; i <= instanceSuperClasses->size(); i++)
1506  {
1507  if (((RexxClass *)instanceSuperClasses->get(i))->isCompatibleWith(other))
1508  {
1509  return true;
1510  }
1511  }
1512  }
1513  return false;
1514 }
1515 
1516 
1526 {
1527  requiredArgument(other, ARG_ONE); // must have the other argument
1528  return isCompatibleWith(other) ? TheTrueObject : TheFalseObject;
1529 }
1530 
1532 /******************************************************************************/
1533 /* Function: Exported access to an object virtual function */
1534 /******************************************************************************/
1535 {
1536  return this->defaultName(); /* forward to the virtual function */
1537 }
1538 
1539 
1540 void *RexxClass::operator new(size_t size,
1541  size_t size1, /* additional size */
1542  const char *className, // The id string of the class
1543  RexxBehaviour *class_behaviour, /* new class behaviour */
1544  RexxBehaviour *instanceBehaviour) /* instance behaviour info */
1545 /*****************************************************************************/
1546 /* Function: Create a new primitive class */
1547 /* for the subclassable classes the rest of the class information */
1548 /* will be filled in when oksetup.c is run */
1549 /*****************************************************************************/
1550 {
1551  RexxClass *new_class; /* newly create class */
1552 
1553  if (size1 == 0) /* want the default? */
1554  {
1555  /* Get new class object */
1556  new_class = (RexxClass *)new_object(size);
1557  }
1558  else
1559  {
1560  /* use the specified size */
1561  new_class = (RexxClass *)new_object(size1);
1562  }
1563  // set this value immediately
1564  new_class->id = new_string(className);
1565  /* set the class specific behaviour */
1566  new_class->setBehaviour(class_behaviour);
1567  /* set the class into the behaviour */
1568  new_class->behaviour->setOwningClass(new_class);
1569  /* set the instance behaviour */
1570  OrefSet(new_class, new_class->instanceBehaviour, instanceBehaviour);
1571  /* and the class of this behaviour */
1572  new_class->instanceBehaviour->setOwningClass(new_class);
1573  /* tell the mobile support to just */
1574  new_class->makeProxiedObject(); /* make a proxy for this class */
1575  return(void *)new_class; /* should be ready */
1576 }
1577 
1578 RexxClass *RexxClass::newRexx(RexxObject **args, size_t argCount)
1579 /*****************************************************************************/
1580 /* Function: Create a new class for a rexx class */
1581 /* A copy of this class object is made */
1582 /* This class' behaviour, class_mdict, metaclass, and class_info */
1583 /* are used in the new class. All the rest of the object state */
1584 /* data is updated to reflect a new class object */
1585 /*****************************************************************************/
1586 {
1587  if (argCount == 0) /* make sure an arg was passed in */
1588  {
1589  /* if not report an error */
1591  }
1592  RexxString *class_id = (RexxString *)args[0]; /* get the id parameter */
1593  class_id = stringArgument(class_id, ARG_ONE); /* and that it can be a string */
1594  /* get a copy of this class object */
1595  RexxClass *new_class = (RexxClass *)this->clone();
1596 
1597  // NOTE: we do this before save() is called. The class object hash value
1598  // is based off of the string name, so we need to set this before we
1599  // attempt putting this into a hash collection.
1600  OrefSet(new_class, new_class->id, class_id);
1601  /* update cloned hashvalue */
1602  ProtectedObject p(new_class); /* better protect this */
1603  /* make this into an instance of the */
1604  /* meta class */
1605  OrefSet(new_class, new_class->behaviour, (RexxBehaviour *)new_class->instanceBehaviour->copy());
1606  /* don't give access to this class' */
1607  /* class mdict */
1608  OrefSet(new_class, new_class->classMethodDictionary, new_table());
1609  /* make this class the superclass */
1610  OrefSet(new_class, new_class->classSuperClasses, new_array(this));
1611  new_class->behaviour->setOwningClass(this);/* and set the behaviour class */
1612  /* if this is a primitive class then */
1613  /* there isn't any metaclass info */
1614  if (this->isPrimitiveClass()) /* set up yet */
1615  {
1616  /* set up the new metaclass list */
1617  OrefSet(new_class, new_class->metaClass, new_array(TheClassClass));
1618  /* the metaclass mdict list */
1619  OrefSet(new_class, new_class->metaClassMethodDictionary, new_array(TheClassClass->instanceMethodDictionary->copy()));
1620  /* and the metaclass scopes list */
1621  OrefSet(new_class, new_class->metaClassScopes, (RexxIdentityTable *)TheClassClass->behaviour->getScopes()->copy());
1622  }
1623  else
1624  {
1625  /* add this class to the new class */
1626  /* metaclass list */
1627  OrefSet(new_class, new_class->metaClass, (RexxArray *)new_class->metaClass->copy());
1628  new_class->metaClass->addFirst(this);
1629  /* the metaclass mdict list */
1630  OrefSet(new_class, new_class->metaClassMethodDictionary, (RexxArray *)new_class->metaClassMethodDictionary->copy());
1632  /* and the metaclass scopes list */
1633  /* this is done by adding all the */
1634  /* scope information of the new class */
1635  OrefSet(new_class, new_class->metaClassScopes, (RexxIdentityTable *)new_class->metaClassScopes->copy());
1636  /* and update the scopes to include */
1637  /* the metaclass scopes */
1638  new_class->metaClassScopes->add(this, TheNilObject);
1639  new_class->metaClassScopes->add(this->behaviour->getScopes()->allAt(TheNilObject), this);
1640  }
1641 
1642  // create the subclasses list
1643  OrefSet(new_class, new_class->subClasses, new_list());
1644  /* set up the instance behaviour with */
1645  /* object's instance methods */
1646  OrefSet(new_class, new_class->instanceBehaviour, (RexxBehaviour *)TheObjectClass->instanceBehaviour->copy());
1647  /* don't give access to this class' */
1648  /* instance mdict */
1649  OrefSet(new_class, new_class->instanceMethodDictionary, new_table());
1650  /* make the instance_superclass list */
1651  /* with OBJECT in it */
1652  OrefSet(new_class, new_class->instanceSuperClasses, new_array(TheObjectClass));
1653  /* and set the behaviour class */
1655  /* and the instance behaviour scopes */
1657  /* set the scoping info */
1659  /* don't give access to this class' */
1660  /* ovd's */
1661  OrefSet(new_class, new_class->objectVariables, OREF_NULL);
1662  /* set the new class as it's own */
1663  /* baseclass */
1664  OrefSet(new_class, new_class->baseClass, new_class);
1665  /* clear the info area except for */
1666  /* uninit */
1667  new_class->setInitialFlagState();
1668  /* if the class object has an UNINIT method defined, make sure we */
1669  /* add this to the table of classes to be processed. */
1670  if (new_class->hasUninitDefined())
1671  {
1672  new_class->setHasUninitDefined();
1673  }
1674  new_class->sendMessage(OREF_INIT, args + 1, argCount - 1);
1675  return new_class; /* return the new class */
1676 }
1677 
1679 /******************************************************************************/
1680 /* Function: Create the initial class object */
1681 /******************************************************************************/
1682 {
1683  /* create a class object */
1685  /* set the instance behaviour */
1686  TheClassClass->setBehaviour(TheClassClassBehaviour);
1687  /* set the instance behaviour */
1688  TheClassClass->setInstanceBehaviour(TheClassBehaviour);
1689 
1690  // the initial class needs to have an ID before it can be used for
1691  // other purposes.
1692  TheClassClass->id = new_string("Class");
1693 
1694  /* tell the mobile support to just */
1695  /* make a proxy for this class */
1696  TheClassClass->makeProxiedObject();
1697  new (TheClassClass) RexxClass;
1698 }
1699 
1700 
1702  RexxObject **arg_array, /* source argument array */
1703  size_t argCount, /* size of the argument array */
1704  RexxObject***init_args, /* remainder arguments */
1705  size_t *remainderSize, /* remaining count of arguments */
1706  size_t required, /* number of arguments we require */
1707  RexxObject **argument1, /* first returned argument */
1708  RexxObject **argument2 ) /* second return argument */
1709 /******************************************************************************/
1710 /* Function: Divide up a class new arglist into new arguments and init args */
1711 /******************************************************************************/
1712 {
1713  *argument1 = OREF_NULL; /* clear the first argument */
1714  if (argCount >= 1) /* have at least one argument? */
1715  {
1716  *argument1 = arg_array[0]; /* get the first argument */
1717  }
1718  if (required == 2)
1719  { /* processing two arguments? */
1720  if (argCount >= 2) /* get at least 2? */
1721  {
1722  *argument2 = arg_array[1]; /* get the second argument */
1723  }
1724  else
1725  {
1726  *argument2 = OREF_NULL; /* clear the second argument */
1727  }
1728  }
1729  /* get the init args part */
1730  *init_args = arg_array + required;
1731  /* if we have at least the required arguments, reduce the count. */
1732  /* Otherwise, set this to zero. */
1733  if (argCount >= required)
1734  {
1735  *remainderSize = argCount - required;
1736  }
1737  else
1738  {
1739  *remainderSize = 0;
1740  }
1741 }
Error_Execution_mixinclass
#define Error_Execution_mixinclass
Definition: RexxErrorCodes.h:545
RexxBehaviour::getScopes
RexxIdentityTable * getScopes()
Definition: RexxBehaviour.hpp:92
RexxClass::mixinclass
RexxClass * mixinclass(RexxString *, RexxClass *, RexxTable *)
Definition: ClassClass.cpp:1332
RexxObject::sendMessage
void sendMessage(RexxString *, RexxArray *, ProtectedObject &)
Definition: ObjectClass.cpp:668
RexxClass::enhanced
RexxObject * enhanced(RexxObject **, size_t)
Definition: ClassClass.cpp:1287
new_array
RexxArray * new_array(size_t s)
Definition: ArrayClass.hpp:250
Error_No_method_name
#define Error_No_method_name
Definition: RexxErrorCodes.h:519
RexxTable::stringGet
RexxObject * stringGet(RexxString *key)
Definition: TableClass.hpp:67
RexxHashTableCollection::index
RexxObject * index(HashLink pos)
Definition: RexxCollection.hpp:90
Error_Translation_bad_metaclass
#define Error_Translation_bad_metaclass
Definition: RexxErrorCodes.h:568
RexxHashTableCollection::next
HashLink next(HashLink pos)
Definition: RexxCollection.hpp:88
RexxArray
Definition: ArrayClass.hpp:100
RexxClass::defmeths
void defmeths(RexxTable *)
Definition: ClassClass.cpp:344
RexxObject::isInstanceOf
bool isInstanceOf(RexxClass *)
Definition: ObjectClass.cpp:226
RexxClass::mergeSuperClassScopes
void mergeSuperClassScopes(RexxBehaviour *target_instance_behaviour)
Definition: ClassClass.cpp:1013
TheFalseObject
#define TheFalseObject
Definition: RexxCore.h:184
RexxClass::classMethodDictionary
RexxTable * classMethodDictionary
Definition: ClassClass.hpp:153
MethodClass.hpp
new_proxy
RexxString * new_proxy(const char *name)
Definition: StringClass.hpp:567
RexxClass::hash
HashCode hash()
Definition: ClassClass.cpp:141
reportNomethod
void reportNomethod(RexxString *message, RexxObject *receiver)
Definition: ActivityManager.hpp:236
WeakReferenceClass.hpp
memory_mark_general
#define memory_mark_general(oref)
Definition: RexxMemory.hpp:437
RexxArray::copy
RexxObject * copy()
Definition: ArrayClass.cpp:120
RexxInternalObject::behaviour
RexxBehaviour * behaviour
Definition: ObjectClass.hpp:306
RexxClass::method
RexxMethod * method(RexxString *)
Definition: ClassClass.cpp:782
OrefSet
#define OrefSet(o, r, v)
Definition: RexxCore.h:94
RexxClass::classSuperClasses
RexxArray * classSuperClasses
Definition: ClassClass.hpp:164
RexxIdentityTable::allAt
RexxArray * allAt(RexxObject *key)
Definition: IdentityTableClass.hpp:64
TheClassClassBehaviour
#define TheClassClassBehaviour
Definition: PrimitiveBehaviourNames.h:55
RexxMethod::newScope
RexxMethod * newScope(RexxClass *)
Definition: MethodClass.cpp:328
RexxInternalObject::clone
RexxObject * clone()
Definition: ObjectClass.cpp:2308
RexxClass::getId
RexxString * getId()
Definition: ClassClass.cpp:250
ActivityManager.hpp
SupplierClass.hpp
RexxClass::getBehaviourDictionary
RexxTable * getBehaviourDictionary()
Definition: ClassClass.cpp:400
RexxList::removeIndex
RexxObject * removeIndex(size_t i)
Definition: ListClass.hpp:113
ListClass.hpp
RexxClass::methodDictionaryMerge
void methodDictionaryMerge(RexxTable *, RexxTable *)
Definition: ClassClass.cpp:1039
RexxClass::defineMethod
RexxObject * defineMethod(RexxString *, RexxMethod *)
Definition: ClassClass.cpp:618
Error_Incorrect_method_minarg
#define Error_Incorrect_method_minarg
Definition: RexxErrorCodes.h:454
WeakReference::get
RexxObject * get()
Definition: WeakReferenceClass.hpp:73
RexxObject::hasUninitMethod
bool hasUninitMethod()
Definition: ObjectClass.cpp:2291
RexxClass::setMixinClass
void setMixinClass()
Definition: ClassClass.hpp:125
requiredArgument
void requiredArgument(RexxObject *object, size_t position)
Definition: RexxCore.h:284
RexxClass::defineClassMethod
RexxObject * defineClassMethod(RexxString *method_name, RexxMethod *newMethod)
Definition: ClassClass.cpp:722
RexxArray::indexOf
size_t indexOf(RexxObject *)
Definition: ArrayClass.cpp:1696
RexxClass::defaultNameRexx
RexxString * defaultNameRexx()
Definition: ClassClass.cpp:1531
RexxArray::size
size_t size()
Definition: ArrayClass.hpp:200
RexxObject::id
RexxString * id()
Definition: ObjectClass.cpp:2240
ARG_TWO
const int ARG_TWO
Definition: RexxCore.h:81
TableClass.hpp
RexxClass::subClassable
void subClassable(bool)
Definition: ClassClass.cpp:427
RexxInternalObject::hasUninit
void hasUninit()
Definition: ObjectClass.cpp:1873
RexxClass::baseClass
RexxClass * baseClass
Definition: ClassClass.hpp:158
reportException
void reportException(wholenumber_t error)
Definition: ActivityManager.hpp:136
TheObjectBehaviour
#define TheObjectBehaviour
Definition: PrimitiveBehaviourNames.h:52
RexxHashTableCollection::remove
virtual RexxObject * remove(RexxObject *key)
Definition: RexxCollection.cpp:190
RexxClass::isEqual
bool isEqual(RexxObject *)
Definition: ClassClass.cpp:173
RexxClass::queryMixinClass
RexxInteger * queryMixinClass()
Definition: ClassClass.cpp:241
RexxClass::unflatten
RexxObject * unflatten(RexxEnvelope *)
Definition: ClassClass.cpp:112
TheClassClass
#define TheClassClass
Definition: RexxCore.h:149
RexxClass::subclass
RexxClass * subclass(RexxString *, RexxClass *, RexxTable *)
Definition: ClassClass.cpp:1357
RexxBehaviour::isPrimitive
bool isPrimitive()
Definition: RexxBehaviour.hpp:102
Error_Execution_uninherit
#define Error_Execution_uninherit
Definition: RexxErrorCodes.h:548
TheTrueObject
#define TheTrueObject
Definition: RexxCore.h:185
RexxSupplier
Definition: SupplierClass.hpp:47
RexxString::getStringData
const char * getStringData()
Definition: StringClass.hpp:333
RexxClass::parentHasUninitDefined
bool parentHasUninitDefined()
Definition: ClassClass.hpp:122
RexxInternalObject::makeProxiedObject
void makeProxiedObject()
Definition: ObjectClass.hpp:256
RexxIdentityTable::get
virtual RexxObject * get(RexxObject *key)
Definition: IdentityTableClass.cpp:111
RexxEnvelope
Definition: RexxEnvelope.hpp:53
RexxList::addFirst
void addFirst(RexxObject *value)
Definition: ListClass.cpp:485
RexxClass::addSubClass
void addSubClass(RexxClass *)
Definition: ClassClass.cpp:333
RexxClass::getSubClasses
RexxArray * getSubClasses()
Definition: ClassClass.cpp:324
RexxArray::get
RexxObject * get(size_t pos)
Definition: ArrayClass.hpp:201
RexxHashTableCollection::copy
RexxObject * copy()
Definition: RexxCollection.cpp:119
new_identity_table
RexxIdentityTable * new_identity_table()
Definition: IdentityTableClass.hpp:74
RexxBehaviour
Definition: RexxBehaviour.hpp:49
isOfClass
#define isOfClass(t, r)
Definition: RexxCore.h:211
RexxClass::methods
RexxSupplier * methods(RexxClass *)
Definition: ClassClass.cpp:800
RexxList::nextIndex
size_t nextIndex(size_t i)
Definition: ListClass.cpp:803
RexxMethod::setScope
void setScope(RexxClass *)
Definition: MethodClass.cpp:360
RexxClass::REXX_DEFINED
Definition: ClassClass.hpp:141
RexxClass::strictEqual
RexxObject * strictEqual(RexxObject *)
Definition: ClassClass.cpp:164
RexxClass::getHashValue
HashCode getHashValue()
Definition: ClassClass.cpp:155
RexxClass::getSuperClass
RexxClass * getSuperClass()
Definition: ClassClass.cpp:299
TheObjectClass
#define TheObjectClass
Definition: RexxCore.h:159
RexxHashTableCollection::first
HashLink first()
Definition: RexxCollection.hpp:87
RexxMethod::newMethodObject
static RexxMethod * newMethodObject(RexxString *, RexxObject *, RexxObject *, RexxSource *a)
Definition: MethodClass.cpp:503
TheStringClass
#define TheStringClass
Definition: RexxCore.h:162
RexxClass::hasUninitDefined
bool hasUninitDefined()
Definition: ClassClass.hpp:117
new_string
RexxString * new_string(const char *s, stringsize_t l)
Definition: StringClass.hpp:524
RexxClass::flatten
void flatten(RexxEnvelope *)
Definition: ClassClass.cpp:104
CHAR_UNINIT
char CHAR_UNINIT[]
RexxHashTableCollection::value
RexxObject * value(HashLink pos)
Definition: RexxCollection.hpp:89
HashCode
size_t HashCode
Definition: ObjectClass.hpp:77
ARG_ONE
const int ARG_ONE
Definition: RexxCore.h:80
Error_Execution_recursive_inherit
#define Error_Execution_recursive_inherit
Definition: RexxErrorCodes.h:547
OREF_NULL
#define OREF_NULL
Definition: RexxCore.h:60
RexxTable::stringAdd
RexxObject * stringAdd(RexxObject *, RexxString *)
Definition: TableClass.cpp:94
ArrayClass.hpp
RexxClass::subClasses
RexxList * subClasses
Definition: ClassClass.hpp:172
RexxClass::setParentHasUninitDefined
void setParentHasUninitDefined()
Definition: ClassClass.hpp:123
RexxBehaviour::methodDictionaryMerge
void methodDictionaryMerge(RexxTable *)
Definition: RexxBehaviour.cpp:690
IntegerTwo
#define IntegerTwo
Definition: RexxCore.h:190
RexxClass
Definition: ClassClass.hpp:49
RexxInternalObject::setBehaviour
void setBehaviour(RexxBehaviour *b)
Definition: ObjectClass.hpp:265
ProtectedObject.hpp
RexxClass::metaClassScopes
RexxIdentityTable * metaClassScopes
Definition: ClassClass.hpp:162
RexxClass::classInstance
static RexxClass * classInstance
Definition: ClassClass.hpp:136
RexxString::concatToCstring
RexxString * concatToCstring(const char *)
Definition: StringClass.cpp:1251
ProtectedObject
Definition: ProtectedObject.hpp:46
RexxClass::setHasUninitDefined
void setHasUninitDefined()
Definition: ClassClass.hpp:118
RexxList::getValue
RexxObject * getValue(size_t i)
Definition: ListClass.cpp:275
StringClass.hpp
RexxClass::classFlags
uint32_t classFlags
Definition: ClassClass.hpp:170
RexxClass::instanceMethodDictionary
RexxTable * instanceMethodDictionary
Definition: ClassClass.hpp:157
RexxClass::newRexx
RexxClass * newRexx(RexxObject **args, size_t argCount)
Definition: ClassClass.cpp:1578
Error_Execution_baseclass
#define Error_Execution_baseclass
Definition: RexxErrorCodes.h:546
RexxClass::metaClassMethodDictionary
RexxArray * metaClassMethodDictionary
Definition: ClassClass.hpp:161
RexxClass::id
RexxString * id
Definition: ClassClass.hpp:150
RexxClass::live
void live(size_t)
Definition: ClassClass.cpp:66
RexxClass::createInstance
static void createInstance()
Definition: ClassClass.cpp:1678
RexxClass::createInstanceBehaviour
void createInstanceBehaviour(RexxBehaviour *)
Definition: ClassClass.cpp:969
RexxSupplier::index
RexxObject * index()
Definition: SupplierClass.cpp:166
RexxClass::liveGeneral
void liveGeneral(int reason)
Definition: ClassClass.cpp:85
RexxClass::defaultName
RexxString * defaultName()
Definition: ClassClass.cpp:369
RexxBehaviour::merge
void merge(RexxBehaviour *)
Definition: RexxBehaviour.cpp:657
RexxBehaviour::copy
RexxObject * copy()
Definition: RexxBehaviour.cpp:163
IntegerOne
#define IntegerOne
Definition: RexxCore.h:189
RexxClass::inherit
RexxObject * inherit(RexxClass *, RexxClass *)
Definition: ClassClass.cpp:1118
RexxClass::getMetaClass
RexxClass * getMetaClass()
Definition: ClassClass.cpp:275
TheClassBehaviour
#define TheClassBehaviour
Definition: PrimitiveBehaviourNames.h:54
RexxArray::addLast
size_t addLast(RexxObject *item)
Definition: ArrayClass.hpp:196
memory_mark
#define memory_mark(oref)
Definition: RexxMemory.hpp:436
lastMessageName
RexxString * lastMessageName()
Definition: ActivityManager.hpp:257
new_table
RexxTable * new_table()
Definition: TableClass.hpp:76
RexxClass::setInitialFlagState
void setInitialFlagState()
Definition: ClassClass.hpp:121
TheNumberStringClass
#define TheNumberStringClass
Definition: RexxCore.h:158
RexxClass::getSuperClasses
RexxArray * getSuperClasses()
Definition: ClassClass.cpp:314
RexxBehaviour::checkScope
bool checkScope(RexxObject *)
Definition: RexxBehaviour.cpp:643
HashLink
size_t HashLink
Definition: RexxHashTable.hpp:49
RexxClass::instanceBehaviour
RexxBehaviour * instanceBehaviour
Definition: ClassClass.hpp:155
RexxClass::setMetaClass
void setMetaClass(RexxClass *)
Definition: ClassClass.cpp:1463
RexxClass::createClassBehaviour
void createClassBehaviour(RexxBehaviour *)
Definition: ClassClass.cpp:894
RexxClass::isPrimitiveClass
bool isPrimitiveClass()
Definition: ClassClass.hpp:124
REQUEST_STRING
RexxString * REQUEST_STRING(RexxObject *object)
Definition: RexxCore.h:276
RexxClass::makeProxy
RexxObject * makeProxy(RexxEnvelope *)
Definition: ClassClass.cpp:120
RexxClass::isRexxDefined
bool isRexxDefined()
Definition: ClassClass.hpp:114
RexxString::strCompare
bool strCompare(const char *s)
Definition: StringClass.hpp:346
RexxClass::equal
RexxObject * equal(RexxObject *)
Definition: ClassClass.cpp:197
RexxString::concatWithCstring
RexxString * concatWithCstring(const char *)
Definition: StringClass.cpp:1271
RexxClass::instanceSuperClasses
RexxArray * instanceSuperClasses
Definition: ClassClass.hpp:167
RexxTable
Definition: TableClass.hpp:49
RexxClass::updateSubClasses
void updateSubClasses()
Definition: ClassClass.cpp:840
RexxClass::setInstanceBehaviour
void setInstanceBehaviour(RexxBehaviour *)
Definition: ClassClass.cpp:290
RexxIdentityTable::add
virtual RexxObject * add(RexxObject *, RexxObject *)
Definition: IdentityTableClass.cpp:161
TheNullArray
#define TheNullArray
Definition: RexxCore.h:182
RexxClass::getBaseClass
RexxClass * getBaseClass()
Definition: ClassClass.cpp:267
new_list
RexxList * new_list()
Definition: ListClass.hpp:147
RexxList::weakReferenceArray
RexxArray * weakReferenceArray()
Definition: ListClass.cpp:1155
RexxClass::deleteMethod
RexxObject * deleteMethod(RexxString *)
Definition: ClassClass.cpp:754
RexxBehaviour::addScope
RexxObject * addScope(RexxObject *)
Definition: RexxBehaviour.cpp:610
RexxClass::isCompatibleWith
bool isCompatibleWith(RexxClass *other)
Definition: ClassClass.cpp:1493
RexxArray::deleteItem
RexxObject * deleteItem(size_t index)
Definition: ArrayClass.cpp:2216
RexxSupplier::available
RexxInteger * available()
Definition: SupplierClass.cpp:122
RexxClass::defineMethods
RexxObject * defineMethods(RexxTable *)
Definition: ClassClass.cpp:676
RexxClass::isMetaClass
bool isMetaClass()
Definition: ClassClass.hpp:116
RexxClass::removeClassMethod
void removeClassMethod(RexxString *method_name)
Definition: ClassClass.cpp:740
RexxBehaviour::setMethodDictionary
void setMethodDictionary(RexxTable *m)
Definition: RexxBehaviour.hpp:94
RexxClass::setRexxDefined
RexxObject * setRexxDefined()
Definition: ClassClass.cpp:258
TheNilObject
#define TheNilObject
Definition: RexxCore.h:180
RexxBehaviour::define
RexxObject * define(RexxString *, RexxMethod *)
Definition: RexxBehaviour.cpp:249
RexxBehaviour::deleteMethod
RexxObject * deleteMethod(RexxString *)
Definition: RexxBehaviour.cpp:400
Error_Logical_value_method
#define Error_Logical_value_method
Definition: RexxErrorCodes.h:273
RexxClass::updateInstanceSubClasses
void updateInstanceSubClasses()
Definition: ClassClass.cpp:872
RexxHashTableCollection::available
bool available(HashLink pos)
Definition: RexxCollection.hpp:91
RexxIdentityTable
Definition: IdentityTableClass.hpp:49
RexxClass::metaClass
RexxArray * metaClass
Definition: ClassClass.hpp:159
RexxBehaviour::setOwningClass
void setOwningClass(RexxClass *c)
Definition: RexxBehaviour.hpp:98
RexxClass::getInstanceBehaviourDictionary
RexxTable * getInstanceBehaviourDictionary()
Definition: ClassClass.cpp:382
RexxActivity.hpp
RexxBehaviour::setEnhanced
void setEnhanced()
Definition: RexxBehaviour.hpp:111
RexxClass::setMetaClass
void setMetaClass()
Definition: ClassClass.hpp:128
LIST_END
#define LIST_END
Definition: ListClass.hpp:60
stringArgument
RexxString * stringArgument(RexxObject *object, size_t position)
Definition: RexxCore.h:296
RexxClass::isSubclassOf
RexxObject * isSubclassOf(RexxClass *other)
Definition: ClassClass.cpp:1525
RexxClass::notEqual
RexxObject * notEqual(RexxObject *)
Definition: ClassClass.cpp:219
RexxBehaviour::setScopes
RexxObject * setScopes(RexxIdentityTable *)
Definition: RexxBehaviour.cpp:599
RexxArray::addFirst
size_t addFirst(RexxObject *item)
Definition: ArrayClass.hpp:197
ClassClass.hpp
RexxClass::processNewArgs
static void processNewArgs(RexxObject **, size_t, RexxObject ***, size_t *, size_t, RexxObject **, RexxObject **)
Definition: ClassClass.cpp:1701
RexxSupplier::next
RexxObject * next()
Definition: SupplierClass.cpp:131
RexxCore.h
RexxArray::insertAfter
size_t insertAfter(RexxObject *item, size_t index)
Definition: ArrayClass.hpp:198
DirectoryClass.hpp
RexxMethod
Definition: MethodClass.hpp:101
new_object
RexxObject * new_object(size_t s)
Definition: RexxMemory.hpp:422
RexxClass::methodDictionaryCreate
RexxTable * methodDictionaryCreate(RexxTable *, RexxClass *)
Definition: ClassClass.cpp:1071
RexxList::firstIndex
size_t firstIndex()
Definition: ListClass.hpp:84
RexxTable::stringPut
RexxObject * stringPut(RexxObject *, RexxString *)
Definition: TableClass.cpp:113
RexxBehaviour::subclass
void subclass(RexxBehaviour *)
Definition: RexxBehaviour.cpp:415
RexxInteger
Definition: IntegerClass.hpp:56
RexxString::upper
RexxString * upper()
Definition: StringClass.cpp:1442
RexxSupplier::value
RexxObject * value()
Definition: SupplierClass.cpp:146
RexxClass::removeSubclass
void removeSubclass(RexxClass *c)
Definition: ClassClass.cpp:1270
RexxClass::PRIMITIVE_CLASS
Definition: ClassClass.hpp:145
WeakReference
Definition: WeakReferenceClass.hpp:54
RexxObject
Definition: ObjectClass.hpp:311
TheIntegerClass
#define TheIntegerClass
Definition: RexxCore.h:151
RexxHashTableCollection::supplier
RexxSupplier * supplier()
Definition: RexxCollection.cpp:476
RexxBehaviour::getMethodDictionary
RexxTable * getMethodDictionary()
Definition: RexxBehaviour.hpp:93
RexxBehaviour::mergeScope
RexxObject * mergeScope(RexxObject *)
Definition: RexxBehaviour.cpp:628
RexxClass::uninherit
RexxObject * uninherit(RexxClass *)
Definition: ClassClass.cpp:1221
RexxString
Definition: StringClass.hpp:119
RexxBehaviour::setInstanceMethodDictionary
void setInstanceMethodDictionary(RexxTable *m)
Definition: RexxBehaviour.hpp:95
RexxClass::isMixinClass
bool isMixinClass()
Definition: ClassClass.hpp:115