LibraryPackage Class Reference

#include <LibraryPackage.hpp>

Inheritance diagram for LibraryPackage:
[legend]

Public Member Functions

void * operator new (size_t, void *ptr)
 
void operator delete (void *, void *)
 
void * operator new (size_t)
 
void operator delete (void *)
 
 LibraryPackage (RexxString *n)
 
 LibraryPackage (RexxString *n, RexxPackageEntry *p)
 
 LibraryPackage (RESTORETYPE restoreType)
 
void live (size_t liveMark)
 
void liveGeneral (int reason)
 
bool load ()
 
void unload ()
 
RexxPackageEntrygetPackageTable ()
 
void loadPackage ()
 
void loadRoutines (RexxRoutineEntry *table)
 
RexxMethodEntrylocateMethodEntry (RexxString *name)
 
RexxRoutineEntrylocateRoutineEntry (RexxString *name)
 
RexxNativeMethodresolveMethod (RexxString *name)
 
RoutineClassresolveRoutine (RexxString *name)
 
PNATIVEMETHOD resolveMethodEntry (RexxString *name)
 
PNATIVEROUTINE resolveRoutineEntry (RexxString *name)
 
PREGISTEREDROUTINE resolveRegisteredRoutineEntry (RexxString *name)
 
void reload ()
 
void reload (RexxPackageEntry *pack)
 
bool isLoaded ()
 
bool isInternal ()
 
void makeInternal ()
 
- Public Member Functions inherited from RexxInternalObject
void * operator new (size_t, RexxClass *)
 
void * operator new (size_t, RexxClass *, RexxObject **, size_t, size_t)
 
void * operator new (size_t size, void *ptr)
 
void operator delete (void *)
 
void operator delete (void *p, void *ptr)
 
 RexxInternalObject ()
 
 RexxInternalObject (RESTORETYPE restoreType)
 
virtual ~RexxInternalObject ()
 
 operator RexxObject * ()
 
size_t getObjectSize ()
 
void setObjectSize (size_t s)
 
size_t getObjectDataSize ()
 
void * getObjectDataSpace ()
 
void clearObject ()
 
void clearObject (size_t l)
 
void setVirtualFunctions (void *t)
 
void setInitHeader (size_t s, size_t markword)
 
void setInitHeader (size_t markword)
 
void setObjectLive (size_t markword)
 
void setHasReferences ()
 
void setHasNoReferences ()
 
bool hasReferences ()
 
bool hasNoReferences ()
 
void setPrimitive ()
 
void setNonPrimitive ()
 
bool isPrimitive ()
 
bool isNonPrimitive ()
 
void setInRexxPackage ()
 
bool isInRexxPackage ()
 
bool isObjectMarked (size_t markword)
 
void setObjectMark (size_t markword)
 
void clearObjectMark ()
 
bool isObjectLive (size_t mark)
 
bool isObjectDead (size_t mark)
 
bool isOldSpace ()
 
bool isNewSpace ()
 
void setNewSpace ()
 
void setOldSpace ()
 
void makeProxiedObject ()
 
bool isProxyObject ()
 
bool isSubClassOrEnhanced ()
 
bool isBaseClass ()
 
size_t getObjectTypeNumber ()
 
RexxBehaviourgetObjectType ()
 
bool isObjectType (RexxBehaviour *b)
 
bool isObjectType (size_t t)
 
bool isSameType (RexxInternalObject *o)
 
void setBehaviour (RexxBehaviour *b)
 
virtual RexxObjectmakeProxy (RexxEnvelope *)
 
virtual RexxObjectcopy ()
 
virtual RexxObjectevaluate (RexxActivation *, RexxExpressionStack *)
 
virtual RexxObjectgetValue (RexxActivation *)
 
virtual RexxObjectgetValue (RexxVariableDictionary *)
 
virtual RexxObjectgetRealValue (RexxActivation *)
 
virtual RexxObjectgetRealValue (RexxVariableDictionary *)
 
virtual void uninit ()
 
virtual HashCode hash ()
 
virtual HashCode getHashValue ()
 
HashCode identityHash ()
 
virtual bool truthValue (int)
 
virtual bool logicalValue (logical_t &)
 
virtual RexxStringmakeString ()
 
virtual RexxTextmakeText ()
 
virtual void copyIntoTail (RexxCompoundTail *buffer)
 
virtual RexxStringprimitiveMakeString ()
 
virtual RexxTextprimitiveMakeText ()
 
virtual RexxArraymakeArray ()
 
virtual RexxStringstringValue ()
 
virtual RexxTexttextValue ()
 
virtual RexxIntegerintegerValue (size_t)
 
virtual bool numberValue (wholenumber_t &result, size_t precision)
 
virtual bool numberValue (wholenumber_t &result)
 
