FUTILS
Some basic Fortran Utilities
Loading...
Searching...
No Matches
enum_generator_m Module Reference

Data Types

interface  assignment(=)
type  enumerator_t

Functions/Subroutines

pure subroutine unset_enumerator (self)
pure elemental logical function is_set_enumerator (self)
pure elemental logical function is_equal (lhs, rhs)
pure logical function not_equal (lhs, rhs)
subroutine assign_enumerator (lhs, rhs)
pure type(string_t) function get_enumerator_name (self)

Function/Subroutine Documentation

◆ assign_enumerator()

subroutine enum_generator_m::assign_enumerator ( class(enumerator_t), intent(out) lhs,
class(enumerator_t), intent(in) rhs )
private

Definition at line 110 of file enum_generator.f90.

111 implicit none
112 class(enumerator_t), intent(out) :: lhs
113 class(enumerator_t), intent(in) :: rhs
114
115 if(.not.same_type_as(lhs,rhs)) then
116 call error_handling%abort('enumerator_t types not equivalent in setter subroutine')
117 endif
118
119 if(.not.rhs%set) then
120 call error_handling%abort('RHS enumerator_t type not set in comparison')
121 endif
122
123 lhs%id = rhs%id
124 lhs%set = .true.
125

◆ get_enumerator_name()

pure type(string_t) function enum_generator_m::get_enumerator_name ( class(enumerator_t), intent(in) self)
private

Definition at line 128 of file enum_generator.f90.

129 implicit none
130 class(enumerator_t), intent(in) :: self
131
132 name = trim(adjustl(self%name))

◆ is_equal()

pure elemental logical function enum_generator_m::is_equal ( class(enumerator_t), intent(in) lhs,
class(enumerator_t), intent(in) rhs )
private

Definition at line 88 of file enum_generator.f90.

89 implicit none
90 class(enumerator_t), intent(in) :: lhs, rhs
91
92 call error_handling%assert(same_type_as(lhs,rhs))
93 call error_handling%assert(lhs%set)
94 call error_handling%assert(rhs%set)
95
96 is_equal = (lhs%id == rhs%id)

References error_handling_m::error_handling, and is_equal().

Referenced by is_equal(), and enum_generator_m::enumerator_t::operator().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_set_enumerator()

pure elemental logical function enum_generator_m::is_set_enumerator ( class(enumerator_t), intent(in) self)
private

Definition at line 80 of file enum_generator.f90.

81 implicit none
82 class(enumerator_t), intent(in) :: self
83
84 is_set_enumerator = self%set
85

References is_set_enumerator().

Referenced by is_set_enumerator().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ not_equal()

pure logical function enum_generator_m::not_equal ( class(enumerator_t), intent(in) lhs,
class(enumerator_t), intent(in) rhs )
private

Definition at line 99 of file enum_generator.f90.

100 implicit none
101 class(enumerator_t), intent(in) :: lhs, rhs
102
103 call error_handling%assert(same_type_as(lhs,rhs))
104 call error_handling%assert(lhs%set)
105 call error_handling%assert(rhs%set)
106
107 not_equal = (lhs%id /= rhs%id)

References error_handling_m::error_handling, and not_equal().

Referenced by not_equal(), and enum_generator_m::enumerator_t::operator().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unset_enumerator()

pure subroutine enum_generator_m::unset_enumerator ( class(enumerator_t), intent(inout) self)
private

Definition at line 73 of file enum_generator.f90.

74 implicit none
75 class(enumerator_t), intent(inout) :: self
76
77 self%set = .false.