summaryrefslogtreecommitdiffhomepage
path: root/planning/structure.puml
blob: 817a3bda55426f183af9d66f4460d9518091248c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
@startuml

state Gem {
	state Headers
	state Structs #red {
		state Struct_Type_Init
		state Struct_Deinit #chocolate
		state "Struct Getter Method" as Struct_Getter #lawngreen {
			state fork_is_struct_getter <<fork>>
			state "Unwrap Struct\nand Read Value" as Unwrap_Struct_Getter
			state "Return Value" as Return_Struct_Getter
			state "Handle If Value\nIs Struct" as Handle_Struct_Value_Getter

			[*] -d-> Unwrap_Struct_Getter
			Unwrap_Struct_Getter -d-> fork_is_struct_getter
			fork_is_struct_getter -d-> Return_Struct_Getter
			fork_is_struct_getter -d-> Handle_Struct_Value_Getter
			Handle_Struct_Value_Getter -d-> Return_Struct_Getter
		}
		state "Struct Setter Method" as Struct_Setter #darkorchid {
			state "Initialize Vars" as Initialize_Vars_Setter
			state "Get and Assign\nArg" as Get_Arg_Setter
			state "Unwrap And Set" as Unwrap_Struct_Setter
			state "Return Var" as Return_Setter

			[*] -d-> Initialize_Vars_Setter
			Initialize_Vars_Setter -d-> Get_Arg_Setter
			Get_Arg_Setter -d-> Unwrap_Struct_Setter
			Unwrap_Struct_Setter -d-> Return_Setter
		}
		state Struct_Initializer as "Struct Initializer" #gold {
			state "Initialize Vars" as Initialize_Vars_Struct_Init
			state fork_kw_args_struct_init <<fork>>
			state "Get and Assign\nArg" as Get_Arg_Struct_Init
			state "Get and Assign\nKwargs" as Get_Kwargs_Struct_Init
			state "Build Struct" as Build_Struct_Struct_Init
			state "Wrap Struct" as Wrap_Struct_Struct_Init
			state "Return Ruby Object" as Return_Struct_Init

			[*] -d-> Initialize_Vars_Struct_Init

			Initialize_Vars_Struct_Init -d-> fork_kw_args_struct_init

			fork_kw_args_struct_init -d-> Get_Arg_Struct_Init

			fork_kw_args_struct_init -d-> Get_Kwargs_Struct_Init

			Get_Arg_Struct_Init -d-> Build_Struct_Struct_Init
			Get_Kwargs_Struct_Init -d-> Build_Struct_Struct_Init

			Build_Struct_Struct_Init -d-> Wrap_Struct_Struct_Init

			Wrap_Struct_Struct_Init -d-> Return_Struct_Init
		}

		Struct_Type_Init --> Struct_Deinit

	}
	state Methods #lightblue {
		state "Initialize Vars" as Initialize_Vars_C_Function
		state fork_kw_args_c_function <<fork>>
		state "Get and Assign Arg" as Get_Arg_C_Function
		state "Get and Assign Kwargs" as Get_Kwargs_C_Function
		state "Call Function" as Call_C_Function
		state fork_wrap_struct_c_function <<fork>>
		state "Wrap Struct" as Wrap_Struct_C_Function
		state "Return Value" as Return_C_Function

		[*] -d-> Initialize_Vars_C_Function
		[*] -d-> Call_C_Function

		Initialize_Vars_C_Function -d-> fork_kw_args_c_function

		fork_kw_args_c_function -d-> Get_Arg_C_Function

		fork_kw_args_c_function -d-> Get_Kwargs_C_Function

		Get_Arg_C_Function -d-> Call_C_Function
		Get_Kwargs_C_Function -d-> Call_C_Function

		Call_C_Function -d-> fork_wrap_struct_c_function
		fork_wrap_struct_c_function -d-> Wrap_Struct_C_Function

		fork_wrap_struct_c_function -d-> Return_C_Function
		Wrap_Struct_C_Function -d-> Return_C_Function
	}
	state Gem_Initializer as "Gem Initializer" {
		state Define_Module as "Define Module" #crimson
		state Define_Struct_Classes as "Define Classes" #darkorange
		state Define_Struct_Methods as "Define Struct Methods" #hotpink
		state Define_Functions as "Define Functions" #lightblue
	}
	state Gem_Finalizer as "Gem Finalizer"


	Headers -d-> Structs
	Structs -d-> Methods
	Methods -d-> Gem_Initializer
	Gem_Initializer -d-> Gem_Finalizer

	Define_Module -d-> Define_Struct_Classes
	Define_Struct_Classes -r-> Define_Struct_Methods
	Define_Struct_Classes -d-> Define_Functions
}

