OSDN Git Service

Backported 87d145bd1f1a14a33f5f6fbc78b63a1952f1ca90 and 2df8c798aeb7f0e77735e893fd137...
[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     USI = 1
49
50     Thrift::Struct.field_accessor self, :usi
51     FIELDS = {
52       USI => {:type => Thrift::Types::STRING, :name => 'usi'}
53     }
54     def validate
55     end
56
57   end
58
59   class Usi2png_result
60     include Thrift::Struct
61     SUCCESS = 0
62
63     Thrift::Struct.field_accessor self, :success
64     FIELDS = {
65       SUCCESS => {:type => Thrift::Types::STRING, :name => 'success'}
66     }
67     def validate
68     end
69
70   end
71
72 end
73