summaryrefslogtreecommitdiff
path: root/TAO/IIOP/test/method_db.i
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/IIOP/test/method_db.i')
-rw-r--r--TAO/IIOP/test/method_db.i67
1 files changed, 67 insertions, 0 deletions
diff --git a/TAO/IIOP/test/method_db.i b/TAO/IIOP/test/method_db.i
new file mode 100644
index 00000000000..d2b552e8284
--- /dev/null
+++ b/TAO/IIOP/test/method_db.i
@@ -0,0 +1,67 @@
+// @(#)method_db.i 05/14/97
+
+// This file provides a way of initializing the method database
+// Written by: Brian Mendel
+
+#include "cubitS.h"
+
+static void
+is_a_skel (CORBA_ServerRequest &req,
+ CORBA_Object_ptr obj,
+ CORBA_Environment &env)
+{
+ CORBA_NVList_ptr nvlist;
+ CORBA_NamedValue_ptr nv;
+ CORBA_Any temp_value (_tc_CORBA_String);
+
+ req.orb()->create_list (0, nvlist);
+ nv = nvlist->add_value (0, temp_value, CORBA_ARG_IN, env);
+
+ req.params (nvlist, env);
+ if (env.exception () != 0)
+ {
+ dexc (env, "is_a_skel, get params");
+ return;
+ }
+
+ CORBA_Boolean *retval;
+ CORBA_String value = *(CORBA_String *) nv->value()->value();
+
+ if (ACE_OS::strcmp ((char*)value, "IDL:Cubit:1.0") == 0
+ || ACE_OS::strcmp ((char *)value, _tc_CORBA_Object->id (env)) == 0)
+ retval = new CORBA_Boolean (CORBA_B_TRUE);
+ else
+ retval = new CORBA_Boolean (CORBA_B_FALSE);
+
+ CORBA_Any *any = new CORBA_Any (_tc_CORBA_Boolean, retval, CORBA_B_TRUE);
+
+ req.result (any, env);
+ dexc (env, "_is_a, result");
+}
+
+
+struct method_db
+{
+ CORBA_String opname;
+ skeleton skel_ptr;
+};
+
+static const method_db cubit_operations[] = {
+ { "_is_a", &is_a_skel },
+ { "cube_octet", &_skel_Cubit::_cube_octet_skel },
+ { "cube_short", &_skel_Cubit::_cube_short_skel },
+ { "cube_long", &_skel_Cubit::_cube_long_skel },
+ { "cube_struct", &_skel_Cubit::_cube_struct_skel },
+ { "cube_union", &_skel_Cubit::_cube_union_skel },
+ { "please_exit", &_skel_Cubit::_please_exit_skel },
+ { 0, 0 }
+};
+
+
+void initialize_method_db (TAO_Dynamic_Operation_Table *the_optable)
+{
+ for (int ndx = 0; ndx < 7; ndx++)
+ the_optable->register_op(cubit_operations[ndx].opname,
+ cubit_operations[ndx].skel_ptr);
+
+}