ClassDirective Class Reference

#include <ClassDirective.hpp>

Inheritance diagram for ClassDirective:
[legend]

Public Types

enum  ClassProperties { PUBLIC , MIXIN , ABSTRACT }
 

Public Member Functions

void * operator new (size_t)
 
void * operator new (size_t size, void *objectPtr)
 
void operator delete (void *)
 
void operator delete (void *, void *)
 
 ClassDirective (RexxString *, RexxString *, RexxClause *)
 
 ClassDirective (RESTORETYPE restoreType)
 
void live (size_t)
 
void liveGeneral (int reason)
 
void flatten (RexxEnvelope *)
 
RexxStringgetName ()
 
RexxClassinstall (RexxSource *source, RexxActivation *activation)
 
void addDependencies (RexxDirectory *class_directives)
 
void checkDependency (RexxString *name, RexxDirectory *class_directives)
 
bool dependenciesResolved ()
 
void removeDependency (RexxString *name)
 
RexxStringgetMetaClass ()
 
void setMetaClass (RexxString *m)
 
RexxStringgetSubClass ()
 
void setSubClass (RexxString *m)
 
void setMixinClass (RexxString *m)
 
bool isMixinClass ()
 
void setPublic ()
 
bool isPublic ()
 
void setAbstract ()
 
bool isAbstract ()
 
void addInherits (RexxString *name)
 
void addMethod (RexxString *name, RexxMethod *method, bool classMethod)
 
void addConstantMethod (RexxString *name, RexxMethod *method)
 
bool checkDuplicateMethod (RexxString *name, bool classMethod)
 
- Public Member Functions inherited from RexxDirective
 RexxDirective ()
 
 RexxDirective (RexxClause *clause, int type)
 
- Public Member Functions inherited from RexxInstruction
void * operator new (size_t)
 
void * operator new (size_t size, void *objectPtr)
 
void operator delete (void *)
 
void operator delete (void *, void *)
 
 RexxInstruction (RexxClause *clause, int type)
 
 RexxInstruction (RESTORETYPE restoreType)
 
 RexxInstruction ()
 
void live (size_t)
 
void liveGeneral (int reason)
 
void flatten (RexxEnvelope *)
 
const SourceLocationgetLocation ()
 
void setLocation (SourceLocation &l)
 
virtual void execute (RexxActivation *, RexxExpressionStack *)
 
void setNext (RexxInstruction *next)
 
void setStart (size_t line, size_t off)
 
void setEnd (size_t line, size_t off)
 
void setType (size_t type)
 
size_t getType ()
 
bool isType (size_t type)
 
size_t getLineNumber ()
 
- 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 RexxObjectunflatten (RexxEnvelope *)
 

Protected Member Functions

RexxTablegetClassMethods ()
 
RexxTablegetInstanceMethods ()
 
- Protected Member Functions inherited from RexxVirtualBase
virtual ~RexxVirtualBase ()
 
virtual void baseVirtual ()
 

Protected Attributes

RexxStringpublicName
 
RexxStringidName
 
RexxStringmetaclassName
 
RexxStringsubclassName
 
RexxListinheritsClasses
 
RexxTableinstanceMethods
 
RexxTableclassMethods
 
RexxDirectorydependencies
 
FlagSet< ClassProperties, 32 > classFlags
 

Friends

class RexxSource
 

Additional Inherited Members

- Static Public Member Functions inherited from RexxInternalObject
static size_t getObjectHeaderSize ()
 
- Public Attributes inherited from RexxInstruction
uint16_t instructionType
 
uint16_t instructionFlags
 
SourceLocation instructionLocation
 
RexxInstructionnextInstruction
 
- Public Attributes inherited from RexxInternalObject
ObjectHeader header
 
RexxBehaviourbehaviour
 

Detailed Description

Definition at line 53 of file ClassDirective.hpp.

Member Enumeration Documentation

◆ ClassProperties

Enumerator
PUBLIC 
MIXIN 
ABSTRACT 

Definition at line 69 of file ClassDirective.hpp.

Constructor & Destructor Documentation

◆ ClassDirective() [1/2]

ClassDirective::ClassDirective ( RexxString n,
RexxString p,
RexxClause clause 
)

Construct a ClassDirective.

Parameters
nThe name of the requires target.
pThe public name of the requires target.
clauseThe source file clause containing the directive.

Definition at line 62 of file ClassDirective.cpp.

References idName, and publicName.

◆ ClassDirective() [2/2]

ClassDirective::ClassDirective ( RESTORETYPE  restoreType)
inline

Definition at line 63 of file ClassDirective.hpp.

Member Function Documentation

◆ addConstantMethod()

void ClassDirective::addConstantMethod ( RexxString name,
RexxMethod method 
)

Add a method to a class definition.

