@@ -13,16 +13,16 @@ module vertex_m
1313
1414 type vertex_t
1515 ! ! Encapsulate a node in a graph comprised of vertices connected by dependencies (edges)
16- private
17- integer , public , allocatable :: edges_(:)
18- ! integer, allocatable :: edges(:) - should be private, but a bug in GCC needs it to be public. When fixed, this will be private again
19- type (varying_string) :: label_
20- character (len= :), allocatable :: attributes_
16+ private
17+ integer , allocatable :: edges_(:)
18+ type (varying_string) :: label_
19+ character (len= :), allocatable :: attributes_
2120 contains
22- procedure :: to_json
23- procedure :: edges
24- procedure :: label
25- procedure :: attributes
21+ procedure :: to_json
22+ procedure :: edges
23+ procedure :: label
24+ procedure :: attributes
25+ procedure :: edges_allocated
2626 end type
2727
2828 interface vertex_t
@@ -53,41 +53,47 @@ pure module function construct_from_components(edges, label, attributes) result(
5353 end interface
5454
5555 interface
56+
57+ elemental module function edges_allocated(self) result(edges_array_allocated)
58+ implicit none
59+ class(vertex_t), intent (in ) :: self
60+ logical edges_array_allocated
61+ end function
62+
63+ module function from_json_object (json_object ) result(vertex)
64+ ! ! construct a vertexa_t object from a jsonff JSON object
65+ implicit none
66+ type (json_object_t), intent (in ) :: json_object
67+ type (vertex_t) :: vertex
68+ end function
69+
70+ impure elemental module function to_json(self) result(json_object)
71+ ! ! Result is a JSON representation of self
72+ implicit none
73+ class(vertex_t), intent (in ) :: self
74+ type (json_object_t) :: json_object
75+ end function
5676
57- module function from_json_object (json_object ) result(vertex)
58- ! ! construct a vertexa_t object from a jsonff JSON object
59- implicit none
60- type (json_object_t), intent (in ) :: json_object
61- type (vertex_t) :: vertex
62- end function
63-
64- impure elemental module function to_json(self) result(json_object)
65- ! ! Result is a JSON representation of self
66- implicit none
67- class(vertex_t), intent (in ) :: self
68- type (json_object_t) :: json_object
69- end function
70-
71- pure module function edges(self) result(my_edges)
72- ! ! Result is the array element numbers of the vertices on which this vertex depends
73- implicit none
74- class(vertex_t), intent (in ) :: self
75- integer :: my_edges(size (self% edges_))
76- end function
77-
78- pure module function label(self) result(my_label)
79- ! ! Vertexd label getter
80- implicit none
81- class(vertex_t), intent (in ) :: self
82- character (len= len (self% label_)) my_label
83- end function
84-
85- pure module function attributes(self) result(my_attributes)
86- ! ! Vertex attributes getter
87- implicit none
88- class(vertex_t), intent (in ) :: self
89- character (len= len (self% attributes_)) my_attributes
90- end function
77+ pure module function edges(self) result(my_edges)
78+ ! ! Result is the array element numbers of the vertices on which this vertex depends
79+ implicit none
80+ class(vertex_t), intent (in ) :: self
81+ integer :: my_edges(size (self% edges_))
82+ end function
83+
84+ pure module function label(self) result(my_label)
85+ ! ! Vertexd label getter
86+ implicit none
87+ class(vertex_t), intent (in ) :: self
88+ character (len= len (self% label_)) my_label
89+ end function
90+
91+ pure module function attributes(self) result(my_attributes)
92+ ! ! Vertex attributes getter
93+ implicit none
94+ class(vertex_t), intent (in ) :: self
95+ character (len= len (self% attributes_)) my_attributes
96+ end function
9197
9298 end interface
9399
0 commit comments