virtual bool unsignedNumberValue (stringsize_t &result, size_t precision)
 
virtual bool unsignedNumberValue (stringsize_t &result)
 
virtual bool doubleValue (double &result)
 
virtual RexxNumberStringnumberString ()
 
virtual bool isEqual (RexxObject *)
 
virtual bool isInstanceOf (RexxClass *)
 
virtual RexxMethodinstanceMethod (RexxString *)
 
virtual RexxSupplierinstanceMethods (RexxClass *)
 
virtual RexxObjectdynamicTarget (RexxObject **arguments, size_t count, size_t named_count)
 
void hasUninit ()
 
void removedUninit ()
 
void printObject ()
 
RexxObjectclone ()
 
- Public Member Functions inherited from RexxVirtualBase
virtual void flatten (RexxEnvelope *)
 
virtual RexxObjectunflatten (RexxEnvelope *)
 

Protected Attributes

RexxPackageEntrypackage
 
RexxStringlibraryName
 
RexxDirectoryroutines
 
RexxDirectorymethods
 
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
 
RexxBehaviourbehaviour
 
- Protected Member Functions inherited from RexxVirtualBase
virtual ~RexxVirtualBase ()
 
virtual void baseVirtual ()
 

Detailed Description

Definition at line 57 of file LibraryPackage.hpp.

Constructor & Destructor Documentation

◆ LibraryPackage() [1/3]

LibraryPackage::LibraryPackage ( RexxString n)

Constructor for a loaded package.

Parameters
nName 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() [2/3]

LibraryPackage::LibraryPackage ( RexxString n,
RexxPackageEntry p 
)

Constructor for a loaded package.

Parameters
nName of the library associated with this package. This is also the name used to load the library when requested.
mThe package manager that orchestrates the loading operations.
pThe packag table attached to this package name.

Definition at line 86 of file LibraryPackage.cpp.

References libraryName, and OrefSet.

◆ LibraryPackage() [3/3]

LibraryPackage::LibraryPackage ( RESTORETYPE  restoreType)
inline

Definition at line 67 of file LibraryPackage.hpp.

Member Function Documentation

◆ getPackageTable()

RexxPackageEntry * LibraryPackage::getPackageTable ( )

Load a library and see if it is possible to retrieve a package entry from the library.

Returns
A package table entry, if possible. A load failure or no package loading routines returns NULL.

Definition at line 181 of file LibraryPackage.cpp.

References SysLibrary::getProcedure(), RexxString::getStringData(), lib, libraryName, SysLibrary::load(), loaded, loader(), and SysLibrary::reset().

◆ isInternal()

bool LibraryPackage::isInternal ( )
inline

Definition at line 86 of file LibraryPackage.hpp.

◆ isLoaded()

bool LibraryPackage::isLoaded ( )
inline

Definition at line 85 of file LibraryPackage.hpp.

References loaded.

◆ live()

void LibraryPackage::live ( size_t  liveMark)
virtual

Normal live marking.

Reimplemented from RexxVirtualBase.

Definition at line 99 of file LibraryPackage.cpp.

References libraryName, memory_mark, methods, and routines.

◆ liveGeneral()

void LibraryPackage::liveGeneral ( int  reason)
virtual

Generalized live marking.

Reimplemented from RexxVirtualBase.

Definition at line 109 of file LibraryPackage.cpp.

References libraryName, memory_mark_general, methods, and routines.

◆ load()

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.

Parameters
managerThe package manager we're attached to.
Returns
True if we were able to load this as proper ooRexx package file, false if either step failed. We do not throw exceptions here, since these are usually loaded in the context of operations that return an error result instead of an exception.

Definition at line 136 of file LibraryPackage.cpp.

References loadPackage(), and package.

◆ loadPackage()

void LibraryPackage::loadPackage ( )

◆ loadRoutines()

void LibraryPackage::loadRoutines ( RexxRoutineEntry table)

Load all of the routines in a package, registering them with the package manager.

Parameters
tableThe 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().

◆ locateMethodEntry()

RexxMethodEntry * LibraryPackage::locateMethodEntry ( RexxString name)

Locate a named method entry from the package registration table.

Parameters
nameThe target name.
Returns
The entry associated with the target entry, if it exists. NULL indicates a not found condition.

Definition at line 298 of file LibraryPackage.cpp.

References _RexxPackageEntry::methods, _RexxMethodEntry::name, package, RexxString::strCaselessCompare(), and _RexxMethodEntry::style.

Referenced by resolveMethod(), and resolveMethodEntry().

◆ locateRoutineEntry()

RexxRoutineEntry * LibraryPackage::locateRoutineEntry ( RexxString name)

Locate a named function entry from the package registration table.

Parameters
nameThe target name.
Returns
A pointer to the located function structure. Returns NULL if the package doesn't exist.

