2 #include "myinterface.h" /* IDL compiler generated prototypes etc. */
4 /* Internal data of our object implementing myinterface */
9 /* Implementation of add method */
10 CORBA_long example_add(myinterface obj, const CORBA_long a,
11 const CORBA_long b, CORBA_Environment *ev)
13 struct example_data *ed = forb_instance_data(obj);
19 /* Implementation of get_last method */
20 void example_get_last(myinterface obj, CORBA_long* a,
21 CORBA_long* b, CORBA_Environment *ev)
23 struct example_data *ed = forb_instance_data(obj);
28 /* Table of implemented methods */
29 struct forb_myinterface_impl example_implementation = {
31 .get_last = example_get_last,
34 int main(int argc, char *argv[])
38 struct example_data example_data;
40 orb = forb_init(&argc, &argv, NULL); /* FORB initialization */
41 /* Cration of an object implementing myinterface */
42 example = forb_myinterface_new(orb, &example_implementation,
44 /* We can register our object under a name, so that other
45 * processes can use it. */
46 forb_register_reference(example, "example");
48 /* Process incomming requests to this object */
49 forb_execute_object(example);
51 return 0; /* Never returns */