cct_register_object Subroutine

public pure subroutine cct_register_object(self, command, error)

Type Bound

compile_command_table_t

Arguments

Type IntentOptional Attributes Name
class(compile_command_table_t), intent(inout) :: self

Instance of the serializable object

type(compile_command_t), intent(in) :: command

Data structure

type(error_t), intent(out), allocatable :: error

Error handling


Source Code

    pure subroutine cct_register_object(self, command, error)
    
        !> Instance of the serializable object
        class(compile_command_table_t), intent(inout) :: self

        !> Data structure
        type(compile_command_t), intent(in) :: command
        
        !> Error handling
        type(error_t), allocatable, intent(out) :: error    
        
        if (allocated(self%command)) then         
           call add_compile_command(self%command, command)
        else
           allocate(self%command(1), source=command) 
        end if        
        
    end subroutine cct_register_object