55 @abstract Allocate an instance of the desired object.
56 @discussion The OSTypeAlloc macro can be used to break the binary compatibility difficulties presented by new. The problem is that C++ compiles the knowledge of the size of the class into the cade calling new. If you use the alloc code however the class size is determined by the callee not the caller.
57 @param type Name of the desired type to be created.
58 @result 'this' if object cas been successfully created.
77 @abstract Roughly analogous to (type *) inst, but check if valid first.
78 @discussion OSDynamicCast is an attempt to implement a rudimentary equivalent to rtti's dynamic_cast<T> operator. Embedded-C++ doesn't allow the use of rtti. OSDynamicCast is build on the OSMetaClass mechanism. Note it is safe to call this with a 0 parameter.
79 @param type name of desired class name. Notice that it is assumed that you desire to cast to a pointer to an object of this type. Also type qualifiers, like const, are not recognized and will cause an, usually obscure, compile error.
80 @param inst Pointer to object that you wish to attempt to type cast. May be 0.
81 @result inst if object non-zero and it is of the desired type, otherwise 0.
167 @abstract Primary implementation of the release mechanism.
168 @discussion If $link retainCount <= the when argument then call $link free(). This indirect implementation of $link release allows the developer to break reference circularity. An example of this sort of problem is a parent/child mutual reference, either the parent or child can implement: void release() { release(2); } thus breaking the cirularity.
169 @param when When retainCount == when then call free(). */
199 @discussion OSMetaClassBase::isEqualTo implements this as a shallow pointer comparison. The OS container classes do a more meaningful comparison. Your mileage may vary.
355 @discussion This constructor is protected and cannot not be used to instantiate an OSMetaClass object, i.e. OSMetaClass is an abstract class. This function stores the currently constructing OSMetaClass instance away for later processing. See preModLoad and postModLoad.
356 @param inClassName cString of the name of the class this meta-class represents.
357 @param inSuperClassName cString of the name of the super class.
365 @discussion If this function is called it means that the object code that implemented this class is actually in the process of unloading. The destructor removes all reference's to the subclass from the runtime type information system. */
376 @abstract Prepare the runtime type system for the load of a module.
377 @discussion Prepare the runtime type information system for the loading of new all meta-classes constructed between now and the next postModLoad. preModLoad grab's a lock so that the runtime type information system loading can be protected, the lock is released by the postModLoad function. Any OSMetaClass that is constructed between the bracketing pre and post calls will be assosiated with the module name.
378 @param kmodName globally unique cString name of the kernel module being loaded.
379 @result If success full return a handle to be used in later calls 0 otherwise. */
389 @abstract Finish postprocessing on a kernel module's meta-classes.
390 @discussion As the order of static object construction is undefined it is necessary to process the constructors in two phases. These phases rely on global information that is created be the preparation step, preModLoad, which also guarantees single threading between multiple modules. Phase one was the static construction of each meta-class object one by one withing the context prepared by the preModLoad call. postModLoad is the second phase of processing. Inserts links all of the super class inheritance chains up, inserts the meta-classes into the global register of classes and records for each meta-class which kernel module caused it's construction. Finally it cleans up the temporary storage and releases the single threading lock and returns whatever error has been recorded in during the construction phase or the post processing phase.
391 @param loadHandle Handle returned when a successful call to preModLoad is made.
392 @result Error code of the first error encountered. */
396 @abstract Do any of the objects represented by OSMetaClass and associated with the given kernel module name have instances?
397 @discussion Check all meta-classes associated with the module name and check their instance counts. This function is used to check to see if a module can be unloaded. Obviously if an instance is still outstanding it isn't safe to unload the code that relies on that object.
398 @param kmodName cString of the kernel module name.
399 @result true if there are any current instances of any class in the module.
404 @abstract Log any object that has instances in a module.
405 @discussion When a developer ask for a module to be unloaded but the unload fails due to outstanding instances. This function will report which classes still have instances. It is intended mostly for developers to find problems with unloading classes and will be called automatically by 'verbose' unloads.
406 @param kmodName cString of the kernel module name. */
459 @abstract Counts the instances of the class behind this metaclass.
460 @discussion Every non-abstract class that inherits from OSObject has a default constructor that calls it's own meta-class' instanceConstructed function. This constructor is defined by the OSDefineMetaClassAndStructors macro (qv) that all OSObject subclasses must use. Also if the instance count goes from 0 to 1, ie the first instance, then increment the instance count of the super class */
464 @abstract Removes one instance of the class behind this metaclass.
465 @discussion OSObject's free function calls this method just before it does a 'delete this' on itself. If the instance count transitions from 1 to 0, i.e. the last object, then one instance of the superclasses is also removed. */
503 @abstract Allocate an instance of the class that this OSMetaClass instance represents.
504 @discussion This alloc function is analogous to the old ObjC class alloc method. Typically not used by clients as the static function allocClassWithName is more generally useful. Infact that function is implemented in terms of this virtual function. All subclass's of OSMetaClass must implement this function but that is what the OSDefineMetaClassAndStructor's families of macros does for the developer automatically.
505 @result Pointer to a new object with a retain count of 1. */
529 @abstract One of the macro's used in the class declaration of all subclasses of OSObject, declares runtime type information data and interfaces.
530 @discussion Macro used in the class declaration all subclasses of OSObject, declares runtime type information data and interfaces. By convention it should be 'called' immediately after the opening brace in a class declaration. It leaves the current privacy state as 'protected:'.
540 @abstract One of the macro's used in the class declaration of all subclasses of OSObject, declares runtime type information data and interfaces.
541 @discussion This macro is used when the class being declared has one or more '= 0' pure virtual methods and thus it is illegal to create an instance of this class. It leaves the current privacy state as 'protected:'.
591 @abstract Primary definition macro for all abstract classes that a subclasses of OSObject.
592 @discussion Define an OSMetaClass subclass and the primary constructors and destructors for a subclass of OSObject that is an abstract class. In general this 'function' is 'called' at the top of the file just before the first function is implemented for a particular class. Once the OSMetaClass has been constructed, at load time, call the init routine. NB you can not rely on the order of execution of the init routines.
593 @param className Name of class. NO QUOTES and NO MACROS.
594 @param superClassName Name of super class. NO QUOTES and NO MACROS.
595 @param init Name of a function to call after the OSMetaClass is constructed. */
602 @discussion Define an OSMetaClass subclass and the primary constructors and destructors for a subclass of OSObject that isn't an abstract class. In general this 'function' is 'called' at the top of the file just before the first function is implemented for a particular class. Once the OSMetaClass has been constructed, at load time, call the init routine. NB you can not rely on the order of execution of the init routines.
603 @param className Name of class. NO QUOTES and NO MACROS.
604 @param superClassName Name of super class. NO QUOTES and NO MACROS.
605 @param init Name of a function to call after the OSMetaClass is constructed. */
619 @abstract Define an OSMetaClass subclass and the runtime system routines.
620 @discussion Define an OSMetaClass subclass and the primary constructors and destructors for a subclass of OSObject that isn't an abstract class. In general this 'function' is 'called' at the top of the file just before the first function is implemented for a particular class.
621 @param className Name of class. NO QUOTES and NO MACROS.
622 @param superClassName Name of super class. NO QUOTES and NO MACROS. */
627 @abstract Define an OSMetaClass subclass and the runtime system routines.
628 @discussion Define an OSMetaClass subclass and the primary constructors and destructors for a subclass of OSObject that is an abstract class. In general this 'function' is 'called' at the top of the file just before the first function is implemented for a particular class.
629 @param className Name of class. NO QUOTES and NO MACROS.
630 @param superClassName Name of super class. NO QUOTES and NO MACROS. */