~ubuntu-branches/debian/sid/simpleitk/sid

« back to all changes in this revision

Viewing changes to ExpandTemplateGenerator/Components/FunctionalAPI.cxx.in

  • Committer: Package Import Robot
  • Author(s): Ghislain Antony Vaillant
  • Date: 2017-11-02 08:49:18 UTC
  • Revision ID: package-import@ubuntu.com-20171102084918-7hs09ih668xq87ej
Tags: upstream-1.0.1
ImportĀ upstreamĀ versionĀ 1.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
$(if (not no_procedure) or (no_procedure == 1) then
 
2
OUT=[[
 
3
//
 
4
// Function to run the Execute method of this filter
 
5
//
 
6
Image ${name:gsub("ImageFilter$", ""):gsub("Filter$", "")} ( $(include ImageParameters.in)$(include InputParameters.in)$(include MemberParameters.in) )
 
7
{
 
8
  ${name} filter;
 
9
  return filter.Execute ( $(for inum=1,number_of_inputs do
 
10
                              if inum>1 then
 
11
                                OUT=OUT..', '
 
12
                              end
 
13
                              OUT=OUT .. 'image' .. inum
 
14
                            end
 
15
                            local count = number_of_inputs
 
16
                            if inputs then
 
17
                              for inum=1,#inputs do
 
18
                                if  not (inputs[inum].optional and no_optional) then
 
19
                                  if count>0 then
 
20
                                    OUT = OUT .. ", "
 
21
                                  end
 
22
                                  count = count + 1
 
23
                                  OUT=OUT..inputs[inum].name:sub(1,1):lower() .. inputs[inum].name:sub(2,-1)
 
24
                                end
 
25
                              end
 
26
                            end
 
27
                            for i = 1,#members do
 
28
                              if count > 0 then
 
29
                                OUT = OUT .. ", "
 
30
                              end
 
31
                              count = count + 1
 
32
                            OUT= OUT .. members[i].name:sub(1,1):lower() .. members[i].name:sub(2,-1)
 
33
                            end) );
 
34
}
 
35
]]
 
36
end)$(if inputs and ((not no_procedure) or (no_procedure == 1))then
 
37
    local has_optional_inputs = false
 
38
    for i =1,#inputs do
 
39
      if inputs[i].optional then
 
40
        has_optional_inputs=inputs[i].optional
 
41
      end
 
42
    end
 
43
    if has_optional_inputs and not no_optional then
 
44
      no_optional=1
 
45
-- we recusively include this same template file but with the no_optional variable defined
 
46
      OUT=[[
 
47
$(include FunctionalAPI.cxx.in)]]
 
48
    end
 
49
end)$(if inputs then no_optional=nil end)