diff options
author | gokhale <asgokhale@users.noreply.github.com> | 1997-07-02 04:05:18 +0000 |
---|---|---|
committer | gokhale <asgokhale@users.noreply.github.com> | 1997-07-02 04:05:18 +0000 |
commit | d34465016b30d4195628856266ec2299b364a2eb (patch) | |
tree | ce2580d63b98f86bad81f71d758c039b66ffa9d9 /TAO | |
parent | 6e2cabcd34de83c245bfce626d97c815eaa15697 (diff) | |
download | ATCD-d34465016b30d4195628856266ec2299b364a2eb.tar.gz |
Orbix Cubit factory client
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/IIOP/tests/Cubit/Orbix/factory_client/Makefile | 77 | ||||
-rw-r--r-- | TAO/IIOP/tests/Cubit/Orbix/factory_client/client.cpp | 235 | ||||
-rw-r--r-- | TAO/IIOP/tests/Cubit/Orbix/factory_client/cubit.h | 1111 | ||||
-rw-r--r-- | TAO/IIOP/tests/Cubit/Orbix/factory_client/cubit.hh | 1111 | ||||
-rw-r--r-- | TAO/IIOP/tests/Cubit/Orbix/factory_client/cubit.idl | 46 | ||||
-rw-r--r-- | TAO/IIOP/tests/Cubit/Orbix/factory_client/cubitC.cpp | 710 | ||||
-rw-r--r-- | TAO/IIOP/tests/Cubit/Orbix/factory_client/cubitS.cpp | 282 | ||||
-rw-r--r-- | TAO/tests/Cubit/Orbix/factory_client/Makefile | 77 | ||||
-rw-r--r-- | TAO/tests/Cubit/Orbix/factory_client/client.cpp | 235 | ||||
-rw-r--r-- | TAO/tests/Cubit/Orbix/factory_client/cubit.h | 1111 | ||||
-rw-r--r-- | TAO/tests/Cubit/Orbix/factory_client/cubit.hh | 1111 | ||||
-rw-r--r-- | TAO/tests/Cubit/Orbix/factory_client/cubit.idl | 46 | ||||
-rw-r--r-- | TAO/tests/Cubit/Orbix/factory_client/cubitC.cpp | 710 | ||||
-rw-r--r-- | TAO/tests/Cubit/Orbix/factory_client/cubitS.cpp | 282 |
14 files changed, 7144 insertions, 0 deletions
diff --git a/TAO/IIOP/tests/Cubit/Orbix/factory_client/Makefile b/TAO/IIOP/tests/Cubit/Orbix/factory_client/Makefile new file mode 100644 index 00000000000..cbc81f28124 --- /dev/null +++ b/TAO/IIOP/tests/Cubit/Orbix/factory_client/Makefile @@ -0,0 +1,77 @@ +#---------------------------------------------------------------------------- +# @(#)Makefile 1.1 10/18/96 +# +# Makefile for the ACE_MT_CORBA_Handler tests +#---------------------------------------------------------------------------- + +#---------------------------------------------------------------------------- +# Local macros +#---------------------------------------------------------------------------- + +SRC = cubitC.cpp client.cpp + +CLT_OBJS = cubitC.o client.o + +LDLIBS = + +VLDLIBS = $(LDLIBS:%=%$(VAR)) + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(WRAPPER_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(WRAPPER_ROOT)/include/makeinclude/macros.GNU +include $(WRAPPER_ROOT)/include/makeinclude/rules.common.GNU +include $(WRAPPER_ROOT)/include/makeinclude/rules.nonested.GNU +include $(WRAPPER_ROOT)/include/makeinclude/rules.lib.GNU +include $(WRAPPER_ROOT)/include/makeinclude/rules.bin.GNU +include $(WRAPPER_ROOT)/include/makeinclude/rules.local.GNU + +#---------------------------------------------------------------------------- +# Orbix related macros and target settings. +#---------------------------------------------------------------------------- + + +ORBIX_BINDIR = $(ORBIX_ROOT)/bin +ORBIX_LIBDIR = $(ORBIX_ROOT)/corba2/lib +ORBIX_INCDIR = $(ORBIX_ROOT)/corba2/include + +CPPFLAGS += -DEXCEPTIONS -I$(ORBIX_INCDIR) -DWANT_ORBIX_FDS +LDFLAGS += -L$(ORBIX_LIBDIR) -R $(ORBIX_LIBDIR) -L$(ACE)/ace + +IDLFLAGS = -s S.cpp -c C.cpp -B + +#---------------------------------------------------------------------------- +# Local targets +#---------------------------------------------------------------------------- + +all: client + +client: $(addprefix $(VDIR),$(CLT_OBJS)) + $(LINK.cc) -o client $(addprefix $(VDIR),$(CLT_OBJS)) $(LDFLAGS) $(ITIIOP) $(ITCLT) $(VLDLIBS) + + +#---------------------------------------------------------------------------- +# Dependencies +#---------------------------------------------------------------------------- +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +.obj/cubitC.o .shobj/cubitC.so: cubitC.cpp cubit.h +.obj/client.o .shobj/client.so: client.cpp $(WRAPPER_ROOT)/ace/OS.h \ + $(WRAPPER_ROOT)/ace/config.h \ + $(WRAPPER_ROOT)/ace/config-sunos5.5-sunc++-4.x.h \ + $(WRAPPER_ROOT)/ace/stdcpp.h \ + $(WRAPPER_ROOT)/ace/OS.i \ + $(WRAPPER_ROOT)/ace/Trace.h \ + $(WRAPPER_ROOT)/ace/Log_Msg.h \ + $(WRAPPER_ROOT)/ace/Log_Record.h \ + $(WRAPPER_ROOT)/ace/ACE.h \ + $(WRAPPER_ROOT)/ace/ACE.i \ + $(WRAPPER_ROOT)/ace/Log_Priority.h \ + $(WRAPPER_ROOT)/ace/Log_Record.i \ + $(WRAPPER_ROOT)/ace/Get_Opt.h \ + $(WRAPPER_ROOT)/ace/Get_Opt.i cubit.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/IIOP/tests/Cubit/Orbix/factory_client/client.cpp b/TAO/IIOP/tests/Cubit/Orbix/factory_client/client.cpp new file mode 100644 index 00000000000..c61cfbc85a5 --- /dev/null +++ b/TAO/IIOP/tests/Cubit/Orbix/factory_client/client.cpp @@ -0,0 +1,235 @@ +//************************************************************************** +// +// NAME : client.C +// DESCRIPTION: +// +// Client for the Cubit example +// +//**************************************************************************** + +#include "ace/OS.h" +#include "ace/Get_Opt.h" +#include "cubit.h" + +int LOOP_COUNT; +char SERVER_HOST [1024]; + +inline int func (unsigned i) { return i - 117; } +void run_tests (Cubit_var, int); + +// = TITLE +// Parses the command line arguments and returns an error status +// +// = DESCRIPTION +// This method parses the command line arguments +int parse_args(int argc, char *argv[]) +{ + ACE_OS::strcpy (SERVER_HOST, "localhost"); + ACE_Get_Opt opts (argc, argv, "dh:n:O:x"); + int c; + + while ((c = opts ()) != -1) + switch (c) { + case 'h': + ACE_OS::strcpy (SERVER_HOST, opts.optarg); + continue; + case 'd': // debug flag + continue; + + case 'n': // loop count + LOOP_COUNT = (unsigned) ACE_OS::atoi (opts.optarg); + continue; + + case 'O': // stringified objref + continue; + + case 'x': + continue; + + case '?': + default: + ACE_OS::fprintf (stderr, "usage: %s" + " [-d]" + " [-n loopcount]" + " [-h SERVER_HOST]" + " [-x]" + "\n", argv [0] + ); + return 1; + } + + return 0; // Indicates successful parsing of command line +} + + +// +// Mainline +// +int +main (int argc, char *argv[]) +{ + if (parse_args (argc, argv) != 0) + return -1; + + Cubit_var cb; + Cubit_Factory_var cf; + + // cout << "attempting to contact server at host " << SERVER_HOST << '\n' ; + + // + // Initialise client's binding to an + // arbitrary cubit server (at some host) + // + TRY { + cf = Cubit_Factory::_bind ("", SERVER_HOST, IT_X); + } + CATCHANY { + cerr << "Binding failed: " << IT_X; + } + ENDTRY; + cb = cf->create_cubit ("My_Cubit"); + + run_tests (cb, LOOP_COUNT); + return 0; +} + + +void +run_tests (Cubit_var cb, int loop_count) +{ + // + // Make the calls in a loop. + // + unsigned i; + unsigned call_count, error_count; + + call_count = 0; + error_count = 0; + + ACE_Time_Value before, after; + + before = ACE_OS::gettimeofday(); + + // + // Cube an octet. + // + + for (i = 0; i < loop_count; i++) + { + + call_count++; + + CORBA::Octet arg_octet = func (i), ret_octet; + + TRY { + ret_octet = cb->cube_octet (arg_octet); + } + CATCHANY { + cerr << "Call failed: " << IT_X; + error_count++; + } + ENDTRY; + arg_octet = arg_octet * arg_octet * arg_octet; + if (arg_octet != ret_octet) { + ACE_OS::printf ("** cube_octet(%d) (--> %d)\n", arg_octet , ret_octet); + error_count++; + } + + + // + // Cube a short. + // + call_count++; + + CORBA::Short arg_short = func (i), ret_short; + + TRY { + ret_short = cb->cube_short (arg_short); + } + CATCHANY { + cerr << "Call failed: " << IT_X; + error_count++; + } + ENDTRY; + arg_short = arg_short * arg_short * arg_short; + if (arg_short != ret_short) { + ACE_OS::printf ("** cube_short(%d) (--> %d)\n", arg_short , ret_short); + error_count++; + } + + // + // Cube a long. + // + + call_count++; + + CORBA::Long arg_long = func (i), ret_long; + + TRY { + ret_long = cb->cube_long (arg_long); + } + CATCHANY { + cerr << "Call failed: " << IT_X; + } + ENDTRY; + arg_long = arg_long * arg_long * arg_long; + if (arg_long != ret_long) { + ACE_OS::printf ("** cube_long(%d) (--> %d)\n", arg_long , ret_long); + error_count++; + } + + + // + // Cube a "struct" ... + // + Cubit::Many arg_struct, ret_struct; + + call_count++; + + arg_struct.l = func (i); + arg_struct.s = func (i); + arg_struct.o = func (i); + + TRY { + ret_struct = cb->cube_struct (arg_struct); + } + CATCHANY { + cerr << "Call failed: " << IT_X; + error_count++; + } + ENDTRY; + arg_struct.l = arg_struct.l * arg_struct.l * arg_struct.l ; + arg_struct.s = arg_struct.s * arg_struct.s * arg_struct.s ; + arg_struct.o = arg_struct.o * arg_struct.o * arg_struct.o ; + + if (arg_struct.l != ret_struct.l + || arg_struct.s != ret_struct.s + || arg_struct.o != ret_struct.o ) + { + cerr << "** cube_struct ERROR\n"; + error_count++; + } + } + + + after = ACE_OS::gettimeofday(); + + if (call_count > 0) + { + if (error_count == 0) + { + ACE_Time_Value diff = after - before; + unsigned long us = diff.sec() * 1000 * 1000 + diff.usec(); + + us /= call_count; + + if (us > 0) + ACE_OS::printf ("cube average call ACE_OS::time\t= %ld.%.03ldms, \t" + "%ld calls/second\n", + us / 1000, us % 1000, + 1000000L / us); + } + + ACE_OS::printf ("%d calls, %d errors\n", call_count, error_count); + } +} diff --git a/TAO/IIOP/tests/Cubit/Orbix/factory_client/cubit.h b/TAO/IIOP/tests/Cubit/Orbix/factory_client/cubit.h new file mode 100644 index 00000000000..72e2fb81395 --- /dev/null +++ b/TAO/IIOP/tests/Cubit/Orbix/factory_client/cubit.h @@ -0,0 +1,1111 @@ + +#ifndef cubit_hh +#define cubit_hh + +#include <CORBA.h> + +#include <string.h> + + +#ifndef _Cubit_defined +#define _Cubit_defined +class Cubit_dispatch : public virtual CORBA::PPTR { +public: + + Cubit_dispatch (void *IT_p, CORBA::Object* IT_o, const char *IT_m, + CORBA::LoaderClass *IT_l, char *IT_i, void* IT_im) + : PPTR (IT_p,IT_o,IT_m,IT_l,IT_i,IT_im) {} + + + Cubit_dispatch (char *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Cubit_dispatch () {} + + Cubit_dispatch (ObjectReference *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Cubit_dispatch (void *IT_p, CORBA::Object *IT_o, const char *IT_m, + char *IT_i, CORBA::Object* IT_ob, void* IT_im) + : PPTR (IT_p,IT_o,IT_m,IT_i,IT_ob,IT_im) {} + + + virtual unsigned char dispatch (CORBA::Request &IT_r, + unsigned char IT_isTarget, void* IT_pp=NULL); + + +}; + +class Cubit; + +#ifndef CubitPtr +#define CubitPtr + +typedef Cubit* Cubit_ptr; + +typedef Cubit* CubitRef; + +#endif + + +#ifndef CubitForwH +#define CubitForwH +CORBA::ObjectRef Cubit_getBase (void *); +void Cubit_release (Cubit *, CORBA::Environment &IT_env); +void Cubit_release (Cubit_ptr); +Cubit* Cubit_duplicate (Cubit_ptr, CORBA::Environment &IT_env); +Cubit* Cubit_duplicate (Cubit_ptr ); +Cubit_ptr Cubit_nil (CORBA::Environment &IT_env); +Cubit_ptr Cubit_nil (); +#endif +#define Cubit_IMPL "Cubit" + + +class Cubit; + +typedef Cubit CubitProxy; +#define Cubit_IR "Cubit$v1.1" +#define Cubit_IMPL "Cubit" + +#ifndef CubitPtr +#define CubitPtr + +typedef Cubit* Cubit_ptr; + +typedef Cubit* CubitRef; + +#endif + +class Cubit: public virtual CORBA::Object { +public: + Cubit (char *IT_OR); + Cubit (ObjectReference *IT_OR); + Cubit () : CORBA::Object (1) {} +protected: + Cubit_ptr __duplicate( + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) { + CORBA::Object::__duplicate (IT_env); + return this; + } +public: + static Cubit_ptr _duplicate( + Cubit_ptr, + CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()); +public: + static Cubit* _bind (const char* IT_markerServer, const char* host, + const CORBA::Context &IT_c, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit* _bind (CORBA::Environment &IT_env); + static Cubit* _bind (const char* IT_markerServer=NULL, const char* host=NULL, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit* _narrow (CORBA::Object* , CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit_ptr _nil (CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()) { + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + return (Cubit_ptr) CORBA::OBJECT_NIL;} + +#ifndef Cubit_Many_defined +#define Cubit_Many_defined + +struct Many { + CORBA::Octet o; + CORBA::Long l; + CORBA::Short s; + + void encodeOp (CORBA::Request &IT_r) const; + void decodeOp (CORBA::Request &IT_r); + void decodeInOutOp (CORBA::Request &IT_r); + Many(const Many &); + Many(); + ~Many(); + Many& operator= (const Many&); +}; + +#ifndef Cubit_ManyVarH +#define Cubit_ManyVarH + +#ifndef Cubit_ManyvPtr +#define Cubit_ManyvPtr +typedef Many* Many_vPtr; +typedef const Many* Many_cvPtr; +#endif + +class Many_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const Many_var &IT_s) { + if (!IT_s._ptr) { + _ptr = IT_s._ptr; + } else + { + _ptr = new Many; + *(_ptr) = *(IT_s._ptr); + } + return 1; + } + + public: + + Many_var (const Many_var &IT_s) { + (void) copyHelper (IT_s); + } + + Many_var () { + _ptr = new Many; +; + } + + Many_var (Many *IT_p) { + _ptr = IT_p; + } + + Many_var &operator= (Many *IT_p) { + if (_ptr != IT_p) { + delete _ptr; + } + _ptr = IT_p; + return (*this); + } + + Many_var &operator= (const Many_var &IT_s) { + if (_ptr != IT_s._ptr) { + delete _ptr; + } + _ptr = new Many; + *(_ptr) = *(IT_s._ptr); + return (*this); + } + + ~Many_var () { + delete _ptr; + } + + Many* operator-> () { + return _ptr; + } + + operator Many_cvPtr () const { return _ptr;} + operator Many_vPtr& () { return _ptr;} + operator Many& () const { return * _ptr;} + + protected: + Many *_ptr; + private: + Many_var &operator= (const CORBA::_var &IT_s); + Many_var (const CORBA::_var &IT_s); +}; + +#endif + + +#endif + +enum discrim {e_0th,e_1st,e_2nd,e_3rd,e_4th,e_5th, IT__ENUM_Cubit_discrim=CORBA_ULONG_MAX}; + +#ifndef Cubit_oneof_defined +#define Cubit_oneof_defined + +struct oneof { + private: + + discrim __d; + union { + CORBA::Octet _o_; + CORBA::Short _s_; + CORBA::Long _l_; + Many * _cm_; + }; + + public: + + void encodeOp (CORBA::Request &IT_r) const; + void decodeOp (CORBA::Request &IT_r); + void decodeInOutOp (CORBA::Request &IT_r); + + private: + + unsigned char isSet; + + public: + + discrim _d () const { return __d; } + + CORBA::Octet o () const { + return _o_; + } + + void o (CORBA::Octet IT_member) { + if (isSet && (__d != Cubit::e_0th)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = Cubit::e_0th; + isSet = 1; + _o_ = IT_member; + } + + CORBA::Short s () const { + return _s_; + } + + void s (CORBA::Short IT_member) { + if (isSet && (__d != Cubit::e_1st)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = Cubit::e_1st; + isSet = 1; + _s_ = IT_member; + } + + CORBA::Long l () const { + return _l_; + } + + void l (CORBA::Long IT_member) { + if (isSet && (__d != Cubit::e_2nd)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = Cubit::e_2nd; + isSet = 1; + _l_ = IT_member; + } + + Many& cm () { + return (*_cm_); + } + + const Many& cm () const { + return (*_cm_); + } + + void cm (const Many& IT_member) { + if (isSet && (__d != Cubit::e_3rd)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = Cubit::e_3rd; + + if (!isSet) { + _cm_ = new Many; + isSet = 1; + } + *(_cm_) = IT_member; + } + + + oneof(); + oneof(const oneof &); + ~oneof(); + oneof& operator= (const oneof&); +}; + +#ifndef Cubit_oneofVarH +#define Cubit_oneofVarH + +#ifndef Cubit_oneofvPtr +#define Cubit_oneofvPtr +typedef oneof* oneof_vPtr; +typedef const oneof* oneof_cvPtr; +#endif + +class oneof_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const oneof_var &IT_s) { + if (!IT_s._ptr) { + _ptr = IT_s._ptr; + } else + { + _ptr = new oneof; + *(_ptr) = *(IT_s._ptr); + } + return 1; + } + + public: + + oneof_var (const oneof_var &IT_s) { + (void) copyHelper (IT_s); + } + + oneof_var () { + _ptr = NULL; + } + + oneof_var (oneof *IT_p) { + _ptr = IT_p; + } + + oneof_var &operator= (oneof *IT_p) { + if (_ptr != IT_p) { + delete _ptr; + } + _ptr = IT_p; + return (*this); + } + + oneof_var &operator= (const oneof_var &IT_s) { + if (_ptr != IT_s._ptr) { + delete _ptr; + } + _ptr = new oneof; + *(_ptr) = *(IT_s._ptr); + return (*this); + } + + ~oneof_var () { + delete _ptr; + } + + oneof* operator-> () { + return _ptr; + } + + operator oneof_cvPtr () const { return _ptr;} + operator oneof_vPtr& () { return _ptr;} + operator oneof& () const { return * _ptr;} + + protected: + oneof *_ptr; + private: + oneof_var &operator= (const CORBA::_var &IT_s); + oneof_var (const CORBA::_var &IT_s); +}; + +#endif + + +#endif + virtual CORBA::Octet cube_octet (CORBA::Octet o, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual CORBA::Short cube_short (CORBA::Short s, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual CORBA::Long cube_long (CORBA::Long l, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual Many cube_struct (const Many& values, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual oneof cube_union (const oneof& values, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual void please_exit (CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); +}; + +#ifndef CubitVarH +#define CubitVarH + +#ifndef CubitvPtr +#define CubitvPtr +typedef Cubit* Cubit_vPtr; +typedef const Cubit* Cubit_cvPtr; +#endif + +class Cubit_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const Cubit_var &IT_s) { + { + _ptr = Cubit_duplicate (IT_s._ptr); + } + return 1; + } + + public: + + Cubit_var (const Cubit_var &IT_s) { + (void) copyHelper (IT_s); + } + + Cubit_var () { + _ptr = Cubit_nil (); + } + + Cubit_var (Cubit *IT_p) { + _ptr = IT_p; + } + + Cubit_var &operator= (Cubit *IT_p) { + Cubit_release (_ptr); + _ptr = IT_p; + return (*this); + } + + Cubit_var &operator= (const Cubit_var &IT_s) { + Cubit_release (_ptr); + _ptr = Cubit_duplicate (IT_s._ptr); + return (*this); + } + + ~Cubit_var () { + Cubit_release (_ptr); + } + + Cubit* operator-> () { + return _ptr; + } + + operator Cubit_cvPtr () const { return _ptr;} + operator Cubit_vPtr& () { return _ptr;} + + protected: + Cubit *_ptr; + private: + Cubit_var &operator= (const CORBA::_var &IT_s); + Cubit_var (const CORBA::_var &IT_s); + Cubit_var &operator= (const CORBA::_mgr &IT_s); + Cubit_var &operator= (const CORBA::_SeqElem &IT_s); + Cubit_var (const CORBA::_mgr &IT_s); + Cubit_var (const CORBA::_SeqElem &IT_s); +}; + +#endif + + +#ifndef CubitMgrH +#define CubitMgrH + +class Cubit_mgr : public CORBA::_mgr +{ + public: + + Cubit_mgr () { + _ptr = Cubit_nil (); + _release = 1; + } + + Cubit_mgr (const Cubit_mgr &IT_s) { + _ptr = Cubit_duplicate (IT_s._ptr); + _release = 1; + } + + Cubit_mgr &operator= (Cubit *IT_p) { + if (_ptr && _release) + Cubit_release (_ptr); + _ptr = IT_p; + _release = 1; + return (*this); + } + + Cubit_mgr &operator= (const Cubit_mgr &IT_s) { + if (_ptr && _release) + Cubit_release (_ptr); + _ptr = Cubit_duplicate(IT_s._ptr); + _release = 1; + return (*this); + } + + Cubit_mgr &operator= (Cubit_var &IT_s) { + if (_ptr && _release) + Cubit_release (_ptr); + _ptr = Cubit_duplicate(IT_s); + _release = 1; + return (*this); + } + + ~Cubit_mgr () { + if (_release) + Cubit_release (_ptr); + } + + unsigned char release () { + return _release; + } + + void release (unsigned char rel) { + _release = rel; + } + + operator int () const { + return (((CORBA::Object_ptr) _ptr) ? 1 : 0); + } + + operator void* () const { + return _ptr; + } + + operator CORBA::Object * () const { + return (CORBA::Object *) _ptr; + } + + operator Cubit* () const { + return (Cubit*) _ptr; + } + + Cubit_ptr operator-> () const { + return _ptr; + } + + Cubit *_ptr; + + protected: + + unsigned char _release; +}; + +typedef Cubit_mgr Cubit_mgr_IT_const; +#endif + +#ifndef CubitSeqElemH +#define CubitSeqElemH + +class Cubit_SeqElem : public CORBA::_SeqElem +{ + public: + + Cubit_SeqElem (Cubit_ptr* IT_p, unsigned char rel) { + _ptr = IT_p; + _release = rel; + } + + Cubit_SeqElem &operator= (Cubit_ptr IT_p) { + if (_ptr) { + if (*(_ptr) && _release) + Cubit_release (*(_ptr)); + *(_ptr) = IT_p; + } + return (*this); + } + + Cubit_SeqElem &operator= (const Cubit_SeqElem &IT_s) { + if (_ptr && IT_s._ptr) { + if (*(_ptr) && _release) + Cubit_release (*(_ptr)); + *(_ptr) = Cubit_duplicate(*(IT_s._ptr)); + } + return (*this); + } + + operator Cubit_ptr () const { + return _ptr ? (Cubit_ptr) (*_ptr) : Cubit_nil(); + } + + Cubit_ptr operator->() const { return *_ptr;} + + protected: + Cubit_ptr *_ptr; + unsigned char _release; +}; + +#endif + + +#define TIE_Cubit(X) Cubit##X + +#define DEF_TIE_Cubit(X) \ + class Cubit##X : public virtual Cubit { \ + X* m_obj; \ + public: \ + \ + \ + Cubit##X (X *objp, const char* m="", CORBA::LoaderClass *l=0)\ + : Cubit(), m_obj(objp) { \ + m_pptr = new Cubit_dispatch \ + (( Cubit*)this,(CORBA::Object*)this,m,l,Cubit_IR,m_obj); \ + } \ + Cubit##X (CORBA::Object *IT_p, const char* IT_m="", void *IT_q=0)\ + : Cubit() { \ + m_pptr = new Cubit_dispatch \ + (( Cubit*)this,(CORBA::Object*)this,IT_m,Cubit_IR,IT_p,IT_q); \ + m_obj = (X*)(m_pptr->getImplObj ()); \ + } \ + \ + virtual ~Cubit##X () { \ + if (_okToDeleteImpl ()) delete m_obj; } \ + virtual void* _deref () { \ + return m_obj; } \ + \ +virtual CORBA::Octet cube_octet (CORBA::Octet o, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_octet ( o,IT_env);\ +}\ + \ +virtual CORBA::Short cube_short (CORBA::Short s, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_short ( s,IT_env);\ +}\ + \ +virtual CORBA::Long cube_long (CORBA::Long l, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_long ( l,IT_env);\ +}\ + \ +virtual Cubit::Many cube_struct (const Cubit::Many& values, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_struct ( values,IT_env);\ +}\ + \ +virtual Cubit::oneof cube_union (const Cubit::oneof& values, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_union ( values,IT_env);\ +}\ + \ +virtual void please_exit (CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->please_exit (IT_env);\ +}\ + \ + }; \ + + +#define QUALS_Cubit \ +virtual CORBA::Octet cube_octet (CORBA::Octet o, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_octet ( o,IT_env);\ +}\ + \ +virtual CORBA::Short cube_short (CORBA::Short s, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_short ( s,IT_env);\ +}\ + \ +virtual CORBA::Long cube_long (CORBA::Long l, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_long ( l,IT_env);\ +}\ + \ +virtual Many cube_struct (const Many& values, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_struct ( values,IT_env);\ +}\ + \ +virtual oneof cube_union (const oneof& values, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_union ( values,IT_env);\ +}\ + \ +virtual void please_exit (CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->please_exit (IT_env);\ +}\ + + + + +class CubitProxyFactoryClass : public virtual CORBA::ObjectFactoryClass { +public: + CubitProxyFactoryClass (unsigned char IT_p=0) + : CORBA::ProxyFactory (Cubit_IR, IT_p) {} + + virtual void* New (char *IT_OR, CORBA::Environment&); + + virtual void* New (ObjectReference *IT_OR, CORBA::Environment&); + + virtual void* New2 (); + + virtual CORBA::Object* NewObject (char *IT_OR, CORBA::Environment&); + + virtual CORBA::Object* NewObject (ObjectReference *IT_OR, CORBA::Environment&); + + virtual CORBA::Object* New2Object (); + + virtual void* IT_castUp (void *IT_p, char* IT_s, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + + virtual CORBA::PPTR* pptr (void *IT_p); + + virtual void baseInterfaces (_IDL_SEQUENCE_string&); + + +}; + +extern CubitProxyFactoryClass CubitProxyFactory; + +class CubitBOAImpl : public virtual Cubit { +public: + CubitBOAImpl (const char *m="", CORBA::LoaderClass *l=NULL) { + if (CORBA::PPTR::isOK (m_pptr, Cubit_IR)) + m_pptr = new Cubit_dispatch ( (Cubit*)this, + (CORBA::Object*)this, m, l, Cubit_IR, this); +} + + virtual CORBA::Octet cube_octet (CORBA::Octet o, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual CORBA::Short cube_short (CORBA::Short s, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual CORBA::Long cube_long (CORBA::Long l, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual Many cube_struct (const Many& values, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual oneof cube_union (const oneof& values, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual void please_exit (CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; +}; + + +#endif + + +#ifndef _Cubit_Factory_defined +#define _Cubit_Factory_defined +class Cubit_Factory_dispatch : public virtual CORBA::PPTR { +public: + + Cubit_Factory_dispatch (void *IT_p, CORBA::Object* IT_o, const char *IT_m, + CORBA::LoaderClass *IT_l, char *IT_i, void* IT_im) + : PPTR (IT_p,IT_o,IT_m,IT_l,IT_i,IT_im) {} + + + Cubit_Factory_dispatch (char *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Cubit_Factory_dispatch () {} + + Cubit_Factory_dispatch (ObjectReference *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Cubit_Factory_dispatch (void *IT_p, CORBA::Object *IT_o, const char *IT_m, + char *IT_i, CORBA::Object* IT_ob, void* IT_im) + : PPTR (IT_p,IT_o,IT_m,IT_i,IT_ob,IT_im) {} + + + virtual unsigned char dispatch (CORBA::Request &IT_r, + unsigned char IT_isTarget, void* IT_pp=NULL); + + +}; + +class Cubit_Factory; + +#ifndef Cubit_FactoryPtr +#define Cubit_FactoryPtr + +typedef Cubit_Factory* Cubit_Factory_ptr; + +typedef Cubit_Factory* Cubit_FactoryRef; + +#endif + + +#ifndef Cubit_FactoryForwH +#define Cubit_FactoryForwH +CORBA::ObjectRef Cubit_Factory_getBase (void *); +void Cubit_Factory_release (Cubit_Factory *, CORBA::Environment &IT_env); +void Cubit_Factory_release (Cubit_Factory_ptr); +Cubit_Factory* Cubit_Factory_duplicate (Cubit_Factory_ptr, CORBA::Environment &IT_env); +Cubit_Factory* Cubit_Factory_duplicate (Cubit_Factory_ptr ); +Cubit_Factory_ptr Cubit_Factory_nil (CORBA::Environment &IT_env); +Cubit_Factory_ptr Cubit_Factory_nil (); +#endif +#define Cubit_Factory_IMPL "Cubit_Factory" + + +class Cubit_Factory; + +typedef Cubit_Factory Cubit_FactoryProxy; +#define Cubit_Factory_IR "Cubit_Factory" +#define Cubit_Factory_IMPL "Cubit_Factory" + +#ifndef Cubit_FactoryPtr +#define Cubit_FactoryPtr + +typedef Cubit_Factory* Cubit_Factory_ptr; + +typedef Cubit_Factory* Cubit_FactoryRef; + +#endif + +class Cubit_Factory: public virtual CORBA::Object { +public: + Cubit_Factory (char *IT_OR); + Cubit_Factory (ObjectReference *IT_OR); + Cubit_Factory () : CORBA::Object (1) {} +protected: + Cubit_Factory_ptr __duplicate( + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) { + CORBA::Object::__duplicate (IT_env); + return this; + } +public: + static Cubit_Factory_ptr _duplicate( + Cubit_Factory_ptr, + CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()); +public: + static Cubit_Factory* _bind (const char* IT_markerServer, const char* host, + const CORBA::Context &IT_c, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit_Factory* _bind (CORBA::Environment &IT_env); + static Cubit_Factory* _bind (const char* IT_markerServer=NULL, const char* host=NULL, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit_Factory* _narrow (CORBA::Object* , CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit_Factory_ptr _nil (CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()) { + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + return (Cubit_Factory_ptr) CORBA::OBJECT_NIL;} + virtual Cubit_ptr create_cubit (const char * name, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); +}; + +#ifndef Cubit_FactoryVarH +#define Cubit_FactoryVarH + +#ifndef Cubit_FactoryvPtr +#define Cubit_FactoryvPtr +typedef Cubit_Factory* Cubit_Factory_vPtr; +typedef const Cubit_Factory* Cubit_Factory_cvPtr; +#endif + +class Cubit_Factory_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const Cubit_Factory_var &IT_s) { + { + _ptr = Cubit_Factory_duplicate (IT_s._ptr); + } + return 1; + } + + public: + + Cubit_Factory_var (const Cubit_Factory_var &IT_s) { + (void) copyHelper (IT_s); + } + + Cubit_Factory_var () { + _ptr = Cubit_Factory_nil (); + } + + Cubit_Factory_var (Cubit_Factory *IT_p) { + _ptr = IT_p; + } + + Cubit_Factory_var &operator= (Cubit_Factory *IT_p) { + Cubit_Factory_release (_ptr); + _ptr = IT_p; + return (*this); + } + + Cubit_Factory_var &operator= (const Cubit_Factory_var &IT_s) { + Cubit_Factory_release (_ptr); + _ptr = Cubit_Factory_duplicate (IT_s._ptr); + return (*this); + } + + ~Cubit_Factory_var () { + Cubit_Factory_release (_ptr); + } + + Cubit_Factory* operator-> () { + return _ptr; + } + + operator Cubit_Factory_cvPtr () const { return _ptr;} + operator Cubit_Factory_vPtr& () { return _ptr;} + + protected: + Cubit_Factory *_ptr; + private: + Cubit_Factory_var &operator= (const CORBA::_var &IT_s); + Cubit_Factory_var (const CORBA::_var &IT_s); + Cubit_Factory_var &operator= (const CORBA::_mgr &IT_s); + Cubit_Factory_var &operator= (const CORBA::_SeqElem &IT_s); + Cubit_Factory_var (const CORBA::_mgr &IT_s); + Cubit_Factory_var (const CORBA::_SeqElem &IT_s); +}; + +#endif + + +#ifndef Cubit_FactoryMgrH +#define Cubit_FactoryMgrH + +class Cubit_Factory_mgr : public CORBA::_mgr +{ + public: + + Cubit_Factory_mgr () { + _ptr = Cubit_Factory_nil (); + _release = 1; + } + + Cubit_Factory_mgr (const Cubit_Factory_mgr &IT_s) { + _ptr = Cubit_Factory_duplicate (IT_s._ptr); + _release = 1; + } + + Cubit_Factory_mgr &operator= (Cubit_Factory *IT_p) { + if (_ptr && _release) + Cubit_Factory_release (_ptr); + _ptr = IT_p; + _release = 1; + return (*this); + } + + Cubit_Factory_mgr &operator= (const Cubit_Factory_mgr &IT_s) { + if (_ptr && _release) + Cubit_Factory_release (_ptr); + _ptr = Cubit_Factory_duplicate(IT_s._ptr); + _release = 1; + return (*this); + } + + Cubit_Factory_mgr &operator= (Cubit_Factory_var &IT_s) { + if (_ptr && _release) + Cubit_Factory_release (_ptr); + _ptr = Cubit_Factory_duplicate(IT_s); + _release = 1; + return (*this); + } + + ~Cubit_Factory_mgr () { + if (_release) + Cubit_Factory_release (_ptr); + } + + unsigned char release () { + return _release; + } + + void release (unsigned char rel) { + _release = rel; + } + + operator int () const { + return (((CORBA::Object_ptr) _ptr) ? 1 : 0); + } + + operator void* () const { + return _ptr; + } + + operator CORBA::Object * () const { + return (CORBA::Object *) _ptr; + } + + operator Cubit_Factory* () const { + return (Cubit_Factory*) _ptr; + } + + Cubit_Factory_ptr operator-> () const { + return _ptr; + } + + Cubit_Factory *_ptr; + + protected: + + unsigned char _release; +}; + +typedef Cubit_Factory_mgr Cubit_Factory_mgr_IT_const; +#endif + +#ifndef Cubit_FactorySeqElemH +#define Cubit_FactorySeqElemH + +class Cubit_Factory_SeqElem : public CORBA::_SeqElem +{ + public: + + Cubit_Factory_SeqElem (Cubit_Factory_ptr* IT_p, unsigned char rel) { + _ptr = IT_p; + _release = rel; + } + + Cubit_Factory_SeqElem &operator= (Cubit_Factory_ptr IT_p) { + if (_ptr) { + if (*(_ptr) && _release) + Cubit_Factory_release (*(_ptr)); + *(_ptr) = IT_p; + } + return (*this); + } + + Cubit_Factory_SeqElem &operator= (const Cubit_Factory_SeqElem &IT_s) { + if (_ptr && IT_s._ptr) { + if (*(_ptr) && _release) + Cubit_Factory_release (*(_ptr)); + *(_ptr) = Cubit_Factory_duplicate(*(IT_s._ptr)); + } + return (*this); + } + + operator Cubit_Factory_ptr () const { + return _ptr ? (Cubit_Factory_ptr) (*_ptr) : Cubit_Factory_nil(); + } + + Cubit_Factory_ptr operator->() const { return *_ptr;} + + protected: + Cubit_Factory_ptr *_ptr; + unsigned char _release; +}; + +#endif + + +#define TIE_Cubit_Factory(X) Cubit_Factory##X + +#define DEF_TIE_Cubit_Factory(X) \ + class Cubit_Factory##X : public virtual Cubit_Factory { \ + X* m_obj; \ + public: \ + \ + \ + Cubit_Factory##X (X *objp, const char* m="", CORBA::LoaderClass *l=0)\ + : Cubit_Factory(), m_obj(objp) { \ + m_pptr = new Cubit_Factory_dispatch \ + (( Cubit_Factory*)this,(CORBA::Object*)this,m,l,Cubit_Factory_IR,m_obj); \ + } \ + Cubit_Factory##X (CORBA::Object *IT_p, const char* IT_m="", void *IT_q=0)\ + : Cubit_Factory() { \ + m_pptr = new Cubit_Factory_dispatch \ + (( Cubit_Factory*)this,(CORBA::Object*)this,IT_m,Cubit_Factory_IR,IT_p,IT_q); \ + m_obj = (X*)(m_pptr->getImplObj ()); \ + } \ + \ + virtual ~Cubit_Factory##X () { \ + if (_okToDeleteImpl ()) delete m_obj; } \ + virtual void* _deref () { \ + return m_obj; } \ + \ +virtual Cubit_ptr create_cubit (const char * name, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->create_cubit ( name,IT_env);\ +}\ + \ + }; \ + + +#define QUALS_Cubit_Factory \ +virtual Cubit_ptr create_cubit (const char * name, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->create_cubit ( name,IT_env);\ +}\ + + + + +class Cubit_FactoryProxyFactoryClass : public virtual CORBA::ObjectFactoryClass { +public: + Cubit_FactoryProxyFactoryClass (unsigned char IT_p=0) + : CORBA::ProxyFactory (Cubit_Factory_IR, IT_p) {} + + virtual void* New (char *IT_OR, CORBA::Environment&); + + virtual void* New (ObjectReference *IT_OR, CORBA::Environment&); + + virtual void* New2 (); + + virtual CORBA::Object* NewObject (char *IT_OR, CORBA::Environment&); + + virtual CORBA::Object* NewObject (ObjectReference *IT_OR, CORBA::Environment&); + + virtual CORBA::Object* New2Object (); + + virtual void* IT_castUp (void *IT_p, char* IT_s, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + + virtual CORBA::PPTR* pptr (void *IT_p); + + virtual void baseInterfaces (_IDL_SEQUENCE_string&); + + +}; + +extern Cubit_FactoryProxyFactoryClass Cubit_FactoryProxyFactory; + +class Cubit_FactoryBOAImpl : public virtual Cubit_Factory { +public: + Cubit_FactoryBOAImpl (const char *m="", CORBA::LoaderClass *l=NULL) { + if (CORBA::PPTR::isOK (m_pptr, Cubit_Factory_IR)) + m_pptr = new Cubit_Factory_dispatch ( (Cubit_Factory*)this, + (CORBA::Object*)this, m, l, Cubit_Factory_IR, this); +} + + virtual Cubit_ptr create_cubit (const char * name, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; +}; + + +#endif + + +#endif diff --git a/TAO/IIOP/tests/Cubit/Orbix/factory_client/cubit.hh b/TAO/IIOP/tests/Cubit/Orbix/factory_client/cubit.hh new file mode 100644 index 00000000000..72e2fb81395 --- /dev/null +++ b/TAO/IIOP/tests/Cubit/Orbix/factory_client/cubit.hh @@ -0,0 +1,1111 @@ + +#ifndef cubit_hh +#define cubit_hh + +#include <CORBA.h> + +#include <string.h> + + +#ifndef _Cubit_defined +#define _Cubit_defined +class Cubit_dispatch : public virtual CORBA::PPTR { +public: + + Cubit_dispatch (void *IT_p, CORBA::Object* IT_o, const char *IT_m, + CORBA::LoaderClass *IT_l, char *IT_i, void* IT_im) + : PPTR (IT_p,IT_o,IT_m,IT_l,IT_i,IT_im) {} + + + Cubit_dispatch (char *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Cubit_dispatch () {} + + Cubit_dispatch (ObjectReference *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Cubit_dispatch (void *IT_p, CORBA::Object *IT_o, const char *IT_m, + char *IT_i, CORBA::Object* IT_ob, void* IT_im) + : PPTR (IT_p,IT_o,IT_m,IT_i,IT_ob,IT_im) {} + + + virtual unsigned char dispatch (CORBA::Request &IT_r, + unsigned char IT_isTarget, void* IT_pp=NULL); + + +}; + +class Cubit; + +#ifndef CubitPtr +#define CubitPtr + +typedef Cubit* Cubit_ptr; + +typedef Cubit* CubitRef; + +#endif + + +#ifndef CubitForwH +#define CubitForwH +CORBA::ObjectRef Cubit_getBase (void *); +void Cubit_release (Cubit *, CORBA::Environment &IT_env); +void Cubit_release (Cubit_ptr); +Cubit* Cubit_duplicate (Cubit_ptr, CORBA::Environment &IT_env); +Cubit* Cubit_duplicate (Cubit_ptr ); +Cubit_ptr Cubit_nil (CORBA::Environment &IT_env); +Cubit_ptr Cubit_nil (); +#endif +#define Cubit_IMPL "Cubit" + + +class Cubit; + +typedef Cubit CubitProxy; +#define Cubit_IR "Cubit$v1.1" +#define Cubit_IMPL "Cubit" + +#ifndef CubitPtr +#define CubitPtr + +typedef Cubit* Cubit_ptr; + +typedef Cubit* CubitRef; + +#endif + +class Cubit: public virtual CORBA::Object { +public: + Cubit (char *IT_OR); + Cubit (ObjectReference *IT_OR); + Cubit () : CORBA::Object (1) {} +protected: + Cubit_ptr __duplicate( + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) { + CORBA::Object::__duplicate (IT_env); + return this; + } +public: + static Cubit_ptr _duplicate( + Cubit_ptr, + CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()); +public: + static Cubit* _bind (const char* IT_markerServer, const char* host, + const CORBA::Context &IT_c, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit* _bind (CORBA::Environment &IT_env); + static Cubit* _bind (const char* IT_markerServer=NULL, const char* host=NULL, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit* _narrow (CORBA::Object* , CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit_ptr _nil (CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()) { + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + return (Cubit_ptr) CORBA::OBJECT_NIL;} + +#ifndef Cubit_Many_defined +#define Cubit_Many_defined + +struct Many { + CORBA::Octet o; + CORBA::Long l; + CORBA::Short s; + + void encodeOp (CORBA::Request &IT_r) const; + void decodeOp (CORBA::Request &IT_r); + void decodeInOutOp (CORBA::Request &IT_r); + Many(const Many &); + Many(); + ~Many(); + Many& operator= (const Many&); +}; + +#ifndef Cubit_ManyVarH +#define Cubit_ManyVarH + +#ifndef Cubit_ManyvPtr +#define Cubit_ManyvPtr +typedef Many* Many_vPtr; +typedef const Many* Many_cvPtr; +#endif + +class Many_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const Many_var &IT_s) { + if (!IT_s._ptr) { + _ptr = IT_s._ptr; + } else + { + _ptr = new Many; + *(_ptr) = *(IT_s._ptr); + } + return 1; + } + + public: + + Many_var (const Many_var &IT_s) { + (void) copyHelper (IT_s); + } + + Many_var () { + _ptr = new Many; +; + } + + Many_var (Many *IT_p) { + _ptr = IT_p; + } + + Many_var &operator= (Many *IT_p) { + if (_ptr != IT_p) { + delete _ptr; + } + _ptr = IT_p; + return (*this); + } + + Many_var &operator= (const Many_var &IT_s) { + if (_ptr != IT_s._ptr) { + delete _ptr; + } + _ptr = new Many; + *(_ptr) = *(IT_s._ptr); + return (*this); + } + + ~Many_var () { + delete _ptr; + } + + Many* operator-> () { + return _ptr; + } + + operator Many_cvPtr () const { return _ptr;} + operator Many_vPtr& () { return _ptr;} + operator Many& () const { return * _ptr;} + + protected: + Many *_ptr; + private: + Many_var &operator= (const CORBA::_var &IT_s); + Many_var (const CORBA::_var &IT_s); +}; + +#endif + + +#endif + +enum discrim {e_0th,e_1st,e_2nd,e_3rd,e_4th,e_5th, IT__ENUM_Cubit_discrim=CORBA_ULONG_MAX}; + +#ifndef Cubit_oneof_defined +#define Cubit_oneof_defined + +struct oneof { + private: + + discrim __d; + union { + CORBA::Octet _o_; + CORBA::Short _s_; + CORBA::Long _l_; + Many * _cm_; + }; + + public: + + void encodeOp (CORBA::Request &IT_r) const; + void decodeOp (CORBA::Request &IT_r); + void decodeInOutOp (CORBA::Request &IT_r); + + private: + + unsigned char isSet; + + public: + + discrim _d () const { return __d; } + + CORBA::Octet o () const { + return _o_; + } + + void o (CORBA::Octet IT_member) { + if (isSet && (__d != Cubit::e_0th)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = Cubit::e_0th; + isSet = 1; + _o_ = IT_member; + } + + CORBA::Short s () const { + return _s_; + } + + void s (CORBA::Short IT_member) { + if (isSet && (__d != Cubit::e_1st)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = Cubit::e_1st; + isSet = 1; + _s_ = IT_member; + } + + CORBA::Long l () const { + return _l_; + } + + void l (CORBA::Long IT_member) { + if (isSet && (__d != Cubit::e_2nd)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = Cubit::e_2nd; + isSet = 1; + _l_ = IT_member; + } + + Many& cm () { + return (*_cm_); + } + + const Many& cm () const { + return (*_cm_); + } + + void cm (const Many& IT_member) { + if (isSet && (__d != Cubit::e_3rd)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = Cubit::e_3rd; + + if (!isSet) { + _cm_ = new Many; + isSet = 1; + } + *(_cm_) = IT_member; + } + + + oneof(); + oneof(const oneof &); + ~oneof(); + oneof& operator= (const oneof&); +}; + +#ifndef Cubit_oneofVarH +#define Cubit_oneofVarH + +#ifndef Cubit_oneofvPtr +#define Cubit_oneofvPtr +typedef oneof* oneof_vPtr; +typedef const oneof* oneof_cvPtr; +#endif + +class oneof_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const oneof_var &IT_s) { + if (!IT_s._ptr) { + _ptr = IT_s._ptr; + } else + { + _ptr = new oneof; + *(_ptr) = *(IT_s._ptr); + } + return 1; + } + + public: + + oneof_var (const oneof_var &IT_s) { + (void) copyHelper (IT_s); + } + + oneof_var () { + _ptr = NULL; + } + + oneof_var (oneof *IT_p) { + _ptr = IT_p; + } + + oneof_var &operator= (oneof *IT_p) { + if (_ptr != IT_p) { + delete _ptr; + } + _ptr = IT_p; + return (*this); + } + + oneof_var &operator= (const oneof_var &IT_s) { + if (_ptr != IT_s._ptr) { + delete _ptr; + } + _ptr = new oneof; + *(_ptr) = *(IT_s._ptr); + return (*this); + } + + ~oneof_var () { + delete _ptr; + } + + oneof* operator-> () { + return _ptr; + } + + operator oneof_cvPtr () const { return _ptr;} + operator oneof_vPtr& () { return _ptr;} + operator oneof& () const { return * _ptr;} + + protected: + oneof *_ptr; + private: + oneof_var &operator= (const CORBA::_var &IT_s); + oneof_var (const CORBA::_var &IT_s); +}; + +#endif + + +#endif + virtual CORBA::Octet cube_octet (CORBA::Octet o, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual CORBA::Short cube_short (CORBA::Short s, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual CORBA::Long cube_long (CORBA::Long l, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual Many cube_struct (const Many& values, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual oneof cube_union (const oneof& values, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual void please_exit (CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); +}; + +#ifndef CubitVarH +#define CubitVarH + +#ifndef CubitvPtr +#define CubitvPtr +typedef Cubit* Cubit_vPtr; +typedef const Cubit* Cubit_cvPtr; +#endif + +class Cubit_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const Cubit_var &IT_s) { + { + _ptr = Cubit_duplicate (IT_s._ptr); + } + return 1; + } + + public: + + Cubit_var (const Cubit_var &IT_s) { + (void) copyHelper (IT_s); + } + + Cubit_var () { + _ptr = Cubit_nil (); + } + + Cubit_var (Cubit *IT_p) { + _ptr = IT_p; + } + + Cubit_var &operator= (Cubit *IT_p) { + Cubit_release (_ptr); + _ptr = IT_p; + return (*this); + } + + Cubit_var &operator= (const Cubit_var &IT_s) { + Cubit_release (_ptr); + _ptr = Cubit_duplicate (IT_s._ptr); + return (*this); + } + + ~Cubit_var () { + Cubit_release (_ptr); + } + + Cubit* operator-> () { + return _ptr; + } + + operator Cubit_cvPtr () const { return _ptr;} + operator Cubit_vPtr& () { return _ptr;} + + protected: + Cubit *_ptr; + private: + Cubit_var &operator= (const CORBA::_var &IT_s); + Cubit_var (const CORBA::_var &IT_s); + Cubit_var &operator= (const CORBA::_mgr &IT_s); + Cubit_var &operator= (const CORBA::_SeqElem &IT_s); + Cubit_var (const CORBA::_mgr &IT_s); + Cubit_var (const CORBA::_SeqElem &IT_s); +}; + +#endif + + +#ifndef CubitMgrH +#define CubitMgrH + +class Cubit_mgr : public CORBA::_mgr +{ + public: + + Cubit_mgr () { + _ptr = Cubit_nil (); + _release = 1; + } + + Cubit_mgr (const Cubit_mgr &IT_s) { + _ptr = Cubit_duplicate (IT_s._ptr); + _release = 1; + } + + Cubit_mgr &operator= (Cubit *IT_p) { + if (_ptr && _release) + Cubit_release (_ptr); + _ptr = IT_p; + _release = 1; + return (*this); + } + + Cubit_mgr &operator= (const Cubit_mgr &IT_s) { + if (_ptr && _release) + Cubit_release (_ptr); + _ptr = Cubit_duplicate(IT_s._ptr); + _release = 1; + return (*this); + } + + Cubit_mgr &operator= (Cubit_var &IT_s) { + if (_ptr && _release) + Cubit_release (_ptr); + _ptr = Cubit_duplicate(IT_s); + _release = 1; + return (*this); + } + + ~Cubit_mgr () { + if (_release) + Cubit_release (_ptr); + } + + unsigned char release () { + return _release; + } + + void release (unsigned char rel) { + _release = rel; + } + + operator int () const { + return (((CORBA::Object_ptr) _ptr) ? 1 : 0); + } + + operator void* () const { + return _ptr; + } + + operator CORBA::Object * () const { + return (CORBA::Object *) _ptr; + } + + operator Cubit* () const { + return (Cubit*) _ptr; + } + + Cubit_ptr operator-> () const { + return _ptr; + } + + Cubit *_ptr; + + protected: + + unsigned char _release; +}; + +typedef Cubit_mgr Cubit_mgr_IT_const; +#endif + +#ifndef CubitSeqElemH +#define CubitSeqElemH + +class Cubit_SeqElem : public CORBA::_SeqElem +{ + public: + + Cubit_SeqElem (Cubit_ptr* IT_p, unsigned char rel) { + _ptr = IT_p; + _release = rel; + } + + Cubit_SeqElem &operator= (Cubit_ptr IT_p) { + if (_ptr) { + if (*(_ptr) && _release) + Cubit_release (*(_ptr)); + *(_ptr) = IT_p; + } + return (*this); + } + + Cubit_SeqElem &operator= (const Cubit_SeqElem &IT_s) { + if (_ptr && IT_s._ptr) { + if (*(_ptr) && _release) + Cubit_release (*(_ptr)); + *(_ptr) = Cubit_duplicate(*(IT_s._ptr)); + } + return (*this); + } + + operator Cubit_ptr () const { + return _ptr ? (Cubit_ptr) (*_ptr) : Cubit_nil(); + } + + Cubit_ptr operator->() const { return *_ptr;} + + protected: + Cubit_ptr *_ptr; + unsigned char _release; +}; + +#endif + + +#define TIE_Cubit(X) Cubit##X + +#define DEF_TIE_Cubit(X) \ + class Cubit##X : public virtual Cubit { \ + X* m_obj; \ + public: \ + \ + \ + Cubit##X (X *objp, const char* m="", CORBA::LoaderClass *l=0)\ + : Cubit(), m_obj(objp) { \ + m_pptr = new Cubit_dispatch \ + (( Cubit*)this,(CORBA::Object*)this,m,l,Cubit_IR,m_obj); \ + } \ + Cubit##X (CORBA::Object *IT_p, const char* IT_m="", void *IT_q=0)\ + : Cubit() { \ + m_pptr = new Cubit_dispatch \ + (( Cubit*)this,(CORBA::Object*)this,IT_m,Cubit_IR,IT_p,IT_q); \ + m_obj = (X*)(m_pptr->getImplObj ()); \ + } \ + \ + virtual ~Cubit##X () { \ + if (_okToDeleteImpl ()) delete m_obj; } \ + virtual void* _deref () { \ + return m_obj; } \ + \ +virtual CORBA::Octet cube_octet (CORBA::Octet o, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_octet ( o,IT_env);\ +}\ + \ +virtual CORBA::Short cube_short (CORBA::Short s, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_short ( s,IT_env);\ +}\ + \ +virtual CORBA::Long cube_long (CORBA::Long l, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_long ( l,IT_env);\ +}\ + \ +virtual Cubit::Many cube_struct (const Cubit::Many& values, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_struct ( values,IT_env);\ +}\ + \ +virtual Cubit::oneof cube_union (const Cubit::oneof& values, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_union ( values,IT_env);\ +}\ + \ +virtual void please_exit (CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->please_exit (IT_env);\ +}\ + \ + }; \ + + +#define QUALS_Cubit \ +virtual CORBA::Octet cube_octet (CORBA::Octet o, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_octet ( o,IT_env);\ +}\ + \ +virtual CORBA::Short cube_short (CORBA::Short s, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_short ( s,IT_env);\ +}\ + \ +virtual CORBA::Long cube_long (CORBA::Long l, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_long ( l,IT_env);\ +}\ + \ +virtual Many cube_struct (const Many& values, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_struct ( values,IT_env);\ +}\ + \ +virtual oneof cube_union (const oneof& values, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_union ( values,IT_env);\ +}\ + \ +virtual void please_exit (CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->please_exit (IT_env);\ +}\ + + + + +class CubitProxyFactoryClass : public virtual CORBA::ObjectFactoryClass { +public: + CubitProxyFactoryClass (unsigned char IT_p=0) + : CORBA::ProxyFactory (Cubit_IR, IT_p) {} + + virtual void* New (char *IT_OR, CORBA::Environment&); + + virtual void* New (ObjectReference *IT_OR, CORBA::Environment&); + + virtual void* New2 (); + + virtual CORBA::Object* NewObject (char *IT_OR, CORBA::Environment&); + + virtual CORBA::Object* NewObject (ObjectReference *IT_OR, CORBA::Environment&); + + virtual CORBA::Object* New2Object (); + + virtual void* IT_castUp (void *IT_p, char* IT_s, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + + virtual CORBA::PPTR* pptr (void *IT_p); + + virtual void baseInterfaces (_IDL_SEQUENCE_string&); + + +}; + +extern CubitProxyFactoryClass CubitProxyFactory; + +class CubitBOAImpl : public virtual Cubit { +public: + CubitBOAImpl (const char *m="", CORBA::LoaderClass *l=NULL) { + if (CORBA::PPTR::isOK (m_pptr, Cubit_IR)) + m_pptr = new Cubit_dispatch ( (Cubit*)this, + (CORBA::Object*)this, m, l, Cubit_IR, this); +} + + virtual CORBA::Octet cube_octet (CORBA::Octet o, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual CORBA::Short cube_short (CORBA::Short s, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual CORBA::Long cube_long (CORBA::Long l, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual Many cube_struct (const Many& values, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual oneof cube_union (const oneof& values, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual void please_exit (CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; +}; + + +#endif + + +#ifndef _Cubit_Factory_defined +#define _Cubit_Factory_defined +class Cubit_Factory_dispatch : public virtual CORBA::PPTR { +public: + + Cubit_Factory_dispatch (void *IT_p, CORBA::Object* IT_o, const char *IT_m, + CORBA::LoaderClass *IT_l, char *IT_i, void* IT_im) + : PPTR (IT_p,IT_o,IT_m,IT_l,IT_i,IT_im) {} + + + Cubit_Factory_dispatch (char *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Cubit_Factory_dispatch () {} + + Cubit_Factory_dispatch (ObjectReference *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Cubit_Factory_dispatch (void *IT_p, CORBA::Object *IT_o, const char *IT_m, + char *IT_i, CORBA::Object* IT_ob, void* IT_im) + : PPTR (IT_p,IT_o,IT_m,IT_i,IT_ob,IT_im) {} + + + virtual unsigned char dispatch (CORBA::Request &IT_r, + unsigned char IT_isTarget, void* IT_pp=NULL); + + +}; + +class Cubit_Factory; + +#ifndef Cubit_FactoryPtr +#define Cubit_FactoryPtr + +typedef Cubit_Factory* Cubit_Factory_ptr; + +typedef Cubit_Factory* Cubit_FactoryRef; + +#endif + + +#ifndef Cubit_FactoryForwH +#define Cubit_FactoryForwH +CORBA::ObjectRef Cubit_Factory_getBase (void *); +void Cubit_Factory_release (Cubit_Factory *, CORBA::Environment &IT_env); +void Cubit_Factory_release (Cubit_Factory_ptr); +Cubit_Factory* Cubit_Factory_duplicate (Cubit_Factory_ptr, CORBA::Environment &IT_env); +Cubit_Factory* Cubit_Factory_duplicate (Cubit_Factory_ptr ); +Cubit_Factory_ptr Cubit_Factory_nil (CORBA::Environment &IT_env); +Cubit_Factory_ptr Cubit_Factory_nil (); +#endif +#define Cubit_Factory_IMPL "Cubit_Factory" + + +class Cubit_Factory; + +typedef Cubit_Factory Cubit_FactoryProxy; +#define Cubit_Factory_IR "Cubit_Factory" +#define Cubit_Factory_IMPL "Cubit_Factory" + +#ifndef Cubit_FactoryPtr +#define Cubit_FactoryPtr + +typedef Cubit_Factory* Cubit_Factory_ptr; + +typedef Cubit_Factory* Cubit_FactoryRef; + +#endif + +class Cubit_Factory: public virtual CORBA::Object { +public: + Cubit_Factory (char *IT_OR); + Cubit_Factory (ObjectReference *IT_OR); + Cubit_Factory () : CORBA::Object (1) {} +protected: + Cubit_Factory_ptr __duplicate( + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) { + CORBA::Object::__duplicate (IT_env); + return this; + } +public: + static Cubit_Factory_ptr _duplicate( + Cubit_Factory_ptr, + CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()); +public: + static Cubit_Factory* _bind (const char* IT_markerServer, const char* host, + const CORBA::Context &IT_c, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit_Factory* _bind (CORBA::Environment &IT_env); + static Cubit_Factory* _bind (const char* IT_markerServer=NULL, const char* host=NULL, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit_Factory* _narrow (CORBA::Object* , CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit_Factory_ptr _nil (CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()) { + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + return (Cubit_Factory_ptr) CORBA::OBJECT_NIL;} + virtual Cubit_ptr create_cubit (const char * name, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); +}; + +#ifndef Cubit_FactoryVarH +#define Cubit_FactoryVarH + +#ifndef Cubit_FactoryvPtr +#define Cubit_FactoryvPtr +typedef Cubit_Factory* Cubit_Factory_vPtr; +typedef const Cubit_Factory* Cubit_Factory_cvPtr; +#endif + +class Cubit_Factory_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const Cubit_Factory_var &IT_s) { + { + _ptr = Cubit_Factory_duplicate (IT_s._ptr); + } + return 1; + } + + public: + + Cubit_Factory_var (const Cubit_Factory_var &IT_s) { + (void) copyHelper (IT_s); + } + + Cubit_Factory_var () { + _ptr = Cubit_Factory_nil (); + } + + Cubit_Factory_var (Cubit_Factory *IT_p) { + _ptr = IT_p; + } + + Cubit_Factory_var &operator= (Cubit_Factory *IT_p) { + Cubit_Factory_release (_ptr); + _ptr = IT_p; + return (*this); + } + + Cubit_Factory_var &operator= (const Cubit_Factory_var &IT_s) { + Cubit_Factory_release (_ptr); + _ptr = Cubit_Factory_duplicate (IT_s._ptr); + return (*this); + } + + ~Cubit_Factory_var () { + Cubit_Factory_release (_ptr); + } + + Cubit_Factory* operator-> () { + return _ptr; + } + + operator Cubit_Factory_cvPtr () const { return _ptr;} + operator Cubit_Factory_vPtr& () { return _ptr;} + + protected: + Cubit_Factory *_ptr; + private: + Cubit_Factory_var &operator= (const CORBA::_var &IT_s); + Cubit_Factory_var (const CORBA::_var &IT_s); + Cubit_Factory_var &operator= (const CORBA::_mgr &IT_s); + Cubit_Factory_var &operator= (const CORBA::_SeqElem &IT_s); + Cubit_Factory_var (const CORBA::_mgr &IT_s); + Cubit_Factory_var (const CORBA::_SeqElem &IT_s); +}; + +#endif + + +#ifndef Cubit_FactoryMgrH +#define Cubit_FactoryMgrH + +class Cubit_Factory_mgr : public CORBA::_mgr +{ + public: + + Cubit_Factory_mgr () { + _ptr = Cubit_Factory_nil (); + _release = 1; + } + + Cubit_Factory_mgr (const Cubit_Factory_mgr &IT_s) { + _ptr = Cubit_Factory_duplicate (IT_s._ptr); + _release = 1; + } + + Cubit_Factory_mgr &operator= (Cubit_Factory *IT_p) { + if (_ptr && _release) + Cubit_Factory_release (_ptr); + _ptr = IT_p; + _release = 1; + return (*this); + } + + Cubit_Factory_mgr &operator= (const Cubit_Factory_mgr &IT_s) { + if (_ptr && _release) + Cubit_Factory_release (_ptr); + _ptr = Cubit_Factory_duplicate(IT_s._ptr); + _release = 1; + return (*this); + } + + Cubit_Factory_mgr &operator= (Cubit_Factory_var &IT_s) { + if (_ptr && _release) + Cubit_Factory_release (_ptr); + _ptr = Cubit_Factory_duplicate(IT_s); + _release = 1; + return (*this); + } + + ~Cubit_Factory_mgr () { + if (_release) + Cubit_Factory_release (_ptr); + } + + unsigned char release () { + return _release; + } + + void release (unsigned char rel) { + _release = rel; + } + + operator int () const { + return (((CORBA::Object_ptr) _ptr) ? 1 : 0); + } + + operator void* () const { + return _ptr; + } + + operator CORBA::Object * () const { + return (CORBA::Object *) _ptr; + } + + operator Cubit_Factory* () const { + return (Cubit_Factory*) _ptr; + } + + Cubit_Factory_ptr operator-> () const { + return _ptr; + } + + Cubit_Factory *_ptr; + + protected: + + unsigned char _release; +}; + +typedef Cubit_Factory_mgr Cubit_Factory_mgr_IT_const; +#endif + +#ifndef Cubit_FactorySeqElemH +#define Cubit_FactorySeqElemH + +class Cubit_Factory_SeqElem : public CORBA::_SeqElem +{ + public: + + Cubit_Factory_SeqElem (Cubit_Factory_ptr* IT_p, unsigned char rel) { + _ptr = IT_p; + _release = rel; + } + + Cubit_Factory_SeqElem &operator= (Cubit_Factory_ptr IT_p) { + if (_ptr) { + if (*(_ptr) && _release) + Cubit_Factory_release (*(_ptr)); + *(_ptr) = IT_p; + } + return (*this); + } + + Cubit_Factory_SeqElem &operator= (const Cubit_Factory_SeqElem &IT_s) { + if (_ptr && IT_s._ptr) { + if (*(_ptr) && _release) + Cubit_Factory_release (*(_ptr)); + *(_ptr) = Cubit_Factory_duplicate(*(IT_s._ptr)); + } + return (*this); + } + + operator Cubit_Factory_ptr () const { + return _ptr ? (Cubit_Factory_ptr) (*_ptr) : Cubit_Factory_nil(); + } + + Cubit_Factory_ptr operator->() const { return *_ptr;} + + protected: + Cubit_Factory_ptr *_ptr; + unsigned char _release; +}; + +#endif + + +#define TIE_Cubit_Factory(X) Cubit_Factory##X + +#define DEF_TIE_Cubit_Factory(X) \ + class Cubit_Factory##X : public virtual Cubit_Factory { \ + X* m_obj; \ + public: \ + \ + \ + Cubit_Factory##X (X *objp, const char* m="", CORBA::LoaderClass *l=0)\ + : Cubit_Factory(), m_obj(objp) { \ + m_pptr = new Cubit_Factory_dispatch \ + (( Cubit_Factory*)this,(CORBA::Object*)this,m,l,Cubit_Factory_IR,m_obj); \ + } \ + Cubit_Factory##X (CORBA::Object *IT_p, const char* IT_m="", void *IT_q=0)\ + : Cubit_Factory() { \ + m_pptr = new Cubit_Factory_dispatch \ + (( Cubit_Factory*)this,(CORBA::Object*)this,IT_m,Cubit_Factory_IR,IT_p,IT_q); \ + m_obj = (X*)(m_pptr->getImplObj ()); \ + } \ + \ + virtual ~Cubit_Factory##X () { \ + if (_okToDeleteImpl ()) delete m_obj; } \ + virtual void* _deref () { \ + return m_obj; } \ + \ +virtual Cubit_ptr create_cubit (const char * name, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->create_cubit ( name,IT_env);\ +}\ + \ + }; \ + + +#define QUALS_Cubit_Factory \ +virtual Cubit_ptr create_cubit (const char * name, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->create_cubit ( name,IT_env);\ +}\ + + + + +class Cubit_FactoryProxyFactoryClass : public virtual CORBA::ObjectFactoryClass { +public: + Cubit_FactoryProxyFactoryClass (unsigned char IT_p=0) + : CORBA::ProxyFactory (Cubit_Factory_IR, IT_p) {} + + virtual void* New (char *IT_OR, CORBA::Environment&); + + virtual void* New (ObjectReference *IT_OR, CORBA::Environment&); + + virtual void* New2 (); + + virtual CORBA::Object* NewObject (char *IT_OR, CORBA::Environment&); + + virtual CORBA::Object* NewObject (ObjectReference *IT_OR, CORBA::Environment&); + + virtual CORBA::Object* New2Object (); + + virtual void* IT_castUp (void *IT_p, char* IT_s, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + + virtual CORBA::PPTR* pptr (void *IT_p); + + virtual void baseInterfaces (_IDL_SEQUENCE_string&); + + +}; + +extern Cubit_FactoryProxyFactoryClass Cubit_FactoryProxyFactory; + +class Cubit_FactoryBOAImpl : public virtual Cubit_Factory { +public: + Cubit_FactoryBOAImpl (const char *m="", CORBA::LoaderClass *l=NULL) { + if (CORBA::PPTR::isOK (m_pptr, Cubit_Factory_IR)) + m_pptr = new Cubit_Factory_dispatch ( (Cubit_Factory*)this, + (CORBA::Object*)this, m, l, Cubit_Factory_IR, this); +} + + virtual Cubit_ptr create_cubit (const char * name, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; +}; + + +#endif + + +#endif diff --git a/TAO/IIOP/tests/Cubit/Orbix/factory_client/cubit.idl b/TAO/IIOP/tests/Cubit/Orbix/factory_client/cubit.idl new file mode 100644 index 00000000000..7dba408d0db --- /dev/null +++ b/TAO/IIOP/tests/Cubit/Orbix/factory_client/cubit.idl @@ -0,0 +1,46 @@ +// @(#)cubit.idl 1.1 95/09/10 +// Copyright 1994-1995 by Sun Microsystems, Inc. + +#pragma prefix "Eng.SUN.COM" +#pragma version Cubit 1.1 + + interface Cubit { + octet cube_octet (in octet o); + short cube_short (in short s); + long cube_long (in long l); + + struct Many { + octet o; // + 3 bytes padding (normally) ... + long l; + short s; // + 2 bytes padding (normally) ... + }; + + Many cube_struct (in Many values); + + enum discrim {e_0th, e_1st, e_2nd, e_3rd, e_4th, e_5th}; + + union oneof + switch (discrim) { + // this is an easy union to interpret; no padding + // is needed between discriminant and value. + case e_0th: + octet o; + case e_1st: + short s; + case e_2nd: + long l; + case e_3rd: + default: + Many cm; + }; + + oneof cube_union (in oneof values); + + oneway void please_exit (); + }; + + + interface Cubit_Factory { + Cubit create_cubit (in string name); + }; + diff --git a/TAO/IIOP/tests/Cubit/Orbix/factory_client/cubitC.cpp b/TAO/IIOP/tests/Cubit/Orbix/factory_client/cubitC.cpp new file mode 100644 index 00000000000..c439fc4c800 --- /dev/null +++ b/TAO/IIOP/tests/Cubit/Orbix/factory_client/cubitC.cpp @@ -0,0 +1,710 @@ + + +#include "cubit.h" + +Cubit::Cubit (char *IT_OR) { + m_pptr = new Cubit_dispatch (IT_OR, this,(CORBA::Object*)this); +} +Cubit::Cubit (ObjectReference *IT_OR) { + m_pptr = new Cubit_dispatch (IT_OR, this,(CORBA::Object*)this); +} + +#ifndef CubitForwC +#define CubitForwC +CORBA::ObjectRef Cubit_getBase(void *IT_p){ + return (Cubit*) IT_p;} + +void Cubit_release (Cubit_ptr IT_p, CORBA::Environment &IT_env) { + CORBA::release(IT_p, IT_env);} + +void Cubit_release (Cubit_ptr IT_p) { + Cubit_release (IT_p, CORBA::IT_chooseDefaultEnv ()); } + +Cubit_ptr Cubit_nil (CORBA::Environment &) { + return Cubit:: _nil ();} + +Cubit_ptr Cubit_nil () { + return Cubit_nil (CORBA::IT_chooseDefaultEnv ());} + +Cubit_ptr Cubit_duplicate (Cubit_ptr IT_p, CORBA::Environment &IT_env) { + return (Cubit::_duplicate(IT_p, IT_env)); } +Cubit_ptr Cubit_duplicate (Cubit_ptr IT_p) { + return Cubit_duplicate (IT_p, CORBA::IT_chooseDefaultEnv ()); } +#endif + +Cubit_ptr Cubit::_duplicate(Cubit_ptr obj, CORBA::Environment& IT_pEnv) { + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (!obj) { + return (obj); + } + Cubit_ptr IT_obj = obj->__duplicate (IT_env); + return IT_obj; +} + + + +Cubit* Cubit:: _bind (const char* IT_markerServer, const char* host, + const CORBA::Context &IT_c, + CORBA::Environment &IT_env) { + return (Cubit*)CORBA::Factory.New (IT_markerServer, IT_env, IT_c, host, + Cubit_IMPL, Cubit_IR); +} + + + +Cubit* Cubit:: _bind (CORBA::Environment &IT_env) { + return _bind (NULL,NULL,CORBA::Context(), IT_env); } + + +Cubit* Cubit:: _bind (const char* IT_markerServer, const char* host, + CORBA::Environment &IT_env) { + return _bind (IT_markerServer, host, CORBA::Context (), IT_env); } +Cubit* Cubit::_narrow (CORBA::Object* IT_obj, CORBA::Environment &IT_pEnv) { + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (CORBA::is_nil (IT_obj)) { + return Cubit:: _nil(); + } + + Cubit* IT_p = (Cubit*)CORBA::Object::_castDown (IT_obj, Cubit_IR, IT_env); + IT_p = IT_p ? IT_p->__duplicate(IT_env) : NULL; + if ((IT_env) &&(!strcmp(IT_env.exception()->id(), "CORBA::StExcep::BAD_PARAM")) && (((CORBA::BAD_PARAM*)IT_env.exception())-> minor() == NARROW_FAILED)) { + IT_env.exception_free(); + } + return IT_p; + } + + +#ifndef Cubit_Many_Ops +#define Cubit_Many_Ops + +void Cubit::Many:: encodeOp (CORBA::Request &IT_r) const { + + IT_r.insertOctet (o); + + IT_r << l; + + IT_r << s; +} + +void Cubit::Many:: decodeOp (CORBA::Request &IT_r) { + + IT_r.extractOctet (o); + + IT_r >> l; + + IT_r >> s; +} + +void Cubit::Many:: decodeInOutOp (CORBA::Request &IT_r) { + + IT_r.extractOctet (o); + + IT_r >> l; + + IT_r >> s; +} + +Cubit::Many ::~Many () { +} + +Cubit::Many:: Many (const Cubit::Many &IT_s) + { + o = IT_s.o; + l = IT_s.l; + s = IT_s.s; +} + +Cubit::Many:: Many () { +} + +Cubit::Many &Cubit::Many:: operator= (const Cubit::Many& IT_s) { + if (this == &IT_s) return *this; + o = IT_s.o; + l = IT_s.l; + s = IT_s.s; + return *this; +} + + +#endif + + +#ifndef Cubit_oneof_Ops +#define Cubit_oneof_Ops +void Cubit::oneof:: encodeOp (CORBA::Request &IT_r) const { + if (!isSet) return; + { + CORBA::ULong IT_0 = (CORBA::ULong) __d; + IT_r << IT_0; + } + switch (__d) { + case Cubit::e_0th: + IT_r.insertOctet (_o_); + break; + case Cubit::e_1st: + IT_r << _s_; + break; + case Cubit::e_2nd: + IT_r << _l_; + break; + case Cubit::e_3rd: + default: + (*_cm_).encodeOp (IT_r); + break; + } + +} + +void Cubit::oneof:: decodeOp (CORBA::Request &IT_r) { + isSet = 0; + { + CORBA::ULong IT_1; + IT_r >> IT_1; + __d = Cubit::discrim(IT_1); + } + switch (__d) { + case Cubit::e_0th: + if (!isSet) { + isSet = 1; + } + IT_r.extractOctet (_o_); + break; + case Cubit::e_1st: + if (!isSet) { + isSet = 1; + } + IT_r >> _s_; + break; + case Cubit::e_2nd: + if (!isSet) { + isSet = 1; + } + IT_r >> _l_; + break; + case Cubit::e_3rd: + default: + if (!isSet) { + _cm_ = new Cubit::Many; + isSet = 1; + } + (*_cm_).decodeOp (IT_r); + break; + } + +} +void Cubit::oneof:: decodeInOutOp (CORBA::Request &IT_r) { + Cubit::discrim IT_d; + { + CORBA::ULong IT_2; + IT_r >> IT_2; + IT_d = Cubit::discrim(IT_2); + } + if (IT_d == __d) + switch (__d) { + case Cubit::e_0th: + if (!isSet) { + isSet = 1; + } + IT_r.extractOctet (_o_); + break; + case Cubit::e_1st: + if (!isSet) { + isSet = 1; + } + IT_r >> _s_; + break; + case Cubit::e_2nd: + if (!isSet) { + isSet = 1; + } + IT_r >> _l_; + break; + case Cubit::e_3rd: + default: + if (!isSet) { + _cm_ = new Cubit::Many; + isSet = 1; + } + (*_cm_).decodeInOutOp (IT_r); + break; + } + + else { + this->oneof:: ~oneof(); + memset(this, 0, sizeof(*this)); + __d = IT_d; + switch (__d) { + case Cubit::e_0th: + if (!isSet) { + isSet = 1; + } + IT_r.extractOctet (_o_); + break; + case Cubit::e_1st: + if (!isSet) { + isSet = 1; + } + IT_r >> _s_; + break; + case Cubit::e_2nd: + if (!isSet) { + isSet = 1; + } + IT_r >> _l_; + break; + case Cubit::e_3rd: + default: + if (!isSet) { + _cm_ = new Cubit::Many; + isSet = 1; + } + (*_cm_).decodeOp (IT_r); + break; + } + isSet = 1; + } + +} + +Cubit::oneof:: oneof() { + memset(this, 0, sizeof(*this)); + isSet = 0; +} + +Cubit::oneof ::~oneof() { + if (!isSet) return; + switch (__d) { + case Cubit::e_0th: break; + case Cubit::e_1st: break; + case Cubit::e_2nd: break; + case Cubit::e_3rd: + default: if (_cm_) delete _cm_; + break; + } + + isSet = 0; +} + +Cubit::oneof:: oneof (const Cubit::oneof &IT_s) { + isSet = 0; + memset(this, 0, sizeof(*this)); + __d = IT_s.__d; + switch (__d) { + case Cubit::e_0th: isSet = 1; + _o_ = IT_s._o_; + break; + case Cubit::e_1st: isSet = 1; + _s_ = IT_s._s_; + break; + case Cubit::e_2nd: isSet = 1; + _l_ = IT_s._l_; + break; + case Cubit::e_3rd: + default: + if (!isSet) { + _cm_ = new Cubit::Many; + isSet = 1; + } + *(_cm_) = *(IT_s._cm_); + break; + } + isSet = 1; +} + +Cubit::oneof& Cubit::oneof:: operator= (const Cubit::oneof & IT_s) { + if (this == &IT_s) return *this; + if (isSet && (__d != IT_s.__d)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = IT_s.__d; + switch (__d) { + case Cubit::e_0th: isSet = 1; + _o_ = IT_s._o_; + break; + case Cubit::e_1st: isSet = 1; + _s_ = IT_s._s_; + break; + case Cubit::e_2nd: isSet = 1; + _l_ = IT_s._l_; + break; + case Cubit::e_3rd: + default: + if (!isSet) { + _cm_ = new Cubit::Many; + isSet = 1; + } + *(_cm_) = *(IT_s._cm_); + break; + } + isSet = 1; + return *this; +} + + +#endif + +void* CubitProxyFactoryClass::New (char *IT_OR, CORBA::Environment&) { + return new class Cubit(IT_OR);} + +void* CubitProxyFactoryClass::New (ObjectReference *IT_OR, CORBA::Environment&) { + return new class Cubit(IT_OR);} + +void* CubitProxyFactoryClass::New2 () { + return new class Cubit((char*)0);} + +CORBA::Object* CubitProxyFactoryClass::NewObject (char *IT_OR, CORBA::Environment&) { + return new class Cubit(IT_OR);} + +CORBA::Object* CubitProxyFactoryClass::NewObject (ObjectReference *IT_OR, CORBA::Environment&) { + return new class Cubit(IT_OR);} + +CORBA::Object* CubitProxyFactoryClass::New2Object () { + return new class Cubit((char*)0);} + +void* CubitProxyFactoryClass::IT_castUp (void *IT_p, char* IT_s, CORBA::Environment &IT_env) { + void *IT_l; + if (!CORBA::_interfaceCmp (IT_s,Cubit_IR, IT_env)) + return IT_p; + else if (IT_l=CORBA::ObjectFactoryClass::IT_castUp((CORBA::Object*)((class Cubit*)IT_p),IT_s, IT_env)) + return IT_l; + else return NULL; + } + + +CORBA::PPTR* CubitProxyFactoryClass::pptr (void *IT_p) { + return ((class Cubit*)IT_p)->_pptr ();} + +void CubitProxyFactoryClass::baseInterfaces (_IDL_SEQUENCE_string& seq) { + add (seq, Cubit_IR); + CORBA::ObjectFactoryClass::baseInterfaces (seq); +} + +CubitProxyFactoryClass CubitProxyFactory(1); + +CORBA::Octet Cubit:: cube_octet (CORBA::Octet o, CORBA::Environment &IT_pEnv) throw (CORBA::SystemException) { + + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (IT_env || m_isNull) { + return 0; + } + CORBA::Request IT_r (this, "cube_octet",IT_env,1,0); + if (!IT_r.isException (IT_env)) { + + IT_r.insertOctet (o); + } + + IT_r.invoke (CORBA::Flags(0),IT_env); + if (!IT_r.isException (IT_env)) { + CORBA::Octet IT_result; + IT_r.extractOctet (IT_result); + IT_r.checkEnv (IT_env); + return IT_result; + } + if (IT_r.exceptionKind () == CORBA::SYSTEM_EXCEPTION) { + IT_r.checkEnv (IT_env); + } + return 0; +} + +CORBA::Short Cubit:: cube_short (CORBA::Short s, CORBA::Environment &IT_pEnv) throw (CORBA::SystemException) { + + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (IT_env || m_isNull) { + return 0; + } + CORBA::Request IT_r (this, "cube_short",IT_env,1,0); + if (!IT_r.isException (IT_env)) { + + IT_r << s; + } + + IT_r.invoke (CORBA::Flags(0),IT_env); + if (!IT_r.isException (IT_env)) { + CORBA::Short IT_result; + IT_r >> IT_result; + IT_r.checkEnv (IT_env); + return IT_result; + } + if (IT_r.exceptionKind () == CORBA::SYSTEM_EXCEPTION) { + IT_r.checkEnv (IT_env); + } + return 0; +} + +CORBA::Long Cubit:: cube_long (CORBA::Long l, CORBA::Environment &IT_pEnv) throw (CORBA::SystemException) { + + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (IT_env || m_isNull) { + return 0; + } + CORBA::Request IT_r (this, "cube_long",IT_env,1,0); + if (!IT_r.isException (IT_env)) { + + IT_r << l; + } + + IT_r.invoke (CORBA::Flags(0),IT_env); + if (!IT_r.isException (IT_env)) { + CORBA::Long IT_result; + IT_r >> IT_result; + IT_r.checkEnv (IT_env); + return IT_result; + } + if (IT_r.exceptionKind () == CORBA::SYSTEM_EXCEPTION) { + IT_r.checkEnv (IT_env); + } + return 0; +} + +Cubit::Many Cubit:: cube_struct (const Cubit::Many& values, CORBA::Environment &IT_pEnv) throw (CORBA::SystemException) { + + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (IT_env || m_isNull) { + { + Cubit::Many IT_l0; + return IT_l0; + } + } + CORBA::Request IT_r (this, "cube_struct",IT_env,1,0); + if (!IT_r.isException (IT_env)) { + + values.encodeOp (IT_r); + } + + IT_r.invoke (CORBA::Flags(0),IT_env); + if (!IT_r.isException (IT_env)) { + Cubit::Many IT_result; + IT_result.decodeOp (IT_r); + IT_r.checkEnv (IT_env); + return IT_result; + } + if (IT_r.exceptionKind () == CORBA::SYSTEM_EXCEPTION) { + IT_r.checkEnv (IT_env); + } + { + Cubit::Many IT_l1; + return IT_l1; + } +} + +Cubit::oneof Cubit:: cube_union (const Cubit::oneof& values, CORBA::Environment &IT_pEnv) throw (CORBA::SystemException) { + + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (IT_env || m_isNull) { + { + Cubit::oneof IT_l0; + return IT_l0; + } + } + CORBA::Request IT_r (this, "cube_union",IT_env,1,0); + if (!IT_r.isException (IT_env)) { + + values.encodeOp (IT_r); + } + + IT_r.invoke (CORBA::Flags(0),IT_env); + if (!IT_r.isException (IT_env)) { + Cubit::oneof IT_result; + IT_result.decodeOp (IT_r); + IT_r.checkEnv (IT_env); + return IT_result; + } + if (IT_r.exceptionKind () == CORBA::SYSTEM_EXCEPTION) { + IT_r.checkEnv (IT_env); + } + { + Cubit::oneof IT_l1; + return IT_l1; + } +} + +void Cubit:: please_exit (CORBA::Environment &IT_pEnv) throw (CORBA::SystemException) { + + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (IT_env || m_isNull) { + return ; + } + CORBA::Request IT_r (this, "please_exit",IT_env,1,1); + + IT_r.invoke (CORBA::Flags(CORBA::INV_NO_RESPONSE), IT_env); + if (IT_r.exceptionKind () == CORBA::SYSTEM_EXCEPTION) { + IT_r.checkEnv (IT_env); + } +} + + + + + +#ifndef Cubit_dispatch_impl + +unsigned char Cubit_dispatch::dispatch (CORBA::Request &IT_r, + unsigned char, void *) { + IT_r.makeRuntimeException1 ("Cubit"); + return 0; +} + +#endif + +Cubit_Factory::Cubit_Factory (char *IT_OR) { + m_pptr = new Cubit_Factory_dispatch (IT_OR, this,(CORBA::Object*)this); +} +Cubit_Factory::Cubit_Factory (ObjectReference *IT_OR) { + m_pptr = new Cubit_Factory_dispatch (IT_OR, this,(CORBA::Object*)this); +} + +#ifndef Cubit_FactoryForwC +#define Cubit_FactoryForwC +CORBA::ObjectRef Cubit_Factory_getBase(void *IT_p){ + return (Cubit_Factory*) IT_p;} + +void Cubit_Factory_release (Cubit_Factory_ptr IT_p, CORBA::Environment &IT_env) { + CORBA::release(IT_p, IT_env);} + +void Cubit_Factory_release (Cubit_Factory_ptr IT_p) { + Cubit_Factory_release (IT_p, CORBA::IT_chooseDefaultEnv ()); } + +Cubit_Factory_ptr Cubit_Factory_nil (CORBA::Environment &) { + return Cubit_Factory:: _nil ();} + +Cubit_Factory_ptr Cubit_Factory_nil () { + return Cubit_Factory_nil (CORBA::IT_chooseDefaultEnv ());} + +Cubit_Factory_ptr Cubit_Factory_duplicate (Cubit_Factory_ptr IT_p, CORBA::Environment &IT_env) { + return (Cubit_Factory::_duplicate(IT_p, IT_env)); } +Cubit_Factory_ptr Cubit_Factory_duplicate (Cubit_Factory_ptr IT_p) { + return Cubit_Factory_duplicate (IT_p, CORBA::IT_chooseDefaultEnv ()); } +#endif + +Cubit_Factory_ptr Cubit_Factory::_duplicate(Cubit_Factory_ptr obj, CORBA::Environment& IT_pEnv) { + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (!obj) { + return (obj); + } + Cubit_Factory_ptr IT_obj = obj->__duplicate (IT_env); + return IT_obj; +} + + + +Cubit_Factory* Cubit_Factory:: _bind (const char* IT_markerServer, const char* host, + const CORBA::Context &IT_c, + CORBA::Environment &IT_env) { + return (Cubit_Factory*)CORBA::Factory.New (IT_markerServer, IT_env, IT_c, host, + Cubit_Factory_IMPL, Cubit_Factory_IR); +} + + + +Cubit_Factory* Cubit_Factory:: _bind (CORBA::Environment &IT_env) { + return _bind (NULL,NULL,CORBA::Context(), IT_env); } + + +Cubit_Factory* Cubit_Factory:: _bind (const char* IT_markerServer, const char* host, + CORBA::Environment &IT_env) { + return _bind (IT_markerServer, host, CORBA::Context (), IT_env); } +Cubit_Factory* Cubit_Factory::_narrow (CORBA::Object* IT_obj, CORBA::Environment &IT_pEnv) { + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (CORBA::is_nil (IT_obj)) { + return Cubit_Factory:: _nil(); + } + + Cubit_Factory* IT_p = (Cubit_Factory*)CORBA::Object::_castDown (IT_obj, Cubit_Factory_IR, IT_env); + IT_p = IT_p ? IT_p->__duplicate(IT_env) : NULL; + if ((IT_env) &&(!strcmp(IT_env.exception()->id(), "CORBA::StExcep::BAD_PARAM")) && (((CORBA::BAD_PARAM*)IT_env.exception())-> minor() == NARROW_FAILED)) { + IT_env.exception_free(); + } + return IT_p; + } + +void* Cubit_FactoryProxyFactoryClass::New (char *IT_OR, CORBA::Environment&) { + return new class Cubit_Factory(IT_OR);} + +void* Cubit_FactoryProxyFactoryClass::New (ObjectReference *IT_OR, CORBA::Environment&) { + return new class Cubit_Factory(IT_OR);} + +void* Cubit_FactoryProxyFactoryClass::New2 () { + return new class Cubit_Factory((char*)0);} + +CORBA::Object* Cubit_FactoryProxyFactoryClass::NewObject (char *IT_OR, CORBA::Environment&) { + return new class Cubit_Factory(IT_OR);} + +CORBA::Object* Cubit_FactoryProxyFactoryClass::NewObject (ObjectReference *IT_OR, CORBA::Environment&) { + return new class Cubit_Factory(IT_OR);} + +CORBA::Object* Cubit_FactoryProxyFactoryClass::New2Object () { + return new class Cubit_Factory((char*)0);} + +void* Cubit_FactoryProxyFactoryClass::IT_castUp (void *IT_p, char* IT_s, CORBA::Environment &IT_env) { + void *IT_l; + if (!CORBA::_interfaceCmp (IT_s,Cubit_Factory_IR, IT_env)) + return IT_p; + else if (IT_l=CORBA::ObjectFactoryClass::IT_castUp((CORBA::Object*)((class Cubit_Factory*)IT_p),IT_s, IT_env)) + return IT_l; + else return NULL; + } + + +CORBA::PPTR* Cubit_FactoryProxyFactoryClass::pptr (void *IT_p) { + return ((class Cubit_Factory*)IT_p)->_pptr ();} + +void Cubit_FactoryProxyFactoryClass::baseInterfaces (_IDL_SEQUENCE_string& seq) { + add (seq, Cubit_Factory_IR); + CORBA::ObjectFactoryClass::baseInterfaces (seq); +} + +Cubit_FactoryProxyFactoryClass Cubit_FactoryProxyFactory(1); + +Cubit_ptr Cubit_Factory:: create_cubit (const char * name, CORBA::Environment &IT_pEnv) throw (CORBA::SystemException) { + + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (IT_env || m_isNull) { + return new Cubit; + } + CORBA::Request IT_r (this, "create_cubit",IT_env,1,0); + if (!IT_r.isException (IT_env)) { + + IT_r.encodeStringOp (name); + } + + IT_r.invoke (CORBA::Flags(0),IT_env); + if (!IT_r.isException (IT_env)) { + Cubit_ptr IT_result; + IT_result = (Cubit*) IT_r.decodeObjRef (Cubit_IR); + IT_r.checkEnv (IT_env); + return IT_result; + } + if (IT_r.exceptionKind () == CORBA::SYSTEM_EXCEPTION) { + IT_r.checkEnv (IT_env); + } + return new Cubit; +} + + + + + +#ifndef Cubit_Factory_dispatch_impl + +unsigned char Cubit_Factory_dispatch::dispatch (CORBA::Request &IT_r, + unsigned char, void *) { + IT_r.makeRuntimeException1 ("Cubit_Factory"); + return 0; +} + +#endif + diff --git a/TAO/IIOP/tests/Cubit/Orbix/factory_client/cubitS.cpp b/TAO/IIOP/tests/Cubit/Orbix/factory_client/cubitS.cpp new file mode 100644 index 00000000000..2f0459962b8 --- /dev/null +++ b/TAO/IIOP/tests/Cubit/Orbix/factory_client/cubitS.cpp @@ -0,0 +1,282 @@ + + +#include "cubit.hh" + + +#define Cubit_dispatch_impl + +unsigned char Cubit_dispatch::dispatch (CORBA::Request &IT_r, + unsigned char IT_isTarget, void *IT_pp) { + if (!IT_pp) + IT_pp = m_obj; + const char *IT_s = IT_r.getOperation (); + if (!strcmp(IT_s,"cube_octet")) { + CORBA::Octet IT_result; + CORBA::Environment IT_env (IT_r); + CORBA::Filter* IT_f = CORBA::Orbix.getFilter (); + if (!IT_r.tcAssert ("\ +Ro~cube_octet~+o{o},>{o},N{}\ +")) + return 1; + CORBA::Octet o; + + IT_r.extractOctet (o); + + if (IT_f && !IT_r.isException (IT_env)) + IT_f->inRequestPostM (IT_r, IT_env); + if (!IT_r.isException (IT_env)) { + try { + IT_result = ((Cubit*)IT_pp)->cube_octet ( o, IT_env); + + } catch (CORBA::SystemException &IT_exSys) { + IT_env.propagate (&IT_exSys); + } catch (CORBA::UserException &IT_exUsr) { + IT_env.propagate (&IT_exUsr); + } + } + + if (!IT_r.isException (IT_env)) { + if (!IT_r.convertToReply ("\ +o\ +", IT_env)) return 1; + IT_r.insertOctet (IT_result); + } + + else IT_r.makeSystemException (IT_env); + return 1; + } + + if (!strcmp(IT_s,"cube_short")) { + CORBA::Short IT_result; + CORBA::Environment IT_env (IT_r); + CORBA::Filter* IT_f = CORBA::Orbix.getFilter (); + if (!IT_r.tcAssert ("\ +Ro~cube_short~+s{s},>{s},N{}\ +")) + return 1; + CORBA::Short s; + + IT_r >> s; + + if (IT_f && !IT_r.isException (IT_env)) + IT_f->inRequestPostM (IT_r, IT_env); + if (!IT_r.isException (IT_env)) { + try { + IT_result = ((Cubit*)IT_pp)->cube_short ( s, IT_env); + + } catch (CORBA::SystemException &IT_exSys) { + IT_env.propagate (&IT_exSys); + } catch (CORBA::UserException &IT_exUsr) { + IT_env.propagate (&IT_exUsr); + } + } + + if (!IT_r.isException (IT_env)) { + if (!IT_r.convertToReply ("\ +s\ +", IT_env)) return 1; + IT_r << IT_result; + } + + else IT_r.makeSystemException (IT_env); + return 1; + } + + if (!strcmp(IT_s,"cube_long")) { + CORBA::Long IT_result; + CORBA::Environment IT_env (IT_r); + CORBA::Filter* IT_f = CORBA::Orbix.getFilter (); + if (!IT_r.tcAssert ("\ +Ro~cube_long~+l{l},>{l},N{}\ +")) + return 1; + CORBA::Long l; + + IT_r >> l; + + if (IT_f && !IT_r.isException (IT_env)) + IT_f->inRequestPostM (IT_r, IT_env); + if (!IT_r.isException (IT_env)) { + try { + IT_result = ((Cubit*)IT_pp)->cube_long ( l, IT_env); + + } catch (CORBA::SystemException &IT_exSys) { + IT_env.propagate (&IT_exSys); + } catch (CORBA::UserException &IT_exUsr) { + IT_env.propagate (&IT_exUsr); + } + } + + if (!IT_r.isException (IT_env)) { + if (!IT_r.convertToReply ("\ +l\ +", IT_env)) return 1; + IT_r << IT_result; + } + + else IT_r.makeSystemException (IT_env); + return 1; + } + + if (!strcmp(IT_s,"cube_struct")) { + Cubit::Many IT_result; + CORBA::Environment IT_env (IT_r); + CORBA::Filter* IT_f = CORBA::Orbix.getFilter (); + if (!IT_r.tcAssert ("\ +Ro~cube_struct~+values{R~Cubit::Many~o{o},l{l},s{s}},>{R~Cubit::Many~o{o},l{l},s{s}},N{}\ +")) + return 1; + Cubit::Many values; + + values.decodeOp (IT_r); + + if (IT_f && !IT_r.isException (IT_env)) + IT_f->inRequestPostM (IT_r, IT_env); + if (!IT_r.isException (IT_env)) { + try { + IT_result = ((Cubit*)IT_pp)->cube_struct ( values, IT_env); + + } catch (CORBA::SystemException &IT_exSys) { + IT_env.propagate (&IT_exSys); + } catch (CORBA::UserException &IT_exUsr) { + IT_env.propagate (&IT_exUsr); + } + } + + if (!IT_r.isException (IT_env)) { + if (!IT_r.convertToReply ("\ +R~Cubit::Many~o{o},l{l},s{s}\ +", IT_env)) return 1; + IT_result.encodeOp (IT_r); + } + + else IT_r.makeSystemException (IT_env); + return 1; + } + + if (!strcmp(IT_s,"cube_union")) { + Cubit::oneof IT_result; + CORBA::Environment IT_env (IT_r); + CORBA::Filter* IT_f = CORBA::Orbix.getFilter (); + IT_r.tcPreAssert ( +"\ +Ro~cube_union~+values{U~Cubit::oneof~{E~Cubit::discrim~e_0th,e_1st,e_2nd,e_3rd,e_4th,e_5th}~Cubit::e_0th o{o};Cubit::e_1st s{s};Cubit::e_2nd l{l};Cubit::e_3rd,$ cm{R~Cubit::Many~o{o},l{l},s{s}}},>{U~Cubit::oneof~{E~Cubit::discrim~e_0th,e_1st,e_2nd,e_3rd,\ +"); + if (!IT_r.tcAssert ("\ +e_4th,e_5th}~Cubit::e_0th o{o};Cubit::e_1st s{s};Cubit::e_2nd l{l};Cubit::e_3rd,$ cm{R~Cubit::Many~o{o},l{l},s{s}}},N{}\ +")) + return 1; + Cubit::oneof values; + + values.decodeOp (IT_r); + + if (IT_f && !IT_r.isException (IT_env)) + IT_f->inRequestPostM (IT_r, IT_env); + if (!IT_r.isException (IT_env)) { + try { + IT_result = ((Cubit*)IT_pp)->cube_union ( values, IT_env); + + } catch (CORBA::SystemException &IT_exSys) { + IT_env.propagate (&IT_exSys); + } catch (CORBA::UserException &IT_exUsr) { + IT_env.propagate (&IT_exUsr); + } + } + + if (!IT_r.isException (IT_env)) { + if (!IT_r.convertToReply ("\ +U~Cubit::oneof~{E~Cubit::discrim~e_0th,e_1st,e_2nd,e_3rd,e_4th,e_5th}~Cubit::e_0th o{o};Cubit::e_1st s{s};Cubit::e_2nd l{l};Cubit::e_3rd,$ cm{R~Cubit::Many~o{o},l{l},s{s}}\ +", IT_env)) return 1; + IT_result.encodeOp (IT_r); + } + + else IT_r.makeSystemException (IT_env); + return 1; + } + + if (!strcmp(IT_s,"please_exit")) { + CORBA::Environment IT_env (IT_r); + CORBA::Filter* IT_f = CORBA::Orbix.getFilter (); + if (!IT_r.tcAssert ("\ +Ro~please_exit~>{v},O{}\ +")) + return 1; + + if (IT_f && !IT_r.isException (IT_env)) + IT_f->inRequestPostM (IT_r, IT_env); + if (!IT_r.isException (IT_env)) { + try { + ((Cubit*)IT_pp)->please_exit (IT_env); + + } catch (CORBA::SystemException &IT_exSys) { + IT_env.propagate (&IT_exSys); + } catch (CORBA::UserException &IT_exUsr) { + IT_env.propagate (&IT_exUsr); + } + } + IT_r.replyNoResults (CORBA::Flags(CORBA::INV_NO_RESPONSE),IT_env); + return 1; + } + + if (IT_isTarget) + IT_r.makeRuntimeException2 (); + + return 0; +} + +#define Cubit_Factory_dispatch_impl + +unsigned char Cubit_Factory_dispatch::dispatch (CORBA::Request &IT_r, + unsigned char IT_isTarget, void *IT_pp) { + if (!IT_pp) + IT_pp = m_obj; + const char *IT_s = IT_r.getOperation (); + if (!strcmp(IT_s,"create_cubit")) { + Cubit_ptr IT_result; + CORBA::Environment IT_env (IT_r); + CORBA::Filter* IT_f = CORBA::Orbix.getFilter (); + if (!IT_r.tcAssert ("\ +Ro~create_cubit~+name{0},>{O~Cubit},N{}\ +")) + return 1; + char * name; + + IT_r.decodeStringOp(name); + + if (IT_f && !IT_r.isException (IT_env)) + IT_f->inRequestPostM (IT_r, IT_env); + if (!IT_r.isException (IT_env)) { + try { + IT_result = ((Cubit_Factory*)IT_pp)->create_cubit ( name, IT_env); + + } catch (CORBA::SystemException &IT_exSys) { + IT_env.propagate (&IT_exSys); + } catch (CORBA::UserException &IT_exUsr) { + IT_env.propagate (&IT_exUsr); + } + } + CORBA::string_free (name); + + if (!IT_r.isException (IT_env)) { + if (!IT_r.convertToReply ("\ +O~Cubit\ +", IT_env)) return 1; + { + CORBA::Object* IT_l1 = (CORBA::Object*) IT_result; + IT_r << IT_l1; + } + if (IT_result) Cubit_release (IT_result); + } + + else IT_r.makeSystemException (IT_env); + return 1; + } + + if (IT_isTarget) + IT_r.makeRuntimeException2 (); + + return 0; +} + +#include "cubitC.cpp" + diff --git a/TAO/tests/Cubit/Orbix/factory_client/Makefile b/TAO/tests/Cubit/Orbix/factory_client/Makefile new file mode 100644 index 00000000000..cbc81f28124 --- /dev/null +++ b/TAO/tests/Cubit/Orbix/factory_client/Makefile @@ -0,0 +1,77 @@ +#---------------------------------------------------------------------------- +# @(#)Makefile 1.1 10/18/96 +# +# Makefile for the ACE_MT_CORBA_Handler tests +#---------------------------------------------------------------------------- + +#---------------------------------------------------------------------------- +# Local macros +#---------------------------------------------------------------------------- + +SRC = cubitC.cpp client.cpp + +CLT_OBJS = cubitC.o client.o + +LDLIBS = + +VLDLIBS = $(LDLIBS:%=%$(VAR)) + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(WRAPPER_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(WRAPPER_ROOT)/include/makeinclude/macros.GNU +include $(WRAPPER_ROOT)/include/makeinclude/rules.common.GNU +include $(WRAPPER_ROOT)/include/makeinclude/rules.nonested.GNU +include $(WRAPPER_ROOT)/include/makeinclude/rules.lib.GNU +include $(WRAPPER_ROOT)/include/makeinclude/rules.bin.GNU +include $(WRAPPER_ROOT)/include/makeinclude/rules.local.GNU + +#---------------------------------------------------------------------------- +# Orbix related macros and target settings. +#---------------------------------------------------------------------------- + + +ORBIX_BINDIR = $(ORBIX_ROOT)/bin +ORBIX_LIBDIR = $(ORBIX_ROOT)/corba2/lib +ORBIX_INCDIR = $(ORBIX_ROOT)/corba2/include + +CPPFLAGS += -DEXCEPTIONS -I$(ORBIX_INCDIR) -DWANT_ORBIX_FDS +LDFLAGS += -L$(ORBIX_LIBDIR) -R $(ORBIX_LIBDIR) -L$(ACE)/ace + +IDLFLAGS = -s S.cpp -c C.cpp -B + +#---------------------------------------------------------------------------- +# Local targets +#---------------------------------------------------------------------------- + +all: client + +client: $(addprefix $(VDIR),$(CLT_OBJS)) + $(LINK.cc) -o client $(addprefix $(VDIR),$(CLT_OBJS)) $(LDFLAGS) $(ITIIOP) $(ITCLT) $(VLDLIBS) + + +#---------------------------------------------------------------------------- +# Dependencies +#---------------------------------------------------------------------------- +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +.obj/cubitC.o .shobj/cubitC.so: cubitC.cpp cubit.h +.obj/client.o .shobj/client.so: client.cpp $(WRAPPER_ROOT)/ace/OS.h \ + $(WRAPPER_ROOT)/ace/config.h \ + $(WRAPPER_ROOT)/ace/config-sunos5.5-sunc++-4.x.h \ + $(WRAPPER_ROOT)/ace/stdcpp.h \ + $(WRAPPER_ROOT)/ace/OS.i \ + $(WRAPPER_ROOT)/ace/Trace.h \ + $(WRAPPER_ROOT)/ace/Log_Msg.h \ + $(WRAPPER_ROOT)/ace/Log_Record.h \ + $(WRAPPER_ROOT)/ace/ACE.h \ + $(WRAPPER_ROOT)/ace/ACE.i \ + $(WRAPPER_ROOT)/ace/Log_Priority.h \ + $(WRAPPER_ROOT)/ace/Log_Record.i \ + $(WRAPPER_ROOT)/ace/Get_Opt.h \ + $(WRAPPER_ROOT)/ace/Get_Opt.i cubit.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/tests/Cubit/Orbix/factory_client/client.cpp b/TAO/tests/Cubit/Orbix/factory_client/client.cpp new file mode 100644 index 00000000000..c61cfbc85a5 --- /dev/null +++ b/TAO/tests/Cubit/Orbix/factory_client/client.cpp @@ -0,0 +1,235 @@ +//************************************************************************** +// +// NAME : client.C +// DESCRIPTION: +// +// Client for the Cubit example +// +//**************************************************************************** + +#include "ace/OS.h" +#include "ace/Get_Opt.h" +#include "cubit.h" + +int LOOP_COUNT; +char SERVER_HOST [1024]; + +inline int func (unsigned i) { return i - 117; } +void run_tests (Cubit_var, int); + +// = TITLE +// Parses the command line arguments and returns an error status +// +// = DESCRIPTION +// This method parses the command line arguments +int parse_args(int argc, char *argv[]) +{ + ACE_OS::strcpy (SERVER_HOST, "localhost"); + ACE_Get_Opt opts (argc, argv, "dh:n:O:x"); + int c; + + while ((c = opts ()) != -1) + switch (c) { + case 'h': + ACE_OS::strcpy (SERVER_HOST, opts.optarg); + continue; + case 'd': // debug flag + continue; + + case 'n': // loop count + LOOP_COUNT = (unsigned) ACE_OS::atoi (opts.optarg); + continue; + + case 'O': // stringified objref + continue; + + case 'x': + continue; + + case '?': + default: + ACE_OS::fprintf (stderr, "usage: %s" + " [-d]" + " [-n loopcount]" + " [-h SERVER_HOST]" + " [-x]" + "\n", argv [0] + ); + return 1; + } + + return 0; // Indicates successful parsing of command line +} + + +// +// Mainline +// +int +main (int argc, char *argv[]) +{ + if (parse_args (argc, argv) != 0) + return -1; + + Cubit_var cb; + Cubit_Factory_var cf; + + // cout << "attempting to contact server at host " << SERVER_HOST << '\n' ; + + // + // Initialise client's binding to an + // arbitrary cubit server (at some host) + // + TRY { + cf = Cubit_Factory::_bind ("", SERVER_HOST, IT_X); + } + CATCHANY { + cerr << "Binding failed: " << IT_X; + } + ENDTRY; + cb = cf->create_cubit ("My_Cubit"); + + run_tests (cb, LOOP_COUNT); + return 0; +} + + +void +run_tests (Cubit_var cb, int loop_count) +{ + // + // Make the calls in a loop. + // + unsigned i; + unsigned call_count, error_count; + + call_count = 0; + error_count = 0; + + ACE_Time_Value before, after; + + before = ACE_OS::gettimeofday(); + + // + // Cube an octet. + // + + for (i = 0; i < loop_count; i++) + { + + call_count++; + + CORBA::Octet arg_octet = func (i), ret_octet; + + TRY { + ret_octet = cb->cube_octet (arg_octet); + } + CATCHANY { + cerr << "Call failed: " << IT_X; + error_count++; + } + ENDTRY; + arg_octet = arg_octet * arg_octet * arg_octet; + if (arg_octet != ret_octet) { + ACE_OS::printf ("** cube_octet(%d) (--> %d)\n", arg_octet , ret_octet); + error_count++; + } + + + // + // Cube a short. + // + call_count++; + + CORBA::Short arg_short = func (i), ret_short; + + TRY { + ret_short = cb->cube_short (arg_short); + } + CATCHANY { + cerr << "Call failed: " << IT_X; + error_count++; + } + ENDTRY; + arg_short = arg_short * arg_short * arg_short; + if (arg_short != ret_short) { + ACE_OS::printf ("** cube_short(%d) (--> %d)\n", arg_short , ret_short); + error_count++; + } + + // + // Cube a long. + // + + call_count++; + + CORBA::Long arg_long = func (i), ret_long; + + TRY { + ret_long = cb->cube_long (arg_long); + } + CATCHANY { + cerr << "Call failed: " << IT_X; + } + ENDTRY; + arg_long = arg_long * arg_long * arg_long; + if (arg_long != ret_long) { + ACE_OS::printf ("** cube_long(%d) (--> %d)\n", arg_long , ret_long); + error_count++; + } + + + // + // Cube a "struct" ... + // + Cubit::Many arg_struct, ret_struct; + + call_count++; + + arg_struct.l = func (i); + arg_struct.s = func (i); + arg_struct.o = func (i); + + TRY { + ret_struct = cb->cube_struct (arg_struct); + } + CATCHANY { + cerr << "Call failed: " << IT_X; + error_count++; + } + ENDTRY; + arg_struct.l = arg_struct.l * arg_struct.l * arg_struct.l ; + arg_struct.s = arg_struct.s * arg_struct.s * arg_struct.s ; + arg_struct.o = arg_struct.o * arg_struct.o * arg_struct.o ; + + if (arg_struct.l != ret_struct.l + || arg_struct.s != ret_struct.s + || arg_struct.o != ret_struct.o ) + { + cerr << "** cube_struct ERROR\n"; + error_count++; + } + } + + + after = ACE_OS::gettimeofday(); + + if (call_count > 0) + { + if (error_count == 0) + { + ACE_Time_Value diff = after - before; + unsigned long us = diff.sec() * 1000 * 1000 + diff.usec(); + + us /= call_count; + + if (us > 0) + ACE_OS::printf ("cube average call ACE_OS::time\t= %ld.%.03ldms, \t" + "%ld calls/second\n", + us / 1000, us % 1000, + 1000000L / us); + } + + ACE_OS::printf ("%d calls, %d errors\n", call_count, error_count); + } +} diff --git a/TAO/tests/Cubit/Orbix/factory_client/cubit.h b/TAO/tests/Cubit/Orbix/factory_client/cubit.h new file mode 100644 index 00000000000..72e2fb81395 --- /dev/null +++ b/TAO/tests/Cubit/Orbix/factory_client/cubit.h @@ -0,0 +1,1111 @@ + +#ifndef cubit_hh +#define cubit_hh + +#include <CORBA.h> + +#include <string.h> + + +#ifndef _Cubit_defined +#define _Cubit_defined +class Cubit_dispatch : public virtual CORBA::PPTR { +public: + + Cubit_dispatch (void *IT_p, CORBA::Object* IT_o, const char *IT_m, + CORBA::LoaderClass *IT_l, char *IT_i, void* IT_im) + : PPTR (IT_p,IT_o,IT_m,IT_l,IT_i,IT_im) {} + + + Cubit_dispatch (char *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Cubit_dispatch () {} + + Cubit_dispatch (ObjectReference *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Cubit_dispatch (void *IT_p, CORBA::Object *IT_o, const char *IT_m, + char *IT_i, CORBA::Object* IT_ob, void* IT_im) + : PPTR (IT_p,IT_o,IT_m,IT_i,IT_ob,IT_im) {} + + + virtual unsigned char dispatch (CORBA::Request &IT_r, + unsigned char IT_isTarget, void* IT_pp=NULL); + + +}; + +class Cubit; + +#ifndef CubitPtr +#define CubitPtr + +typedef Cubit* Cubit_ptr; + +typedef Cubit* CubitRef; + +#endif + + +#ifndef CubitForwH +#define CubitForwH +CORBA::ObjectRef Cubit_getBase (void *); +void Cubit_release (Cubit *, CORBA::Environment &IT_env); +void Cubit_release (Cubit_ptr); +Cubit* Cubit_duplicate (Cubit_ptr, CORBA::Environment &IT_env); +Cubit* Cubit_duplicate (Cubit_ptr ); +Cubit_ptr Cubit_nil (CORBA::Environment &IT_env); +Cubit_ptr Cubit_nil (); +#endif +#define Cubit_IMPL "Cubit" + + +class Cubit; + +typedef Cubit CubitProxy; +#define Cubit_IR "Cubit$v1.1" +#define Cubit_IMPL "Cubit" + +#ifndef CubitPtr +#define CubitPtr + +typedef Cubit* Cubit_ptr; + +typedef Cubit* CubitRef; + +#endif + +class Cubit: public virtual CORBA::Object { +public: + Cubit (char *IT_OR); + Cubit (ObjectReference *IT_OR); + Cubit () : CORBA::Object (1) {} +protected: + Cubit_ptr __duplicate( + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) { + CORBA::Object::__duplicate (IT_env); + return this; + } +public: + static Cubit_ptr _duplicate( + Cubit_ptr, + CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()); +public: + static Cubit* _bind (const char* IT_markerServer, const char* host, + const CORBA::Context &IT_c, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit* _bind (CORBA::Environment &IT_env); + static Cubit* _bind (const char* IT_markerServer=NULL, const char* host=NULL, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit* _narrow (CORBA::Object* , CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit_ptr _nil (CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()) { + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + return (Cubit_ptr) CORBA::OBJECT_NIL;} + +#ifndef Cubit_Many_defined +#define Cubit_Many_defined + +struct Many { + CORBA::Octet o; + CORBA::Long l; + CORBA::Short s; + + void encodeOp (CORBA::Request &IT_r) const; + void decodeOp (CORBA::Request &IT_r); + void decodeInOutOp (CORBA::Request &IT_r); + Many(const Many &); + Many(); + ~Many(); + Many& operator= (const Many&); +}; + +#ifndef Cubit_ManyVarH +#define Cubit_ManyVarH + +#ifndef Cubit_ManyvPtr +#define Cubit_ManyvPtr +typedef Many* Many_vPtr; +typedef const Many* Many_cvPtr; +#endif + +class Many_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const Many_var &IT_s) { + if (!IT_s._ptr) { + _ptr = IT_s._ptr; + } else + { + _ptr = new Many; + *(_ptr) = *(IT_s._ptr); + } + return 1; + } + + public: + + Many_var (const Many_var &IT_s) { + (void) copyHelper (IT_s); + } + + Many_var () { + _ptr = new Many; +; + } + + Many_var (Many *IT_p) { + _ptr = IT_p; + } + + Many_var &operator= (Many *IT_p) { + if (_ptr != IT_p) { + delete _ptr; + } + _ptr = IT_p; + return (*this); + } + + Many_var &operator= (const Many_var &IT_s) { + if (_ptr != IT_s._ptr) { + delete _ptr; + } + _ptr = new Many; + *(_ptr) = *(IT_s._ptr); + return (*this); + } + + ~Many_var () { + delete _ptr; + } + + Many* operator-> () { + return _ptr; + } + + operator Many_cvPtr () const { return _ptr;} + operator Many_vPtr& () { return _ptr;} + operator Many& () const { return * _ptr;} + + protected: + Many *_ptr; + private: + Many_var &operator= (const CORBA::_var &IT_s); + Many_var (const CORBA::_var &IT_s); +}; + +#endif + + +#endif + +enum discrim {e_0th,e_1st,e_2nd,e_3rd,e_4th,e_5th, IT__ENUM_Cubit_discrim=CORBA_ULONG_MAX}; + +#ifndef Cubit_oneof_defined +#define Cubit_oneof_defined + +struct oneof { + private: + + discrim __d; + union { + CORBA::Octet _o_; + CORBA::Short _s_; + CORBA::Long _l_; + Many * _cm_; + }; + + public: + + void encodeOp (CORBA::Request &IT_r) const; + void decodeOp (CORBA::Request &IT_r); + void decodeInOutOp (CORBA::Request &IT_r); + + private: + + unsigned char isSet; + + public: + + discrim _d () const { return __d; } + + CORBA::Octet o () const { + return _o_; + } + + void o (CORBA::Octet IT_member) { + if (isSet && (__d != Cubit::e_0th)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = Cubit::e_0th; + isSet = 1; + _o_ = IT_member; + } + + CORBA::Short s () const { + return _s_; + } + + void s (CORBA::Short IT_member) { + if (isSet && (__d != Cubit::e_1st)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = Cubit::e_1st; + isSet = 1; + _s_ = IT_member; + } + + CORBA::Long l () const { + return _l_; + } + + void l (CORBA::Long IT_member) { + if (isSet && (__d != Cubit::e_2nd)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = Cubit::e_2nd; + isSet = 1; + _l_ = IT_member; + } + + Many& cm () { + return (*_cm_); + } + + const Many& cm () const { + return (*_cm_); + } + + void cm (const Many& IT_member) { + if (isSet && (__d != Cubit::e_3rd)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = Cubit::e_3rd; + + if (!isSet) { + _cm_ = new Many; + isSet = 1; + } + *(_cm_) = IT_member; + } + + + oneof(); + oneof(const oneof &); + ~oneof(); + oneof& operator= (const oneof&); +}; + +#ifndef Cubit_oneofVarH +#define Cubit_oneofVarH + +#ifndef Cubit_oneofvPtr +#define Cubit_oneofvPtr +typedef oneof* oneof_vPtr; +typedef const oneof* oneof_cvPtr; +#endif + +class oneof_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const oneof_var &IT_s) { + if (!IT_s._ptr) { + _ptr = IT_s._ptr; + } else + { + _ptr = new oneof; + *(_ptr) = *(IT_s._ptr); + } + return 1; + } + + public: + + oneof_var (const oneof_var &IT_s) { + (void) copyHelper (IT_s); + } + + oneof_var () { + _ptr = NULL; + } + + oneof_var (oneof *IT_p) { + _ptr = IT_p; + } + + oneof_var &operator= (oneof *IT_p) { + if (_ptr != IT_p) { + delete _ptr; + } + _ptr = IT_p; + return (*this); + } + + oneof_var &operator= (const oneof_var &IT_s) { + if (_ptr != IT_s._ptr) { + delete _ptr; + } + _ptr = new oneof; + *(_ptr) = *(IT_s._ptr); + return (*this); + } + + ~oneof_var () { + delete _ptr; + } + + oneof* operator-> () { + return _ptr; + } + + operator oneof_cvPtr () const { return _ptr;} + operator oneof_vPtr& () { return _ptr;} + operator oneof& () const { return * _ptr;} + + protected: + oneof *_ptr; + private: + oneof_var &operator= (const CORBA::_var &IT_s); + oneof_var (const CORBA::_var &IT_s); +}; + +#endif + + +#endif + virtual CORBA::Octet cube_octet (CORBA::Octet o, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual CORBA::Short cube_short (CORBA::Short s, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual CORBA::Long cube_long (CORBA::Long l, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual Many cube_struct (const Many& values, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual oneof cube_union (const oneof& values, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual void please_exit (CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); +}; + +#ifndef CubitVarH +#define CubitVarH + +#ifndef CubitvPtr +#define CubitvPtr +typedef Cubit* Cubit_vPtr; +typedef const Cubit* Cubit_cvPtr; +#endif + +class Cubit_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const Cubit_var &IT_s) { + { + _ptr = Cubit_duplicate (IT_s._ptr); + } + return 1; + } + + public: + + Cubit_var (const Cubit_var &IT_s) { + (void) copyHelper (IT_s); + } + + Cubit_var () { + _ptr = Cubit_nil (); + } + + Cubit_var (Cubit *IT_p) { + _ptr = IT_p; + } + + Cubit_var &operator= (Cubit *IT_p) { + Cubit_release (_ptr); + _ptr = IT_p; + return (*this); + } + + Cubit_var &operator= (const Cubit_var &IT_s) { + Cubit_release (_ptr); + _ptr = Cubit_duplicate (IT_s._ptr); + return (*this); + } + + ~Cubit_var () { + Cubit_release (_ptr); + } + + Cubit* operator-> () { + return _ptr; + } + + operator Cubit_cvPtr () const { return _ptr;} + operator Cubit_vPtr& () { return _ptr;} + + protected: + Cubit *_ptr; + private: + Cubit_var &operator= (const CORBA::_var &IT_s); + Cubit_var (const CORBA::_var &IT_s); + Cubit_var &operator= (const CORBA::_mgr &IT_s); + Cubit_var &operator= (const CORBA::_SeqElem &IT_s); + Cubit_var (const CORBA::_mgr &IT_s); + Cubit_var (const CORBA::_SeqElem &IT_s); +}; + +#endif + + +#ifndef CubitMgrH +#define CubitMgrH + +class Cubit_mgr : public CORBA::_mgr +{ + public: + + Cubit_mgr () { + _ptr = Cubit_nil (); + _release = 1; + } + + Cubit_mgr (const Cubit_mgr &IT_s) { + _ptr = Cubit_duplicate (IT_s._ptr); + _release = 1; + } + + Cubit_mgr &operator= (Cubit *IT_p) { + if (_ptr && _release) + Cubit_release (_ptr); + _ptr = IT_p; + _release = 1; + return (*this); + } + + Cubit_mgr &operator= (const Cubit_mgr &IT_s) { + if (_ptr && _release) + Cubit_release (_ptr); + _ptr = Cubit_duplicate(IT_s._ptr); + _release = 1; + return (*this); + } + + Cubit_mgr &operator= (Cubit_var &IT_s) { + if (_ptr && _release) + Cubit_release (_ptr); + _ptr = Cubit_duplicate(IT_s); + _release = 1; + return (*this); + } + + ~Cubit_mgr () { + if (_release) + Cubit_release (_ptr); + } + + unsigned char release () { + return _release; + } + + void release (unsigned char rel) { + _release = rel; + } + + operator int () const { + return (((CORBA::Object_ptr) _ptr) ? 1 : 0); + } + + operator void* () const { + return _ptr; + } + + operator CORBA::Object * () const { + return (CORBA::Object *) _ptr; + } + + operator Cubit* () const { + return (Cubit*) _ptr; + } + + Cubit_ptr operator-> () const { + return _ptr; + } + + Cubit *_ptr; + + protected: + + unsigned char _release; +}; + +typedef Cubit_mgr Cubit_mgr_IT_const; +#endif + +#ifndef CubitSeqElemH +#define CubitSeqElemH + +class Cubit_SeqElem : public CORBA::_SeqElem +{ + public: + + Cubit_SeqElem (Cubit_ptr* IT_p, unsigned char rel) { + _ptr = IT_p; + _release = rel; + } + + Cubit_SeqElem &operator= (Cubit_ptr IT_p) { + if (_ptr) { + if (*(_ptr) && _release) + Cubit_release (*(_ptr)); + *(_ptr) = IT_p; + } + return (*this); + } + + Cubit_SeqElem &operator= (const Cubit_SeqElem &IT_s) { + if (_ptr && IT_s._ptr) { + if (*(_ptr) && _release) + Cubit_release (*(_ptr)); + *(_ptr) = Cubit_duplicate(*(IT_s._ptr)); + } + return (*this); + } + + operator Cubit_ptr () const { + return _ptr ? (Cubit_ptr) (*_ptr) : Cubit_nil(); + } + + Cubit_ptr operator->() const { return *_ptr;} + + protected: + Cubit_ptr *_ptr; + unsigned char _release; +}; + +#endif + + +#define TIE_Cubit(X) Cubit##X + +#define DEF_TIE_Cubit(X) \ + class Cubit##X : public virtual Cubit { \ + X* m_obj; \ + public: \ + \ + \ + Cubit##X (X *objp, const char* m="", CORBA::LoaderClass *l=0)\ + : Cubit(), m_obj(objp) { \ + m_pptr = new Cubit_dispatch \ + (( Cubit*)this,(CORBA::Object*)this,m,l,Cubit_IR,m_obj); \ + } \ + Cubit##X (CORBA::Object *IT_p, const char* IT_m="", void *IT_q=0)\ + : Cubit() { \ + m_pptr = new Cubit_dispatch \ + (( Cubit*)this,(CORBA::Object*)this,IT_m,Cubit_IR,IT_p,IT_q); \ + m_obj = (X*)(m_pptr->getImplObj ()); \ + } \ + \ + virtual ~Cubit##X () { \ + if (_okToDeleteImpl ()) delete m_obj; } \ + virtual void* _deref () { \ + return m_obj; } \ + \ +virtual CORBA::Octet cube_octet (CORBA::Octet o, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_octet ( o,IT_env);\ +}\ + \ +virtual CORBA::Short cube_short (CORBA::Short s, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_short ( s,IT_env);\ +}\ + \ +virtual CORBA::Long cube_long (CORBA::Long l, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_long ( l,IT_env);\ +}\ + \ +virtual Cubit::Many cube_struct (const Cubit::Many& values, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_struct ( values,IT_env);\ +}\ + \ +virtual Cubit::oneof cube_union (const Cubit::oneof& values, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_union ( values,IT_env);\ +}\ + \ +virtual void please_exit (CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->please_exit (IT_env);\ +}\ + \ + }; \ + + +#define QUALS_Cubit \ +virtual CORBA::Octet cube_octet (CORBA::Octet o, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_octet ( o,IT_env);\ +}\ + \ +virtual CORBA::Short cube_short (CORBA::Short s, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_short ( s,IT_env);\ +}\ + \ +virtual CORBA::Long cube_long (CORBA::Long l, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_long ( l,IT_env);\ +}\ + \ +virtual Many cube_struct (const Many& values, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_struct ( values,IT_env);\ +}\ + \ +virtual oneof cube_union (const oneof& values, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_union ( values,IT_env);\ +}\ + \ +virtual void please_exit (CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->please_exit (IT_env);\ +}\ + + + + +class CubitProxyFactoryClass : public virtual CORBA::ObjectFactoryClass { +public: + CubitProxyFactoryClass (unsigned char IT_p=0) + : CORBA::ProxyFactory (Cubit_IR, IT_p) {} + + virtual void* New (char *IT_OR, CORBA::Environment&); + + virtual void* New (ObjectReference *IT_OR, CORBA::Environment&); + + virtual void* New2 (); + + virtual CORBA::Object* NewObject (char *IT_OR, CORBA::Environment&); + + virtual CORBA::Object* NewObject (ObjectReference *IT_OR, CORBA::Environment&); + + virtual CORBA::Object* New2Object (); + + virtual void* IT_castUp (void *IT_p, char* IT_s, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + + virtual CORBA::PPTR* pptr (void *IT_p); + + virtual void baseInterfaces (_IDL_SEQUENCE_string&); + + +}; + +extern CubitProxyFactoryClass CubitProxyFactory; + +class CubitBOAImpl : public virtual Cubit { +public: + CubitBOAImpl (const char *m="", CORBA::LoaderClass *l=NULL) { + if (CORBA::PPTR::isOK (m_pptr, Cubit_IR)) + m_pptr = new Cubit_dispatch ( (Cubit*)this, + (CORBA::Object*)this, m, l, Cubit_IR, this); +} + + virtual CORBA::Octet cube_octet (CORBA::Octet o, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual CORBA::Short cube_short (CORBA::Short s, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual CORBA::Long cube_long (CORBA::Long l, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual Many cube_struct (const Many& values, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual oneof cube_union (const oneof& values, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual void please_exit (CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; +}; + + +#endif + + +#ifndef _Cubit_Factory_defined +#define _Cubit_Factory_defined +class Cubit_Factory_dispatch : public virtual CORBA::PPTR { +public: + + Cubit_Factory_dispatch (void *IT_p, CORBA::Object* IT_o, const char *IT_m, + CORBA::LoaderClass *IT_l, char *IT_i, void* IT_im) + : PPTR (IT_p,IT_o,IT_m,IT_l,IT_i,IT_im) {} + + + Cubit_Factory_dispatch (char *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Cubit_Factory_dispatch () {} + + Cubit_Factory_dispatch (ObjectReference *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Cubit_Factory_dispatch (void *IT_p, CORBA::Object *IT_o, const char *IT_m, + char *IT_i, CORBA::Object* IT_ob, void* IT_im) + : PPTR (IT_p,IT_o,IT_m,IT_i,IT_ob,IT_im) {} + + + virtual unsigned char dispatch (CORBA::Request &IT_r, + unsigned char IT_isTarget, void* IT_pp=NULL); + + +}; + +class Cubit_Factory; + +#ifndef Cubit_FactoryPtr +#define Cubit_FactoryPtr + +typedef Cubit_Factory* Cubit_Factory_ptr; + +typedef Cubit_Factory* Cubit_FactoryRef; + +#endif + + +#ifndef Cubit_FactoryForwH +#define Cubit_FactoryForwH +CORBA::ObjectRef Cubit_Factory_getBase (void *); +void Cubit_Factory_release (Cubit_Factory *, CORBA::Environment &IT_env); +void Cubit_Factory_release (Cubit_Factory_ptr); +Cubit_Factory* Cubit_Factory_duplicate (Cubit_Factory_ptr, CORBA::Environment &IT_env); +Cubit_Factory* Cubit_Factory_duplicate (Cubit_Factory_ptr ); +Cubit_Factory_ptr Cubit_Factory_nil (CORBA::Environment &IT_env); +Cubit_Factory_ptr Cubit_Factory_nil (); +#endif +#define Cubit_Factory_IMPL "Cubit_Factory" + + +class Cubit_Factory; + +typedef Cubit_Factory Cubit_FactoryProxy; +#define Cubit_Factory_IR "Cubit_Factory" +#define Cubit_Factory_IMPL "Cubit_Factory" + +#ifndef Cubit_FactoryPtr +#define Cubit_FactoryPtr + +typedef Cubit_Factory* Cubit_Factory_ptr; + +typedef Cubit_Factory* Cubit_FactoryRef; + +#endif + +class Cubit_Factory: public virtual CORBA::Object { +public: + Cubit_Factory (char *IT_OR); + Cubit_Factory (ObjectReference *IT_OR); + Cubit_Factory () : CORBA::Object (1) {} +protected: + Cubit_Factory_ptr __duplicate( + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) { + CORBA::Object::__duplicate (IT_env); + return this; + } +public: + static Cubit_Factory_ptr _duplicate( + Cubit_Factory_ptr, + CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()); +public: + static Cubit_Factory* _bind (const char* IT_markerServer, const char* host, + const CORBA::Context &IT_c, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit_Factory* _bind (CORBA::Environment &IT_env); + static Cubit_Factory* _bind (const char* IT_markerServer=NULL, const char* host=NULL, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit_Factory* _narrow (CORBA::Object* , CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit_Factory_ptr _nil (CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()) { + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + return (Cubit_Factory_ptr) CORBA::OBJECT_NIL;} + virtual Cubit_ptr create_cubit (const char * name, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); +}; + +#ifndef Cubit_FactoryVarH +#define Cubit_FactoryVarH + +#ifndef Cubit_FactoryvPtr +#define Cubit_FactoryvPtr +typedef Cubit_Factory* Cubit_Factory_vPtr; +typedef const Cubit_Factory* Cubit_Factory_cvPtr; +#endif + +class Cubit_Factory_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const Cubit_Factory_var &IT_s) { + { + _ptr = Cubit_Factory_duplicate (IT_s._ptr); + } + return 1; + } + + public: + + Cubit_Factory_var (const Cubit_Factory_var &IT_s) { + (void) copyHelper (IT_s); + } + + Cubit_Factory_var () { + _ptr = Cubit_Factory_nil (); + } + + Cubit_Factory_var (Cubit_Factory *IT_p) { + _ptr = IT_p; + } + + Cubit_Factory_var &operator= (Cubit_Factory *IT_p) { + Cubit_Factory_release (_ptr); + _ptr = IT_p; + return (*this); + } + + Cubit_Factory_var &operator= (const Cubit_Factory_var &IT_s) { + Cubit_Factory_release (_ptr); + _ptr = Cubit_Factory_duplicate (IT_s._ptr); + return (*this); + } + + ~Cubit_Factory_var () { + Cubit_Factory_release (_ptr); + } + + Cubit_Factory* operator-> () { + return _ptr; + } + + operator Cubit_Factory_cvPtr () const { return _ptr;} + operator Cubit_Factory_vPtr& () { return _ptr;} + + protected: + Cubit_Factory *_ptr; + private: + Cubit_Factory_var &operator= (const CORBA::_var &IT_s); + Cubit_Factory_var (const CORBA::_var &IT_s); + Cubit_Factory_var &operator= (const CORBA::_mgr &IT_s); + Cubit_Factory_var &operator= (const CORBA::_SeqElem &IT_s); + Cubit_Factory_var (const CORBA::_mgr &IT_s); + Cubit_Factory_var (const CORBA::_SeqElem &IT_s); +}; + +#endif + + +#ifndef Cubit_FactoryMgrH +#define Cubit_FactoryMgrH + +class Cubit_Factory_mgr : public CORBA::_mgr +{ + public: + + Cubit_Factory_mgr () { + _ptr = Cubit_Factory_nil (); + _release = 1; + } + + Cubit_Factory_mgr (const Cubit_Factory_mgr &IT_s) { + _ptr = Cubit_Factory_duplicate (IT_s._ptr); + _release = 1; + } + + Cubit_Factory_mgr &operator= (Cubit_Factory *IT_p) { + if (_ptr && _release) + Cubit_Factory_release (_ptr); + _ptr = IT_p; + _release = 1; + return (*this); + } + + Cubit_Factory_mgr &operator= (const Cubit_Factory_mgr &IT_s) { + if (_ptr && _release) + Cubit_Factory_release (_ptr); + _ptr = Cubit_Factory_duplicate(IT_s._ptr); + _release = 1; + return (*this); + } + + Cubit_Factory_mgr &operator= (Cubit_Factory_var &IT_s) { + if (_ptr && _release) + Cubit_Factory_release (_ptr); + _ptr = Cubit_Factory_duplicate(IT_s); + _release = 1; + return (*this); + } + + ~Cubit_Factory_mgr () { + if (_release) + Cubit_Factory_release (_ptr); + } + + unsigned char release () { + return _release; + } + + void release (unsigned char rel) { + _release = rel; + } + + operator int () const { + return (((CORBA::Object_ptr) _ptr) ? 1 : 0); + } + + operator void* () const { + return _ptr; + } + + operator CORBA::Object * () const { + return (CORBA::Object *) _ptr; + } + + operator Cubit_Factory* () const { + return (Cubit_Factory*) _ptr; + } + + Cubit_Factory_ptr operator-> () const { + return _ptr; + } + + Cubit_Factory *_ptr; + + protected: + + unsigned char _release; +}; + +typedef Cubit_Factory_mgr Cubit_Factory_mgr_IT_const; +#endif + +#ifndef Cubit_FactorySeqElemH +#define Cubit_FactorySeqElemH + +class Cubit_Factory_SeqElem : public CORBA::_SeqElem +{ + public: + + Cubit_Factory_SeqElem (Cubit_Factory_ptr* IT_p, unsigned char rel) { + _ptr = IT_p; + _release = rel; + } + + Cubit_Factory_SeqElem &operator= (Cubit_Factory_ptr IT_p) { + if (_ptr) { + if (*(_ptr) && _release) + Cubit_Factory_release (*(_ptr)); + *(_ptr) = IT_p; + } + return (*this); + } + + Cubit_Factory_SeqElem &operator= (const Cubit_Factory_SeqElem &IT_s) { + if (_ptr && IT_s._ptr) { + if (*(_ptr) && _release) + Cubit_Factory_release (*(_ptr)); + *(_ptr) = Cubit_Factory_duplicate(*(IT_s._ptr)); + } + return (*this); + } + + operator Cubit_Factory_ptr () const { + return _ptr ? (Cubit_Factory_ptr) (*_ptr) : Cubit_Factory_nil(); + } + + Cubit_Factory_ptr operator->() const { return *_ptr;} + + protected: + Cubit_Factory_ptr *_ptr; + unsigned char _release; +}; + +#endif + + +#define TIE_Cubit_Factory(X) Cubit_Factory##X + +#define DEF_TIE_Cubit_Factory(X) \ + class Cubit_Factory##X : public virtual Cubit_Factory { \ + X* m_obj; \ + public: \ + \ + \ + Cubit_Factory##X (X *objp, const char* m="", CORBA::LoaderClass *l=0)\ + : Cubit_Factory(), m_obj(objp) { \ + m_pptr = new Cubit_Factory_dispatch \ + (( Cubit_Factory*)this,(CORBA::Object*)this,m,l,Cubit_Factory_IR,m_obj); \ + } \ + Cubit_Factory##X (CORBA::Object *IT_p, const char* IT_m="", void *IT_q=0)\ + : Cubit_Factory() { \ + m_pptr = new Cubit_Factory_dispatch \ + (( Cubit_Factory*)this,(CORBA::Object*)this,IT_m,Cubit_Factory_IR,IT_p,IT_q); \ + m_obj = (X*)(m_pptr->getImplObj ()); \ + } \ + \ + virtual ~Cubit_Factory##X () { \ + if (_okToDeleteImpl ()) delete m_obj; } \ + virtual void* _deref () { \ + return m_obj; } \ + \ +virtual Cubit_ptr create_cubit (const char * name, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->create_cubit ( name,IT_env);\ +}\ + \ + }; \ + + +#define QUALS_Cubit_Factory \ +virtual Cubit_ptr create_cubit (const char * name, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->create_cubit ( name,IT_env);\ +}\ + + + + +class Cubit_FactoryProxyFactoryClass : public virtual CORBA::ObjectFactoryClass { +public: + Cubit_FactoryProxyFactoryClass (unsigned char IT_p=0) + : CORBA::ProxyFactory (Cubit_Factory_IR, IT_p) {} + + virtual void* New (char *IT_OR, CORBA::Environment&); + + virtual void* New (ObjectReference *IT_OR, CORBA::Environment&); + + virtual void* New2 (); + + virtual CORBA::Object* NewObject (char *IT_OR, CORBA::Environment&); + + virtual CORBA::Object* NewObject (ObjectReference *IT_OR, CORBA::Environment&); + + virtual CORBA::Object* New2Object (); + + virtual void* IT_castUp (void *IT_p, char* IT_s, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + + virtual CORBA::PPTR* pptr (void *IT_p); + + virtual void baseInterfaces (_IDL_SEQUENCE_string&); + + +}; + +extern Cubit_FactoryProxyFactoryClass Cubit_FactoryProxyFactory; + +class Cubit_FactoryBOAImpl : public virtual Cubit_Factory { +public: + Cubit_FactoryBOAImpl (const char *m="", CORBA::LoaderClass *l=NULL) { + if (CORBA::PPTR::isOK (m_pptr, Cubit_Factory_IR)) + m_pptr = new Cubit_Factory_dispatch ( (Cubit_Factory*)this, + (CORBA::Object*)this, m, l, Cubit_Factory_IR, this); +} + + virtual Cubit_ptr create_cubit (const char * name, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; +}; + + +#endif + + +#endif diff --git a/TAO/tests/Cubit/Orbix/factory_client/cubit.hh b/TAO/tests/Cubit/Orbix/factory_client/cubit.hh new file mode 100644 index 00000000000..72e2fb81395 --- /dev/null +++ b/TAO/tests/Cubit/Orbix/factory_client/cubit.hh @@ -0,0 +1,1111 @@ + +#ifndef cubit_hh +#define cubit_hh + +#include <CORBA.h> + +#include <string.h> + + +#ifndef _Cubit_defined +#define _Cubit_defined +class Cubit_dispatch : public virtual CORBA::PPTR { +public: + + Cubit_dispatch (void *IT_p, CORBA::Object* IT_o, const char *IT_m, + CORBA::LoaderClass *IT_l, char *IT_i, void* IT_im) + : PPTR (IT_p,IT_o,IT_m,IT_l,IT_i,IT_im) {} + + + Cubit_dispatch (char *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Cubit_dispatch () {} + + Cubit_dispatch (ObjectReference *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Cubit_dispatch (void *IT_p, CORBA::Object *IT_o, const char *IT_m, + char *IT_i, CORBA::Object* IT_ob, void* IT_im) + : PPTR (IT_p,IT_o,IT_m,IT_i,IT_ob,IT_im) {} + + + virtual unsigned char dispatch (CORBA::Request &IT_r, + unsigned char IT_isTarget, void* IT_pp=NULL); + + +}; + +class Cubit; + +#ifndef CubitPtr +#define CubitPtr + +typedef Cubit* Cubit_ptr; + +typedef Cubit* CubitRef; + +#endif + + +#ifndef CubitForwH +#define CubitForwH +CORBA::ObjectRef Cubit_getBase (void *); +void Cubit_release (Cubit *, CORBA::Environment &IT_env); +void Cubit_release (Cubit_ptr); +Cubit* Cubit_duplicate (Cubit_ptr, CORBA::Environment &IT_env); +Cubit* Cubit_duplicate (Cubit_ptr ); +Cubit_ptr Cubit_nil (CORBA::Environment &IT_env); +Cubit_ptr Cubit_nil (); +#endif +#define Cubit_IMPL "Cubit" + + +class Cubit; + +typedef Cubit CubitProxy; +#define Cubit_IR "Cubit$v1.1" +#define Cubit_IMPL "Cubit" + +#ifndef CubitPtr +#define CubitPtr + +typedef Cubit* Cubit_ptr; + +typedef Cubit* CubitRef; + +#endif + +class Cubit: public virtual CORBA::Object { +public: + Cubit (char *IT_OR); + Cubit (ObjectReference *IT_OR); + Cubit () : CORBA::Object (1) {} +protected: + Cubit_ptr __duplicate( + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) { + CORBA::Object::__duplicate (IT_env); + return this; + } +public: + static Cubit_ptr _duplicate( + Cubit_ptr, + CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()); +public: + static Cubit* _bind (const char* IT_markerServer, const char* host, + const CORBA::Context &IT_c, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit* _bind (CORBA::Environment &IT_env); + static Cubit* _bind (const char* IT_markerServer=NULL, const char* host=NULL, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit* _narrow (CORBA::Object* , CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit_ptr _nil (CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()) { + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + return (Cubit_ptr) CORBA::OBJECT_NIL;} + +#ifndef Cubit_Many_defined +#define Cubit_Many_defined + +struct Many { + CORBA::Octet o; + CORBA::Long l; + CORBA::Short s; + + void encodeOp (CORBA::Request &IT_r) const; + void decodeOp (CORBA::Request &IT_r); + void decodeInOutOp (CORBA::Request &IT_r); + Many(const Many &); + Many(); + ~Many(); + Many& operator= (const Many&); +}; + +#ifndef Cubit_ManyVarH +#define Cubit_ManyVarH + +#ifndef Cubit_ManyvPtr +#define Cubit_ManyvPtr +typedef Many* Many_vPtr; +typedef const Many* Many_cvPtr; +#endif + +class Many_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const Many_var &IT_s) { + if (!IT_s._ptr) { + _ptr = IT_s._ptr; + } else + { + _ptr = new Many; + *(_ptr) = *(IT_s._ptr); + } + return 1; + } + + public: + + Many_var (const Many_var &IT_s) { + (void) copyHelper (IT_s); + } + + Many_var () { + _ptr = new Many; +; + } + + Many_var (Many *IT_p) { + _ptr = IT_p; + } + + Many_var &operator= (Many *IT_p) { + if (_ptr != IT_p) { + delete _ptr; + } + _ptr = IT_p; + return (*this); + } + + Many_var &operator= (const Many_var &IT_s) { + if (_ptr != IT_s._ptr) { + delete _ptr; + } + _ptr = new Many; + *(_ptr) = *(IT_s._ptr); + return (*this); + } + + ~Many_var () { + delete _ptr; + } + + Many* operator-> () { + return _ptr; + } + + operator Many_cvPtr () const { return _ptr;} + operator Many_vPtr& () { return _ptr;} + operator Many& () const { return * _ptr;} + + protected: + Many *_ptr; + private: + Many_var &operator= (const CORBA::_var &IT_s); + Many_var (const CORBA::_var &IT_s); +}; + +#endif + + +#endif + +enum discrim {e_0th,e_1st,e_2nd,e_3rd,e_4th,e_5th, IT__ENUM_Cubit_discrim=CORBA_ULONG_MAX}; + +#ifndef Cubit_oneof_defined +#define Cubit_oneof_defined + +struct oneof { + private: + + discrim __d; + union { + CORBA::Octet _o_; + CORBA::Short _s_; + CORBA::Long _l_; + Many * _cm_; + }; + + public: + + void encodeOp (CORBA::Request &IT_r) const; + void decodeOp (CORBA::Request &IT_r); + void decodeInOutOp (CORBA::Request &IT_r); + + private: + + unsigned char isSet; + + public: + + discrim _d () const { return __d; } + + CORBA::Octet o () const { + return _o_; + } + + void o (CORBA::Octet IT_member) { + if (isSet && (__d != Cubit::e_0th)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = Cubit::e_0th; + isSet = 1; + _o_ = IT_member; + } + + CORBA::Short s () const { + return _s_; + } + + void s (CORBA::Short IT_member) { + if (isSet && (__d != Cubit::e_1st)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = Cubit::e_1st; + isSet = 1; + _s_ = IT_member; + } + + CORBA::Long l () const { + return _l_; + } + + void l (CORBA::Long IT_member) { + if (isSet && (__d != Cubit::e_2nd)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = Cubit::e_2nd; + isSet = 1; + _l_ = IT_member; + } + + Many& cm () { + return (*_cm_); + } + + const Many& cm () const { + return (*_cm_); + } + + void cm (const Many& IT_member) { + if (isSet && (__d != Cubit::e_3rd)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = Cubit::e_3rd; + + if (!isSet) { + _cm_ = new Many; + isSet = 1; + } + *(_cm_) = IT_member; + } + + + oneof(); + oneof(const oneof &); + ~oneof(); + oneof& operator= (const oneof&); +}; + +#ifndef Cubit_oneofVarH +#define Cubit_oneofVarH + +#ifndef Cubit_oneofvPtr +#define Cubit_oneofvPtr +typedef oneof* oneof_vPtr; +typedef const oneof* oneof_cvPtr; +#endif + +class oneof_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const oneof_var &IT_s) { + if (!IT_s._ptr) { + _ptr = IT_s._ptr; + } else + { + _ptr = new oneof; + *(_ptr) = *(IT_s._ptr); + } + return 1; + } + + public: + + oneof_var (const oneof_var &IT_s) { + (void) copyHelper (IT_s); + } + + oneof_var () { + _ptr = NULL; + } + + oneof_var (oneof *IT_p) { + _ptr = IT_p; + } + + oneof_var &operator= (oneof *IT_p) { + if (_ptr != IT_p) { + delete _ptr; + } + _ptr = IT_p; + return (*this); + } + + oneof_var &operator= (const oneof_var &IT_s) { + if (_ptr != IT_s._ptr) { + delete _ptr; + } + _ptr = new oneof; + *(_ptr) = *(IT_s._ptr); + return (*this); + } + + ~oneof_var () { + delete _ptr; + } + + oneof* operator-> () { + return _ptr; + } + + operator oneof_cvPtr () const { return _ptr;} + operator oneof_vPtr& () { return _ptr;} + operator oneof& () const { return * _ptr;} + + protected: + oneof *_ptr; + private: + oneof_var &operator= (const CORBA::_var &IT_s); + oneof_var (const CORBA::_var &IT_s); +}; + +#endif + + +#endif + virtual CORBA::Octet cube_octet (CORBA::Octet o, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual CORBA::Short cube_short (CORBA::Short s, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual CORBA::Long cube_long (CORBA::Long l, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual Many cube_struct (const Many& values, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual oneof cube_union (const oneof& values, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual void please_exit (CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); +}; + +#ifndef CubitVarH +#define CubitVarH + +#ifndef CubitvPtr +#define CubitvPtr +typedef Cubit* Cubit_vPtr; +typedef const Cubit* Cubit_cvPtr; +#endif + +class Cubit_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const Cubit_var &IT_s) { + { + _ptr = Cubit_duplicate (IT_s._ptr); + } + return 1; + } + + public: + + Cubit_var (const Cubit_var &IT_s) { + (void) copyHelper (IT_s); + } + + Cubit_var () { + _ptr = Cubit_nil (); + } + + Cubit_var (Cubit *IT_p) { + _ptr = IT_p; + } + + Cubit_var &operator= (Cubit *IT_p) { + Cubit_release (_ptr); + _ptr = IT_p; + return (*this); + } + + Cubit_var &operator= (const Cubit_var &IT_s) { + Cubit_release (_ptr); + _ptr = Cubit_duplicate (IT_s._ptr); + return (*this); + } + + ~Cubit_var () { + Cubit_release (_ptr); + } + + Cubit* operator-> () { + return _ptr; + } + + operator Cubit_cvPtr () const { return _ptr;} + operator Cubit_vPtr& () { return _ptr;} + + protected: + Cubit *_ptr; + private: + Cubit_var &operator= (const CORBA::_var &IT_s); + Cubit_var (const CORBA::_var &IT_s); + Cubit_var &operator= (const CORBA::_mgr &IT_s); + Cubit_var &operator= (const CORBA::_SeqElem &IT_s); + Cubit_var (const CORBA::_mgr &IT_s); + Cubit_var (const CORBA::_SeqElem &IT_s); +}; + +#endif + + +#ifndef CubitMgrH +#define CubitMgrH + +class Cubit_mgr : public CORBA::_mgr +{ + public: + + Cubit_mgr () { + _ptr = Cubit_nil (); + _release = 1; + } + + Cubit_mgr (const Cubit_mgr &IT_s) { + _ptr = Cubit_duplicate (IT_s._ptr); + _release = 1; + } + + Cubit_mgr &operator= (Cubit *IT_p) { + if (_ptr && _release) + Cubit_release (_ptr); + _ptr = IT_p; + _release = 1; + return (*this); + } + + Cubit_mgr &operator= (const Cubit_mgr &IT_s) { + if (_ptr && _release) + Cubit_release (_ptr); + _ptr = Cubit_duplicate(IT_s._ptr); + _release = 1; + return (*this); + } + + Cubit_mgr &operator= (Cubit_var &IT_s) { + if (_ptr && _release) + Cubit_release (_ptr); + _ptr = Cubit_duplicate(IT_s); + _release = 1; + return (*this); + } + + ~Cubit_mgr () { + if (_release) + Cubit_release (_ptr); + } + + unsigned char release () { + return _release; + } + + void release (unsigned char rel) { + _release = rel; + } + + operator int () const { + return (((CORBA::Object_ptr) _ptr) ? 1 : 0); + } + + operator void* () const { + return _ptr; + } + + operator CORBA::Object * () const { + return (CORBA::Object *) _ptr; + } + + operator Cubit* () const { + return (Cubit*) _ptr; + } + + Cubit_ptr operator-> () const { + return _ptr; + } + + Cubit *_ptr; + + protected: + + unsigned char _release; +}; + +typedef Cubit_mgr Cubit_mgr_IT_const; +#endif + +#ifndef CubitSeqElemH +#define CubitSeqElemH + +class Cubit_SeqElem : public CORBA::_SeqElem +{ + public: + + Cubit_SeqElem (Cubit_ptr* IT_p, unsigned char rel) { + _ptr = IT_p; + _release = rel; + } + + Cubit_SeqElem &operator= (Cubit_ptr IT_p) { + if (_ptr) { + if (*(_ptr) && _release) + Cubit_release (*(_ptr)); + *(_ptr) = IT_p; + } + return (*this); + } + + Cubit_SeqElem &operator= (const Cubit_SeqElem &IT_s) { + if (_ptr && IT_s._ptr) { + if (*(_ptr) && _release) + Cubit_release (*(_ptr)); + *(_ptr) = Cubit_duplicate(*(IT_s._ptr)); + } + return (*this); + } + + operator Cubit_ptr () const { + return _ptr ? (Cubit_ptr) (*_ptr) : Cubit_nil(); + } + + Cubit_ptr operator->() const { return *_ptr;} + + protected: + Cubit_ptr *_ptr; + unsigned char _release; +}; + +#endif + + +#define TIE_Cubit(X) Cubit##X + +#define DEF_TIE_Cubit(X) \ + class Cubit##X : public virtual Cubit { \ + X* m_obj; \ + public: \ + \ + \ + Cubit##X (X *objp, const char* m="", CORBA::LoaderClass *l=0)\ + : Cubit(), m_obj(objp) { \ + m_pptr = new Cubit_dispatch \ + (( Cubit*)this,(CORBA::Object*)this,m,l,Cubit_IR,m_obj); \ + } \ + Cubit##X (CORBA::Object *IT_p, const char* IT_m="", void *IT_q=0)\ + : Cubit() { \ + m_pptr = new Cubit_dispatch \ + (( Cubit*)this,(CORBA::Object*)this,IT_m,Cubit_IR,IT_p,IT_q); \ + m_obj = (X*)(m_pptr->getImplObj ()); \ + } \ + \ + virtual ~Cubit##X () { \ + if (_okToDeleteImpl ()) delete m_obj; } \ + virtual void* _deref () { \ + return m_obj; } \ + \ +virtual CORBA::Octet cube_octet (CORBA::Octet o, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_octet ( o,IT_env);\ +}\ + \ +virtual CORBA::Short cube_short (CORBA::Short s, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_short ( s,IT_env);\ +}\ + \ +virtual CORBA::Long cube_long (CORBA::Long l, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_long ( l,IT_env);\ +}\ + \ +virtual Cubit::Many cube_struct (const Cubit::Many& values, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_struct ( values,IT_env);\ +}\ + \ +virtual Cubit::oneof cube_union (const Cubit::oneof& values, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_union ( values,IT_env);\ +}\ + \ +virtual void please_exit (CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->please_exit (IT_env);\ +}\ + \ + }; \ + + +#define QUALS_Cubit \ +virtual CORBA::Octet cube_octet (CORBA::Octet o, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_octet ( o,IT_env);\ +}\ + \ +virtual CORBA::Short cube_short (CORBA::Short s, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_short ( s,IT_env);\ +}\ + \ +virtual CORBA::Long cube_long (CORBA::Long l, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_long ( l,IT_env);\ +}\ + \ +virtual Many cube_struct (const Many& values, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_struct ( values,IT_env);\ +}\ + \ +virtual oneof cube_union (const oneof& values, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->cube_union ( values,IT_env);\ +}\ + \ +virtual void please_exit (CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->please_exit (IT_env);\ +}\ + + + + +class CubitProxyFactoryClass : public virtual CORBA::ObjectFactoryClass { +public: + CubitProxyFactoryClass (unsigned char IT_p=0) + : CORBA::ProxyFactory (Cubit_IR, IT_p) {} + + virtual void* New (char *IT_OR, CORBA::Environment&); + + virtual void* New (ObjectReference *IT_OR, CORBA::Environment&); + + virtual void* New2 (); + + virtual CORBA::Object* NewObject (char *IT_OR, CORBA::Environment&); + + virtual CORBA::Object* NewObject (ObjectReference *IT_OR, CORBA::Environment&); + + virtual CORBA::Object* New2Object (); + + virtual void* IT_castUp (void *IT_p, char* IT_s, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + + virtual CORBA::PPTR* pptr (void *IT_p); + + virtual void baseInterfaces (_IDL_SEQUENCE_string&); + + +}; + +extern CubitProxyFactoryClass CubitProxyFactory; + +class CubitBOAImpl : public virtual Cubit { +public: + CubitBOAImpl (const char *m="", CORBA::LoaderClass *l=NULL) { + if (CORBA::PPTR::isOK (m_pptr, Cubit_IR)) + m_pptr = new Cubit_dispatch ( (Cubit*)this, + (CORBA::Object*)this, m, l, Cubit_IR, this); +} + + virtual CORBA::Octet cube_octet (CORBA::Octet o, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual CORBA::Short cube_short (CORBA::Short s, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual CORBA::Long cube_long (CORBA::Long l, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual Many cube_struct (const Many& values, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual oneof cube_union (const oneof& values, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual void please_exit (CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; +}; + + +#endif + + +#ifndef _Cubit_Factory_defined +#define _Cubit_Factory_defined +class Cubit_Factory_dispatch : public virtual CORBA::PPTR { +public: + + Cubit_Factory_dispatch (void *IT_p, CORBA::Object* IT_o, const char *IT_m, + CORBA::LoaderClass *IT_l, char *IT_i, void* IT_im) + : PPTR (IT_p,IT_o,IT_m,IT_l,IT_i,IT_im) {} + + + Cubit_Factory_dispatch (char *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Cubit_Factory_dispatch () {} + + Cubit_Factory_dispatch (ObjectReference *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Cubit_Factory_dispatch (void *IT_p, CORBA::Object *IT_o, const char *IT_m, + char *IT_i, CORBA::Object* IT_ob, void* IT_im) + : PPTR (IT_p,IT_o,IT_m,IT_i,IT_ob,IT_im) {} + + + virtual unsigned char dispatch (CORBA::Request &IT_r, + unsigned char IT_isTarget, void* IT_pp=NULL); + + +}; + +class Cubit_Factory; + +#ifndef Cubit_FactoryPtr +#define Cubit_FactoryPtr + +typedef Cubit_Factory* Cubit_Factory_ptr; + +typedef Cubit_Factory* Cubit_FactoryRef; + +#endif + + +#ifndef Cubit_FactoryForwH +#define Cubit_FactoryForwH +CORBA::ObjectRef Cubit_Factory_getBase (void *); +void Cubit_Factory_release (Cubit_Factory *, CORBA::Environment &IT_env); +void Cubit_Factory_release (Cubit_Factory_ptr); +Cubit_Factory* Cubit_Factory_duplicate (Cubit_Factory_ptr, CORBA::Environment &IT_env); +Cubit_Factory* Cubit_Factory_duplicate (Cubit_Factory_ptr ); +Cubit_Factory_ptr Cubit_Factory_nil (CORBA::Environment &IT_env); +Cubit_Factory_ptr Cubit_Factory_nil (); +#endif +#define Cubit_Factory_IMPL "Cubit_Factory" + + +class Cubit_Factory; + +typedef Cubit_Factory Cubit_FactoryProxy; +#define Cubit_Factory_IR "Cubit_Factory" +#define Cubit_Factory_IMPL "Cubit_Factory" + +#ifndef Cubit_FactoryPtr +#define Cubit_FactoryPtr + +typedef Cubit_Factory* Cubit_Factory_ptr; + +typedef Cubit_Factory* Cubit_FactoryRef; + +#endif + +class Cubit_Factory: public virtual CORBA::Object { +public: + Cubit_Factory (char *IT_OR); + Cubit_Factory (ObjectReference *IT_OR); + Cubit_Factory () : CORBA::Object (1) {} +protected: + Cubit_Factory_ptr __duplicate( + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) { + CORBA::Object::__duplicate (IT_env); + return this; + } +public: + static Cubit_Factory_ptr _duplicate( + Cubit_Factory_ptr, + CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()); +public: + static Cubit_Factory* _bind (const char* IT_markerServer, const char* host, + const CORBA::Context &IT_c, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit_Factory* _bind (CORBA::Environment &IT_env); + static Cubit_Factory* _bind (const char* IT_markerServer=NULL, const char* host=NULL, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit_Factory* _narrow (CORBA::Object* , CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Cubit_Factory_ptr _nil (CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()) { + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + return (Cubit_Factory_ptr) CORBA::OBJECT_NIL;} + virtual Cubit_ptr create_cubit (const char * name, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); +}; + +#ifndef Cubit_FactoryVarH +#define Cubit_FactoryVarH + +#ifndef Cubit_FactoryvPtr +#define Cubit_FactoryvPtr +typedef Cubit_Factory* Cubit_Factory_vPtr; +typedef const Cubit_Factory* Cubit_Factory_cvPtr; +#endif + +class Cubit_Factory_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const Cubit_Factory_var &IT_s) { + { + _ptr = Cubit_Factory_duplicate (IT_s._ptr); + } + return 1; + } + + public: + + Cubit_Factory_var (const Cubit_Factory_var &IT_s) { + (void) copyHelper (IT_s); + } + + Cubit_Factory_var () { + _ptr = Cubit_Factory_nil (); + } + + Cubit_Factory_var (Cubit_Factory *IT_p) { + _ptr = IT_p; + } + + Cubit_Factory_var &operator= (Cubit_Factory *IT_p) { + Cubit_Factory_release (_ptr); + _ptr = IT_p; + return (*this); + } + + Cubit_Factory_var &operator= (const Cubit_Factory_var &IT_s) { + Cubit_Factory_release (_ptr); + _ptr = Cubit_Factory_duplicate (IT_s._ptr); + return (*this); + } + + ~Cubit_Factory_var () { + Cubit_Factory_release (_ptr); + } + + Cubit_Factory* operator-> () { + return _ptr; + } + + operator Cubit_Factory_cvPtr () const { return _ptr;} + operator Cubit_Factory_vPtr& () { return _ptr;} + + protected: + Cubit_Factory *_ptr; + private: + Cubit_Factory_var &operator= (const CORBA::_var &IT_s); + Cubit_Factory_var (const CORBA::_var &IT_s); + Cubit_Factory_var &operator= (const CORBA::_mgr &IT_s); + Cubit_Factory_var &operator= (const CORBA::_SeqElem &IT_s); + Cubit_Factory_var (const CORBA::_mgr &IT_s); + Cubit_Factory_var (const CORBA::_SeqElem &IT_s); +}; + +#endif + + +#ifndef Cubit_FactoryMgrH +#define Cubit_FactoryMgrH + +class Cubit_Factory_mgr : public CORBA::_mgr +{ + public: + + Cubit_Factory_mgr () { + _ptr = Cubit_Factory_nil (); + _release = 1; + } + + Cubit_Factory_mgr (const Cubit_Factory_mgr &IT_s) { + _ptr = Cubit_Factory_duplicate (IT_s._ptr); + _release = 1; + } + + Cubit_Factory_mgr &operator= (Cubit_Factory *IT_p) { + if (_ptr && _release) + Cubit_Factory_release (_ptr); + _ptr = IT_p; + _release = 1; + return (*this); + } + + Cubit_Factory_mgr &operator= (const Cubit_Factory_mgr &IT_s) { + if (_ptr && _release) + Cubit_Factory_release (_ptr); + _ptr = Cubit_Factory_duplicate(IT_s._ptr); + _release = 1; + return (*this); + } + + Cubit_Factory_mgr &operator= (Cubit_Factory_var &IT_s) { + if (_ptr && _release) + Cubit_Factory_release (_ptr); + _ptr = Cubit_Factory_duplicate(IT_s); + _release = 1; + return (*this); + } + + ~Cubit_Factory_mgr () { + if (_release) + Cubit_Factory_release (_ptr); + } + + unsigned char release () { + return _release; + } + + void release (unsigned char rel) { + _release = rel; + } + + operator int () const { + return (((CORBA::Object_ptr) _ptr) ? 1 : 0); + } + + operator void* () const { + return _ptr; + } + + operator CORBA::Object * () const { + return (CORBA::Object *) _ptr; + } + + operator Cubit_Factory* () const { + return (Cubit_Factory*) _ptr; + } + + Cubit_Factory_ptr operator-> () const { + return _ptr; + } + + Cubit_Factory *_ptr; + + protected: + + unsigned char _release; +}; + +typedef Cubit_Factory_mgr Cubit_Factory_mgr_IT_const; +#endif + +#ifndef Cubit_FactorySeqElemH +#define Cubit_FactorySeqElemH + +class Cubit_Factory_SeqElem : public CORBA::_SeqElem +{ + public: + + Cubit_Factory_SeqElem (Cubit_Factory_ptr* IT_p, unsigned char rel) { + _ptr = IT_p; + _release = rel; + } + + Cubit_Factory_SeqElem &operator= (Cubit_Factory_ptr IT_p) { + if (_ptr) { + if (*(_ptr) && _release) + Cubit_Factory_release (*(_ptr)); + *(_ptr) = IT_p; + } + return (*this); + } + + Cubit_Factory_SeqElem &operator= (const Cubit_Factory_SeqElem &IT_s) { + if (_ptr && IT_s._ptr) { + if (*(_ptr) && _release) + Cubit_Factory_release (*(_ptr)); + *(_ptr) = Cubit_Factory_duplicate(*(IT_s._ptr)); + } + return (*this); + } + + operator Cubit_Factory_ptr () const { + return _ptr ? (Cubit_Factory_ptr) (*_ptr) : Cubit_Factory_nil(); + } + + Cubit_Factory_ptr operator->() const { return *_ptr;} + + protected: + Cubit_Factory_ptr *_ptr; + unsigned char _release; +}; + +#endif + + +#define TIE_Cubit_Factory(X) Cubit_Factory##X + +#define DEF_TIE_Cubit_Factory(X) \ + class Cubit_Factory##X : public virtual Cubit_Factory { \ + X* m_obj; \ + public: \ + \ + \ + Cubit_Factory##X (X *objp, const char* m="", CORBA::LoaderClass *l=0)\ + : Cubit_Factory(), m_obj(objp) { \ + m_pptr = new Cubit_Factory_dispatch \ + (( Cubit_Factory*)this,(CORBA::Object*)this,m,l,Cubit_Factory_IR,m_obj); \ + } \ + Cubit_Factory##X (CORBA::Object *IT_p, const char* IT_m="", void *IT_q=0)\ + : Cubit_Factory() { \ + m_pptr = new Cubit_Factory_dispatch \ + (( Cubit_Factory*)this,(CORBA::Object*)this,IT_m,Cubit_Factory_IR,IT_p,IT_q); \ + m_obj = (X*)(m_pptr->getImplObj ()); \ + } \ + \ + virtual ~Cubit_Factory##X () { \ + if (_okToDeleteImpl ()) delete m_obj; } \ + virtual void* _deref () { \ + return m_obj; } \ + \ +virtual Cubit_ptr create_cubit (const char * name, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->create_cubit ( name,IT_env);\ +}\ + \ + }; \ + + +#define QUALS_Cubit_Factory \ +virtual Cubit_ptr create_cubit (const char * name, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +return m_obj->create_cubit ( name,IT_env);\ +}\ + + + + +class Cubit_FactoryProxyFactoryClass : public virtual CORBA::ObjectFactoryClass { +public: + Cubit_FactoryProxyFactoryClass (unsigned char IT_p=0) + : CORBA::ProxyFactory (Cubit_Factory_IR, IT_p) {} + + virtual void* New (char *IT_OR, CORBA::Environment&); + + virtual void* New (ObjectReference *IT_OR, CORBA::Environment&); + + virtual void* New2 (); + + virtual CORBA::Object* NewObject (char *IT_OR, CORBA::Environment&); + + virtual CORBA::Object* NewObject (ObjectReference *IT_OR, CORBA::Environment&); + + virtual CORBA::Object* New2Object (); + + virtual void* IT_castUp (void *IT_p, char* IT_s, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + + virtual CORBA::PPTR* pptr (void *IT_p); + + virtual void baseInterfaces (_IDL_SEQUENCE_string&); + + +}; + +extern Cubit_FactoryProxyFactoryClass Cubit_FactoryProxyFactory; + +class Cubit_FactoryBOAImpl : public virtual Cubit_Factory { +public: + Cubit_FactoryBOAImpl (const char *m="", CORBA::LoaderClass *l=NULL) { + if (CORBA::PPTR::isOK (m_pptr, Cubit_Factory_IR)) + m_pptr = new Cubit_Factory_dispatch ( (Cubit_Factory*)this, + (CORBA::Object*)this, m, l, Cubit_Factory_IR, this); +} + + virtual Cubit_ptr create_cubit (const char * name, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; +}; + + +#endif + + +#endif diff --git a/TAO/tests/Cubit/Orbix/factory_client/cubit.idl b/TAO/tests/Cubit/Orbix/factory_client/cubit.idl new file mode 100644 index 00000000000..7dba408d0db --- /dev/null +++ b/TAO/tests/Cubit/Orbix/factory_client/cubit.idl @@ -0,0 +1,46 @@ +// @(#)cubit.idl 1.1 95/09/10 +// Copyright 1994-1995 by Sun Microsystems, Inc. + +#pragma prefix "Eng.SUN.COM" +#pragma version Cubit 1.1 + + interface Cubit { + octet cube_octet (in octet o); + short cube_short (in short s); + long cube_long (in long l); + + struct Many { + octet o; // + 3 bytes padding (normally) ... + long l; + short s; // + 2 bytes padding (normally) ... + }; + + Many cube_struct (in Many values); + + enum discrim {e_0th, e_1st, e_2nd, e_3rd, e_4th, e_5th}; + + union oneof + switch (discrim) { + // this is an easy union to interpret; no padding + // is needed between discriminant and value. + case e_0th: + octet o; + case e_1st: + short s; + case e_2nd: + long l; + case e_3rd: + default: + Many cm; + }; + + oneof cube_union (in oneof values); + + oneway void please_exit (); + }; + + + interface Cubit_Factory { + Cubit create_cubit (in string name); + }; + diff --git a/TAO/tests/Cubit/Orbix/factory_client/cubitC.cpp b/TAO/tests/Cubit/Orbix/factory_client/cubitC.cpp new file mode 100644 index 00000000000..c439fc4c800 --- /dev/null +++ b/TAO/tests/Cubit/Orbix/factory_client/cubitC.cpp @@ -0,0 +1,710 @@ + + +#include "cubit.h" + +Cubit::Cubit (char *IT_OR) { + m_pptr = new Cubit_dispatch (IT_OR, this,(CORBA::Object*)this); +} +Cubit::Cubit (ObjectReference *IT_OR) { + m_pptr = new Cubit_dispatch (IT_OR, this,(CORBA::Object*)this); +} + +#ifndef CubitForwC +#define CubitForwC +CORBA::ObjectRef Cubit_getBase(void *IT_p){ + return (Cubit*) IT_p;} + +void Cubit_release (Cubit_ptr IT_p, CORBA::Environment &IT_env) { + CORBA::release(IT_p, IT_env);} + +void Cubit_release (Cubit_ptr IT_p) { + Cubit_release (IT_p, CORBA::IT_chooseDefaultEnv ()); } + +Cubit_ptr Cubit_nil (CORBA::Environment &) { + return Cubit:: _nil ();} + +Cubit_ptr Cubit_nil () { + return Cubit_nil (CORBA::IT_chooseDefaultEnv ());} + +Cubit_ptr Cubit_duplicate (Cubit_ptr IT_p, CORBA::Environment &IT_env) { + return (Cubit::_duplicate(IT_p, IT_env)); } +Cubit_ptr Cubit_duplicate (Cubit_ptr IT_p) { + return Cubit_duplicate (IT_p, CORBA::IT_chooseDefaultEnv ()); } +#endif + +Cubit_ptr Cubit::_duplicate(Cubit_ptr obj, CORBA::Environment& IT_pEnv) { + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (!obj) { + return (obj); + } + Cubit_ptr IT_obj = obj->__duplicate (IT_env); + return IT_obj; +} + + + +Cubit* Cubit:: _bind (const char* IT_markerServer, const char* host, + const CORBA::Context &IT_c, + CORBA::Environment &IT_env) { + return (Cubit*)CORBA::Factory.New (IT_markerServer, IT_env, IT_c, host, + Cubit_IMPL, Cubit_IR); +} + + + +Cubit* Cubit:: _bind (CORBA::Environment &IT_env) { + return _bind (NULL,NULL,CORBA::Context(), IT_env); } + + +Cubit* Cubit:: _bind (const char* IT_markerServer, const char* host, + CORBA::Environment &IT_env) { + return _bind (IT_markerServer, host, CORBA::Context (), IT_env); } +Cubit* Cubit::_narrow (CORBA::Object* IT_obj, CORBA::Environment &IT_pEnv) { + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (CORBA::is_nil (IT_obj)) { + return Cubit:: _nil(); + } + + Cubit* IT_p = (Cubit*)CORBA::Object::_castDown (IT_obj, Cubit_IR, IT_env); + IT_p = IT_p ? IT_p->__duplicate(IT_env) : NULL; + if ((IT_env) &&(!strcmp(IT_env.exception()->id(), "CORBA::StExcep::BAD_PARAM")) && (((CORBA::BAD_PARAM*)IT_env.exception())-> minor() == NARROW_FAILED)) { + IT_env.exception_free(); + } + return IT_p; + } + + +#ifndef Cubit_Many_Ops +#define Cubit_Many_Ops + +void Cubit::Many:: encodeOp (CORBA::Request &IT_r) const { + + IT_r.insertOctet (o); + + IT_r << l; + + IT_r << s; +} + +void Cubit::Many:: decodeOp (CORBA::Request &IT_r) { + + IT_r.extractOctet (o); + + IT_r >> l; + + IT_r >> s; +} + +void Cubit::Many:: decodeInOutOp (CORBA::Request &IT_r) { + + IT_r.extractOctet (o); + + IT_r >> l; + + IT_r >> s; +} + +Cubit::Many ::~Many () { +} + +Cubit::Many:: Many (const Cubit::Many &IT_s) + { + o = IT_s.o; + l = IT_s.l; + s = IT_s.s; +} + +Cubit::Many:: Many () { +} + +Cubit::Many &Cubit::Many:: operator= (const Cubit::Many& IT_s) { + if (this == &IT_s) return *this; + o = IT_s.o; + l = IT_s.l; + s = IT_s.s; + return *this; +} + + +#endif + + +#ifndef Cubit_oneof_Ops +#define Cubit_oneof_Ops +void Cubit::oneof:: encodeOp (CORBA::Request &IT_r) const { + if (!isSet) return; + { + CORBA::ULong IT_0 = (CORBA::ULong) __d; + IT_r << IT_0; + } + switch (__d) { + case Cubit::e_0th: + IT_r.insertOctet (_o_); + break; + case Cubit::e_1st: + IT_r << _s_; + break; + case Cubit::e_2nd: + IT_r << _l_; + break; + case Cubit::e_3rd: + default: + (*_cm_).encodeOp (IT_r); + break; + } + +} + +void Cubit::oneof:: decodeOp (CORBA::Request &IT_r) { + isSet = 0; + { + CORBA::ULong IT_1; + IT_r >> IT_1; + __d = Cubit::discrim(IT_1); + } + switch (__d) { + case Cubit::e_0th: + if (!isSet) { + isSet = 1; + } + IT_r.extractOctet (_o_); + break; + case Cubit::e_1st: + if (!isSet) { + isSet = 1; + } + IT_r >> _s_; + break; + case Cubit::e_2nd: + if (!isSet) { + isSet = 1; + } + IT_r >> _l_; + break; + case Cubit::e_3rd: + default: + if (!isSet) { + _cm_ = new Cubit::Many; + isSet = 1; + } + (*_cm_).decodeOp (IT_r); + break; + } + +} +void Cubit::oneof:: decodeInOutOp (CORBA::Request &IT_r) { + Cubit::discrim IT_d; + { + CORBA::ULong IT_2; + IT_r >> IT_2; + IT_d = Cubit::discrim(IT_2); + } + if (IT_d == __d) + switch (__d) { + case Cubit::e_0th: + if (!isSet) { + isSet = 1; + } + IT_r.extractOctet (_o_); + break; + case Cubit::e_1st: + if (!isSet) { + isSet = 1; + } + IT_r >> _s_; + break; + case Cubit::e_2nd: + if (!isSet) { + isSet = 1; + } + IT_r >> _l_; + break; + case Cubit::e_3rd: + default: + if (!isSet) { + _cm_ = new Cubit::Many; + isSet = 1; + } + (*_cm_).decodeInOutOp (IT_r); + break; + } + + else { + this->oneof:: ~oneof(); + memset(this, 0, sizeof(*this)); + __d = IT_d; + switch (__d) { + case Cubit::e_0th: + if (!isSet) { + isSet = 1; + } + IT_r.extractOctet (_o_); + break; + case Cubit::e_1st: + if (!isSet) { + isSet = 1; + } + IT_r >> _s_; + break; + case Cubit::e_2nd: + if (!isSet) { + isSet = 1; + } + IT_r >> _l_; + break; + case Cubit::e_3rd: + default: + if (!isSet) { + _cm_ = new Cubit::Many; + isSet = 1; + } + (*_cm_).decodeOp (IT_r); + break; + } + isSet = 1; + } + +} + +Cubit::oneof:: oneof() { + memset(this, 0, sizeof(*this)); + isSet = 0; +} + +Cubit::oneof ::~oneof() { + if (!isSet) return; + switch (__d) { + case Cubit::e_0th: break; + case Cubit::e_1st: break; + case Cubit::e_2nd: break; + case Cubit::e_3rd: + default: if (_cm_) delete _cm_; + break; + } + + isSet = 0; +} + +Cubit::oneof:: oneof (const Cubit::oneof &IT_s) { + isSet = 0; + memset(this, 0, sizeof(*this)); + __d = IT_s.__d; + switch (__d) { + case Cubit::e_0th: isSet = 1; + _o_ = IT_s._o_; + break; + case Cubit::e_1st: isSet = 1; + _s_ = IT_s._s_; + break; + case Cubit::e_2nd: isSet = 1; + _l_ = IT_s._l_; + break; + case Cubit::e_3rd: + default: + if (!isSet) { + _cm_ = new Cubit::Many; + isSet = 1; + } + *(_cm_) = *(IT_s._cm_); + break; + } + isSet = 1; +} + +Cubit::oneof& Cubit::oneof:: operator= (const Cubit::oneof & IT_s) { + if (this == &IT_s) return *this; + if (isSet && (__d != IT_s.__d)) + { + this-> oneof::~oneof(); + memset(this, 0, sizeof(*this)); + } + + __d = IT_s.__d; + switch (__d) { + case Cubit::e_0th: isSet = 1; + _o_ = IT_s._o_; + break; + case Cubit::e_1st: isSet = 1; + _s_ = IT_s._s_; + break; + case Cubit::e_2nd: isSet = 1; + _l_ = IT_s._l_; + break; + case Cubit::e_3rd: + default: + if (!isSet) { + _cm_ = new Cubit::Many; + isSet = 1; + } + *(_cm_) = *(IT_s._cm_); + break; + } + isSet = 1; + return *this; +} + + +#endif + +void* CubitProxyFactoryClass::New (char *IT_OR, CORBA::Environment&) { + return new class Cubit(IT_OR);} + +void* CubitProxyFactoryClass::New (ObjectReference *IT_OR, CORBA::Environment&) { + return new class Cubit(IT_OR);} + +void* CubitProxyFactoryClass::New2 () { + return new class Cubit((char*)0);} + +CORBA::Object* CubitProxyFactoryClass::NewObject (char *IT_OR, CORBA::Environment&) { + return new class Cubit(IT_OR);} + +CORBA::Object* CubitProxyFactoryClass::NewObject (ObjectReference *IT_OR, CORBA::Environment&) { + return new class Cubit(IT_OR);} + +CORBA::Object* CubitProxyFactoryClass::New2Object () { + return new class Cubit((char*)0);} + +void* CubitProxyFactoryClass::IT_castUp (void *IT_p, char* IT_s, CORBA::Environment &IT_env) { + void *IT_l; + if (!CORBA::_interfaceCmp (IT_s,Cubit_IR, IT_env)) + return IT_p; + else if (IT_l=CORBA::ObjectFactoryClass::IT_castUp((CORBA::Object*)((class Cubit*)IT_p),IT_s, IT_env)) + return IT_l; + else return NULL; + } + + +CORBA::PPTR* CubitProxyFactoryClass::pptr (void *IT_p) { + return ((class Cubit*)IT_p)->_pptr ();} + +void CubitProxyFactoryClass::baseInterfaces (_IDL_SEQUENCE_string& seq) { + add (seq, Cubit_IR); + CORBA::ObjectFactoryClass::baseInterfaces (seq); +} + +CubitProxyFactoryClass CubitProxyFactory(1); + +CORBA::Octet Cubit:: cube_octet (CORBA::Octet o, CORBA::Environment &IT_pEnv) throw (CORBA::SystemException) { + + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (IT_env || m_isNull) { + return 0; + } + CORBA::Request IT_r (this, "cube_octet",IT_env,1,0); + if (!IT_r.isException (IT_env)) { + + IT_r.insertOctet (o); + } + + IT_r.invoke (CORBA::Flags(0),IT_env); + if (!IT_r.isException (IT_env)) { + CORBA::Octet IT_result; + IT_r.extractOctet (IT_result); + IT_r.checkEnv (IT_env); + return IT_result; + } + if (IT_r.exceptionKind () == CORBA::SYSTEM_EXCEPTION) { + IT_r.checkEnv (IT_env); + } + return 0; +} + +CORBA::Short Cubit:: cube_short (CORBA::Short s, CORBA::Environment &IT_pEnv) throw (CORBA::SystemException) { + + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (IT_env || m_isNull) { + return 0; + } + CORBA::Request IT_r (this, "cube_short",IT_env,1,0); + if (!IT_r.isException (IT_env)) { + + IT_r << s; + } + + IT_r.invoke (CORBA::Flags(0),IT_env); + if (!IT_r.isException (IT_env)) { + CORBA::Short IT_result; + IT_r >> IT_result; + IT_r.checkEnv (IT_env); + return IT_result; + } + if (IT_r.exceptionKind () == CORBA::SYSTEM_EXCEPTION) { + IT_r.checkEnv (IT_env); + } + return 0; +} + +CORBA::Long Cubit:: cube_long (CORBA::Long l, CORBA::Environment &IT_pEnv) throw (CORBA::SystemException) { + + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (IT_env || m_isNull) { + return 0; + } + CORBA::Request IT_r (this, "cube_long",IT_env,1,0); + if (!IT_r.isException (IT_env)) { + + IT_r << l; + } + + IT_r.invoke (CORBA::Flags(0),IT_env); + if (!IT_r.isException (IT_env)) { + CORBA::Long IT_result; + IT_r >> IT_result; + IT_r.checkEnv (IT_env); + return IT_result; + } + if (IT_r.exceptionKind () == CORBA::SYSTEM_EXCEPTION) { + IT_r.checkEnv (IT_env); + } + return 0; +} + +Cubit::Many Cubit:: cube_struct (const Cubit::Many& values, CORBA::Environment &IT_pEnv) throw (CORBA::SystemException) { + + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (IT_env || m_isNull) { + { + Cubit::Many IT_l0; + return IT_l0; + } + } + CORBA::Request IT_r (this, "cube_struct",IT_env,1,0); + if (!IT_r.isException (IT_env)) { + + values.encodeOp (IT_r); + } + + IT_r.invoke (CORBA::Flags(0),IT_env); + if (!IT_r.isException (IT_env)) { + Cubit::Many IT_result; + IT_result.decodeOp (IT_r); + IT_r.checkEnv (IT_env); + return IT_result; + } + if (IT_r.exceptionKind () == CORBA::SYSTEM_EXCEPTION) { + IT_r.checkEnv (IT_env); + } + { + Cubit::Many IT_l1; + return IT_l1; + } +} + +Cubit::oneof Cubit:: cube_union (const Cubit::oneof& values, CORBA::Environment &IT_pEnv) throw (CORBA::SystemException) { + + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (IT_env || m_isNull) { + { + Cubit::oneof IT_l0; + return IT_l0; + } + } + CORBA::Request IT_r (this, "cube_union",IT_env,1,0); + if (!IT_r.isException (IT_env)) { + + values.encodeOp (IT_r); + } + + IT_r.invoke (CORBA::Flags(0),IT_env); + if (!IT_r.isException (IT_env)) { + Cubit::oneof IT_result; + IT_result.decodeOp (IT_r); + IT_r.checkEnv (IT_env); + return IT_result; + } + if (IT_r.exceptionKind () == CORBA::SYSTEM_EXCEPTION) { + IT_r.checkEnv (IT_env); + } + { + Cubit::oneof IT_l1; + return IT_l1; + } +} + +void Cubit:: please_exit (CORBA::Environment &IT_pEnv) throw (CORBA::SystemException) { + + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (IT_env || m_isNull) { + return ; + } + CORBA::Request IT_r (this, "please_exit",IT_env,1,1); + + IT_r.invoke (CORBA::Flags(CORBA::INV_NO_RESPONSE), IT_env); + if (IT_r.exceptionKind () == CORBA::SYSTEM_EXCEPTION) { + IT_r.checkEnv (IT_env); + } +} + + + + + +#ifndef Cubit_dispatch_impl + +unsigned char Cubit_dispatch::dispatch (CORBA::Request &IT_r, + unsigned char, void *) { + IT_r.makeRuntimeException1 ("Cubit"); + return 0; +} + +#endif + +Cubit_Factory::Cubit_Factory (char *IT_OR) { + m_pptr = new Cubit_Factory_dispatch (IT_OR, this,(CORBA::Object*)this); +} +Cubit_Factory::Cubit_Factory (ObjectReference *IT_OR) { + m_pptr = new Cubit_Factory_dispatch (IT_OR, this,(CORBA::Object*)this); +} + +#ifndef Cubit_FactoryForwC +#define Cubit_FactoryForwC +CORBA::ObjectRef Cubit_Factory_getBase(void *IT_p){ + return (Cubit_Factory*) IT_p;} + +void Cubit_Factory_release (Cubit_Factory_ptr IT_p, CORBA::Environment &IT_env) { + CORBA::release(IT_p, IT_env);} + +void Cubit_Factory_release (Cubit_Factory_ptr IT_p) { + Cubit_Factory_release (IT_p, CORBA::IT_chooseDefaultEnv ()); } + +Cubit_Factory_ptr Cubit_Factory_nil (CORBA::Environment &) { + return Cubit_Factory:: _nil ();} + +Cubit_Factory_ptr Cubit_Factory_nil () { + return Cubit_Factory_nil (CORBA::IT_chooseDefaultEnv ());} + +Cubit_Factory_ptr Cubit_Factory_duplicate (Cubit_Factory_ptr IT_p, CORBA::Environment &IT_env) { + return (Cubit_Factory::_duplicate(IT_p, IT_env)); } +Cubit_Factory_ptr Cubit_Factory_duplicate (Cubit_Factory_ptr IT_p) { + return Cubit_Factory_duplicate (IT_p, CORBA::IT_chooseDefaultEnv ()); } +#endif + +Cubit_Factory_ptr Cubit_Factory::_duplicate(Cubit_Factory_ptr obj, CORBA::Environment& IT_pEnv) { + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (!obj) { + return (obj); + } + Cubit_Factory_ptr IT_obj = obj->__duplicate (IT_env); + return IT_obj; +} + + + +Cubit_Factory* Cubit_Factory:: _bind (const char* IT_markerServer, const char* host, + const CORBA::Context &IT_c, + CORBA::Environment &IT_env) { + return (Cubit_Factory*)CORBA::Factory.New (IT_markerServer, IT_env, IT_c, host, + Cubit_Factory_IMPL, Cubit_Factory_IR); +} + + + +Cubit_Factory* Cubit_Factory:: _bind (CORBA::Environment &IT_env) { + return _bind (NULL,NULL,CORBA::Context(), IT_env); } + + +Cubit_Factory* Cubit_Factory:: _bind (const char* IT_markerServer, const char* host, + CORBA::Environment &IT_env) { + return _bind (IT_markerServer, host, CORBA::Context (), IT_env); } +Cubit_Factory* Cubit_Factory::_narrow (CORBA::Object* IT_obj, CORBA::Environment &IT_pEnv) { + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (CORBA::is_nil (IT_obj)) { + return Cubit_Factory:: _nil(); + } + + Cubit_Factory* IT_p = (Cubit_Factory*)CORBA::Object::_castDown (IT_obj, Cubit_Factory_IR, IT_env); + IT_p = IT_p ? IT_p->__duplicate(IT_env) : NULL; + if ((IT_env) &&(!strcmp(IT_env.exception()->id(), "CORBA::StExcep::BAD_PARAM")) && (((CORBA::BAD_PARAM*)IT_env.exception())-> minor() == NARROW_FAILED)) { + IT_env.exception_free(); + } + return IT_p; + } + +void* Cubit_FactoryProxyFactoryClass::New (char *IT_OR, CORBA::Environment&) { + return new class Cubit_Factory(IT_OR);} + +void* Cubit_FactoryProxyFactoryClass::New (ObjectReference *IT_OR, CORBA::Environment&) { + return new class Cubit_Factory(IT_OR);} + +void* Cubit_FactoryProxyFactoryClass::New2 () { + return new class Cubit_Factory((char*)0);} + +CORBA::Object* Cubit_FactoryProxyFactoryClass::NewObject (char *IT_OR, CORBA::Environment&) { + return new class Cubit_Factory(IT_OR);} + +CORBA::Object* Cubit_FactoryProxyFactoryClass::NewObject (ObjectReference *IT_OR, CORBA::Environment&) { + return new class Cubit_Factory(IT_OR);} + +CORBA::Object* Cubit_FactoryProxyFactoryClass::New2Object () { + return new class Cubit_Factory((char*)0);} + +void* Cubit_FactoryProxyFactoryClass::IT_castUp (void *IT_p, char* IT_s, CORBA::Environment &IT_env) { + void *IT_l; + if (!CORBA::_interfaceCmp (IT_s,Cubit_Factory_IR, IT_env)) + return IT_p; + else if (IT_l=CORBA::ObjectFactoryClass::IT_castUp((CORBA::Object*)((class Cubit_Factory*)IT_p),IT_s, IT_env)) + return IT_l; + else return NULL; + } + + +CORBA::PPTR* Cubit_FactoryProxyFactoryClass::pptr (void *IT_p) { + return ((class Cubit_Factory*)IT_p)->_pptr ();} + +void Cubit_FactoryProxyFactoryClass::baseInterfaces (_IDL_SEQUENCE_string& seq) { + add (seq, Cubit_Factory_IR); + CORBA::ObjectFactoryClass::baseInterfaces (seq); +} + +Cubit_FactoryProxyFactoryClass Cubit_FactoryProxyFactory(1); + +Cubit_ptr Cubit_Factory:: create_cubit (const char * name, CORBA::Environment &IT_pEnv) throw (CORBA::SystemException) { + + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + if (IT_env || m_isNull) { + return new Cubit; + } + CORBA::Request IT_r (this, "create_cubit",IT_env,1,0); + if (!IT_r.isException (IT_env)) { + + IT_r.encodeStringOp (name); + } + + IT_r.invoke (CORBA::Flags(0),IT_env); + if (!IT_r.isException (IT_env)) { + Cubit_ptr IT_result; + IT_result = (Cubit*) IT_r.decodeObjRef (Cubit_IR); + IT_r.checkEnv (IT_env); + return IT_result; + } + if (IT_r.exceptionKind () == CORBA::SYSTEM_EXCEPTION) { + IT_r.checkEnv (IT_env); + } + return new Cubit; +} + + + + + +#ifndef Cubit_Factory_dispatch_impl + +unsigned char Cubit_Factory_dispatch::dispatch (CORBA::Request &IT_r, + unsigned char, void *) { + IT_r.makeRuntimeException1 ("Cubit_Factory"); + return 0; +} + +#endif + diff --git a/TAO/tests/Cubit/Orbix/factory_client/cubitS.cpp b/TAO/tests/Cubit/Orbix/factory_client/cubitS.cpp new file mode 100644 index 00000000000..2f0459962b8 --- /dev/null +++ b/TAO/tests/Cubit/Orbix/factory_client/cubitS.cpp @@ -0,0 +1,282 @@ + + +#include "cubit.hh" + + +#define Cubit_dispatch_impl + +unsigned char Cubit_dispatch::dispatch (CORBA::Request &IT_r, + unsigned char IT_isTarget, void *IT_pp) { + if (!IT_pp) + IT_pp = m_obj; + const char *IT_s = IT_r.getOperation (); + if (!strcmp(IT_s,"cube_octet")) { + CORBA::Octet IT_result; + CORBA::Environment IT_env (IT_r); + CORBA::Filter* IT_f = CORBA::Orbix.getFilter (); + if (!IT_r.tcAssert ("\ +Ro~cube_octet~+o{o},>{o},N{}\ +")) + return 1; + CORBA::Octet o; + + IT_r.extractOctet (o); + + if (IT_f && !IT_r.isException (IT_env)) + IT_f->inRequestPostM (IT_r, IT_env); + if (!IT_r.isException (IT_env)) { + try { + IT_result = ((Cubit*)IT_pp)->cube_octet ( o, IT_env); + + } catch (CORBA::SystemException &IT_exSys) { + IT_env.propagate (&IT_exSys); + } catch (CORBA::UserException &IT_exUsr) { + IT_env.propagate (&IT_exUsr); + } + } + + if (!IT_r.isException (IT_env)) { + if (!IT_r.convertToReply ("\ +o\ +", IT_env)) return 1; + IT_r.insertOctet (IT_result); + } + + else IT_r.makeSystemException (IT_env); + return 1; + } + + if (!strcmp(IT_s,"cube_short")) { + CORBA::Short IT_result; + CORBA::Environment IT_env (IT_r); + CORBA::Filter* IT_f = CORBA::Orbix.getFilter (); + if (!IT_r.tcAssert ("\ +Ro~cube_short~+s{s},>{s},N{}\ +")) + return 1; + CORBA::Short s; + + IT_r >> s; + + if (IT_f && !IT_r.isException (IT_env)) + IT_f->inRequestPostM (IT_r, IT_env); + if (!IT_r.isException (IT_env)) { + try { + IT_result = ((Cubit*)IT_pp)->cube_short ( s, IT_env); + + } catch (CORBA::SystemException &IT_exSys) { + IT_env.propagate (&IT_exSys); + } catch (CORBA::UserException &IT_exUsr) { + IT_env.propagate (&IT_exUsr); + } + } + + if (!IT_r.isException (IT_env)) { + if (!IT_r.convertToReply ("\ +s\ +", IT_env)) return 1; + IT_r << IT_result; + } + + else IT_r.makeSystemException (IT_env); + return 1; + } + + if (!strcmp(IT_s,"cube_long")) { + CORBA::Long IT_result; + CORBA::Environment IT_env (IT_r); + CORBA::Filter* IT_f = CORBA::Orbix.getFilter (); + if (!IT_r.tcAssert ("\ +Ro~cube_long~+l{l},>{l},N{}\ +")) + return 1; + CORBA::Long l; + + IT_r >> l; + + if (IT_f && !IT_r.isException (IT_env)) + IT_f->inRequestPostM (IT_r, IT_env); + if (!IT_r.isException (IT_env)) { + try { + IT_result = ((Cubit*)IT_pp)->cube_long ( l, IT_env); + + } catch (CORBA::SystemException &IT_exSys) { + IT_env.propagate (&IT_exSys); + } catch (CORBA::UserException &IT_exUsr) { + IT_env.propagate (&IT_exUsr); + } + } + + if (!IT_r.isException (IT_env)) { + if (!IT_r.convertToReply ("\ +l\ +", IT_env)) return 1; + IT_r << IT_result; + } + + else IT_r.makeSystemException (IT_env); + return 1; + } + + if (!strcmp(IT_s,"cube_struct")) { + Cubit::Many IT_result; + CORBA::Environment IT_env (IT_r); + CORBA::Filter* IT_f = CORBA::Orbix.getFilter (); + if (!IT_r.tcAssert ("\ +Ro~cube_struct~+values{R~Cubit::Many~o{o},l{l},s{s}},>{R~Cubit::Many~o{o},l{l},s{s}},N{}\ +")) + return 1; + Cubit::Many values; + + values.decodeOp (IT_r); + + if (IT_f && !IT_r.isException (IT_env)) + IT_f->inRequestPostM (IT_r, IT_env); + if (!IT_r.isException (IT_env)) { + try { + IT_result = ((Cubit*)IT_pp)->cube_struct ( values, IT_env); + + } catch (CORBA::SystemException &IT_exSys) { + IT_env.propagate (&IT_exSys); + } catch (CORBA::UserException &IT_exUsr) { + IT_env.propagate (&IT_exUsr); + } + } + + if (!IT_r.isException (IT_env)) { + if (!IT_r.convertToReply ("\ +R~Cubit::Many~o{o},l{l},s{s}\ +", IT_env)) return 1; + IT_result.encodeOp (IT_r); + } + + else IT_r.makeSystemException (IT_env); + return 1; + } + + if (!strcmp(IT_s,"cube_union")) { + Cubit::oneof IT_result; + CORBA::Environment IT_env (IT_r); + CORBA::Filter* IT_f = CORBA::Orbix.getFilter (); + IT_r.tcPreAssert ( +"\ +Ro~cube_union~+values{U~Cubit::oneof~{E~Cubit::discrim~e_0th,e_1st,e_2nd,e_3rd,e_4th,e_5th}~Cubit::e_0th o{o};Cubit::e_1st s{s};Cubit::e_2nd l{l};Cubit::e_3rd,$ cm{R~Cubit::Many~o{o},l{l},s{s}}},>{U~Cubit::oneof~{E~Cubit::discrim~e_0th,e_1st,e_2nd,e_3rd,\ +"); + if (!IT_r.tcAssert ("\ +e_4th,e_5th}~Cubit::e_0th o{o};Cubit::e_1st s{s};Cubit::e_2nd l{l};Cubit::e_3rd,$ cm{R~Cubit::Many~o{o},l{l},s{s}}},N{}\ +")) + return 1; + Cubit::oneof values; + + values.decodeOp (IT_r); + + if (IT_f && !IT_r.isException (IT_env)) + IT_f->inRequestPostM (IT_r, IT_env); + if (!IT_r.isException (IT_env)) { + try { + IT_result = ((Cubit*)IT_pp)->cube_union ( values, IT_env); + + } catch (CORBA::SystemException &IT_exSys) { + IT_env.propagate (&IT_exSys); + } catch (CORBA::UserException &IT_exUsr) { + IT_env.propagate (&IT_exUsr); + } + } + + if (!IT_r.isException (IT_env)) { + if (!IT_r.convertToReply ("\ +U~Cubit::oneof~{E~Cubit::discrim~e_0th,e_1st,e_2nd,e_3rd,e_4th,e_5th}~Cubit::e_0th o{o};Cubit::e_1st s{s};Cubit::e_2nd l{l};Cubit::e_3rd,$ cm{R~Cubit::Many~o{o},l{l},s{s}}\ +", IT_env)) return 1; + IT_result.encodeOp (IT_r); + } + + else IT_r.makeSystemException (IT_env); + return 1; + } + + if (!strcmp(IT_s,"please_exit")) { + CORBA::Environment IT_env (IT_r); + CORBA::Filter* IT_f = CORBA::Orbix.getFilter (); + if (!IT_r.tcAssert ("\ +Ro~please_exit~>{v},O{}\ +")) + return 1; + + if (IT_f && !IT_r.isException (IT_env)) + IT_f->inRequestPostM (IT_r, IT_env); + if (!IT_r.isException (IT_env)) { + try { + ((Cubit*)IT_pp)->please_exit (IT_env); + + } catch (CORBA::SystemException &IT_exSys) { + IT_env.propagate (&IT_exSys); + } catch (CORBA::UserException &IT_exUsr) { + IT_env.propagate (&IT_exUsr); + } + } + IT_r.replyNoResults (CORBA::Flags(CORBA::INV_NO_RESPONSE),IT_env); + return 1; + } + + if (IT_isTarget) + IT_r.makeRuntimeException2 (); + + return 0; +} + +#define Cubit_Factory_dispatch_impl + +unsigned char Cubit_Factory_dispatch::dispatch (CORBA::Request &IT_r, + unsigned char IT_isTarget, void *IT_pp) { + if (!IT_pp) + IT_pp = m_obj; + const char *IT_s = IT_r.getOperation (); + if (!strcmp(IT_s,"create_cubit")) { + Cubit_ptr IT_result; + CORBA::Environment IT_env (IT_r); + CORBA::Filter* IT_f = CORBA::Orbix.getFilter (); + if (!IT_r.tcAssert ("\ +Ro~create_cubit~+name{0},>{O~Cubit},N{}\ +")) + return 1; + char * name; + + IT_r.decodeStringOp(name); + + if (IT_f && !IT_r.isException (IT_env)) + IT_f->inRequestPostM (IT_r, IT_env); + if (!IT_r.isException (IT_env)) { + try { + IT_result = ((Cubit_Factory*)IT_pp)->create_cubit ( name, IT_env); + + } catch (CORBA::SystemException &IT_exSys) { + IT_env.propagate (&IT_exSys); + } catch (CORBA::UserException &IT_exUsr) { + IT_env.propagate (&IT_exUsr); + } + } + CORBA::string_free (name); + + if (!IT_r.isException (IT_env)) { + if (!IT_r.convertToReply ("\ +O~Cubit\ +", IT_env)) return 1; + { + CORBA::Object* IT_l1 = (CORBA::Object*) IT_result; + IT_r << IT_l1; + } + if (IT_result) Cubit_release (IT_result); + } + + else IT_r.makeSystemException (IT_env); + return 1; + } + + if (IT_isTarget) + IT_r.makeRuntimeException2 (); + + return 0; +} + +#include "cubitC.cpp" + |