FTMultiIndexTableClass Module

The MultiIndexTable stores an FTObject pointer associated with any number of integer keys(:) as a hash table.

Usage

Definition (Subclass of FTObject)

     TYPE(FTMultiIndexTable) :: multiIndexTable

Initialization

     CALL MultiIndexTable % initWithSize(N)

The size, N = the maximum value of all of the keys.

Destruction

     CALL releaseFTMultiIndexTable(MultiIndexTable)     [Pointers]

Adding an object

     CLASS(FTObject), POINTER :: obj
     INTEGER, DIMENSION(dim)  :: keys
     CALL MultiIndexTable % addObjectForKeys(obj,keys)

Retrieving an object

     CLASS(FTObject), POINTER :: obj
     INTEGER, DIMENSION(dim)  :: keys
     obj => MultiIndexTable % objectForKeys(keys)

Be sure to retain the object if you want it to live beyond the life of the table.

Testing the presence of keys

     LOGICAL :: exists
     exists = MultiIndexTable % containsKeys(keys)

Uses

  • module~~ftmultiindextableclass~~UsesGraph module~ftmultiindextableclass FTMultiIndexTableClass module~ftlinkedlistclass FTLinkedListClass module~ftmultiindextableclass->module~ftlinkedlistclass module~ftmultiindextabledata FTMultiIndexTableData module~ftmultiindextableclass->module~ftmultiindextabledata module~ftobjectclass FTObjectClass module~ftmultiindextableclass->module~ftobjectclass module~ftlinkedlistrecordclass FTLinkedListRecordClass module~ftlinkedlistclass->module~ftlinkedlistrecordclass module~ftmutableobjectarrayclass FTMutableObjectArrayClass module~ftlinkedlistclass->module~ftmutableobjectarrayclass module~ftmultiindextabledata->module~ftobjectclass module~ftlinkedlistrecordclass->module~ftobjectclass module~ftmutableobjectarrayclass->module~ftobjectclass

Derived Types

type, public, extends(FTObject) ::  FTMultiIndexTable

Components

Type Visibility Attributes Name Initial
class(FTLinkedList), public, DIMENSION(:), ALLOCATABLE :: table

Finalizations Procedures

final :: destructMultiIndexTable

Type-Bound Procedures

procedure, public :: init => initFTObject
procedure, public :: description => FTObjectDescription
procedure, public :: className
procedure, public, non_overridable :: copy => copyFTObject
procedure, public, non_overridable :: retain => retainFTObject
procedure, public, non_overridable :: isUnreferenced
procedure, public, non_overridable :: refCount
procedure, public :: initWithSize => initMultiIndexTableWithSize
procedure, public :: containsKeys => MultiIndexTableContainsKeys
procedure, public :: addObjectForKeys => addObjectToMultiIndexTableForKeys
procedure, public :: objectForKeys => objectInMultiIndexTableForKeys
procedure, public :: printDescription => printMultiIndexTableDescription
procedure, public :: MultiIndexTableSize

Functions

public function objectInMultiIndexTableForKeys(self, keys) result(r)

Arguments

Type IntentOptional Attributes Name
class(FTMultiIndexTable) :: self
integer :: keys(:)

Return Value class(FTObject), POINTER

public function MultiIndexTableContainsKeys(self, keys) result(r)

Arguments

Type IntentOptional Attributes Name
class(FTMultiIndexTable) :: self
integer :: keys(:)

Return Value logical

public function MultiIndexTableSize(self)

Arguments

Type IntentOptional Attributes Name
class(FTMultiIndexTable) :: self

Return Value integer

public function MultiIndexTableFromObject(obj) result(cast)

Arguments

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

Return Value class(FTMultiIndexTable), POINTER

public function keysMatch(key1, key2)

Arguments

Type IntentOptional Attributes Name
integer, DIMENSION(:) :: key1
integer, DIMENSION(:) :: key2

Return Value logical


Subroutines

public subroutine initMultiIndexTableWithSize(self, N)

Arguments

Type IntentOptional Attributes Name
class(FTMultiIndexTable) :: self
integer :: N

public subroutine releaseFTMultiIndexTable(self)

Arguments

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

public subroutine destructMultiIndexTable(self)

Arguments

Type IntentOptional Attributes Name
type(FTMultiIndexTable) :: self

public subroutine addObjectToMultiIndexTableForKeys(self, obj, keys)

Arguments

Type IntentOptional Attributes Name
class(FTMultiIndexTable) :: self
class(FTObject), POINTER :: obj
integer :: keys(:)

public subroutine sortKeysAscending(keys)

Arguments

Type IntentOptional Attributes Name
integer, DIMENSION(:) :: keys

public subroutine printMultiIndexTableDescription(self, iUnit)

Arguments

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