OSDN Git Service

Stub files connecting to a shogigraphic server.
[shogi-server/shogi-server.git] / showgame / gen-rb / ShogiGraphic.rb
1 #
2 # Autogenerated by Thrift
3 #
4 # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 #
6
7 require 'thrift'
8 require 'thrift/protocol'
9 require File.dirname(__FILE__) + '/graphicserver_types'
10
11 module ShogiGraphic
12   class Client
13     include Thrift::Client
14
15     def usi2png(usi)
16       send_usi2png(usi)
17       return recv_usi2png()
18     end
19
20     def send_usi2png(usi)
21       send_message('usi2png', Usi2png_args, :usi => usi)
22     end
23
24     def recv_usi2png()
25       result = receive_message(Usi2png_result)
26       return result.success unless result.success.nil?
27       raise Thrift::ApplicationException.new(Thrift::ApplicationException::MISSING_RESULT, 'usi2png failed: unknown result')
28     end
29
30   end
31
32   class Processor
33     include Thrift::Processor
34
35     def process_usi2png(seqid, iprot, oprot)
36       args = read_args(iprot, Usi2png_args)
37       result = Usi2png_result.new()
38       result.success = @handler.usi2png(args.usi)
39       write_result(result, oprot, 'usi2png', seqid)
40     end
41
42   end
43
44   # HELPER FUNCTIONS AND STRUCTURES
45
46   class Usi2png_args
47     include Thrift::Struct
48     Thrift::Struct.field_accessor self, :usi
49     FIELDS = {
50       1 => {:type => Thrift::Types::STRING, :name => 'usi'}
51     }
52   end
53
54   class Usi2png_result
55     include Thrift::Struct
56     Thrift::Struct.field_accessor self, :success
57     FIELDS = {
58       0 => {:type => Thrift::Types::STRING, :name => 'success'}
59     }
60   end
61
62 end
63