File: FunctionalAPI.cxx.in

package info (click to toggle)
simpleitk 1.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 75,056 kB
  • sloc: cpp: 25,403; python: 3,060; sh: 1,131; ansic: 369; java: 260; cs: 215; makefile: 51; ruby: 47; tcl: 22
file content (49 lines) | stat: -rw-r--r-- 2,068 bytes parent folder | download
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
$(if (not no_procedure) or (no_procedure == 1) then
OUT=[[
//
// Function to run the Execute method of this filter
//
Image ${name:gsub("ImageFilter$", ""):gsub("Filter$", "")} ( $(include ImageParameters.in)$(include InputParameters.in)$(include MemberParameters.in) )
{
  ${name} filter;
  return filter.Execute ( $(for inum=1,number_of_inputs do
                              if inum>1 then
                                OUT=OUT..', '
                              end
                              OUT=OUT .. 'image' .. inum
                            end
                            local count = number_of_inputs
                            if inputs then
                              for inum=1,#inputs do
                                if  not (inputs[inum].optional and no_optional) then
                                  if count>0 then
                                    OUT = OUT .. ", "
                                  end
                                  count = count + 1
                                  OUT=OUT..inputs[inum].name:sub(1,1):lower() .. inputs[inum].name:sub(2,-1)
                                end
                              end
                            end
                            for i = 1,#members do
                              if count > 0 then
                                OUT = OUT .. ", "
                              end
                              count = count + 1
                            OUT= OUT .. members[i].name:sub(1,1):lower() .. members[i].name:sub(2,-1)
                            end) );
}
]]
end)$(if inputs and ((not no_procedure) or (no_procedure == 1))then
    local has_optional_inputs = false
    for i =1,#inputs do
      if inputs[i].optional then
        has_optional_inputs=inputs[i].optional
      end
    end
    if has_optional_inputs and not no_optional then
      no_optional=1
-- we recusively include this same template file but with the no_optional variable defined
      OUT=[[
$(include FunctionalAPI.cxx.in)]]
    end
end)$(if inputs then no_optional=nil end)