#include <RexxBehaviour.hpp>
Static Public Member Functions | |
static RexxBehaviour * | restoreSavedPrimitiveBehaviour (RexxBehaviour *b) |
static RexxBehaviour * | getPrimitiveBehaviour (size_t index) |
static PCPPM * | getOperatorMethods (size_t index) |
Static Public Member Functions inherited from RexxInternalObject | |
static size_t | getObjectHeaderSize () |
Static Public Attributes | |
static RexxBehaviour | primitiveBehaviours [] |
Protected Types | |
enum | { NON_PRIMITIVE_BEHAVIOUR = 0x0001 , ENHANCED_OBJECT = 0x0002 , INTERNAL_CLASS = 0x0004 , TRANSIENT_CLASS = 0x0008 , BEHAVIOUR_NOT_RESOLVED = 0x0010 } |
Protected Attributes | |
uint16_t | classType |
uint16_t | behaviourFlags |
RexxIdentityTable * | scopes |
RexxTable * | methodDictionary |
PCPPM * | operatorMethods |
RexxClass * | owningClass |
RexxTable * | instanceMethodDictionary |
Additional Inherited Members | |
Public Attributes inherited from RexxInternalObject | |
ObjectHeader | header |
RexxBehaviour * | behaviour |
Protected Member Functions inherited from RexxVirtualBase | |
virtual | ~RexxVirtualBase () |
virtual void | baseVirtual () |
Definition at line 49 of file RexxBehaviour.hpp.
|
protected |
Enumerator | |
---|---|
NON_PRIMITIVE_BEHAVIOUR | |
ENHANCED_OBJECT | |
INTERNAL_CLASS | |
TRANSIENT_CLASS | |
BEHAVIOUR_NOT_RESOLVED |
Definition at line 150 of file RexxBehaviour.hpp.
RexxBehaviour::RexxBehaviour | ( | size_t | newTypenum, |
PCPPM * | operator_methods | ||
) |
Definition at line 55 of file RexxBehaviour.cpp.
References RexxInternalObject::behaviour, behaviourFlags, getPrimitiveBehaviour(), RexxInternalObject::header, instanceMethodDictionary, INTERNAL_CLASS, methodDictionary, operatorMethods, OREF_NULL, owningClass, scopes, setClassType(), ObjectHeader::setObjectSize(), T_Behaviour, T_First_Transient_Class, T_Last_Exported_Class, and TRANSIENT_CLASS.
|
inline |
Definition at line 59 of file RexxBehaviour.hpp.
|
inline |
Definition at line 60 of file RexxBehaviour.hpp.
void RexxBehaviour::addMethod | ( | RexxString * | methodName, |
RexxMethod * | method | ||
) |
Definition at line 321 of file RexxBehaviour.cpp.
References instanceMethodDictionary, methodDictionary, new_table(), OREF_NULL, OrefSet, RexxHashTableCollection::remove(), RexxTable::stringAdd(), RexxTable::stringGet(), and RexxTable::stringPut().
Referenced by RexxObject::defMethod().
RexxObject * RexxBehaviour::addScope | ( | RexxObject * | scope | ) |
Definition at line 612 of file RexxBehaviour.cpp.
References RexxIdentityTable::add(), RexxIdentityTable::allAt(), new_identity_table(), OREF_NULL, OrefSet, scopes, and TheNilObject.
Referenced by RexxClass::createClassBehaviour(), RexxClass::createInstanceBehaviour(), mergeScope(), RexxClass::mergeSuperClassScopes(), RexxClass::newRexx(), and RexxClass::subClassable().
bool RexxBehaviour::checkScope | ( | RexxObject * | scope | ) |
Definition at line 645 of file RexxBehaviour.cpp.
References RexxIdentityTable::get(), OREF_NULL, and scopes.
Referenced by RexxClass::createClassBehaviour(), RexxClass::createInstanceBehaviour(), RexxClass::inherit(), mergeScope(), RexxClass::mergeSuperClassScopes(), RexxClass::methods(), and RexxMessage::send().
|
virtual |
Reimplemented from RexxInternalObject.
Definition at line 163 of file RexxBehaviour.cpp.
References RexxInternalObject::clone(), RexxHashTableCollection::copy(), instanceMethodDictionary, methodDictionary, operatorMethods, RexxObject::operatorMethods, OREF_NULL, OrefSet, scopes, and setNonPrimitive().
Referenced by RexxObject::copy(), RexxObject::defMethod(), RexxObject::defMethods(), and RexxClass::newRexx().
void RexxBehaviour::copyBehaviour | ( | RexxBehaviour * | source | ) |
Definition at line 202 of file RexxBehaviour.cpp.
References RexxHashTableCollection::copy(), instanceMethodDictionary, methodDictionary, operatorMethods, OREF_NULL, OrefSet, owningClass, and scopes.
RexxMethod * RexxBehaviour::define | ( | const char * | name, |
PCPPM | entryPoint, | ||
size_t | arguments, | ||
bool | passNamedArgs | ||
) |
Define a native kernel method on this behaviour.
name | The method name. |
entryPoint | The method entry point |
arguments | The argument definition. |
passNamedArgs | True if the named arguments must be passed. |
Definition at line 242 of file RexxBehaviour.cpp.
References define(), RexxMemory::getGlobalName(), and CPPCode::resolveExportedMethod().
RexxObject * RexxBehaviour::define | ( | RexxString * | methodName, |
RexxMethod * | method | ||
) |
Definition at line 251 of file RexxBehaviour.cpp.
References RexxMethod::getScope(), methodDictionary, new_table(), OREF_NULL, OrefSet, RexxTable::stringAdd(), RexxTable::stringGet(), RexxTable::stringPut(), and TheNilObject.
Referenced by define(), RexxMemory::defineKernelMethod(), RexxMemory::definePrivateKernelMethod(), RexxMemory::defineProtectedKernelMethod(), RexxObject::defMethods(), and RexxClass::defmeths().
RexxObject * RexxBehaviour::deleteMethod | ( | RexxString * | messageName | ) |
Definition at line 402 of file RexxBehaviour.cpp.
References methodDictionary, OREF_NULL, and RexxHashTableCollection::remove().
Referenced by RexxClass::removeClassMethod().
|
virtual |
Reimplemented from RexxVirtualBase.
Definition at line 126 of file RexxBehaviour.cpp.
References cleanUpFlatten, flatten_reference, isNonPrimitive(), and setUpFlatten.
|
inline |
Definition at line 101 of file RexxBehaviour.hpp.
References classType.
Referenced by RexxInternalObject::getObjectTypeNumber(), getSavedPrimitiveBehaviour(), RexxMemory::gutCheck(), RexxMemory::orphanCheckMark(), RexxEnvelope::puff(), resolveNonPrimitiveBehaviour(), RexxMemory::restoreImage(), RexxMemory::saveImageMark(), RexxMemory::setOref(), and subclass().
|
inline |
Definition at line 96 of file RexxBehaviour.hpp.
References instanceMethodDictionary.
Referenced by RexxObject::copy(), and RexxObject::defMethod().
RexxMethod * RexxBehaviour::getMethod | ( | RexxString * | messageName | ) |
Definition at line 387 of file RexxBehaviour.cpp.
References methodDictionary, OREF_NULL, and RexxTable::stringGet().
|
inline |
Definition at line 93 of file RexxBehaviour.hpp.
References methodDictionary.
Referenced by RexxClass::createClassBehaviour(), RexxClass::defineClassMethod(), RexxClass::getBehaviourDictionary(), RexxClass::getInstanceBehaviourDictionary(), RexxObject::instanceMethod(), RexxClass::method(), RexxClass::methods(), and restore().
RexxSupplier * RexxBehaviour::getMethods | ( | RexxObject * | scope | ) |
Extract from the method dictionary all methods defined with a given scope.
scope | The target scope. If null, then all methods are returned. |
Definition at line 562 of file RexxBehaviour.cpp.
References RexxHashTableCollection::first(), RexxHashTableCollection::index(), methodDictionary, new_array(), new_supplier(), OREF_NULL, RexxArray::put(), RexxHashTableCollection::supplier(), and RexxHashTableCollection::value().
Referenced by RexxObject::instanceMethods().
|
inline |
Definition at line 142 of file RexxBehaviour.hpp.
References operatorMethods.
Referenced by callOperatorMethod().
|
inlinestatic |
Definition at line 144 of file RexxBehaviour.hpp.
References getPrimitiveBehaviour(), and operatorMethods.
Referenced by resolveNonPrimitiveBehaviour().
|
inline |
Definition at line 97 of file RexxBehaviour.hpp.
References owningClass.
Referenced by RexxObject::classObject(), RexxObject::defaultName(), RexxObject::defMethod(), RexxString::dynamicTarget(), RexxObject::id(), restore(), RexxMemory::saveImageMark(), RexxList::sectionSubclass(), RexxQueue::sectionSubclass(), and RexxArray::sectionSubclass().
|
inlinestatic |
Definition at line 143 of file RexxBehaviour.hpp.
References primitiveBehaviours.
Referenced by RexxMemory::checkSetOref(), RexxMemory::dump(), getOperatorMethods(), RexxMemory::inObjectStorage(), RexxMemory::newObject(), RexxMemory::newObjects(), RexxMemory::objectReferenceOK(), restore(), RexxBehaviour(), and RexxMemory::saveImage().
|
inline |
Definition at line 116 of file RexxBehaviour.hpp.
References getClassType(), INTERNALCLASS, isInternalClass(), and T_Last_Exported_Class.
Referenced by RexxEnvelope::copyBuffer(), and RexxMemory::saveImageMark().
|
inline |
Definition at line 92 of file RexxBehaviour.hpp.
References scopes.
Referenced by RexxClass::createClassBehaviour(), RexxClass::newRexx(), and restore().
|
inline |
Definition at line 106 of file RexxBehaviour.hpp.
References behaviourFlags, and ENHANCED_OBJECT.
Referenced by RexxObject::defaultName().
|
inline |
Definition at line 107 of file RexxBehaviour.hpp.
References behaviourFlags, and INTERNAL_CLASS.
Referenced by getSavedPrimitiveBehaviour().
|
inline |
Definition at line 103 of file RexxBehaviour.hpp.
References behaviourFlags, and NON_PRIMITIVE_BEHAVIOUR.
Referenced by RexxEnvelope::copyBuffer(), flatten(), RexxInternalObject::isSubClassOrEnhanced(), liveGeneral(), and RexxMemory::saveImageMark().
|
inline |
Definition at line 104 of file RexxBehaviour.hpp.
References BEHAVIOUR_NOT_RESOLVED, and behaviourFlags.
Referenced by resolveNonPrimitiveBehaviour().
|
inline |
Definition at line 102 of file RexxBehaviour.hpp.
References behaviourFlags, and NON_PRIMITIVE_BEHAVIOUR.
Referenced by RexxInternalObject::isBaseClass(), and RexxClass::isEqual().
|
inline |
Definition at line 105 of file RexxBehaviour.hpp.
References BEHAVIOUR_NOT_RESOLVED, and behaviourFlags.
|
inline |
Definition at line 108 of file RexxBehaviour.hpp.
References behaviourFlags, and TRANSIENT_CLASS.
Referenced by RexxEnvelope::copyBuffer(), and RexxMemory::saveImageMark().
|
virtual |
Reimplemented from RexxVirtualBase.
Definition at line 88 of file RexxBehaviour.cpp.
References instanceMethodDictionary, memory_mark, methodDictionary, owningClass, and scopes.
|
virtual |
Reimplemented from RexxVirtualBase.
Definition at line 99 of file RexxBehaviour.cpp.
References instanceMethodDictionary, isNonPrimitive(), memory_mark_general, memoryObject, methodDictionary, owningClass, resolveNonPrimitiveBehaviour(), RexxMemory::restoringImage(), RexxMemory::savingImage(), scopes, and setNotResolved().
void RexxBehaviour::merge | ( | RexxBehaviour * | source_behav | ) |
Definition at line 659 of file RexxBehaviour.cpp.
References RexxHashTableCollection::copy(), RexxHashTableCollection::merge(), methodDictionary, OREF_NULL, and OrefSet.
Referenced by RexxClass::mergeSuperClassScopes(), and RexxClass::subClassable().
RexxObject * RexxBehaviour::mergeScope | ( | RexxObject * | scope | ) |
Definition at line 630 of file RexxBehaviour.cpp.
References addScope(), checkScope(), and OREF_NULL.
Referenced by RexxClass::createClassBehaviour().
void RexxBehaviour::methodDictionaryMerge | ( | RexxTable * | sourceDictionary | ) |
Definition at line 692 of file RexxBehaviour.cpp.
References RexxHashTableCollection::copy(), RexxHashTableCollection::merge(), methodDictionary, OREF_NULL, and OrefSet.
Referenced by RexxClass::createClassBehaviour(), and RexxClass::createInstanceBehaviour().
RexxMethod * RexxBehaviour::methodLookup | ( | RexxString * | messageName | ) |
Definition at line 366 of file RexxBehaviour.cpp.
References methodDictionary, OREF_NULL, RexxTable::stringGet(), and TheNilObject.
Referenced by RexxObject::hasMethod(), RexxObject::messageSend(), RexxObject::methodLookup(), methodObject(), and RexxObject::processUnknown().
RexxMethod * RexxBehaviour::methodObject | ( | RexxString * | messageName | ) |
Definition at line 353 of file RexxBehaviour.cpp.
References ARG_ONE, methodLookup(), stringArgument(), and RexxString::upper().
|
inline |
Definition at line 54 of file RexxBehaviour.hpp.
|
inline |
Definition at line 55 of file RexxBehaviour.hpp.
|
inline |
Definition at line 56 of file RexxBehaviour.hpp.
|
inline |
Definition at line 53 of file RexxBehaviour.hpp.
void * RexxBehaviour::operator new | ( | size_t | size, |
size_t | typenum | ||
) |
Definition at line 463 of file RexxBehaviour.cpp.
void RexxBehaviour::removeMethod | ( | RexxString * | methodName | ) |
Definition at line 303 of file RexxBehaviour.cpp.
References instanceMethodDictionary, methodDictionary, OREF_NULL, and RexxHashTableCollection::remove().
Referenced by RexxObject::unsetMethod().
void RexxBehaviour::resolveNonPrimitiveBehaviour | ( | ) |
Do fix ups for non-primitive behaviours, ensuring they get all of the appropriate information from their parent primitive behaviour types.
Definition at line 153 of file RexxBehaviour.cpp.
References getClassType(), getOperatorMethods(), isNotResolved(), operatorMethods, and setResolved().
Referenced by liveGeneral(), and RexxEnvelope::puff().
void RexxBehaviour::restore | ( | RexxBehaviour * | saved | ) |
Definition at line 428 of file RexxBehaviour.cpp.
References getMethodDictionary(), getOwningClass(), getPrimitiveBehaviour(), getScopes(), methodDictionary, owningClass, roundObjectBoundary(), scopes, RexxInternalObject::setBehaviour(), RexxInternalObject::setObjectSize(), RexxInternalObject::setOldSpace(), and T_Behaviour.
Referenced by RexxMemory::restoreImage().
RexxClass * RexxBehaviour::restoreClass | ( | ) |
Definition at line 448 of file RexxBehaviour.cpp.
References owningClass, and RexxClass::setInstanceBehaviour().
|
inlinestatic |
Definition at line 129 of file RexxBehaviour.hpp.
References INTERNALCLASS, primitiveBehaviours, and T_Last_Exported_Class.
Referenced by RexxEnvelope::puff(), and RexxMemory::restoreImage().
|
inline |
Definition at line 100 of file RexxBehaviour.hpp.
References classType.
Referenced by RexxBehaviour(), and subclass().
|
inline |
Definition at line 111 of file RexxBehaviour.hpp.
References behaviourFlags, and ENHANCED_OBJECT.
Referenced by RexxClass::enhanced().
|
inline |
Definition at line 95 of file RexxBehaviour.hpp.
References instanceMethodDictionary, and OrefSet.
Referenced by RexxClass::enhanced().
|
inline |
Definition at line 113 of file RexxBehaviour.hpp.
References behaviourFlags, and INTERNAL_CLASS.
|
inline |
Definition at line 94 of file RexxBehaviour.hpp.
References methodDictionary, and OrefSet.
Referenced by RexxClass::defineMethods(), RexxClass::enhanced(), RexxClass::subclass(), RexxClass::updateInstanceSubClasses(), and RexxClass::updateSubClasses().
void RexxBehaviour::setMethodDictionaryScope | ( | RexxObject * | scope | ) |
Definition at line 529 of file RexxBehaviour.cpp.
References RexxHashTableCollection::first(), methodDictionary, OREF_NULL, and RexxHashTableCollection::value().
|
inline |
Definition at line 112 of file RexxBehaviour.hpp.
References behaviourFlags, and NON_PRIMITIVE_BEHAVIOUR.
Referenced by copy(), and RexxMemory::saveImageMark().
|
inline |
Definition at line 110 of file RexxBehaviour.hpp.
References BEHAVIOUR_NOT_RESOLVED, and behaviourFlags.
Referenced by liveGeneral().
|
inline |
Definition at line 98 of file RexxBehaviour.hpp.
References OrefSet, and owningClass.
Referenced by RexxClass::enhanced(), RexxClass::newRexx(), RexxClass::operator new(), RexxClass::subclass(), and RexxClass::subClassable().
|
inline |
Definition at line 109 of file RexxBehaviour.hpp.
References BEHAVIOUR_NOT_RESOLVED, and behaviourFlags.
Referenced by resolveNonPrimitiveBehaviour().
RexxObject * RexxBehaviour::setScopes | ( | RexxIdentityTable * | newscopes | ) |
Definition at line 601 of file RexxBehaviour.cpp.
References OREF_NULL, OrefSet, and scopes.
Referenced by RexxClass::defineMethods(), RexxClass::enhanced(), RexxClass::newRexx(), RexxClass::subclass(), RexxClass::updateInstanceSubClasses(), and RexxClass::updateSubClasses().
|
inline |
Definition at line 114 of file RexxBehaviour.hpp.
References behaviourFlags, and TRANSIENT_CLASS.
void RexxBehaviour::subclass | ( | RexxBehaviour * | subclass_behaviour | ) |
Definition at line 417 of file RexxBehaviour.cpp.
References getClassType(), and setClassType().
Referenced by RexxClass::subclass().
RexxMethod * RexxBehaviour::superMethod | ( | RexxString * | messageName, |
RexxObject * | startScope | ||
) |
Definition at line 487 of file RexxBehaviour.cpp.
References RexxIdentityTable::get(), RexxArray::get(), RexxMethod::getScope(), methodDictionary, OREF_NULL, scopes, RexxArray::size(), RexxTable::stringGetAll(), and TheNilObject.
Referenced by RexxObject::superMethod().
RexxObject * RexxBehaviour::superScope | ( | RexxObject * | start_scope | ) |
Definition at line 473 of file RexxBehaviour.cpp.
References RexxIdentityTable::findSuperScope(), OREF_NULL, scopes, and TheNilObject.
Referenced by RexxObject::superScope().
|
protected |
Definition at line 161 of file RexxBehaviour.hpp.
Referenced by isEnhanced(), isInternalClass(), isNonPrimitive(), isNotResolved(), isPrimitive(), isResolved(), isTransientClass(), RexxBehaviour(), setEnhanced(), setInternalClass(), setNonPrimitive(), setNotResolved(), setResolved(), and setTransientClass().
|
protected |
Definition at line 160 of file RexxBehaviour.hpp.
Referenced by getClassType(), and setClassType().
|
protected |
Definition at line 167 of file RexxBehaviour.hpp.
Referenced by addMethod(), copy(), copyBehaviour(), getInstanceMethodDictionary(), live(), liveGeneral(), removeMethod(), RexxBehaviour(), and setInstanceMethodDictionary().
|
protected |
Definition at line 163 of file RexxBehaviour.hpp.
Referenced by addMethod(), copy(), copyBehaviour(), define(), deleteMethod(), getMethod(), getMethodDictionary(), getMethods(), live(), liveGeneral(), merge(), methodDictionaryMerge(), methodLookup(), removeMethod(), restore(), RexxBehaviour(), setMethodDictionary(), setMethodDictionaryScope(), and superMethod().
|
protected |
Definition at line 164 of file RexxBehaviour.hpp.
Referenced by copy(), copyBehaviour(), getOperatorMethod(), getOperatorMethods(), resolveNonPrimitiveBehaviour(), and RexxBehaviour().
|
protected |
Definition at line 165 of file RexxBehaviour.hpp.
Referenced by copyBehaviour(), getOwningClass(), live(), liveGeneral(), restore(), restoreClass(), RexxBehaviour(), and setOwningClass().
|
static |
Definition at line 146 of file RexxBehaviour.hpp.
Referenced by getPrimitiveBehaviour(), RexxMemory::restoreImage(), and restoreSavedPrimitiveBehaviour().
|
protected |
Definition at line 162 of file RexxBehaviour.hpp.
Referenced by addScope(), checkScope(), copy(), copyBehaviour(), getScopes(), live(), liveGeneral(), restore(), RexxBehaviour(), setScopes(), superMethod(), and superScope().