summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgokhale <asgokhale@users.noreply.github.com>1997-12-11 04:41:02 +0000
committergokhale <asgokhale@users.noreply.github.com>1997-12-11 04:41:02 +0000
commitbbc8e38b23fe28a19eff11a82c5fc17581ee35d8 (patch)
tree40f649ad7ccd2f313ab6c6a29ef21fdcca57ff30
parenta36db35bb260389747cec1d18729f30845c0b995 (diff)
downloadATCD-bbc8e38b23fe28a19eff11a82c5fc17581ee35d8.tar.gz
*** empty log message ***
-rw-r--r--TAO/ChangeLog-98c15
-rw-r--r--TAO/tests/Cubit/TAO/DII_Cubit/cubitS.cpp116
-rw-r--r--TAO/tests/Cubit/TAO/DII_Cubit/cubitS.h57
-rw-r--r--TAO/tests/Cubit/TAO/DII_Cubit/method_db.i11
4 files changed, 121 insertions, 78 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c
index 767f76e429f..bb187ab54d8 100644
--- a/TAO/ChangeLog-98c
+++ b/TAO/ChangeLog-98c
@@ -1,3 +1,10 @@
+Wed Dec 10 22:38:08 1997 Aniruddha Gokhale <gokhale@mambo.cs.wustl.edu>
+
+ * TAO/tests/Cubit/TAO/DII_Cubit: Fixed the hand-crafted code to
+ make use of the many changes that were made to the dispatching
+ scheme as well as changes made to the signature of the skeletons
+ for operations of interfaces.
+
Wed Dec 10 21:41:48 1997 Sergio Flores <sergio@tango.cs.wustl.edu>
* docs/releasenotes/index.html: Updated the release notes on the
@@ -5,7 +12,7 @@ Wed Dec 10 21:41:48 1997 Sergio Flores <sergio@tango.cs.wustl.edu>
Wed Dec 10 20:13:57 1997 Carlos O'Ryan <coryan@macarena.cs.wustl.edu>
- * Makefile:
+ * Makefile:
Added orbsvcs to the hierarchy.
* The orbsvcs directory was completely reorganized, in preparation
@@ -19,7 +26,7 @@ Wed Dec 10 20:13:57 1997 Carlos O'Ryan <coryan@macarena.cs.wustl.edu>
- orbsvcs/Event_Service: TAO Real-Time Event Service.
- orbsvcs/tests: test programs and examples.
- * docs/releasenotes/index.html:
+ * docs/releasenotes/index.html:
Updated documentation on the Event Service and its friends.
Wed Dec 10 19:57:07 1997 Chris Cleeland <cleeland@cs.wustl.edu>
@@ -32,13 +39,13 @@ Wed Dec 10 19:57:07 1997 Chris Cleeland <cleeland@cs.wustl.edu>
Wed Dec 10 14:23:24 1997 Carlos O'Ryan <coryan@macarena.cs.wustl.edu>
- * TAO_IDL/be/be_state_structure.cpp:
+ * TAO_IDL/be/be_state_structure.cpp:
Fixed a bug when handling typedefs.
It was generating code for imported types, we protected the
generation with a !imported(), thank to Andy Gokhale
<gokhale@cs.wustl.edu> for helping me on this.
- * tao/connect.cpp:
+ * tao/connect.cpp:
Set the TCP_NODELAY option by default, otherwise oneway calls
are considerably slower. It should have no effect for twoway
calls. Anyway an option should be added to control this
diff --git a/TAO/tests/Cubit/TAO/DII_Cubit/cubitS.cpp b/TAO/tests/Cubit/TAO/DII_Cubit/cubitS.cpp
index 0e313d7e7c8..a0edb1001f0 100644
--- a/TAO/tests/Cubit/TAO/DII_Cubit/cubitS.cpp
+++ b/TAO/tests/Cubit/TAO/DII_Cubit/cubitS.cpp
@@ -16,8 +16,9 @@ TAO_Dynamic_Hash_OpTable tao_cubit_optable (cubit_operations, 7, 14); // Dynami
_skel_Cubit::_skel_Cubit (const char *obj_name)
{
+#if 0
const char* mn = "_skel_Cubit::_skel_Cubit ()";
-
+
char *type_id = "IDL:Cubit:1.0";
IIOP_Object *data;
TAO_ORB_Core *ocp = TAO_ORB_Core_instance ();
@@ -31,7 +32,7 @@ _skel_Cubit::_skel_Cubit (const char *obj_name)
ACE_ERROR ((LM_ERROR, " (%P|%t) %s Unable to locate a valid object adapter\n", mn));
return;
}
-
+
this->optable_ = &tao_cubit_optable;
data = new IIOP_Object (type_id);
@@ -44,7 +45,7 @@ _skel_Cubit::_skel_Cubit (const char *obj_name)
data->profile.object_key.maximum = data->profile.object_key.length;
data->profile.object_key.buffer =
new CORBA::Octet[(size_t)data->profile.object_key.length + 1];
-
+
ACE_OS::memcpy (data->profile.object_key.buffer,
obj_name,
data->profile.object_key.length+1);
@@ -57,146 +58,159 @@ _skel_Cubit::_skel_Cubit (const char *obj_name)
" (%P|%t) %s Unable to bind object to key '%s': %p\n",
mn,
data->profile.object_key.buffer));
+#endif
+ const CORBA::String repoID = "IDL:Cubit:1.0"; // repository ID
+ IIOP_Object *data; // Actual object reference
+ TAO_ORB_Core *ocp = TAO_ORB_Core_instance (); // underlying ORB core instance
+ CORBA::POA_ptr oa = TAO_ORB_Core_instance ()->root_poa (); // underlying OA
+ const ACE_INET_Addr &addr = ocp->orb_params ()->addr ();
+ this->optable_ = &tao_cubit_optable;
+
+ // set up an IIOP object
+ data = new IIOP_Object (CORBA::string_dup (repoID), addr, obj_name);
+ this->set_parent (data); // store the IIOP obj ref with us
+ if (oa) oa->bind (data->profile.object_key, this); // register ourselves
}
void
_skel_Cubit::_cube_octet_skel (CORBA::ServerRequest &req,
- CORBA::Object_ptr obj,
- CORBA::Environment &env)
+ void *obj,
+ void */*context*/,
+ CORBA::Environment &env)
{
CORBA::NVList_ptr nvlist;
CORBA::NamedValue_ptr nv;
CORBA::Any temp_value (CORBA::_tc_octet);
-
+
req.orb ()->create_list (0, nvlist);
nv = nvlist->add_value (0, temp_value, CORBA::ARG_IN, env);
dexc (env, "cube_octet, add value");
-
+
req.params (nvlist, env);
dexc (env, "cube_octet, get params");
-
+
// Call Implementation
CORBA::Octet *value = new CORBA::Octet;
- Cubit *the_cubit = (Cubit *) obj->get_subclass ();
+ _skel_Cubit *the_cubit = (_skel_Cubit *) obj;
*value = the_cubit->Cubit_cube_octet (*(CORBA::Octet *) nv->value ()->value (), env);
CORBA::Any *any = new CORBA::Any (CORBA::_tc_octet, value, CORBA::B_TRUE);
-
+
req.result (any, env);
dexc (env, "cube_octet, result");
}
void
_skel_Cubit::_cube_short_skel (CORBA::ServerRequest &req,
- CORBA::Object_ptr obj,
+ void *obj, void */*context*/,
CORBA::Environment &env)
{
CORBA::NVList_ptr nvlist;
CORBA::NamedValue_ptr nv;
CORBA::Any temp_value (CORBA::_tc_short);
-
+
req.orb ()->create_list (0, nvlist);
nv = nvlist->add_value (0, temp_value, CORBA::ARG_IN, env);
dexc (env, "cube_short, add_value");
-
+
req.params (nvlist, env);
dexc (env, "cube_short, get params");
-
+
// Call Implementation
CORBA::Short *value = new CORBA::Short;
- Cubit *the_cubit = (Cubit *) obj->get_subclass ();
+ _skel_Cubit *the_cubit = (_skel_Cubit *) obj;
*value = the_cubit->Cubit_cube_short (*(CORBA::Short *) nv->value ()->value (), env);
-
+
CORBA::Any *any = new CORBA::Any (CORBA::_tc_short, value, CORBA::B_TRUE);
-
+
req.result (any, env);
dexc (env, "cube_short, result");
}
void
_skel_Cubit::_cube_long_skel (CORBA::ServerRequest &req,
- CORBA::Object_ptr obj,
+ void *obj, void */*context*/,
CORBA::Environment &env)
{
CORBA::NVList_ptr nvlist;
CORBA::NamedValue_ptr nv;
CORBA::Any temp_value (CORBA::_tc_long);
-
+
req.orb ()->create_list (0, nvlist);
nv = nvlist->add_value (0, temp_value, CORBA::ARG_IN, env);
dexc (env, "cube_long, add_value");
-
+
req.params (nvlist, env);
dexc (env, "cube_long, get params");
-
+
// Call Implementation
CORBA::Long *value = new CORBA::Long;
- Cubit *the_cubit = (Cubit *) obj->get_subclass ();
+ _skel_Cubit *the_cubit = (_skel_Cubit *) obj;
*value = the_cubit->Cubit_cube_long (*(CORBA::Long *) nv->value ()->value (), env);
-
+
CORBA::Any *any =
new CORBA::Any (CORBA::_tc_long, value, CORBA::B_TRUE);
-
+
req.result (any, env);
dexc (env, "cube_long, result");
}
void
_skel_Cubit::_cube_struct_skel (CORBA::ServerRequest &req,
- CORBA::Object_ptr obj,
+ void *obj, void */*context*/,
CORBA::Environment &env)
{
CORBA::NVList_ptr nvlist;
CORBA::NamedValue_ptr nv;
CORBA::Any temp_value (TC_Cubit_Many);
-
+
req.orb ()->create_list (0, nvlist);
nv = nvlist->add_value (0, temp_value, CORBA::ARG_IN, env);
dexc (env, "cube_struct, add_value");
-
+
req.params (nvlist, env);
dexc (env, "cube_struct, get params");
-
+
// Call Implementation
Cubit_Many *value;
- Cubit *the_cubit = (Cubit *) obj->get_subclass ();
+ _skel_Cubit *the_cubit = (_skel_Cubit *) obj;
value = the_cubit->Cubit_cube_struct (*(Cubit_Many *) nv->value ()->value (), env);
-
+
Cubit_Many *retval = new Cubit_Many;
retval->o = (CORBA::Octet)value->o;
retval->s = (CORBA::Short)value->s;
retval->l = value->l;
-
+
// dmsg2 ("cube struct.o, %d -> %d", value->o, retval->o);
// dmsg2 ("cube struct.s, %d -> %d", value->s, retval->s);
// dmsg2 ("cube struct.l, %d -> %d", value->l, retval->l);
-
+
CORBA::Any *any = new CORBA::Any (TC_Cubit_Many, retval, CORBA::B_TRUE);
-
+
req.result (any, env);
dexc (env, "cube_struct, result");
}
void
_skel_Cubit::_cube_union_skel (CORBA::ServerRequest &req,
- CORBA::Object_ptr obj,
+ void *obj, void */*context*/,
CORBA::Environment &env)
{
CORBA::NVList_ptr nvlist;
CORBA::NamedValue_ptr nv;
CORBA::Any temp_value (TC_Cubit_oneof);
-
+
req.orb ()->create_list (0, nvlist);
nv = nvlist->add_value (0, temp_value, CORBA::ARG_IN, env);
dexc (env, "cube_union_3rd, add_value");
-
+
req.params (nvlist, env);
dexc (env, "cube_union_3rd, get params");
-
+
// Call Implementation
Cubit_oneof *v;
- Cubit *the_cubit = (Cubit *) obj->get_subclass ();
+ _skel_Cubit *the_cubit = (_skel_Cubit *) obj;
v = the_cubit->Cubit_cube_union (*(Cubit_oneof *) nv->value ()->value (), env);
Cubit_oneof *r = new Cubit_oneof;
@@ -207,20 +221,36 @@ _skel_Cubit::_cube_union_skel (CORBA::ServerRequest &req,
r->cm.o = (CORBA::Octet) (v->cm.o);
r->cm.s = (CORBA::Short) (v->cm.s);
r->cm.l = v->cm.l;
-
+
CORBA::Any *any = new CORBA::Any (TC_Cubit_oneof, r, CORBA::B_TRUE);
-
+
req.result (any, env);
dexc (env, "cube_struct, result");
}
void
_skel_Cubit::_please_exit_skel (CORBA::ServerRequest &req,
- CORBA::Object_ptr obj,
+ void *obj, void */*context*/,
CORBA::Environment &env)
{
ACE_UNUSED_ARG (req);
-
- Cubit *the_cubit = (Cubit *) obj->get_subclass ();
+
+ _skel_Cubit *the_cubit = (_skel_Cubit *) obj;
the_cubit->Cubit_please_exit (env);
}
+
+void _skel_Cubit::dispatch (CORBA::ServerRequest &req,
+ void *context,
+ CORBA::Environment &env)
+{
+ TAO_Skeleton skel; // pointer to skeleton for operation
+ CORBA::String opname = req.op_name (); // retrieve operation name
+ // find the skeleton corresponding to this opname
+ if (this->find (opname, skel) == -1)
+ {
+ env.exception (new CORBA_BAD_OPERATION (CORBA::COMPLETED_NO));
+ ACE_ERROR ((LM_ERROR, "Bad operation <%s>\n", opname));
+ }
+ else
+ skel (req, this, context, env);
+}
diff --git a/TAO/tests/Cubit/TAO/DII_Cubit/cubitS.h b/TAO/tests/Cubit/TAO/DII_Cubit/cubitS.h
index bf7dbf12363..9cde582496b 100644
--- a/TAO/tests/Cubit/TAO/DII_Cubit/cubitS.h
+++ b/TAO/tests/Cubit/TAO/DII_Cubit/cubitS.h
@@ -7,7 +7,7 @@
/**************************************************************************
This file has been hand-crafted to work with the ORB API of the SUN's IIOP
-implementation
+implementation
***************************************************************************/
#ifndef _SKEL_CUBIT_HH
@@ -26,54 +26,63 @@ public:
virtual
CORBA::Octet Cubit_cube_octet (CORBA::Octet o,
CORBA::Environment &env) = 0;
- static
+ static
void _cube_octet_skel(CORBA::ServerRequest &req,
- CORBA::Object_ptr obj,
- CORBA::Environment &env);
+ void *obj,
+ void *context,
+ CORBA::Environment &env);
virtual
CORBA::Short Cubit_cube_short (CORBA::Short s,
CORBA::Environment &env) = 0;
-
+
static
void _cube_short_skel (CORBA::ServerRequest &req,
- CORBA::Object_ptr obj,
- CORBA::Environment &env);
+ void *obj,
+ void *context,
+ CORBA::Environment &env);
virtual
CORBA::Long Cubit_cube_long (CORBA::Long l,
CORBA::Environment &env) = 0;
-
- static
+
+ static
void _cube_long_skel (CORBA::ServerRequest &req,
- CORBA::Object_ptr obj,
- CORBA::Environment &env);
+ void *obj,
+ void *context,
+ CORBA::Environment &env);
virtual
Cubit_Many* Cubit_cube_struct (Cubit_Many &values,
CORBA::Environment &env) = 0;
-
- static
+
+ static
void _cube_struct_skel (CORBA::ServerRequest &req,
- CORBA::Object_ptr obj,
- CORBA::Environment &env);
+ void *obj,
+ void *context,
+ CORBA::Environment &env);
- virtual
+ virtual
Cubit_oneof* Cubit_cube_union (Cubit_oneof &values,
CORBA::Environment &env) = 0;
-
- static
+
+ static
void _cube_union_skel (CORBA::ServerRequest &req,
- CORBA::Object_ptr obj,
- CORBA::Environment &env);
+ void *obj,
+ void *context,
+ CORBA::Environment &env);
- virtual
+ virtual
void Cubit_please_exit (CORBA::Environment &env) = 0;
- static
+ static
void _please_exit_skel (CORBA::ServerRequest &req,
- CORBA::Object_ptr obj,
- CORBA::Environment &env);
+ void *obj,
+ void *context,
+ CORBA::Environment &env);
+ virtual void dispatch (CORBA::ServerRequest &req,
+ void *context,
+ CORBA::Environment &env);
protected:
_skel_Cubit (const char* obj_name = 0);
virtual ~_skel_Cubit (void) { }
diff --git a/TAO/tests/Cubit/TAO/DII_Cubit/method_db.i b/TAO/tests/Cubit/TAO/DII_Cubit/method_db.i
index 8a1b474fc9e..76595399353 100644
--- a/TAO/tests/Cubit/TAO/DII_Cubit/method_db.i
+++ b/TAO/tests/Cubit/TAO/DII_Cubit/method_db.i
@@ -7,11 +7,10 @@
static void
is_a_skel (CORBA::ServerRequest &req,
- CORBA::Object_ptr obj,
+ void */* obj */,
+ void */* context */,
CORBA::Environment &env)
{
- ACE_UNUSED_ARG (obj);
-
CORBA::NVList_ptr nvlist;
CORBA::NamedValue_ptr nv;
CORBA::Any temp_value (CORBA::_tc_string);
@@ -21,7 +20,7 @@ is_a_skel (CORBA::ServerRequest &req,
req.params (nvlist, env);
- if (env.exception () != 0)
+ if (env.exception () != 0)
{
dexc (env, "is_a_skel, get params");
return;
@@ -42,7 +41,7 @@ is_a_skel (CORBA::ServerRequest &req,
dexc (env, "_is_a, result");
}
-static const TAO_operation_db_entry cubit_operations[] =
+static const TAO_operation_db_entry cubit_operations[] =
{
{ "_is_a", &is_a_skel },
{ "cube_octet", &_skel_Cubit::_cube_octet_skel },
@@ -53,5 +52,3 @@ static const TAO_operation_db_entry cubit_operations[] =
{ "please_exit", &_skel_Cubit::_please_exit_skel },
{ 0, 0 }
};
-
-