File: Generator.rb

package info (click to toggle)
quickfix 1.13.3%2Bdfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 152,548 kB
  • ctags: 679,426
  • sloc: cpp: 639,331; xml: 129,200; python: 108,722; ruby: 85,152; sh: 10,492; ansic: 9,025; java: 1,827; cs: 1,145; makefile: 523; sql: 313; perl: 108
file content (39 lines) | stat: -rw-r--r-- 1,396 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
require 'Processor'
require 'Aggregator'
require "GeneratorCPP"
require "GeneratorNET"
require "GeneratorPython"
require "GeneratorRuby"

def versionXML( type, major, minor, sp )
  dir = "../src"
  xml = "#{type}#{major}#{minor}.xml"
  if( sp != 0 )
    xml = "#{type}#{major}#{minor}SP#{sp}.xml"
  end
  return xml	
end

def aggregateFields( type, major, minor, sp, aggregator )
  xml = versionXML( type, major, minor, sp )
  Processor.new(xml, [aggregator]).processFields
end

def generateVersion( type, major, minor, sp, aggregator )
  dir = "../src"
  xml = versionXML( type, major, minor, sp )
  cpp = GeneratorCPP.new(type, major.to_s, minor.to_s, sp.to_s, "#{dir}/C++")
  net = GeneratorNET.new(type, major.to_s, minor.to_s, sp.to_s, "#{dir}/.NET")
  python = GeneratorPython.new(type, major.to_s, minor.to_s, sp.to_s, "#{dir}/python")
  ruby = GeneratorRuby.new(type, major.to_s, minor.to_s, sp.to_s, "#{dir}/ruby")
  processor = Processor.new(xml, [cpp, net, python, ruby]).process( aggregator )
end

aggregator = Aggregator.new
aggregateFields( "FIXT", 1, 1, 0, aggregator )
(0..4).each { |i| aggregateFields( "FIX", 4, i, 0, aggregator ) }
(0..2).each { |i| aggregateFields( "FIX", 5, 0, i, aggregator ) }

generateVersion( "FIXT", 1, 1, 0, aggregator )
(0..4).each { |i| generateVersion( "FIX", 4, i, 0, aggregator ) }
(0..2).each { |i| generateVersion( "FIX", 5, 0, i, aggregator ) }