|
From: Frank V. C. <fr...@us...> - 2000-11-19 05:19:56
|
Update of /cvsroot/corelinux/clfw/clfw/LibLoad In directory slayer.i.sourceforge.net:/tmp/cvs-serv5509/clfw/LibLoad Modified Files: LibraryInstance.hpp LibraryObject.hpp LibraryObjectRegistry.hpp Log Message: 122753 LibraryLoader refit Index: LibraryInstance.hpp =================================================================== RCS file: /cvsroot/corelinux/clfw/clfw/LibLoad/LibraryInstance.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** LibraryInstance.hpp 2000/11/19 03:18:28 1.2 --- LibraryInstance.hpp 2000/11/19 05:19:52 1.3 *************** *** 26,29 **** --- 26,33 ---- #endif + #if !defined(__METACLASS_HPP) + #include <MetaClass.hpp> + #endif + namespace corelinux { *************** *** 90,95 **** @param CharCptr to the name of the object @return The instance of the LibraryObject ! @exception NullPointerException if the name is ! the empty string */ --- 94,98 ---- @param CharCptr to the name of the object @return The instance of the LibraryObject ! @exception NullPointerException if the name is null */ *************** *** 107,110 **** --- 110,124 ---- throw ( NullPointerException )= 0; + /** + Returns the MetaClassPtr that represents the canonical + reference point from which all other types for this + library are subsumed + @return MetaClassPtr to top level class + */ + + virtual MetaClassPtr getObjectClassParent( void ) const ; + + + protected: *************** *** 114,119 **** LibraryObjectRegistry::createObject @param CharCptr to the name of the object ! @exception NullPointerException if the name is ! the empty string */ --- 128,132 ---- LibraryObjectRegistry::createObject @param CharCptr to the name of the object ! @exception NullPointerException if the name is null */ Index: LibraryObject.hpp =================================================================== RCS file: /cvsroot/corelinux/clfw/clfw/LibLoad/LibraryObject.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** LibraryObject.hpp 2000/11/19 03:18:28 1.2 --- LibraryObject.hpp 2000/11/19 05:19:52 1.3 *************** *** 35,44 **** /** ! LibraryObject is the individual of type LibraryObjectDefinition */ class LibraryObject : public Aggregate { - DECLARE_METATYPEMEMBERS( LibraryObject ); --- 35,46 ---- /** ! LibraryObject is the individual of type MetaTypeLibraryObject, ! derivations that are to be used in instantiating instances must ! support 'create' dispatch call that creates an instance ! of the class. */ class LibraryObject : public Aggregate { DECLARE_METATYPEMEMBERS( LibraryObject ); Index: LibraryObjectRegistry.hpp =================================================================== RCS file: /cvsroot/corelinux/clfw/clfw/LibLoad/LibraryObjectRegistry.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** LibraryObjectRegistry.hpp 2000/11/19 03:18:28 1.3 --- LibraryObjectRegistry.hpp 2000/11/19 05:19:52 1.4 *************** *** 54,65 **** DECLARE_TYPE( struct __LibObjectReference, LibObjectReference ); CORELINUX_MAP ( ! LibraryInstancePtr, LibObjectReference, ! less<LibraryInstancePtr>, ObjectInstanceMap ); /** The LibraryObjectRegistry --- 54,81 ---- DECLARE_TYPE( struct __LibObjectReference, LibObjectReference ); + struct KeyComp + { + bool operator()(CharCptr s1, CharCptr s2) const + { + return strcmp(s1, s2) < 0; + } + }; + CORELINUX_MAP ( ! CharCptr, LibObjectReference, ! KeyComp, ObjectInstanceMap ); + CORELINUX_MAP + ( + LibraryInstancePtr, + ObjectInstanceMap, + less<LibraryInstancePtr>, + LibraryInstanceMap + ); + /** The LibraryObjectRegistry *************** *** 94,100 **** /** Performs a lookup of the object description using the instance ! name as key. When the description is resolved, a library object ! instance is returned. The management of the LibraryObject ! instances is a responsibility of the LibraryObjectDefinition. @param LibraryInstance pointer to library instance. This is passed to the LibraryObjectDefinition if found. --- 110,117 ---- /** Performs a lookup of the object description using the instance ! name as key. When the description is resolved, a library ! objectinstance is returned. The management of the ! LibraryObject instances is a responsibility of the ! LibraryObject MetaClass @param LibraryInstance pointer to library instance. This is passed to the LibraryObjectDefinition if found. *************** *** 105,109 **** */ ! static LibraryObjectPtr createObject ( LibraryInstancePtr, --- 122,126 ---- */ ! static LibraryObjectPtr getObject ( LibraryInstancePtr, *************** *** 123,127 **** */ ! static void destroyObject( LibraryInstancePtr, LibraryObjectPtr ) throw ( NullPointerException ); --- 140,144 ---- */ ! static void returnObject( LibraryInstancePtr, LibraryObjectPtr ) throw ( NullPointerException ); *************** *** 134,148 **** // ! // Accessors // ! /// Return true if name is already a key ! bool isLibraryDefined( CharCptr ) const; - // - // Mutators - // protected: --- 151,182 ---- // ! // Mutators // ! /** ! This is called from the static method to resolve either ! from the registry cache, or via MetaClass lookup and ! calling the 'create' dispatch on the MetaClass child of ! LibraryObject ! @param LibraryInstancePtr to LibraryInstance ! @param CharCptr to LibraryObject type class name ! @return LibraryObjectPtr to instance or null if not found ! */ ! LibraryObjectPtr resolveObject ! ( ! LibraryInstancePtr, ! CharCptr ! ); + /** + This is called from the static method to either keep + the object in the cache, or get rid of it + @param LibraryInstancePtr to LibraryInstance + @param LibraryObject pointer. + */ + + void disgardObject( LibraryInstancePtr, LibraryObjectPtr ); protected: *************** *** 156,160 **** /// The map of libraries to their objects ! ObjectInstanceMap theInstances; }; --- 190,194 ---- /// The map of libraries to their objects ! LibraryInstanceMap theInstances; }; |