#include <LibraryPackage.hpp>
Protected Attributes | |
RexxPackageEntry * | package |
RexxString * | libraryName |
RexxDirectory * | routines |
RexxDirectory * | methods |
SysLibrary | lib |
bool | loaded |
bool | internal |
Additional Inherited Members | |
Static Public Member Functions inherited from RexxInternalObject | |
static size_t | getObjectHeaderSize () |
Public Attributes inherited from RexxInternalObject | |
ObjectHeader | header |
RexxBehaviour * | behaviour |
Protected Member Functions inherited from RexxVirtualBase | |
virtual | ~RexxVirtualBase () |
virtual void | baseVirtual () |
Definition at line 57 of file LibraryPackage.hpp.
LibraryPackage::LibraryPackage | ( | RexxString * | n | ) |
Constructor for a loaded package.
n | Name of the library associated with this package. This is also the name used to load the library when requested. |
Definition at line 73 of file LibraryPackage.cpp.
References libraryName, and OrefSet.
LibraryPackage::LibraryPackage | ( | RexxString * | n, |
RexxPackageEntry * | p | ||
) |
Constructor for a loaded package.
n | Name of the library associated with this package. This is also the name used to load the library when requested. |
m | The package manager that orchestrates the loading operations. |
p | The packag table attached to this package name. |
Definition at line 86 of file LibraryPackage.cpp.
References libraryName, and OrefSet.
|
inline |
Definition at line 67 of file LibraryPackage.hpp.
RexxPackageEntry * LibraryPackage::getPackageTable | ( | ) |
Load a library and see if it is possible to retrieve a package entry from the library.
Definition at line 181 of file LibraryPackage.cpp.
References SysLibrary::getProcedure(), RexxString::getStringData(), lib, libraryName, SysLibrary::load(), loaded, loader(), and SysLibrary::reset().
|
inline |
Definition at line 86 of file LibraryPackage.hpp.
|
inline |
Definition at line 85 of file LibraryPackage.hpp.
References loaded.
|
virtual |
Normal live marking.
Reimplemented from RexxVirtualBase.
Definition at line 99 of file LibraryPackage.cpp.
References libraryName, memory_mark, methods, and routines.
|
virtual |
Generalized live marking.
Reimplemented from RexxVirtualBase.
Definition at line 109 of file LibraryPackage.cpp.
References libraryName, memory_mark_general, methods, and routines.
bool LibraryPackage::load | ( | ) |
Perform the initial loading of a package. The loading process involves resolving the external library and attempting to resolve a Rexx package exporter routine in the library. If the library loads, but does not have the package exporter function, this is a classic library.
If we do find a package exporter, then we can load all of the routines immediately. Method loads are deferred until the first request.
manager | The package manager we're attached to. |
Definition at line 136 of file LibraryPackage.cpp.
References loadPackage(), and package.
void LibraryPackage::loadPackage | ( | ) |
Load a package with a provided package definition.
p | The package table entry. |
Definition at line 218 of file LibraryPackage.cpp.
References ActivityManager::currentActivity, Error_Execution_library_version, libraryName, _RexxPackageEntry::loader, loadRoutines(), package, reportException(), _RexxPackageEntry::requiredVersion, REXX_CURRENT_INTERPRETER_VERSION, _RexxPackageEntry::routines, and RexxActivity::run().
Referenced by load().
void LibraryPackage::loadRoutines | ( | RexxRoutineEntry * | table | ) |
Load all of the routines in a package, registering them with the package manager.
table | The package table describing this package. |
Definition at line 245 of file LibraryPackage.cpp.
References PackageManager::addPackageRoutine(), _RexxRoutineEntry::entryPoint, libraryName, _RexxRoutineEntry::name, new_directory(), new_string(), new_upper_string(), OREF_NULL, OrefSet, RexxDirectory::put(), ROUTINE_CLASSIC_STYLE, routines, and _RexxRoutineEntry::style.
Referenced by loadPackage().
RexxMethodEntry * LibraryPackage::locateMethodEntry | ( | RexxString * | name | ) |
Locate a named method entry from the package registration table.
name | The target name. |
Definition at line 298 of file LibraryPackage.cpp.
References _RexxPackageEntry::methods, _RexxMethodEntry::name, package, RexxString::strCaselessCompare(), and _RexxMethodEntry::style.
Referenced by resolveMethod(), and resolveMethodEntry().
RexxRoutineEntry * LibraryPackage::locateRoutineEntry | ( | RexxString * | name | ) |
Locate a named function entry from the package registration table.
name | The target name. |
Definition at line 329 of file LibraryPackage.cpp.
References _RexxRoutineEntry::name, package, _RexxPackageEntry::routines, RexxString::strCaselessCompare(), and _RexxRoutineEntry::style.
Referenced by resolveRegisteredRoutineEntry(), and resolveRoutineEntry().
|
inline |
Definition at line 87 of file LibraryPackage.hpp.
|
inline |
Definition at line 63 of file LibraryPackage.hpp.
|
inline |
Definition at line 61 of file LibraryPackage.hpp.
void * LibraryPackage::operator new | ( | size_t | size | ) |
Create a new LibraryPackage object instance.
size | Size of the object. |
Definition at line 61 of file LibraryPackage.cpp.
References new_object(), and T_LibraryPackage.
|
inline |
Definition at line 60 of file LibraryPackage.hpp.
void LibraryPackage::reload | ( | ) |
Refresh a non-internal package after an image restore.
Definition at line 480 of file LibraryPackage.cpp.
References Interpreter::logicError(), OREF_NULL, and package.
Referenced by PackageManager::restore().
void LibraryPackage::reload | ( | RexxPackageEntry * | pack | ) |
Refresh an internal package after an image restore.
pack | The internal package entry. |
Definition at line 495 of file LibraryPackage.cpp.
RexxNativeMethod * LibraryPackage::resolveMethod | ( | RexxString * | name | ) |
Get a NativeCode object for a method associated with a package.
name | Name of the target method. |
Definition at line 359 of file LibraryPackage.cpp.
References RexxDirectory::at(), _RexxMethodEntry::entryPoint, libraryName, locateMethodEntry(), methods, new_directory(), OREF_NULL, OrefSet, and RexxDirectory::put().
Referenced by PackageManager::resolveMethod().
PNATIVEMETHOD LibraryPackage::resolveMethodEntry | ( | RexxString * | name | ) |
Resolve an entry point for a package method entry (used on a restore or reflatten);
name | Name of the target method. |
Definition at line 410 of file LibraryPackage.cpp.
References _RexxMethodEntry::entryPoint, Error_Execution_library_method, libraryName, locateMethodEntry(), and reportException().
PREGISTEREDROUTINE LibraryPackage::resolveRegisteredRoutineEntry | ( | RexxString * | name | ) |
Resolve an entry point for a package function entry (used on a restore or reflatten);
name | Name of the target function. |
Definition at line 458 of file LibraryPackage.cpp.
References _RexxRoutineEntry::entryPoint, Error_Execution_library_routine, libraryName, locateRoutineEntry(), reportException(), ROUTINE_CLASSIC_STYLE, and _RexxRoutineEntry::style.
RoutineClass * LibraryPackage::resolveRoutine | ( | RexxString * | name | ) |
Get a Routine object for a method associated with a package.
name | Name of the target method. |
Definition at line 395 of file LibraryPackage.cpp.
References RexxDirectory::at(), and routines.
Referenced by PackageManager::resolveRoutine().
PNATIVEROUTINE LibraryPackage::resolveRoutineEntry | ( | RexxString * | name | ) |
Resolve an entry point for a package function entry (used on a restore or reflatten);
name | Name of the target function. |
Definition at line 431 of file LibraryPackage.cpp.
References _RexxRoutineEntry::entryPoint, Error_Execution_library_routine, libraryName, locateRoutineEntry(), reportException(), ROUTINE_CLASSIC_STYLE, and _RexxRoutineEntry::style.
void LibraryPackage::unload | ( | ) |
Unload a package library.
Definition at line 155 of file LibraryPackage.cpp.
References ActivityManager::currentActivity, lib, loaded, package, RexxActivity::run(), SysLibrary::unload(), and _RexxPackageEntry::unloader.
Referenced by PackageManager::unload().
|
protected |
Definition at line 97 of file LibraryPackage.hpp.
|
protected |
Definition at line 95 of file LibraryPackage.hpp.
Referenced by getPackageTable(), and unload().
|
protected |
Definition at line 92 of file LibraryPackage.hpp.
Referenced by getPackageTable(), LibraryPackage(), live(), liveGeneral(), loadPackage(), loadRoutines(), resolveMethod(), resolveMethodEntry(), resolveRegisteredRoutineEntry(), and resolveRoutineEntry().
|
protected |
Definition at line 96 of file LibraryPackage.hpp.
Referenced by getPackageTable(), isLoaded(), and unload().
|
protected |
Definition at line 94 of file LibraryPackage.hpp.
Referenced by live(), liveGeneral(), and resolveMethod().
|
protected |
Definition at line 91 of file LibraryPackage.hpp.
Referenced by load(), loadPackage(), locateMethodEntry(), locateRoutineEntry(), reload(), and unload().
|
protected |
Definition at line 93 of file LibraryPackage.hpp.
Referenced by live(), liveGeneral(), loadRoutines(), and resolveRoutine().