| /* |
| * |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, |
| * software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations |
| * under the License. |
| * |
| */ |
| |
| |
| // This file automatically generated by: |
| // Apache Etch 1.1.0-incubating (LOCAL-0) / c 1.1.0-incubating (LOCAL-0) |
| // Fri Aug 28 15:58:20 CEST 2009 |
| // This file is automatically created and should not be edited! |
| |
| /* |
| * helloworld_client_stub.c |
| */ |
| |
| #include "helloworld_client.h" |
| #include "helloworld_client_stub.h" |
| #include "helloworld_valufact.h" |
| |
| #include "etch_url.h" |
| #include "etch_objecttypes.h" |
| #include "etch_svcobj_masks.h" |
| #include "etch_general.h" |
| |
| |
| unsigned short CLASSID_HELLOWORLD_CLIENT_STUB; |
| |
| |
| int destroy_helloworld_client_stub(void*); |
| |
| |
| /* - - - - - - - - - - - |
| * stub helper methods |
| * - - - - - - - - - - - |
| */ |
| |
| /** |
| * helloworld_client_stub_run_nothing_ |
| */ |
| int helloworld_client_stub_run_nothing_ (etch_stub* stub, i_delivery_service* dsvc, |
| void* obj, etch_who* whofrom, etch_message* msg) |
| { |
| i_helloworld_client* client = (i_helloworld_client*)obj; |
| helloworld_valufact_impl* pvfi = NULL; |
| helloworld_valufact* pvf = NULL; |
| struct helloworld_client_impl* impl = NULL; |
| |
| /* objects specific to service.nothing_() */ |
| etch_field* key_foo = NULL; |
| etch_int64* val_foo = NULL; |
| etch_field* key_bar = NULL; |
| etch_string* val_bar = NULL; |
| etch_int32* resultobj = NULL; |
| |
| etchstub_validate_args (stub, dsvc, msg, client, &pvf, (void**)&pvfi, (void**)&impl); |
| |
| key_foo = NULL; |
| key_bar = NULL; |
| ETCH_ASSERT(key_foo && key_bar); |
| |
| /* nullarg asserts are initial tests only: server impl |
| * will generate exceptions on nullargs in the real world */ |
| val_foo = NULL; /* = (etch_int64*) message_get (msg, key_foo); */ |
| val_bar = NULL; /* = (etch_string*) message_get (msg, key_bar); */ |
| ETCH_ASSERT(val_foo && val_bar); |
| |
| /* execute the service method */ |
| resultobj = NULL; /* server->nothing_ (impl, val_foo, val_bar); */ |
| ETCH_ASSERT(resultobj); |
| |
| /* transmit reply back to sender */ |
| return etchstub_send_reply (stub, dsvc, whofrom, msg, (void*) resultobj, TRUE); |
| } |
| |
| /* - - - - - - - - - |
| * constructors |
| * - - - - - - - - - |
| */ |
| |
| /** |
| * new_helloworld_client_stub. |
| * called from $helper.getRemoteName($intf, $helper.getRemoteDirection($mc))* perfhelper.new_remote_SERVER(). |
| * @param p client parameter bundle |
| */ |
| helloworld_client_stub* new_helloworld_client_stub (etch_client_factory* p) |
| { |
| helloworld_client_stub* mystub = NULL; |
| i_delivery_service* ids = p->dsvc; |
| etch_threadpool *qp = p->qpool, *fp = p->fpool; |
| |
| i_helloworld_client* client = p->iclient; |
| ETCH_ASSERT(is_etch_ideliverysvc(ids)); |
| ETCH_ASSERT(is_etch_client_base(client)); |
| |
| mystub = new_clientstub_init (client, sizeof(helloworld_client_stub), |
| destroy_helloworld_client_stub, ids, qp, fp, p); |
| |
| ((etch_object*)mystub)->class_id = get_dynamic_classid_unique(&CLASSID_HELLOWORLD_CLIENT_STUB); |
| mystub->server_id = p->server_id; |
| |
| /* initialize custom methods and data here */ |
| |
| /* set stub helper methods */ |
| |
| return mystub; |
| } |
| |
| /** |
| * is_helloworld_client_stub() |
| */ |
| int is_helloworld_client_stub(void* obj) |
| { |
| return obj && ((etch_object*)obj)->class_id == CLASSID_HELLOWORLD_CLIENT_STUB; |
| } |
| |
| /** |
| * destroy_def_helloworld_client_stub() |
| * helloworld_client_stub user-allocated memory destructor. |
| * called back from private object destructor destroy_stub_object(). |
| * if you explicitly allocate memory in the client stub object, destroy it here. |
| */ |
| int destroy_helloworld_client_stub(void* data) |
| { |
| /* |
| helloworld_client_stub* mystub = (helloworld_client_stub*)data; |
| free custom memory allocations here */ |
| //etch_free(mystub->my_example_obj); /* free example alloc */ |
| |
| return 0; |
| } |