FTStackClass Module

Inherits from FTLinkedListClass : FTObjectClass

Definition (Subclass of FTLinkedListClass):

TYPE(FTStack) :: list

Usage:

Initialization

  ALLOCATE(stack)  If stack is a pointer
  CALL stack  %  init()

Destruction

  CALL releaseFTStack(stack) [Pointers]

Pushing an object onto the stack

  TYPE(FTObject) :: objectPtr
  objectPtr => r1
  CALL stack % push(objectPtr)

Peeking at the top of the stack

  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

Popping the top of the stack

  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

Uses

  • module~~ftstackclass~~UsesGraph module~ftstackclass FTStackClass module~ftlinkedlistclass FTLinkedListClass module~ftstackclass->module~ftlinkedlistclass module~ftlinkedlistrecordclass FTLinkedListRecordClass module~ftlinkedlistclass->module~ftlinkedlistrecordclass module~ftmutableobjectarrayclass FTMutableObjectArrayClass module~ftlinkedlistclass->module~ftmutableobjectarrayclass module~ftobjectclass FTObjectClass module~ftlinkedlistrecordclass->module~ftobjectclass module~ftmutableobjectarrayclass->module~ftobjectclass

Used by

  • module~~ftstackclass~~UsedByGraph module~ftstackclass FTStackClass module~ftexceptionclass FTExceptionClass module~ftexceptionclass->module~ftstackclass module~ftobjectlibrary FTObjectLibrary module~ftobjectlibrary->module~ftstackclass module~ftobjectlibrary->module~ftexceptionclass module~sharedexceptionmanagermodule SharedExceptionManagerModule module~sharedexceptionmanagermodule->module~ftexceptionclass

Derived Types

type, public, extends(FTLinkedList) ::  FTStack

Components

Type Visibility Attributes Name Initial
class(FTLinkedListRecord), public, POINTER :: head => NULL()
class(FTLinkedListRecord), public, POINTER :: tail => NULL()
integer, public :: nRecords
logical, public :: isCircular_

Type-Bound Procedures

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

Functions

public function peek(self)

Arguments

Type IntentOptional Attributes Name
class(FTStack) :: self

Return Value class(FTObject), POINTER

public function stackFromObject(obj) result(cast)

Arguments

Type IntentOptional Attributes Name
class(FTObject), POINTER :: obj

Return Value class(FTStack), POINTER

public function stackClassName(self) result(s)

Class name returns a string with the name of the type of the object

Read more…

Arguments

Type IntentOptional Attributes Name
class(FTStack) :: self

Return Value character(len=CLASS_NAME_CHARACTER_LENGTH)


Subroutines

public subroutine initFTStack(self)

Public, generic name: init()

Read more…

Arguments

Type IntentOptional Attributes Name
class(FTStack) :: self

public subroutine releaseFTStack(self)

Arguments

Type IntentOptional Attributes Name
type(FTStack), POINTER :: self

public subroutine push(self, obj)

Arguments

Type IntentOptional Attributes Name
class(FTStack) :: self
class(FTObject), POINTER :: obj

public subroutine pop(self, p)

Arguments

Type IntentOptional Attributes Name
class(FTStack) :: self
class(FTObject), POINTER :: p

public subroutine printStackDescription(self, iUnit)

Arguments

Type IntentOptional Attributes Name
class(FTStack) :: self
integer :: iUnit