diff --git a/src/connection_m.f90 b/src/connection_m.f90 index b11138942fde48658079c56a73fc4d5e6ac83208..126d08ea6249c4694020a3e058d849034141e80b 100644 --- a/src/connection_m.f90 +++ b/src/connection_m.f90 @@ -87,39 +87,6 @@ module connection_m module procedure :: new_connection_3 end interface connection_t - !> Represents a container for a single connection_t pointer - type :: connection_container_t - private - class(connection_t), pointer :: content - - contains - !> Getter for the private 'content' component - !! @return Pointer to the contained connection (type connection_t, pointer) - procedure :: get_content => get_content_connection_container_impl - - !> Setter for the private 'content' component - !! @param[in] content Pointer to the connection (type connection_t, pointer) - procedure :: set_content => set_content_connection_container_impl - - !> Scalar desctructor for single instances of the class connection_container_t - final :: destroy_connection_container - - !> Array desctructor for arrays of instances of the class connection_container_t - final :: destroy_connection_container_array - - end type connection_container_t - - interface connection_container_t - !> Constructor of connection_container_t class - !! @return Instance of the class connection_container_t with nullified content - module procedure :: new_connection_container_empty - - !> Constructor of connection_container_t class - !! @param[in] content_in connection to be contained (type connection_t, pointer) - !! @return Pointer to the instance of the class connection_t with assigned content - module procedure :: new_connection_container_assigned - end interface connection_container_t - !> Represents a connection between two neurons. !! Able to pass a signal from an input neuron to !! an output one. @@ -373,112 +340,6 @@ module connection_m #endif end subroutine pass_signal_impl - !------------------------------! - ! class connection_container_t ! - !------------------------------! - - !--------------!------------------------------------------------------------------------ - ! Constructors ! - !--------------! - - !> Constructor of connection_container_t class - !! @return Instance of the class connection_container_t with nullified content - function new_connection_container_empty() result(new_obj) - type(connection_container_t) :: new_obj -#ifdef TIME_PROFILING - real :: start_time - call time_profiling_start(start_time) -#endif - new_obj%content => null() -#ifdef TIME_PROFILING - call time_profiling_stop(start_time, 'new_connection_container_empty') -#endif - end function new_connection_container_empty - - !> Constructor of connection_container_t class - !! @param[in] content_in connection to be contained (type connection_t, pointer) - !! @return Pointer to the instance of the class connection_t with assigned content - function new_connection_container_assigned(content_in) result(new_obj) - class(connection_t), pointer, intent(in) :: content_in - type(connection_container_t) :: new_obj -#ifdef TIME_PROFILING - real :: start_time - call time_profiling_start(start_time) -#endif - new_obj%content => content_in -#ifdef TIME_PROFILING - call time_profiling_stop(start_time, 'new_connection_container_assigned') -#endif - end function new_connection_container_assigned - - !--------------!------------------------------------------------------------------------ - ! Destructors ! - !--------------! - - !> Scalar desctructor for single instances of the class connection_container_t - subroutine destroy_connection_container(this) - type(connection_container_t), intent(inout) :: this -#ifdef TIME_PROFILING - real :: start_time - call time_profiling_start(start_time) -#endif - nullify(this%content) -#ifdef TIME_PROFILING - call time_profiling_stop(start_time, 'destroy_connection_container') -#endif - end subroutine destroy_connection_container - - !> Array desctructor for arrays of instances of the class connection_container_t - subroutine destroy_connection_container_array(this) - type(connection_container_t), intent(inout) :: this(:) - integer :: i -#ifdef TIME_PROFILING - real :: start_time - call time_profiling_start(start_time) -#endif - do i = 1, size(this) - nullify(this(i)%content) - end do -#ifdef TIME_PROFILING - call time_profiling_stop(start_time, 'destroy_connection_container_array') -#endif - end subroutine destroy_connection_container_array - - !-------------------!------------------------------------------------------------------ - ! Getters & Setters ! - !-------------------! - - !> Getter for the private 'content' component - !! @return Pointer to the contained connection (type connection_t, pointer) - function get_content_connection_container_impl(this) result(content) - class(connection_container_t), intent(in) :: this - class(connection_t), pointer:: content -#ifdef TIME_PROFILING - real :: start_time - call time_profiling_start(start_time) -#endif - content => this%content -#ifdef TIME_PROFILING - call time_profiling_stop(start_time,'get_content_connection_container_impl') -#endif - end function get_content_connection_container_impl - - !> Setter for the private 'content' component - !! @param[in] content Pointer to the connection (type connection_t, pointer) - subroutine set_content_connection_container_impl(this, content) - class(connection_container_t), intent(inout) :: this - class(connection_t), pointer, intent(in) :: content -#ifdef TIME_PROFILING - real :: start_time - call time_profiling_start(start_time) -#endif - this%content => content -#ifdef TIME_PROFILING - call time_profiling_stop(start_time,'set_content_connection_container_impl') -#endif - end subroutine set_content_connection_container_impl - - !----------------!--------------------------------------------------------------------- ! Common methods ! !----------------! diff --git a/src/neuron_m.f90 b/src/neuron_m.f90 index 373d0eef8dc3d76b8b4525849ec83d4f0ffab3c5..7a8c4414266eefced91911aece40cbc42d91c590 100644 --- a/src/neuron_m.f90 +++ b/src/neuron_m.f90 @@ -10,6 +10,7 @@ module neuron_m use time_measurement_m use normal_m use data_kinds_4neuro_m + use abstract_base_m implicit none @@ -20,7 +21,7 @@ module neuron_m !----------------! !> Abstract class representing a general neuron - type, abstract :: neuron_t + type, abstract, extends(abstract_base_t) :: neuron_t private real(kind=real_4neuro) :: potential !< Neuron inner potential @@ -338,9 +339,9 @@ module neuron_m !> Constructor of mock_neuron_t class !! @return Returns pointer to the instance of the class mock_neuron_t function new_mock_neuron() result(new_obj) - type(mock_neuron_t), pointer :: new_obj + class(mock_neuron_t), pointer :: new_obj #ifdef TIME_PROFILING - real :: start_time + real :: start_time call time_profiling_start(start_time) #endif allocate(new_obj)