Inherits from FTLinkedListClass : FTObjectClass
TYPE(FTStack) :: list
ALLOCATE(stack) If stack is a pointer
CALL stack % init()
CALL releaseFTStack(stack) [Pointers]
TYPE(FTObject) :: objectPtr
objectPtr => r1
CALL stack % push(objectPtr)
objectPtr => stack % peek() No change of ownership
SELECT TYPE(objectPtr)
TYPE is (*SubclassType*)
… Do something with ObjectPtr as subclass
CLASS DEFAULT
… Problem with casting
END SELECT
objectPtr => stack % pop() Ownership transferred to caller
SELECT TYPE(objectPtr)
TYPE is (*SubclassType*)
… Do something with ObjectPtr as subclass
CLASS DEFAULT
… Problem with casting
END SELECT
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(FTLinkedListRecord), | public, | POINTER | :: | head | => | NULL() | |
class(FTLinkedListRecord), | public, | POINTER | :: | tail | => | NULL() | |
integer, | public | :: | nRecords | ||||
logical, | public | :: | isCircular_ |
procedure, public, non_overridable :: copy => copyFTObject | |
procedure, public, non_overridable :: retain => retainFTObject | |
procedure, public, non_overridable :: isUnreferenced | |
procedure, public, non_overridable :: refCount | |
procedure, public :: add | |
procedure, public :: remove => removeObject | |
procedure, public :: reverse => reverseLinkedList | |
procedure, public :: removeRecord => removeLinkedListRecord | |
procedure, public :: count => numberOfRecords | |
procedure, public :: description => FTLinkedListDescription | |
procedure, public :: allObjects => allLinkedListObjects | |
procedure, public :: removeAllObjects => removeAllLinkedListObjects | |
procedure, public :: addObjectsFromList | |
procedure, public :: makeCircular | |
procedure, public :: isCircular | |
procedure, public :: insertObjectAfterRecord | |
procedure, public :: insertObjectAfterObject | |
procedure, public :: init => initFTStack | |
procedure, public :: printDescription => printStackDescription | |
procedure, public :: className => stackClassName | |
procedure, public :: push | |
procedure, public :: pop | |
procedure, public :: peek |
Class name returns a string with the name of the type of the object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTStack) | :: | self |
Public, generic name: init()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTStack) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(FTStack), | POINTER | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTStack) | :: | self | ||||
integer | :: | iUnit |