| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE.md file. | |
| 4 | |
| 5 // Generated file. Do not edit. | |
| 6 | |
| 7 library myapi_service; | |
| 8 | |
| 9 import "dart:ffi"; | |
| 10 import "dart:service" as service; | |
| 11 | |
| 12 final Channel _channel = new Channel(); | |
| 13 final Port _port = new Port(_channel); | |
| 14 final Foreign _postResult = Foreign.lookup("PostResultToService"); | |
| 15 | |
| 16 bool _terminated = false; | |
| 17 MyApiService _impl; | |
| 18 | |
| 19 abstract class MyApiService { | |
| 20 int create(); | |
| 21 void destroy(int api); | |
| 22 int foo(int api); | |
| 23 void MyObject_funk(int api, int id, int o); | |
| 24 | |
| 25 static void initialize(MyApiService impl) { | |
| 26 if (_impl != null) { | |
| 27 throw new UnsupportedError("Cannot re-initialize"); | |
| 28 } | |
| 29 _impl = impl; | |
| 30 _terminated = false; | |
| 31 service.register("MyApiService", _port); | |
| 32 } | |
| 33 | |
| 34 static bool hasNextEvent() { | |
| 35 return !_terminated; | |
| 36 } | |
| 37 | |
| 38 static void handleNextEvent() { | |
| 39 var request = _channel.receive(); | |
| 40 switch (request.getInt32(0)) { | |
| 41 case _TERMINATE_METHOD_ID: | |
| 42 _terminated = true; | |
| 43 _postResult.vcall$1(request); | |
| 44 break; | |
| 45 case _CREATE_METHOD_ID: | |
| 46 var result = _impl.create(); | |
| 47 request.setInt32(56, result); | |
| 48 _postResult.vcall$1(request); | |
| 49 break; | |
| 50 case _DESTROY_METHOD_ID: | |
| 51 _impl.destroy(request.getInt32(56)); | |
| 52 _postResult.vcall$1(request); | |
| 53 break; | |
| 54 case _FOO_METHOD_ID: | |
| 55 var result = _impl.foo(request.getInt32(56)); | |
| 56 request.setInt32(56, result); | |
| 57 _postResult.vcall$1(request); | |
| 58 break; | |
| 59 case _MY_OBJECT_FUNK_METHOD_ID: | |
| 60 _impl.MyObject_funk(request.getInt32(56), request.getInt32(60), request.
getInt32(64)); | |
| 61 _postResult.vcall$1(request); | |
| 62 break; | |
| 63 default: | |
| 64 throw new UnsupportedError("Unknown method"); | |
| 65 } | |
| 66 } | |
| 67 | |
| 68 static const int _TERMINATE_METHOD_ID = 0; | |
| 69 static const int _CREATE_METHOD_ID = 1; | |
| 70 static const int _DESTROY_METHOD_ID = 2; | |
| 71 static const int _FOO_METHOD_ID = 3; | |
| 72 static const int _MY_OBJECT_FUNK_METHOD_ID = 4; | |
| 73 } | |
| OLD | NEW |