Parameters
nameThe name to add.
methodThe method object that maps to this name.

Definition at line 413 of file ClassDirective.cpp.

References addMethod().

Referenced by RexxSource::createConstantGetterMethod().

◆ addDependencies()

void ClassDirective::addDependencies ( RexxDirectory class_directives)

Check our class dependencies against the locally defined class list to develop a cross dependency list.

Parameters
class_directivesThe global set of defined classes in this package.

Definition at line 266 of file ClassDirective.cpp.

References checkDependency(), RexxList::firstIndex(), RexxList::getValue(), inheritsClasses, LIST_END, metaclassName, RexxList::nextIndex(), OREF_NULL, and subclassName.

Referenced by RexxSource::resolveDependencies().

◆ addInherits()

void ClassDirective::addInherits ( RexxString name)

Add an inherits class to the class definition.

Parameters
nameThe name of the inherited class.

Definition at line 323 of file ClassDirective.cpp.

References RexxList::append(), inheritsClasses, new_list(), OREF_NULL, and OrefSet.

◆ addMethod()

void ClassDirective::addMethod ( RexxString name,
RexxMethod method,
bool  classMethod 
)

Add a method to a class definition.

Parameters
nameThe name to add.
methodThe method object that maps to this name.
classMethodIndicates whether this is a new class or instance method.

Definition at line 394 of file ClassDirective.cpp.

References getClassMethods(), getInstanceMethods(), and RexxHashTableCollection::put().

Referenced by addConstantMethod(), and RexxSource::addMethod().

◆ checkDependency()

void ClassDirective::checkDependency ( RexxString name,
RexxDirectory class_directives 
)

Check if a dependency this class has is based off of a class co-located in the same class package.

Parameters
nameThe class name.
class_directivesThe global local classes list.

Definition at line 241 of file ClassDirective.cpp.

References dependencies, RexxDirectory::entry(), new_directory(), OREF_NULL, OrefSet, and RexxDirectory::setEntry().

Referenced by addDependencies().

◆ checkDuplicateMethod()

bool ClassDirective::checkDuplicateMethod ( RexxString name,
bool  classMethod 
)

Check for a duplicate method defined om this class.

Parameters
nameThe method name.
classMethodIndicates whether we are checking for a class or instance method.
Returns
true if this is a duplicate of the method type.

Definition at line 372 of file ClassDirective.cpp.

References RexxHashTableCollection::get(), getClassMethods(), getInstanceMethods(), and OREF_NULL.

Referenced by RexxSource::checkDuplicateMethod().

◆ dependenciesResolved()

bool ClassDirective::dependenciesResolved ( )

Check if this class has any additional in-package dependencies.

Returns
true if all in-package dependencies have been resolved already.

Definition at line 291 of file ClassDirective.cpp.

References dependencies, and OREF_NULL.

Referenced by RexxSource::resolveDependencies().

◆ flatten()

void ClassDirective::flatten ( RexxEnvelope envelope)
virtual

Flatten the directive instance.

Parameters
envelopeThe envelope we're flattening into.

Reimplemented from RexxVirtualBase.

Definition at line 111 of file ClassDirective.cpp.

References cleanUpFlatten, flatten_reference, OREF_NULL, and setUpFlatten.

◆ getClassMethods()

RexxTable * ClassDirective::getClassMethods ( )
protected

Retrieve the class methods directory for this class.

Returns
The class methods directory.

Definition at line 338 of file ClassDirective.cpp.

References classMethods, new_table(), OREF_NULL, and OrefSet.

Referenced by addMethod(), and checkDuplicateMethod().

◆ getInstanceMethods()

RexxTable * ClassDirective::getInstanceMethods ( )
protected

Retrieve the instance methods directory for this class.

Returns
The instance methods directory.

Definition at line 353 of file ClassDirective.cpp.

References instanceMethods, new_table(), OREF_NULL, and OrefSet.

Referenced by addMethod(), and checkDuplicateMethod().

◆ getMetaClass()

RexxString* ClassDirective::getMetaClass ( )
inline

Definition at line 85 of file ClassDirective.hpp.

References metaclassName.

Referenced by RexxSource::classDirective().

◆ getName()

RexxString* ClassDirective::getName ( )
inline

Definition at line 77 of file ClassDirective.hpp.

References publicName.

Referenced by RexxSource::resolveDependencies().

◆ getSubClass()

RexxString* ClassDirective::getSubClass ( )
inline

Definition at line 87 of file ClassDirective.hpp.

References subclassName.

Referenced by RexxSource::classDirective().

◆ install()

RexxClass * ClassDirective::install ( RexxSource source,
RexxActivation activation 
)

◆ isAbstract()

bool ClassDirective::isAbstract ( )
inline

Definition at line 94 of file ClassDirective.hpp.

References ABSTRACT, and classFlags.