Definition at line 329 of file LibraryPackage.cpp.

References _RexxRoutineEntry::name, package, _RexxPackageEntry::routines, RexxString::strCaselessCompare(), and _RexxRoutineEntry::style.

Referenced by resolveRegisteredRoutineEntry(), and resolveRoutineEntry().

◆ makeInternal()

void LibraryPackage::makeInternal ( )
inline

Definition at line 87 of file LibraryPackage.hpp.

◆ operator delete() [1/2]

void LibraryPackage::operator delete ( void *  )
inline

Definition at line 63 of file LibraryPackage.hpp.

◆ operator delete() [2/2]

void LibraryPackage::operator delete ( void *  ,
void *   
)
inline

Definition at line 61 of file LibraryPackage.hpp.

◆ operator new() [1/2]

void * LibraryPackage::operator new ( size_t  size)

Create a new LibraryPackage object instance.

Parameters
sizeSize of the object.
Returns
Pointer to new object storage.

Definition at line 61 of file LibraryPackage.cpp.

References new_object(), and T_LibraryPackage.

◆ operator new() [2/2]

void* LibraryPackage::operator new ( size_t  ,
void *  ptr 
)
inline

Definition at line 60 of file LibraryPackage.hpp.

◆ reload() [1/2]

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().

◆ reload() [2/2]

void LibraryPackage::reload ( RexxPackageEntry pack)

Refresh an internal package after an image restore.

Parameters
packThe internal package entry.

Definition at line 495 of file LibraryPackage.cpp.

◆ resolveMethod()

RexxNativeMethod * LibraryPackage::resolveMethod ( RexxString name)

Get a NativeCode object for a method associated with a package.

Parameters
nameName of the target method.
Returns
A RexxNativeCode object for this method, if located.

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().

◆ resolveMethodEntry()

PNATIVEMETHOD LibraryPackage::resolveMethodEntry ( RexxString name)

Resolve an entry point for a package method entry (used on a restore or reflatten);

Parameters
nameName of the target method.
Returns
The target entry point.

Definition at line 410 of file LibraryPackage.cpp.

References _RexxMethodEntry::entryPoint, Error_Execution_library_method, libraryName, locateMethodEntry(), and reportException().

◆ resolveRegisteredRoutineEntry()

PREGISTEREDROUTINE LibraryPackage::resolveRegisteredRoutineEntry ( RexxString name)

Resolve an entry point for a package function entry (used on a restore or reflatten);

Parameters
nameName of the target function.
Returns
The target entry point.

Definition at line 458 of file LibraryPackage.cpp.

References _RexxRoutineEntry::entryPoint, Error_Execution_library_routine, libraryName, locateRoutineEntry(), reportException(), ROUTINE_CLASSIC_STYLE, and _RexxRoutineEntry::style.

◆ resolveRoutine()

RoutineClass * LibraryPackage::resolveRoutine ( RexxString name)

Get a Routine object for a method associated with a package.

Parameters
nameName of the target method.
Returns
A RexxNativeCode object for this method, if located.

Definition at line 395 of file LibraryPackage.cpp.

References RexxDirectory::at(), and routines.

Referenced by PackageManager::resolveRoutine().

◆ resolveRoutineEntry()

PNATIVEROUTINE LibraryPackage::resolveRoutineEntry ( RexxString name)

Resolve an entry point for a package function entry (used on a restore or reflatten);

Parameters
nameName of the target function.
Returns
The target entry point.

Definition at line 431 of file LibraryPackage.cpp.

References _RexxRoutineEntry::entryPoint, Error_Execution_library_routine, libraryName, locateRoutineEntry(), reportException(), ROUTINE_CLASSIC_STYLE, and _RexxRoutineEntry::style.

◆ unload()

void LibraryPackage::unload ( )

Member Data Documentation

◆ internal

bool LibraryPackage::internal
protected

Definition at line 97 of file LibraryPackage.hpp.

◆ lib

SysLibrary LibraryPackage::lib
protected

Definition at line 95 of file LibraryPackage.hpp.

Referenced by getPackageTable(), and unload().

◆ libraryName

◆ loaded

bool LibraryPackage::loaded
protected

Definition at line 96 of file LibraryPackage.hpp.

Referenced by getPackageTable(), isLoaded(), and unload().

◆ methods

RexxDirectory* LibraryPackage::methods
protected

Definition at line 94 of file LibraryPackage.hpp.

Referenced by live(), liveGeneral(), and resolveMethod().

◆ package

RexxPackageEntry* LibraryPackage::package
protected

◆ routines

RexxDirectory* LibraryPackage::routines
protected

Definition at line 93 of file LibraryPackage.hpp.

Referenced by live(), liveGeneral(), loadRoutines(), and resolveRoutine().


The documentation for this class was generated from the following files: