diff options
author | gokhale <asgokhale@users.noreply.github.com> | 1997-07-02 04:06:28 +0000 |
---|---|---|
committer | gokhale <asgokhale@users.noreply.github.com> | 1997-07-02 04:06:28 +0000 |
commit | bfc59de46cac9236338b836118ea2059d4f27cb4 (patch) | |
tree | 7788019b6268f0b2af603520d594245ff8b588b0 /TAO/IIOP/tests | |
parent | b0f42b7f68e680720653efb7305b370c17958eb2 (diff) | |
download | ATCD-bfc59de46cac9236338b836118ea2059d4f27cb4.tar.gz |
Orbix Cubit thread per session
Diffstat (limited to 'TAO/IIOP/tests')
-rw-r--r-- | TAO/IIOP/tests/Cubit/Orbix/tps/Makefile | 349 | ||||
-rw-r--r-- | TAO/IIOP/tests/Cubit/Orbix/tps/cubit.h | 1111 | ||||
-rw-r--r-- | TAO/IIOP/tests/Cubit/Orbix/tps/cubit.idl | 46 | ||||
-rw-r--r-- | TAO/IIOP/tests/Cubit/Orbix/tps/cubitC.cpp | 710 | ||||
-rw-r--r-- | TAO/IIOP/tests/Cubit/Orbix/tps/cubitS.cpp | 282 | ||||
-rw-r--r-- | TAO/IIOP/tests/Cubit/Orbix/tps/cubit_impl.cpp | 81 | ||||
-rw-r--r-- | TAO/IIOP/tests/Cubit/Orbix/tps/cubit_impl.h | 46 | ||||
-rw-r--r-- | TAO/IIOP/tests/Cubit/Orbix/tps/tps.cpp | 26 | ||||
-rw-r--r-- | TAO/IIOP/tests/Cubit/Orbix/tps/tps.h | 11 |
9 files changed, 2662 insertions, 0 deletions
diff --git a/TAO/IIOP/tests/Cubit/Orbix/tps/Makefile b/TAO/IIOP/tests/Cubit/Orbix/tps/Makefile new file mode 100644 index 00000000000..441aaf063a4 --- /dev/null +++ b/TAO/IIOP/tests/Cubit/Orbix/tps/Makefile @@ -0,0 +1,349 @@ +#---------------------------------------------------------------------------- +# @(#)Makefile 1.1 10/18/96 +# +# Makefile for the ACE_MT_CORBA_Handler tests +#---------------------------------------------------------------------------- + +#---------------------------------------------------------------------------- +# Local macros +#---------------------------------------------------------------------------- + +SRC = cubitS.cpp cubit_impl.cpp server.cpp tps.cpp + +SVR_OBJS = cubitS.o cubit_impl.o server.o tps.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 + +# Remove -DCubit_USE_BOA from below to use the TIE approach + +CPPFLAGS += -DEXCEPTIONS -I$(ORBIX_INCDIR) -DWANT_ORBIX_FDS -DCubit_USE_BOA +LDFLAGS += -L$(ORBIX_LIBDIR) -R $(ORBIX_LIBDIR) -L$(ACE)/ace + +IDLFLAGS = -s S.cpp -c C.cpp -B + +#---------------------------------------------------------------------------- +# Local targets +#---------------------------------------------------------------------------- + +all: server + +server: $(addprefix $(VDIR),$(SVR_OBJS)) + $(LINK.cc) -o server $(addprefix $(VDIR),$(SVR_OBJS)) $(LDFLAGS) $(ITIIOP) $(ITSRV) $(VLDLIBS) + +#---------------------------------------------------------------------------- +# Dependencies +#---------------------------------------------------------------------------- +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +.obj/cubitS.o .shobj/cubitS.so: cubitS.cpp cubit.h cubitC.cpp +.obj/cubit_impl.o .shobj/cubit_impl.so: cubit_impl.cpp cubit_impl.h cubit.h \ + $(WRAPPER_ROOT)/ace/Task.h \ + $(WRAPPER_ROOT)/ace/Service_Object.h \ + $(WRAPPER_ROOT)/ace/Shared_Object.h \ + $(WRAPPER_ROOT)/ace/ACE.h \ + $(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/Log_Priority.h \ + $(WRAPPER_ROOT)/ace/Log_Record.i \ + $(WRAPPER_ROOT)/ace/ACE.i \ + $(WRAPPER_ROOT)/ace/Shared_Object.i \ + $(WRAPPER_ROOT)/ace/Event_Handler.h \ + $(WRAPPER_ROOT)/ace/Event_Handler.i \ + $(WRAPPER_ROOT)/ace/Service_Object.i \ + $(WRAPPER_ROOT)/ace/Thread_Manager.h \ + $(WRAPPER_ROOT)/ace/Thread.h \ + $(WRAPPER_ROOT)/ace/Thread.i \ + $(WRAPPER_ROOT)/ace/Synch.h \ + $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.h \ + $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.h \ + $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.i \ + $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.i \ + $(WRAPPER_ROOT)/ace/Synch.i \ + $(WRAPPER_ROOT)/ace/Synch_T.h \ + $(WRAPPER_ROOT)/ace/Synch_T.i \ + $(WRAPPER_ROOT)/ace/Thread_Manager.i \ + $(WRAPPER_ROOT)/ace/Task.i \ + $(WRAPPER_ROOT)/ace/Task_T.h \ + $(WRAPPER_ROOT)/ace/Message_Queue.h \ + $(WRAPPER_ROOT)/ace/Message_Block.h \ + $(WRAPPER_ROOT)/ace/Malloc.h \ + $(WRAPPER_ROOT)/ace/Malloc.i \ + $(WRAPPER_ROOT)/ace/Malloc_T.h \ + $(WRAPPER_ROOT)/ace/Malloc_T.i \ + $(WRAPPER_ROOT)/ace/Memory_Pool.h \ + $(WRAPPER_ROOT)/ace/Signal.h \ + $(WRAPPER_ROOT)/ace/Containers.h \ + $(WRAPPER_ROOT)/ace/Containers.i \ + $(WRAPPER_ROOT)/ace/Signal.i \ + $(WRAPPER_ROOT)/ace/Mem_Map.h \ + $(WRAPPER_ROOT)/ace/Mem_Map.i \ + $(WRAPPER_ROOT)/ace/Memory_Pool.i \ + $(WRAPPER_ROOT)/ace/Message_Block.i \ + $(WRAPPER_ROOT)/ace/IO_Cntl_Msg.h \ + $(WRAPPER_ROOT)/ace/Strategies.h \ + $(WRAPPER_ROOT)/ace/Strategies_T.h \ + $(WRAPPER_ROOT)/ace/Service_Config.h \ + $(WRAPPER_ROOT)/ace/Service_Config.i \ + $(WRAPPER_ROOT)/ace/Reactor.h \ + $(WRAPPER_ROOT)/ace/Handle_Set.h \ + $(WRAPPER_ROOT)/ace/Handle_Set.i \ + $(WRAPPER_ROOT)/ace/Timer_Queue.h \ + $(WRAPPER_ROOT)/ace/Timer_Queue_T.h \ + $(WRAPPER_ROOT)/ace/Time_Value.h \ + $(WRAPPER_ROOT)/ace/Free_List.h \ + $(WRAPPER_ROOT)/ace/Free_List.i \ + $(WRAPPER_ROOT)/ace/Timer_Queue_T.i \ + $(WRAPPER_ROOT)/ace/Token.h \ + $(WRAPPER_ROOT)/ace/Token.i \ + $(WRAPPER_ROOT)/ace/Pipe.h \ + $(WRAPPER_ROOT)/ace/Pipe.i \ + $(WRAPPER_ROOT)/ace/SOCK_Stream.h \ + $(WRAPPER_ROOT)/ace/SOCK_IO.h \ + $(WRAPPER_ROOT)/ace/SOCK.h \ + $(WRAPPER_ROOT)/ace/Addr.h \ + $(WRAPPER_ROOT)/ace/Addr.i \ + $(WRAPPER_ROOT)/ace/IPC_SAP.h \ + $(WRAPPER_ROOT)/ace/IPC_SAP.i \ + $(WRAPPER_ROOT)/ace/SOCK.i \ + $(WRAPPER_ROOT)/ace/SOCK_IO.i \ + $(WRAPPER_ROOT)/ace/INET_Addr.h \ + $(WRAPPER_ROOT)/ace/INET_Addr.i \ + $(WRAPPER_ROOT)/ace/SOCK_Stream.i \ + $(WRAPPER_ROOT)/ace/Reactor.i \ + $(WRAPPER_ROOT)/ace/Proactor.h \ + $(WRAPPER_ROOT)/ace/Asynch_IO.h \ + $(WRAPPER_ROOT)/ace/Timer_List.h \ + $(WRAPPER_ROOT)/ace/Timer_List_T.h \ + $(WRAPPER_ROOT)/ace/Timer_Heap.h \ + $(WRAPPER_ROOT)/ace/Timer_Heap_T.h \ + $(WRAPPER_ROOT)/ace/Timer_Wheel.h \ + $(WRAPPER_ROOT)/ace/Timer_Wheel_T.h \ + $(WRAPPER_ROOT)/ace/ReactorEx.h \ + $(WRAPPER_ROOT)/ace/ReactorEx.i \ + $(WRAPPER_ROOT)/ace/Svc_Conf_Tokens.h \ + $(WRAPPER_ROOT)/ace/Synch_Options.h \ + $(WRAPPER_ROOT)/ace/Hash_Map_Manager.h \ + $(WRAPPER_ROOT)/ace/Message_Queue.i \ + $(WRAPPER_ROOT)/ace/Task_T.i +.obj/server.o .shobj/server.so: server.cpp cubit_impl.h cubit.h \ + $(WRAPPER_ROOT)/ace/Task.h \ + $(WRAPPER_ROOT)/ace/Service_Object.h \ + $(WRAPPER_ROOT)/ace/Shared_Object.h \ + $(WRAPPER_ROOT)/ace/ACE.h \ + $(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/Log_Priority.h \ + $(WRAPPER_ROOT)/ace/Log_Record.i \ + $(WRAPPER_ROOT)/ace/ACE.i \ + $(WRAPPER_ROOT)/ace/Shared_Object.i \ + $(WRAPPER_ROOT)/ace/Event_Handler.h \ + $(WRAPPER_ROOT)/ace/Event_Handler.i \ + $(WRAPPER_ROOT)/ace/Service_Object.i \ + $(WRAPPER_ROOT)/ace/Thread_Manager.h \ + $(WRAPPER_ROOT)/ace/Thread.h \ + $(WRAPPER_ROOT)/ace/Thread.i \ + $(WRAPPER_ROOT)/ace/Synch.h \ + $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.h \ + $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.h \ + $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.i \ + $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.i \ + $(WRAPPER_ROOT)/ace/Synch.i \ + $(WRAPPER_ROOT)/ace/Synch_T.h \ + $(WRAPPER_ROOT)/ace/Synch_T.i \ + $(WRAPPER_ROOT)/ace/Thread_Manager.i \ + $(WRAPPER_ROOT)/ace/Task.i \ + $(WRAPPER_ROOT)/ace/Task_T.h \ + $(WRAPPER_ROOT)/ace/Message_Queue.h \ + $(WRAPPER_ROOT)/ace/Message_Block.h \ + $(WRAPPER_ROOT)/ace/Malloc.h \ + $(WRAPPER_ROOT)/ace/Malloc.i \ + $(WRAPPER_ROOT)/ace/Malloc_T.h \ + $(WRAPPER_ROOT)/ace/Malloc_T.i \ + $(WRAPPER_ROOT)/ace/Memory_Pool.h \ + $(WRAPPER_ROOT)/ace/Signal.h \ + $(WRAPPER_ROOT)/ace/Containers.h \ + $(WRAPPER_ROOT)/ace/Containers.i \ + $(WRAPPER_ROOT)/ace/Signal.i \ + $(WRAPPER_ROOT)/ace/Mem_Map.h \ + $(WRAPPER_ROOT)/ace/Mem_Map.i \ + $(WRAPPER_ROOT)/ace/Memory_Pool.i \ + $(WRAPPER_ROOT)/ace/Message_Block.i \ + $(WRAPPER_ROOT)/ace/IO_Cntl_Msg.h \ + $(WRAPPER_ROOT)/ace/Strategies.h \ + $(WRAPPER_ROOT)/ace/Strategies_T.h \ + $(WRAPPER_ROOT)/ace/Service_Config.h \ + $(WRAPPER_ROOT)/ace/Service_Config.i \ + $(WRAPPER_ROOT)/ace/Reactor.h \ + $(WRAPPER_ROOT)/ace/Handle_Set.h \ + $(WRAPPER_ROOT)/ace/Handle_Set.i \ + $(WRAPPER_ROOT)/ace/Timer_Queue.h \ + $(WRAPPER_ROOT)/ace/Timer_Queue_T.h \ + $(WRAPPER_ROOT)/ace/Time_Value.h \ + $(WRAPPER_ROOT)/ace/Free_List.h \ + $(WRAPPER_ROOT)/ace/Free_List.i \ + $(WRAPPER_ROOT)/ace/Timer_Queue_T.i \ + $(WRAPPER_ROOT)/ace/Token.h \ + $(WRAPPER_ROOT)/ace/Token.i \ + $(WRAPPER_ROOT)/ace/Pipe.h \ + $(WRAPPER_ROOT)/ace/Pipe.i \ + $(WRAPPER_ROOT)/ace/SOCK_Stream.h \ + $(WRAPPER_ROOT)/ace/SOCK_IO.h \ + $(WRAPPER_ROOT)/ace/SOCK.h \ + $(WRAPPER_ROOT)/ace/Addr.h \ + $(WRAPPER_ROOT)/ace/Addr.i \ + $(WRAPPER_ROOT)/ace/IPC_SAP.h \ + $(WRAPPER_ROOT)/ace/IPC_SAP.i \ + $(WRAPPER_ROOT)/ace/SOCK.i \ + $(WRAPPER_ROOT)/ace/SOCK_IO.i \ + $(WRAPPER_ROOT)/ace/INET_Addr.h \ + $(WRAPPER_ROOT)/ace/INET_Addr.i \ + $(WRAPPER_ROOT)/ace/SOCK_Stream.i \ + $(WRAPPER_ROOT)/ace/Reactor.i \ + $(WRAPPER_ROOT)/ace/Proactor.h \ + $(WRAPPER_ROOT)/ace/Asynch_IO.h \ + $(WRAPPER_ROOT)/ace/Timer_List.h \ + $(WRAPPER_ROOT)/ace/Timer_List_T.h \ + $(WRAPPER_ROOT)/ace/Timer_Heap.h \ + $(WRAPPER_ROOT)/ace/Timer_Heap_T.h \ + $(WRAPPER_ROOT)/ace/Timer_Wheel.h \ + $(WRAPPER_ROOT)/ace/Timer_Wheel_T.h \ + $(WRAPPER_ROOT)/ace/ReactorEx.h \ + $(WRAPPER_ROOT)/ace/ReactorEx.i \ + $(WRAPPER_ROOT)/ace/Svc_Conf_Tokens.h \ + $(WRAPPER_ROOT)/ace/Synch_Options.h \ + $(WRAPPER_ROOT)/ace/Hash_Map_Manager.h \ + $(WRAPPER_ROOT)/ace/Message_Queue.i \ + $(WRAPPER_ROOT)/ace/Task_T.i +.obj/tps.o .shobj/tps.so: tps.cpp tps.h cubit.h cubit_impl.h \ + $(WRAPPER_ROOT)/ace/Task.h \ + $(WRAPPER_ROOT)/ace/Service_Object.h \ + $(WRAPPER_ROOT)/ace/Shared_Object.h \ + $(WRAPPER_ROOT)/ace/ACE.h \ + $(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/Log_Priority.h \ + $(WRAPPER_ROOT)/ace/Log_Record.i \ + $(WRAPPER_ROOT)/ace/ACE.i \ + $(WRAPPER_ROOT)/ace/Shared_Object.i \ + $(WRAPPER_ROOT)/ace/Event_Handler.h \ + $(WRAPPER_ROOT)/ace/Event_Handler.i \ + $(WRAPPER_ROOT)/ace/Service_Object.i \ + $(WRAPPER_ROOT)/ace/Thread_Manager.h \ + $(WRAPPER_ROOT)/ace/Thread.h \ + $(WRAPPER_ROOT)/ace/Thread.i \ + $(WRAPPER_ROOT)/ace/Synch.h \ + $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.h \ + $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.h \ + $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.i \ + $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.i \ + $(WRAPPER_ROOT)/ace/Synch.i \ + $(WRAPPER_ROOT)/ace/Synch_T.h \ + $(WRAPPER_ROOT)/ace/Synch_T.i \ + $(WRAPPER_ROOT)/ace/Thread_Manager.i \ + $(WRAPPER_ROOT)/ace/Task.i \ + $(WRAPPER_ROOT)/ace/Task_T.h \ + $(WRAPPER_ROOT)/ace/Message_Queue.h \ + $(WRAPPER_ROOT)/ace/Message_Block.h \ + $(WRAPPER_ROOT)/ace/Malloc.h \ + $(WRAPPER_ROOT)/ace/Malloc.i \ + $(WRAPPER_ROOT)/ace/Malloc_T.h \ + $(WRAPPER_ROOT)/ace/Malloc_T.i \ + $(WRAPPER_ROOT)/ace/Memory_Pool.h \ + $(WRAPPER_ROOT)/ace/Signal.h \ + $(WRAPPER_ROOT)/ace/Containers.h \ + $(WRAPPER_ROOT)/ace/Containers.i \ + $(WRAPPER_ROOT)/ace/Signal.i \ + $(WRAPPER_ROOT)/ace/Mem_Map.h \ + $(WRAPPER_ROOT)/ace/Mem_Map.i \ + $(WRAPPER_ROOT)/ace/Memory_Pool.i \ + $(WRAPPER_ROOT)/ace/Message_Block.i \ + $(WRAPPER_ROOT)/ace/IO_Cntl_Msg.h \ + $(WRAPPER_ROOT)/ace/Strategies.h \ + $(WRAPPER_ROOT)/ace/Strategies_T.h \ + $(WRAPPER_ROOT)/ace/Service_Config.h \ + $(WRAPPER_ROOT)/ace/Service_Config.i \ + $(WRAPPER_ROOT)/ace/Reactor.h \ + $(WRAPPER_ROOT)/ace/Handle_Set.h \ + $(WRAPPER_ROOT)/ace/Handle_Set.i \ + $(WRAPPER_ROOT)/ace/Timer_Queue.h \ + $(WRAPPER_ROOT)/ace/Timer_Queue_T.h \ + $(WRAPPER_ROOT)/ace/Time_Value.h \ + $(WRAPPER_ROOT)/ace/Free_List.h \ + $(WRAPPER_ROOT)/ace/Free_List.i \ + $(WRAPPER_ROOT)/ace/Timer_Queue_T.i \ + $(WRAPPER_ROOT)/ace/Token.h \ + $(WRAPPER_ROOT)/ace/Token.i \ + $(WRAPPER_ROOT)/ace/Pipe.h \ + $(WRAPPER_ROOT)/ace/Pipe.i \ + $(WRAPPER_ROOT)/ace/SOCK_Stream.h \ + $(WRAPPER_ROOT)/ace/SOCK_IO.h \ + $(WRAPPER_ROOT)/ace/SOCK.h \ + $(WRAPPER_ROOT)/ace/Addr.h \ + $(WRAPPER_ROOT)/ace/Addr.i \ + $(WRAPPER_ROOT)/ace/IPC_SAP.h \ + $(WRAPPER_ROOT)/ace/IPC_SAP.i \ + $(WRAPPER_ROOT)/ace/SOCK.i \ + $(WRAPPER_ROOT)/ace/SOCK_IO.i \ + $(WRAPPER_ROOT)/ace/INET_Addr.h \ + $(WRAPPER_ROOT)/ace/INET_Addr.i \ + $(WRAPPER_ROOT)/ace/SOCK_Stream.i \ + $(WRAPPER_ROOT)/ace/Reactor.i \ + $(WRAPPER_ROOT)/ace/Proactor.h \ + $(WRAPPER_ROOT)/ace/Asynch_IO.h \ + $(WRAPPER_ROOT)/ace/Timer_List.h \ + $(WRAPPER_ROOT)/ace/Timer_List_T.h \ + $(WRAPPER_ROOT)/ace/Timer_Heap.h \ + $(WRAPPER_ROOT)/ace/Timer_Heap_T.h \ + $(WRAPPER_ROOT)/ace/Timer_Wheel.h \ + $(WRAPPER_ROOT)/ace/Timer_Wheel_T.h \ + $(WRAPPER_ROOT)/ace/ReactorEx.h \ + $(WRAPPER_ROOT)/ace/ReactorEx.i \ + $(WRAPPER_ROOT)/ace/Svc_Conf_Tokens.h \ + $(WRAPPER_ROOT)/ace/Synch_Options.h \ + $(WRAPPER_ROOT)/ace/Hash_Map_Manager.h \ + $(WRAPPER_ROOT)/ace/Message_Queue.i \ + $(WRAPPER_ROOT)/ace/Task_T.i + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/IIOP/tests/Cubit/Orbix/tps/cubit.h b/TAO/IIOP/tests/Cubit/Orbix/tps/cubit.h new file mode 100644 index 00000000000..72e2fb81395 --- /dev/null +++ b/TAO/IIOP/tests/Cubit/Orbix/tps/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/tps/cubit.idl b/TAO/IIOP/tests/Cubit/Orbix/tps/cubit.idl new file mode 100644 index 00000000000..7dba408d0db --- /dev/null +++ b/TAO/IIOP/tests/Cubit/Orbix/tps/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/tps/cubitC.cpp b/TAO/IIOP/tests/Cubit/Orbix/tps/cubitC.cpp new file mode 100644 index 00000000000..c439fc4c800 --- /dev/null +++ b/TAO/IIOP/tests/Cubit/Orbix/tps/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/tps/cubitS.cpp b/TAO/IIOP/tests/Cubit/Orbix/tps/cubitS.cpp new file mode 100644 index 00000000000..a2898e12914 --- /dev/null +++ b/TAO/IIOP/tests/Cubit/Orbix/tps/cubitS.cpp @@ -0,0 +1,282 @@ + + +#include "cubit.h" + + +#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/IIOP/tests/Cubit/Orbix/tps/cubit_impl.cpp b/TAO/IIOP/tests/Cubit/Orbix/tps/cubit_impl.cpp new file mode 100644 index 00000000000..27ee125e4df --- /dev/null +++ b/TAO/IIOP/tests/Cubit/Orbix/tps/cubit_impl.cpp @@ -0,0 +1,81 @@ +#include "cubit_impl.h" + +CORBA::Octet Cubit_Impl:: cube_octet (CORBA::Octet o, CORBA::Environment &) throw (CORBA::SystemException) { + return (CORBA::Octet) (o * o * o); +} + +CORBA::Short Cubit_Impl:: cube_short (CORBA::Short s, CORBA::Environment &) throw (CORBA::SystemException) { + return (CORBA::Short) (s * s * s); +} + +CORBA::Long Cubit_Impl:: cube_long (CORBA::Long l, CORBA::Environment &) throw (CORBA::SystemException) { + return (CORBA::Long) (l * l * l); +} + +Cubit::Many Cubit_Impl:: cube_struct (const Cubit::Many& values, CORBA::Environment &) throw (CORBA::SystemException) { + Cubit::Many out_values; + out_values.o = values.o * values.o * values.o; + out_values.s = values.s * values.s * values.s; + out_values.l = values.l * values.l * values.l; + return out_values; +} + +Cubit::oneof Cubit_Impl:: cube_union (const Cubit::oneof& values, CORBA::Environment &) throw (CORBA::SystemException) { + Cubit::oneof out_values; + switch (values._d ()) { + case Cubit::e_0th: + out_values.o (values.o () * values.o () * values.o ()); + break; + case Cubit::e_1st: + out_values.s (values.s () * values.s () * values.s ()); + break; + case Cubit::e_2nd: + out_values.l (values.l () * values.l () * values.l ()); + break; + case Cubit::e_3rd: + default: + out_values.cm ().o = values.cm ().o * values.cm ().o * values.cm ().o ; + out_values.cm ().s = values.cm ().s * values.cm ().s * values.cm ().s ; + out_values.cm ().l = values.cm ().l * values.cm ().l * values.cm ().l ; + break; + } + return out_values; +} + +void Cubit_Impl:: please_exit (CORBA::Environment &) throw (CORBA::SystemException) { +} + +Cubit_ptr Cubit_Factory_Impl:: create_cubit (const char * name, CORBA::Environment &) throw (CORBA::SystemException) { + cerr << "Creating Cubit for " << name << endl; + +#ifdef Cubit_USE_BOA + Cubit_Impl_Task *cubit = new Cubit_Impl_Task (); +#else + Cubit_Impl_Task *cubit = new TIE_Cubit (Cubit_Impl) (new Cubit_Impl_Task); +#endif + Cubit::_duplicate ((Cubit *)cubit); + cubit->activate (1); + return (Cubit *) cubit; +} + +int +Cubit_Impl_Task::svc (void) +{ + while (1) + { + // Dequeue message + ACE_Message_Block *mb; + this->msg_queue ()->dequeue_head (mb); + CORBA::Request *vp = (CORBA::Request *) mb->base (); + mb->release (); + // Hand it off to Orbix + CORBA::Orbix.continueThreadDispatch (*vp); + } + return 0; +} + +void * +Cubit_Impl_Task::_deref (void) +{ + return this; +} diff --git a/TAO/IIOP/tests/Cubit/Orbix/tps/cubit_impl.h b/TAO/IIOP/tests/Cubit/Orbix/tps/cubit_impl.h new file mode 100644 index 00000000000..31a8874f07b --- /dev/null +++ b/TAO/IIOP/tests/Cubit/Orbix/tps/cubit_impl.h @@ -0,0 +1,46 @@ + +#ifndef cubit_ih +#define cubit_ih + +#include "cubit.h" +#include "ace/Task.h" + +#ifdef Cubit_USE_BOA +class Cubit_Impl : public virtual CubitBOAImpl { +#else +class Cubit_Impl { +#endif /* Cubit_USE_BOA */ +public: + virtual CORBA::Octet cube_octet (CORBA::Octet o, CORBA::Environment &IT_env=CORBA::default_environment) throw (CORBA::SystemException); + virtual CORBA::Short cube_short (CORBA::Short s, CORBA::Environment &IT_env=CORBA::default_environment) throw (CORBA::SystemException); + virtual CORBA::Long cube_long (CORBA::Long l, CORBA::Environment &IT_env=CORBA::default_environment) throw (CORBA::SystemException); + virtual Cubit::Many cube_struct (const Cubit::Many& values, CORBA::Environment &IT_env=CORBA::default_environment) throw (CORBA::SystemException); + virtual Cubit::oneof cube_union (const Cubit::oneof& values, CORBA::Environment &IT_env=CORBA::default_environment) throw (CORBA::SystemException); + virtual void please_exit (CORBA::Environment &IT_env=CORBA::default_environment) throw (CORBA::SystemException); + +}; + +#ifdef Cubit_USE_BOA +class Cubit_Factory_Impl : public virtual Cubit_FactoryBOAImpl { +#else +class Cubit_Factory_Impl { +#endif + +public: + virtual Cubit_ptr create_cubit (const char * name, CORBA::Environment &IT_env=CORBA::default_environment) throw (CORBA::SystemException); +}; + +class Cubit_Impl_Task : public virtual Cubit_Impl, public virtual ACE_Task<ACE_MT_SYNCH> { +public: + // For ACE_Task + int svc (void); + // for narrowing + virtual void *_deref (); +}; + +#ifndef Cubit_USE_BOA +DEF_TIE_Cubit (Cubit_Impl) +DEF_TIE_Cubit_Factory (Cubit_Factory_Impl) +#endif /* Cubit_USE_BOA */ + +#endif diff --git a/TAO/IIOP/tests/Cubit/Orbix/tps/tps.cpp b/TAO/IIOP/tests/Cubit/Orbix/tps/tps.cpp new file mode 100644 index 00000000000..1035f1e503f --- /dev/null +++ b/TAO/IIOP/tests/Cubit/Orbix/tps/tps.cpp @@ -0,0 +1,26 @@ +#include "tps.h" + +int +TPS_Filter::inRequestPreMarshal(CORBA::Request &r, CORBA::Environment& env) +{ + // Get target + CORBA::Object_ptr obj = r.target (); + Cubit * cb = Cubit::_narrow (obj, env); + + if (env) // Not for our object!! + return 1; // continue in the same thread + + // Enqueue the request + Cubit_Impl_Task *ct; + if (CORBA::is_nil (cb)) + return 1; + ct = (Cubit_Impl_Task *) DEREF(cb); + if (ct) { + ACE_Message_Block *mb = new ACE_Message_Block ( (char *) (&r)); + ct->msg_queue ()->enqueue (mb); + } + // Done + return -1; +} + +TPS_Filter tps_filter; diff --git a/TAO/IIOP/tests/Cubit/Orbix/tps/tps.h b/TAO/IIOP/tests/Cubit/Orbix/tps/tps.h new file mode 100644 index 00000000000..272bc90f20d --- /dev/null +++ b/TAO/IIOP/tests/Cubit/Orbix/tps/tps.h @@ -0,0 +1,11 @@ +#include "cubit.h" +#include "cubit_impl.h" +#include "ace/Service_Config.h" +#include "ace/Thread_Manager.h" +#include "ace/Task.h" + +class TPS_Filter : public ACE_Task<ACE_MT_SYNCH>, public CORBA::ThreadFilter +{ +public: + virtual int inRequestPreMarshal(CORBA::Request &, CORBA::Environment&); +}; |