Referenced by install().

◆ isMixinClass()

bool ClassDirective::isMixinClass ( )
inline

Definition at line 90 of file ClassDirective.hpp.

References classFlags, and MIXIN.

Referenced by install().

◆ isPublic()

bool ClassDirective::isPublic ( )
inline

Definition at line 92 of file ClassDirective.hpp.

References classFlags, and PUBLIC.

Referenced by install().

◆ live()

void ClassDirective::live ( size_t  liveMark)
virtual

Normal garbage collecting live mark.

Parameters
liveMarkThe current live object mark.

Reimplemented from RexxVirtualBase.

Definition at line 73 of file ClassDirective.cpp.

References classMethods, dependencies, idName, inheritsClasses, instanceMethods, memory_mark, metaclassName, RexxInstruction::nextInstruction, publicName, and subclassName.

◆ liveGeneral()

void ClassDirective::liveGeneral ( int  reason)
virtual

The generalized object marking routine.

Parameters
reasonThe processing faze we're running the mark on.

Reimplemented from RexxVirtualBase.

Definition at line 92 of file ClassDirective.cpp.

References classMethods, dependencies, idName, inheritsClasses, instanceMethods, memory_mark_general, metaclassName, RexxInstruction::nextInstruction, publicName, and subclassName.

◆ operator delete() [1/2]

void ClassDirective::operator delete ( void *  )
inline

Definition at line 59 of file ClassDirective.hpp.

◆ operator delete() [2/2]

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

Definition at line 60 of file ClassDirective.hpp.

◆ operator new() [1/2]

void* ClassDirective::operator new ( size_t  size,
void *  objectPtr 
)
inline

Definition at line 58 of file ClassDirective.hpp.

◆ operator new() [2/2]

void * ClassDirective::operator new ( size_t  size)

Allocate a new requires directive.

Parameters
sizeThe size of the object.
Returns
The memory for the new object.

Definition at line 138 of file ClassDirective.cpp.

References new_object(), and T_ClassDirective.

◆ removeDependency()

void ClassDirective::removeDependency ( RexxString name)

Remove a class from the dependency list.

Parameters
nameThe name of the class that's next in the ordering.

Definition at line 302 of file ClassDirective.cpp.

References dependencies, RexxDirectory::items(), OREF_NULL, OrefSet, and RexxDirectory::remove().

Referenced by RexxSource::resolveDependencies().

◆ setAbstract()

void ClassDirective::setAbstract ( )
inline

Definition at line 93 of file ClassDirective.hpp.

References ABSTRACT, and classFlags.

◆ setMetaClass()

void ClassDirective::setMetaClass ( RexxString m)
inline

Definition at line 86 of file ClassDirective.hpp.

References metaclassName, and OrefSet.

◆ setMixinClass()

void ClassDirective::setMixinClass ( RexxString m)
inline

Definition at line 89 of file ClassDirective.hpp.

References classFlags, MIXIN, OrefSet, and subclassName.

◆ setPublic()

void ClassDirective::setPublic ( )
inline

Definition at line 91 of file ClassDirective.hpp.

References classFlags, and PUBLIC.

◆ setSubClass()

void ClassDirective::setSubClass ( RexxString m)
inline

Definition at line 88 of file ClassDirective.hpp.

References OrefSet, and subclassName.

Friends And Related Function Documentation

◆ RexxSource

friend class RexxSource
friend

Definition at line 55 of file ClassDirective.hpp.

Member Data Documentation

◆ classFlags

FlagSet<ClassProperties, 32> ClassDirective::classFlags
protected

◆ classMethods

RexxTable* ClassDirective::classMethods
protected

Definition at line 113 of file ClassDirective.hpp.

Referenced by getClassMethods(), install(), live(), and liveGeneral().

◆ dependencies

RexxDirectory* ClassDirective::dependencies
protected

◆ idName

RexxString* ClassDirective::idName
protected

Definition at line 108 of file ClassDirective.hpp.

Referenced by ClassDirective(), install(), live(), and liveGeneral().

◆ inheritsClasses

RexxList* ClassDirective::inheritsClasses
protected

Definition at line 111 of file ClassDirective.hpp.

Referenced by addDependencies(), addInherits(), install(), live(), and liveGeneral().

◆ instanceMethods

RexxTable* ClassDirective::instanceMethods
protected

Definition at line 112 of file ClassDirective.hpp.

Referenced by getInstanceMethods(), install(), live(), and liveGeneral().

◆ metaclassName

RexxString* ClassDirective::metaclassName
protected

◆ publicName

RexxString* ClassDirective::publicName
protected

Definition at line 107 of file ClassDirective.hpp.

Referenced by ClassDirective(), getName(), install(), live(), and liveGeneral().

◆ subclassName

RexxString* ClassDirective::subclassName
protected

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