mixin_prims.hpp

Go to the documentation of this file.
00001 /* Copyright 1994, 1995 LongView Technologies L.L.C. $Revision: 1.15 $ */
00002 /* Copyright (c) 2006, Sun Microsystems, Inc.
00003 All rights reserved.
00004 
00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 
00006 following conditions are met:
00007 
00008     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
00009     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 
00010           disclaimer in the documentation and/or other materials provided with the distribution.
00011     * Neither the name of Sun Microsystems nor the names of its contributors may be used to endorse or promote products derived 
00012           from this software without specific prior written permission.
00013 
00014 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 
00015 NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 
00016 THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
00017 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
00018 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 
00019 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
00020 
00021 
00022 */
00023 
00024 // Primitives for mixins
00025 
00026 class mixinOopPrimitives : AllStatic {
00027  private: 
00028   static void inc_calls() { number_of_calls++; }
00029  public:
00030   static int number_of_calls;
00031 
00032   // METHODS
00033 
00034   //%prim
00035   // <NoReceiver> primitiveMixinNumberOfMethodsOf: mixin <Mixin>
00036   //                                       ifFail: failBlock <PrimFailBlock> ^<SmallInteger> =
00037   //   Internal { name  = 'mixinOopPrimitives::number_of_methods' }
00038   //%
00039   static PRIM_DECL_1(number_of_methods, oop mixin);
00040 
00041   //%prim
00042   // <NoReceiver> primitiveMixin: mixin     <Mixin>
00043   //                    methodAt: index     <SmallInteger>
00044   //                      ifFail: failBlock <PrimFailBlock> ^<Method> =
00045   //   Internal { error = #(OutOfBounds)
00046   //              name  = 'mixinOopPrimitives::method_at' }
00047   //%
00048   static PRIM_DECL_2(method_at, oop mixin, oop index);
00049 
00050   //%prim
00051   // <NoReceiver> primitiveMixin: mixin     <Mixin>
00052   //                   addMethod: method    <Method>
00053   //                      ifFail: failBlock <PrimFailBlock> ^<Method> =
00054   //   Internal { error = #(IsInstalled)
00055   //              name  = 'mixinOopPrimitives::add_method' }
00056   //%
00057   static PRIM_DECL_2(add_method, oop mixin, oop method);
00058 
00059   //%prim
00060   // <NoReceiver> primitiveMixin: mixin     <Mixin>
00061   //              removeMethodAt: index     <SmallInteger> 
00062   //                      ifFail: failBlock <PrimFailBlock> ^<Method> =
00063   //   Internal {  error = #(IsInstalled OutOfBounds)
00064   //               name  = 'mixinOopPrimitives::remove_method_at' }
00065   //%
00066   static PRIM_DECL_2(remove_method_at, oop mixin, oop index);
00067 
00068 
00069   //%prim
00070   // <NoReceiver> primitiveMixin: mixin     <Mixin>
00071   //               methodsIfFail: failBlock <PrimFailBlock> ^<Symbol> =
00072   //   Internal { name  = 'mixinOopPrimitives::methods' }
00073   //%
00074   static PRIM_DECL_1(methods, oop mixin);
00075 
00076 
00077   // INSTANCE VARIABLES
00078 
00079   //%prim
00080   // <NoReceiver> primitiveMixinNumberOfInstanceVariablesOf: mixin <Mixin>
00081   //                                                 ifFail: failBlock <PrimFailBlock> ^<SmallInteger> =
00082   //   Internal { name = 'mixinOopPrimitives::number_of_instance_variables' }
00083   //%
00084   static PRIM_DECL_1(number_of_instance_variables, oop mixin);
00085 
00086   //%prim
00087   // <NoReceiver> primitiveMixin: mixin     <Mixin>
00088   //          instanceVariableAt: index     <SmallInteger>
00089   //                      ifFail: failBlock <PrimFailBlock> ^<Symbol> =
00090   //   Internal { error = #(OutOfBounds)
00091   //              name  = 'mixinOopPrimitives::instance_variable_at' }
00092   //%
00093   static PRIM_DECL_2(instance_variable_at, oop mixin, oop index);
00094 
00095   //%prim
00096   // <NoReceiver> primitiveMixin: mixin     <Mixin>
00097   //         addInstanceVariable: name      <Symbol>
00098   //                      ifFail: failBlock <PrimFailBlock> ^<Symbol> =
00099   //   Internal { error = #(IsInstalled OutOfBounds)
00100   //              name = 'mixinOopPrimitives::add_instance_variable' }
00101   //%
00102   static PRIM_DECL_2(add_instance_variable, oop mixin, oop name);
00103 
00104   //%prim
00105   // <NoReceiver> primitiveMixin: mixin     <Mixin>
00106   //    removeInstanceVariableAt: index     <SmallInteger> 
00107   //                      ifFail: failBlock <PrimFailBlock> ^<Symbol> =
00108   //   Internal { error = #(IsInstalled OutOfBounds)
00109   //              name  = 'mixinOopPrimitives::remove_instance_variable_at' }
00110   //%
00111   static PRIM_DECL_2(remove_instance_variable_at, oop mixin, oop index);
00112 
00113   //%prim
00114   // <NoReceiver> primitiveMixin: mixin     <Mixin>
00115   //     instanceVariablesIfFail: failBlock <PrimFailBlock> ^<Symbol> =
00116   //   Internal { name  = 'mixinOopPrimitives::instance_variables' }
00117   //%
00118   static PRIM_DECL_1(instance_variables, oop mixin);
00119 
00120   // CLASS VARIABLES
00121 
00122   //%prim
00123   // <NoReceiver> primitiveMixinNumberOfClassVariablesOf: mixin <Mixin>
00124   //                                              ifFail: failBlock <PrimFailBlock> ^<SmallInteger> =
00125   //   Internal { name  = 'mixinOopPrimitives::number_of_class_variables' }
00126   //%
00127   static PRIM_DECL_1(number_of_class_variables, oop mixin);
00128 
00129   //%prim
00130   // <NoReceiver> primitiveMixin: mixin     <Mixin>
00131   //             classVariableAt: index     <SmallInteger>
00132   //                      ifFail: failBlock <PrimFailBlock> ^<Symbol> =
00133   //   Internal { error = #(OutOfBounds)
00134   //              name  = 'mixinOopPrimitives::class_variable_at' }
00135   //%
00136   static PRIM_DECL_2(class_variable_at, oop mixin, oop index);
00137 
00138   //%prim
00139   // <NoReceiver> primitiveMixin: mixin     <Mixin>
00140   //            addClassVariable: name      <Symbol>
00141   //                      ifFail: failBlock <PrimFailBlock> ^<Mixin> =
00142   //   Internal {  error = #(IsInstalled OutOfBounds)
00143   //               name = 'mixinOopPrimitives::add_class_variable' }
00144   //%
00145   static PRIM_DECL_2(add_class_variable, oop mixin, oop name);
00146 
00147   //%prim
00148   // <NoReceiver> primitiveMixin: mixin     <Mixin>
00149   //       removeClassVariableAt: index     <SmallInteger> 
00150   //                      ifFail: failBlock <PrimFailBlock> ^<Symbol> =
00151   //   Internal { error = #(IsInstalled OutOfBounds)
00152   //              name  = 'mixinOopPrimitives::remove_class_variable_at' }
00153   //%
00154   static PRIM_DECL_2(remove_class_variable_at, oop mixin, oop index);
00155 
00156   //%prim
00157   // <NoReceiver> primitiveMixin: mixin     <Mixin>
00158   //        classVariablesIfFail: failBlock <PrimFailBlock> ^<Symbol> =
00159   //   Internal { name  = 'mixinOopPrimitives::class_variables' }
00160   //%
00161   static PRIM_DECL_1(class_variables, oop mixin);
00162 
00163 
00164   // PRIMARY INVOCATION
00165 
00166   //%prim
00167   // <NoReceiver> primitiveMixinPrimaryInvocationOf: mixin <Mixin>
00168   //                                         ifFail: failBlock <PrimFailBlock> ^<Class> =
00169   //   Internal { name = 'mixinOopPrimitives::primary_invocation' }
00170   //%
00171   static PRIM_DECL_1(primary_invocation, oop mixin);
00172 
00173   //%prim
00174   // <NoReceiver> primitiveMixinSetPrimaryInvocationOf: mixin <Mixin>
00175   //                                                to: class <Class>
00176   //                                            ifFail: failBlock <PrimFailBlock> ^<Class> =
00177   //   Internal { error = #(IsInstalled)
00178   //              name  = 'mixinOopPrimitives::set_primary_invocation' }
00179   //%
00180   static PRIM_DECL_2(set_primary_invocation, oop mixin, oop klass);
00181 
00182   // CLASS MIXIN
00183 
00184   //%prim
00185   // <NoReceiver> primitiveMixinClassMixinOf: mixin <Mixin>
00186   //                                  ifFail: failBlock <PrimFailBlock> ^<Mixin> =
00187   //   Internal { name = 'mixinOopPrimitives::class_mixin' }
00188   //%
00189   static PRIM_DECL_1(class_mixin, oop mixin);
00190 
00191   //%prim
00192   // <NoReceiver> primitiveMixinSetClassMixinOf: mixin      <Mixin>
00193   //                                         to: classMixin <Mixin>
00194   //                                     ifFail: failBlock <PrimFailBlock> ^<Mixin> =
00195   //   Internal { error = #(IsInstalled)
00196   //              name  = 'mixinOopPrimitives::set_class_mixin' }
00197   //%
00198   static PRIM_DECL_2(set_class_mixin, oop mixin, oop class_mixin);
00199 
00200   //%prim
00201   // <NoReceiver> primitiveMixinIsInstalled: mixin <Mixin>
00202   //                                 ifFail: failBlock <PrimFailBlock> ^<Boolean> =
00203   //   Internal { name = 'mixinOopPrimitives::is_installed' }
00204   //%
00205   static PRIM_DECL_1(is_installed, oop mixin);
00206 
00207   //%prim
00208   // <NoReceiver> primitiveMixinSetInstalled: mixin <Mixin>
00209   //                                  ifFail: failBlock <PrimFailBlock> ^<Boolean> =
00210   //   Internal { name = 'mixinOopPrimitives::set_installed' }
00211   //%
00212   static PRIM_DECL_1(set_installed, oop mixin);
00213 
00214     //%prim
00215   // <NoReceiver> primitiveMixinSetUnInstalled: mixin <Mixin>
00216   //                                    ifFail: failBlock <PrimFailBlock> ^<Boolean> =
00217   //   Internal { name = 'mixinOopPrimitives::set_uninstalled' }
00218   //%
00219   static PRIM_DECL_1(set_uninstalled, oop mixin);
00220 
00221 };

Generated on Mon Oct 9 13:37:15 2006 for Strongtalk VM by  doxygen 1.4.7