state Build_State as "Build State Hash" {
	state BS_C_Gemname as "Gem Name" #crimson : string
	state BS_C_Typedef as "Typedefs" : hash(typedef: c_type)
	state BS_C_Function_Name as "C Function Name" #lightblue {
		state BS_Cfun_Skip as "Skip" : boolean
		state BS_Cfun_RClass as "Ruby Class" #darkorange : string or array(string)
		state BS_Cfun_Name as "Ruby Name" : string
		state BS_Cfun_Selfparam as "Param as Self" : string
	}
	state BS_C_Struct_Name as "C Struct Name" #red {
		state BS_C_Deinit as "Deinitialize Object" #chocolate : string(C code)
		state BS_Cstc_Skip as "Skip" : boolean
		state BS_Cstc_Name as "Ruby Name" : string
		state BS_Cstc_RClass as "Ruby Class" #darkorange : string or array(string)
		state BS_Cstc_Typedef as "C Typedefs" : array of strings
		state BS_Cstc_Init as "Initializer" #gold {
			state BS_Cstc_I_skip as "Skip" : boolean
		}
		state BS_Cstc_Accessors as "Accessors" #hotpink {
			state BS_Cstc_Getters as "Getters" #lawngreen {
				state BS_Cstc_G_Name as "Ruby Name" : string
				state BS_Cstc_G_Skip as "Skip" : boolean
			}
			state BS_Cstc_Setters as "Setters" #darkorchid {
				state BS_Cstc_S_Name as "Ruby Name" : string
				state BS_Cstc_S_Skip as "Skip" : boolean
			}
		}
		BS_Cstc_Getters -d[hidden]-> BS_Cstc_Setters
	}

	BS_C_Function_Name -d[hidden]-> BS_C_Struct_Name
}

state UCTags as "Universal Ctags Identifier" {
	state UCT_KindIsProto as "Tag Kind Is\nPrototype"
	state UCT_KindIsTypedef as "Tag Kind Is\nTypedef"
	state UCT_KindIsMember as "Tag Kind Is\nMember"

	state UCT_TyperefIsTypename as "Tag Typeref is\n'typename:{something}'"
	state UCT_TyperefIsStruct as "Tag Typeref is\n'struct:{something}'"

	state UCT_IsFunction as "It's a Function"
	state UCT_IsStructParam as "It's a Struct\nParameter"
	state UCT_IsTypedef as "It's an Alias\n(Typedef)"
	state UCT_IsStruct as "It's a Struct"

	[*] -d-> UCT_KindIsProto
	[*] -d-> UCT_KindIsTypedef
	[*] -d-> UCT_KindIsMember

	UCT_KindIsProto -d-> UCT_IsFunction
	UCT_KindIsMember -d-> UCT_IsStructParam

	UCT_KindIsTypedef -d-> UCT_TyperefIsTypename
	UCT_KindIsTypedef -d-> UCT_TyperefIsStruct
	UCT_TyperefIsTypename -d-> UCT_IsStruct
	UCT_TyperefIsStruct -d-> UCT_IsTypedef

}





@enduml