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 release(MultiIndexTable)     ... Pointers
     call MultiIndexTable % destruct() ... non 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)


Interfaces

public interface release

  • public subroutine releaseFTMultiIndexTable(self)

    Public, generic name: release(self)

    Call release(self) on an object to release control of an object. If its reference count is zero, then it is deallocated.

    Arguments

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

Derived Types

type, public, extends(FTObject) ::  FTMultiIndexTable

Components

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

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 :: destruct => destructMultiIndexTable
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 destructMultiIndexTable(self)

Arguments

Type IntentOptional Attributes Name
class(FTMultiIndexTable) :: self

public subroutine releaseFTMultiIndexTable(self)

Public, generic name: release(self)

Read more…

Arguments

Type IntentOptional Attributes Name
class(FTMultiIndexTable), POINTER :: 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