1 #include "masterdispatch.h"
12 IObject
*obj
= wvcreate
<IObject
>("mymulti:5 hello world!");
15 AnyType
any2(obj
, IObject_IID
, obj
);
17 printf("switch2: %p -> %d\n",
18 (IObject
*)any2
.obj
, any2
.switchto(IString_IID
));
19 printf("switch2b: %p -> %d\n",
20 (IObject
*)any2b
.obj
, any2b
.switchto(IString_IID
));
22 AnyType x
[] = { AnyType(98) };
23 master
->call(any2
, "setInt", 1, x
);
24 AnyType ret
= master
->call(any2
, "getInt", 0, NULL
);
25 printf("return: %s\n", ret
.str
.cstr());
26 assert(ret
.str
.num() == 98);
28 AnyType x2
[] = { AnyType("42 silly")};
29 master
->call(any2
, "setString", 1, x2
);
30 ret
= master
->call(any2
, "getInt", 0, NULL
);
31 printf("return: %s\n", ret
.str
.cstr());
32 assert(ret
.str
.num() == 42);
38 WvString o
= unicreate("mymulti:7 hello world!");
39 int x
= atoi(unicall(o
, "getInt"));
40 printf("x = %d\n", x
);
41 unicall(o
, "setString {blah blah}");
42 printf("x2 = '%s'\n", unicall(o
, "getString"));