added LIBT2N_SET_DEFAULTGROUP
authorJens Thiele <jens.thiele@intra2net.com>
Tue, 14 Nov 2006 18:03:58 +0000 (18:03 +0000)
committerJens Thiele <jens.thiele@intra2net.com>
Tue, 14 Nov 2006 18:03:58 +0000 (18:03 +0000)
examples/TODO
examples/minimalistic-client-stub.cpp
examples/minimalistic-server.cpp
examples/minimalistic-stub.hxx

index d6a808d..6a7aba4 100644 (file)
@@ -1 +1,28 @@
 - function to command group mapping?
+
+code generator:
+gccxml output: type of function arguments is a bit tricky:
+
+<Function id="_18" name="testfunc" returns="_1506" context="_1" mangled="_Z8testfuncRKSs" demangled="testfunc(std::string const&amp;)" location="f3:16" fil
+e="f3" line="16" endline="25" attributes="gccxml(libt2n-example)">
+    <Argument name="str" type="_1550" location="f3:16" file="f3" line="16"/>
+  </Function>
+
+=> _1550:
+<ReferenceType id="_1550" type="_1506c" size="32" align="32"/>
+
+=> _1506c:
+<CvQualifiedType id="_1506c" type="_1506" const="1"/>:
+
+=> _1506:
+<Typedef id="_1506" name="string" type="_1505" context="_2" location="f105:60" file="f105" line="60"/>
+
+=> _1505:
+<Struct id="_1505" name="basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;" context="_2" mangled="Ss" demangled="std::strin
+g" location="f105:56" file="f105" line="56" artificial="1" size="32" align="32" members="_4377 _4378 _4379 _4380 _4381 _4382 _4383 _4384 _4385 _4386 _4387 _4
+388 _4389 _4390 _4391 _4392 _4393 _4394 _4395 _4396 _4397 _4398 _4399 _4400 _4401 _4402 _4403 _4404 _4405 _4406 _4407 _4408 _4409 _4410 _4411 _4412 _4413 _44
+14 _4415 _4416 _4417 _4418 _4419 _4420 _4421 _4422 _4423 _4424 _4425 _4426 _4427 _4428 _4429 _4430 _4431 _4432 _4433 _4434 _4435 _4436 _4437 _4438 _4439 _444
+0 _4441 _4442 _4443 _4444 _4445 _4446 _4447 _4448 _4449 _4450 _4451 _4452 _4453 _4454 _4455 _4456 _4457 _4458 _4459 _4460 _4461 _4462 _4463 _4464 _4465 _4466
+ _4467 _4468 _4469 _4470 _4471 _4472 _4473 _4474 _4475 _4476 _4477 _4478 _4479 _4480 _4481 _4482 _4483 _4484 _4485 _4486 _4487 _4488 _4489 _4490 _4491 _4492
+_4493 _4494 _4495 _4496 _4497 _4498 _4499 _4500 _4501 _4502 _4503 _4504 _4505 _4506 _4507 _4508 _4509 _4510 _4511 _4512 _4513 _4514 _4515 _4516 _4517 _4518 _
+4519 _4520 _4521 _4522 _4523 " bases=""/>
index b12b642..d6ec553 100644 (file)
@@ -14,6 +14,7 @@ std::string cmd_group_example_client::testfunc(const std::string& str)
 
     testfunc_res* res=dynamic_cast<testfunc_res*>(rc.get_result());
     if (!res)
+      // TODO: another exception and details
       throw libt2n::t2n_communication_error("result object of wrong type");
     return res->get_data();
 }
index 1b5e3a2..90dbc22 100644 (file)
@@ -12,7 +12,9 @@
 
 using namespace std;
 
-LIBT2N_EXPORT_GROUP(example) string testfunc(const string& str) 
+LIBT2N_SET_DEFAULTGROUP(example)
+
+LIBT2N_EXPORT string testfunc(const string& str) 
 {
     string ret;
     if (str=="throw")
index f6e7de1..7516a31 100644 (file)
 #include <command.hxx>
 
 #ifdef __GCCXML__
-#define LIBT2N_EXPORT __attribute((gccxml("libt2n")))
+#define LIBT2N_SET_DEFAULTGROUP(x) namespace { typedef __attribute((gccxml(#x))) int libt2n_default; }
+#define LIBT2N_EXPORT __attribute((gccxml("libt2n-default")))
 #define LIBT2N_EXPORT_GROUP(group) __attribute((gccxml("libt2n-"#group)))
 #else
+#define LIBT2N_SET_DEFAULTGROUP(x)
 #define LIBT2N_EXPORT
 #define LIBT2N_EXPORT_GROUP(group)
 #endif