diff options
Diffstat (limited to 'TAO')
19 files changed, 3724 insertions, 0 deletions
diff --git a/TAO/Benchmark/Marshal_Test/Orbix/Makefile b/TAO/Benchmark/Marshal_Test/Orbix/Makefile new file mode 100644 index 00000000000..df6cd4a0673 --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/Makefile @@ -0,0 +1,75 @@ +#---------------------------------------------------------------------------- +# $Id$ +# +# Top-level Makefile for the Orbix Marshal Benchmark +#---------------------------------------------------------------------------- + +#---------------------------------------------------------------------------- +# Local macros +#---------------------------------------------------------------------------- + +LDLIBS = -lACE -lbenchmark + +PROG_SRCS = marshalC.cpp marshalS.cpp orbix_marshal_client.cpp orbix_marshal_server.cpp \ + orbix_marshal_impl.cpp client.cpp server.cpp + +LSRC = $(PROG_SRCS) + +MARSHAL_CLIENT_OBJS = marshalC.o orbix_marshal_client.o client.o + +ifdef dsi +MARSHAL_SERVER_OBJS = orbix_marshal_impl.o orbix_marshal_server.o server.o +else +MARSHAL_SERVER_OBJS = marshalS.o orbix_marshal_impl.o orbix_marshal_server.o server.o +endif +BIN = client server + +BUILD = $(BIN) + +#CLIENT_LIBS = -lITini -liiop -lorbix +#SERVER_LIBS = -lITini -liiop -lDSI -lorbix -lIRclt +CLIENT_LIBS = -liiop -lorbix +SERVER_LIBS = -liiop -lDSI -lorbix -lIRclt + +VLDLIBS = $(LDLIBS:%=%$(VAR)) + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU +#include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU +# include Orbix specific file +include /project/mambo/gokhale/CONFIG/orbixsol2s4.mk + +#---------------------------------------------------------------------------- +# Local modifications to variables imported by includes above. +#---------------------------------------------------------------------------- + +ifndef TAO_ROOT +TAO_ROOT = $(ACE_ROOT)/TAO +endif + +CPPFLAGS += -I$(TAO_ROOT)/Benchmark + +server: $(addprefix $(VDIR),$(MARSHAL_SERVER_OBJS)) + $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(SERVER_LIBS) + +client: $(addprefix $(VDIR),$(MARSHAL_CLIENT_OBJS)) + $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(CLIENT_LIBS) + +marshal.h marshalC.cpp marshalS.cpp: marshal.idl + $(IDL) $(IDLFLAGS) $< + +clean: + rm -f core *.o *~ client server *C.cpp *S.cpp *S.h *C.h + $(MAKE) realclean + + + + diff --git a/TAO/Benchmark/Marshal_Test/Orbix/client.cpp b/TAO/Benchmark/Marshal_Test/Orbix/client.cpp new file mode 100644 index 00000000000..690221a2b4e --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/client.cpp @@ -0,0 +1,12 @@ +#include "benchmark/driver.h" +#include "orbix_marshal_client.h" + +int main (int argc, char *argv []) +{ + // instantiate a DRIVER with the Orbix_Client_Proxy as the template + CORBA_Benchmark_Driver<Orbix_Marshal_Client_Proxy> driver (new + Orbix_Marshal_Client_Proxy ()); + + // let the driver do everything for us so that we remain very simple + return driver.run (argc, argv); +} diff --git a/TAO/Benchmark/Marshal_Test/Orbix/marshal.h b/TAO/Benchmark/Marshal_Test/Orbix/marshal.h new file mode 100644 index 00000000000..6326c0d315d --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/marshal.h @@ -0,0 +1,1325 @@ +b +#ifndef marshal_h +#define marshal_h + +#include <CORBA.h> + +#include <string.h> + + +#ifndef _IDL_SEQUENCE_any_defined +#define _IDL_SEQUENCE_any_defined + +class _IDL_SEQUENCE_any { + CORBA::ULong _maximum; + CORBA::ULong _length; + CORBA::any* _buffer; + unsigned char _release; + + public: + _IDL_SEQUENCE_any& operator= (const _IDL_SEQUENCE_any&); + _IDL_SEQUENCE_any (const _IDL_SEQUENCE_any&); + + _IDL_SEQUENCE_any (CORBA::ULong max); + _IDL_SEQUENCE_any (CORBA::ULong max, CORBA::ULong length, CORBA::any* data, CORBA::Boolean release = 0); + _IDL_SEQUENCE_any (); + + ~_IDL_SEQUENCE_any (); + + static CORBA::any* allocbuf(CORBA::ULong nelems); + static void freebuf(CORBA::any* data); + + CORBA::ULong maximum() const; + CORBA::ULong length() const; + void length (CORBA::ULong len); + + CORBA::any& operator [] (CORBA::ULong IT_i); + + const CORBA::any& operator [] (CORBA::ULong IT_i) const; + + void encodeOp (CORBA::Request &IT_r) const; + void decodeOp (CORBA::Request &IT_r); + void decodeInOutOp (CORBA::Request &IT_r); +}; + +extern const CORBA::TypeCode_ptr _tc__IDL_SEQUENCE_any; + +#ifndef _IDL_SEQUENCE_anyVarH +#define _IDL_SEQUENCE_anyVarH + +#ifndef _IDL_SEQUENCE_anyvPtr +#define _IDL_SEQUENCE_anyvPtr +typedef _IDL_SEQUENCE_any* _IDL_SEQUENCE_any_vPtr; +typedef const _IDL_SEQUENCE_any* _IDL_SEQUENCE_any_cvPtr; +#endif + +class _IDL_SEQUENCE_any_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const _IDL_SEQUENCE_any_var &IT_s) { + if (!IT_s._ptr) { + _ptr = IT_s._ptr; + } else + { + _ptr = new _IDL_SEQUENCE_any; + *(_ptr) = *(IT_s._ptr); + } + return 1; + } + + public: + + _IDL_SEQUENCE_any_var (const _IDL_SEQUENCE_any_var &IT_s) { + (void) copyHelper (IT_s); + } + + _IDL_SEQUENCE_any_var () { + _ptr = NULL; + } + + _IDL_SEQUENCE_any_var (_IDL_SEQUENCE_any *IT_p) { + _ptr = IT_p; + } + + _IDL_SEQUENCE_any_var &operator= (_IDL_SEQUENCE_any *IT_p) { + if (_ptr != IT_p) { + delete _ptr; + } + _ptr = IT_p; + return (*this); + } + + _IDL_SEQUENCE_any_var &operator= (const _IDL_SEQUENCE_any_var &IT_s) { + if (_ptr != IT_s._ptr) { + delete _ptr; + } + _ptr = new _IDL_SEQUENCE_any; + *(_ptr) = *(IT_s._ptr); + return (*this); + } + + ~_IDL_SEQUENCE_any_var () { + delete _ptr; + } + + _IDL_SEQUENCE_any* operator-> () { + return _ptr; + } + + operator _IDL_SEQUENCE_any_cvPtr () const { return _ptr;} + operator _IDL_SEQUENCE_any_vPtr& () { return _ptr;} + operator _IDL_SEQUENCE_any& () const { return * _ptr;} + + const CORBA::any& operator[] (CORBA::ULong index) const; + + CORBA::any& operator[] (CORBA::ULong index); + + protected: + _IDL_SEQUENCE_any *_ptr; + private: + _IDL_SEQUENCE_any_var &operator= (const CORBA::_var &IT_s); + _IDL_SEQUENCE_any_var (const CORBA::_var &IT_s); +}; + +#endif + + +#endif + + +#ifndef _Marshal_defined +#define _Marshal_defined +class Marshal_dispatch : public virtual CORBA::PPTR { +public: + + Marshal_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) {} + + + Marshal_dispatch (char *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Marshal_dispatch () {} + + Marshal_dispatch (ObjectReference *IT_OR, void *IT_p, CORBA::Object *IT_o) + : PPTR (IT_OR,IT_p,IT_o) {} + + + Marshal_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 Marshal; + +#ifndef MarshalPtr +#define MarshalPtr + +typedef Marshal* Marshal_ptr; + +typedef Marshal* MarshalRef; + +#endif + + +#ifndef MarshalForwH +#define MarshalForwH +CORBA::ObjectRef Marshal_getBase (void *); +void Marshal_release (Marshal *, CORBA::Environment &IT_env); +void Marshal_release (Marshal_ptr); +Marshal* Marshal_duplicate (Marshal_ptr, CORBA::Environment &IT_env); +Marshal* Marshal_duplicate (Marshal_ptr ); +Marshal_ptr Marshal_nil (CORBA::Environment &IT_env); +Marshal_ptr Marshal_nil (); +#endif +#define Marshal_IMPL "Marshal" + + +class Marshal; + +typedef Marshal MarshalProxy; +#define Marshal_IR "Marshal" +#define Marshal_IMPL "Marshal" + +#ifndef MarshalPtr +#define MarshalPtr + +typedef Marshal* Marshal_ptr; + +typedef Marshal* MarshalRef; + +#endif + +class Marshal: public virtual CORBA::Object { +public: + Marshal (char *IT_OR); + Marshal (ObjectReference *IT_OR); + Marshal () : CORBA::Object (1) {} +protected: + Marshal_ptr __duplicate( + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) { + CORBA::Object::__duplicate (IT_env); + return this; + } +public: + static Marshal_ptr _duplicate( + Marshal_ptr, + CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()); +public: + static Marshal* _bind (const char* IT_markerServer, const char* host, + const CORBA::Context &IT_c, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Marshal* _bind (CORBA::Environment &IT_env); + static Marshal* _bind (const char* IT_markerServer=NULL, const char* host=NULL, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + static Marshal* _narrow (CORBA::Object* , CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); +private: + static const void* IT_impl; +public: + static Marshal_ptr _nil (CORBA::Environment &IT_pEnv=CORBA::IT_chooseDefaultEnv ()) { + CORBA::EnvExcRaiser IT_raise; + CORBA::Environment &IT_env = IT_raise.registerEnv (&IT_pEnv); + return (Marshal_ptr) CORBA::OBJECT_NIL;} + +#ifndef Marshal_Marshal_Struct_defined +#define Marshal_Marshal_Struct_defined + +struct Marshal_Struct { + CORBA::Short s; + CORBA::Long l; + CORBA::Char c; + CORBA::Octet o; + CORBA::Double d; + + void encodeOp (CORBA::Request &IT_r) const; + void decodeOp (CORBA::Request &IT_r); + void decodeInOutOp (CORBA::Request &IT_r); + static void* IT_anySupport (CORBA::Request &IT_r, + void *&, void*, const CORBA::Flags&); + static const void *IT_fn; + Marshal_Struct(const Marshal_Struct &); + Marshal_Struct(); + ~Marshal_Struct(); + Marshal_Struct& operator= (const Marshal_Struct&); +}; + +static const CORBA::TypeCode_ptr _tc_Marshal_Struct; + +#ifndef Marshal_Marshal_StructVarH +#define Marshal_Marshal_StructVarH + +#ifndef Marshal_Marshal_StructvPtr +#define Marshal_Marshal_StructvPtr +typedef Marshal_Struct* Marshal_Struct_vPtr; +typedef const Marshal_Struct* Marshal_Struct_cvPtr; +#endif + +class Marshal_Struct_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const Marshal_Struct_var &IT_s) { + if (!IT_s._ptr) { + _ptr = IT_s._ptr; + } else + { + _ptr = new Marshal_Struct; + *(_ptr) = *(IT_s._ptr); + } + return 1; + } + + public: + + Marshal_Struct_var (const Marshal_Struct_var &IT_s) { + (void) copyHelper (IT_s); + } + + Marshal_Struct_var () { + _ptr = new Marshal_Struct; +; + } + + Marshal_Struct_var (Marshal_Struct *IT_p) { + _ptr = IT_p; + } + + Marshal_Struct_var &operator= (Marshal_Struct *IT_p) { + if (_ptr != IT_p) { + delete _ptr; + } + _ptr = IT_p; + return (*this); + } + + Marshal_Struct_var &operator= (const Marshal_Struct_var &IT_s) { + if (_ptr != IT_s._ptr) { + delete _ptr; + } + _ptr = new Marshal_Struct; + *(_ptr) = *(IT_s._ptr); + return (*this); + } + + ~Marshal_Struct_var () { + delete _ptr; + } + + Marshal_Struct* operator-> () { + return _ptr; + } + + operator Marshal_Struct_cvPtr () const { return _ptr;} + operator Marshal_Struct_vPtr& () { return _ptr;} + operator Marshal_Struct& () const { return * _ptr;} + + protected: + Marshal_Struct *_ptr; + private: + Marshal_Struct_var &operator= (const CORBA::_var &IT_s); + Marshal_Struct_var (const CORBA::_var &IT_s); +}; + +#endif + + +#endif + +static const CORBA::TypeCode_ptr _tc_discrim; + +enum discrim {e_0th,e_1st,e_2nd,e_3rd,e_4th,e_5th,e_6th, IT__ENUM_Marshal_discrim=CORBA_ULONG_MAX}; + +#ifndef Marshal_Marshal_Union_defined +#define Marshal_Marshal_Union_defined + +struct Marshal_Union { + private: + + discrim __d; + union { + CORBA::Short _s_; + CORBA::Long _l_; + CORBA::Char _c_; + CORBA::Octet _o_; + CORBA::Double _d_; + Marshal_Struct * _ms_; + }; + + public: + + void encodeOp (CORBA::Request &IT_r) const; + void decodeOp (CORBA::Request &IT_r); + void decodeInOutOp (CORBA::Request &IT_r); + static void* IT_anySupport (CORBA::Request &IT_r, + void *&, void*, const CORBA::Flags&); + static const void *IT_fn; + + private: + + unsigned char isSet; + + public: + + discrim _d () const { return __d; } + + CORBA::Short s () const { + return _s_; + } + + void s (CORBA::Short IT_member) { + if (isSet && (__d != Marshal::e_0th)) + { + this-> Marshal_Union::~Marshal_Union(); + memset(this, 0, sizeof(*this)); + } + + __d = Marshal::e_0th; + isSet = 1; + _s_ = IT_member; + } + + CORBA::Long l () const { + return _l_; + } + + void l (CORBA::Long IT_member) { + if (isSet && (__d != Marshal::e_1st)) + { + this-> Marshal_Union::~Marshal_Union(); + memset(this, 0, sizeof(*this)); + } + + __d = Marshal::e_1st; + isSet = 1; + _l_ = IT_member; + } + + CORBA::Char c () const { + return _c_; + } + + void c (CORBA::Char IT_member) { + if (isSet && (__d != Marshal::e_2nd)) + { + this-> Marshal_Union::~Marshal_Union(); + memset(this, 0, sizeof(*this)); + } + + __d = Marshal::e_2nd; + isSet = 1; + _c_ = IT_member; + } + + CORBA::Octet o () const { + return _o_; + } + + void o (CORBA::Octet IT_member) { + if (isSet && (__d != Marshal::e_3rd)) + { + this-> Marshal_Union::~Marshal_Union(); + memset(this, 0, sizeof(*this)); + } + + __d = Marshal::e_3rd; + isSet = 1; + _o_ = IT_member; + } + + CORBA::Double d () const { + return _d_; + } + + void d (CORBA::Double IT_member) { + if (isSet && (__d != Marshal::e_4th)) + { + this-> Marshal_Union::~Marshal_Union(); + memset(this, 0, sizeof(*this)); + } + + __d = Marshal::e_4th; + isSet = 1; + _d_ = IT_member; + } + + Marshal_Struct& ms () { + return (*_ms_); + } + + const Marshal_Struct& ms () const { + return (*_ms_); + } + + void ms (const Marshal_Struct& IT_member) { + if (isSet && (__d != Marshal::e_6th)) + { + this-> Marshal_Union::~Marshal_Union(); + memset(this, 0, sizeof(*this)); + } + + __d = Marshal::e_6th; + + if (!isSet) { + _ms_ = new Marshal_Struct; + isSet = 1; + } + *(_ms_) = IT_member; + } + + + Marshal_Union(); + Marshal_Union(const Marshal_Union &); + ~Marshal_Union(); + Marshal_Union& operator= (const Marshal_Union&); +}; + +static const CORBA::TypeCode_ptr _tc_Marshal_Union; + +#ifndef Marshal_Marshal_UnionVarH +#define Marshal_Marshal_UnionVarH + +#ifndef Marshal_Marshal_UnionvPtr +#define Marshal_Marshal_UnionvPtr +typedef Marshal_Union* Marshal_Union_vPtr; +typedef const Marshal_Union* Marshal_Union_cvPtr; +#endif + +class Marshal_Union_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const Marshal_Union_var &IT_s) { + if (!IT_s._ptr) { + _ptr = IT_s._ptr; + } else + { + _ptr = new Marshal_Union; + *(_ptr) = *(IT_s._ptr); + } + return 1; + } + + public: + + Marshal_Union_var (const Marshal_Union_var &IT_s) { + (void) copyHelper (IT_s); + } + + Marshal_Union_var () { + _ptr = NULL; + } + + Marshal_Union_var (Marshal_Union *IT_p) { + _ptr = IT_p; + } + + Marshal_Union_var &operator= (Marshal_Union *IT_p) { + if (_ptr != IT_p) { + delete _ptr; + } + _ptr = IT_p; + return (*this); + } + + Marshal_Union_var &operator= (const Marshal_Union_var &IT_s) { + if (_ptr != IT_s._ptr) { + delete _ptr; + } + _ptr = new Marshal_Union; + *(_ptr) = *(IT_s._ptr); + return (*this); + } + + ~Marshal_Union_var () { + delete _ptr; + } + + Marshal_Union* operator-> () { + return _ptr; + } + + operator Marshal_Union_cvPtr () const { return _ptr;} + operator Marshal_Union_vPtr& () { return _ptr;} + operator Marshal_Union& () const { return * _ptr;} + + protected: + Marshal_Union *_ptr; + private: + Marshal_Union_var &operator= (const CORBA::_var &IT_s); + Marshal_Union_var (const CORBA::_var &IT_s); +}; + +#endif + + +#endif +static const CORBA::TypeCode_ptr _tc_AnySeq; + +typedef _IDL_SEQUENCE_any AnySeq; +typedef const _IDL_SEQUENCE_any AnySeq_IT_const; + +typedef _IDL_SEQUENCE_any_var AnySeq_var; + + +#ifndef Marshal__IDL_SEQUENCE_Marshal_Marshal_Recursive_defined +#define Marshal__IDL_SEQUENCE_Marshal_Marshal_Recursive_defined + +struct Marshal_Recursive; +class _IDL_SEQUENCE_Marshal_Marshal_Recursive { + CORBA::ULong _maximum; + CORBA::ULong _length; + Marshal_Recursive* _buffer; + unsigned char _release; + + public: + _IDL_SEQUENCE_Marshal_Marshal_Recursive& operator= (const _IDL_SEQUENCE_Marshal_Marshal_Recursive&); + _IDL_SEQUENCE_Marshal_Marshal_Recursive (const _IDL_SEQUENCE_Marshal_Marshal_Recursive&); + + _IDL_SEQUENCE_Marshal_Marshal_Recursive (CORBA::ULong max); + _IDL_SEQUENCE_Marshal_Marshal_Recursive (CORBA::ULong max, CORBA::ULong length, Marshal_Recursive* data, CORBA::Boolean release = 0); + _IDL_SEQUENCE_Marshal_Marshal_Recursive (); + + ~_IDL_SEQUENCE_Marshal_Marshal_Recursive (); + + static Marshal_Recursive* allocbuf(CORBA::ULong nelems); + static void freebuf(Marshal_Recursive* data); + + CORBA::ULong maximum() const; + CORBA::ULong length() const; + void length (CORBA::ULong len); + + Marshal_Recursive& operator [] (CORBA::ULong IT_i); + + const Marshal_Recursive& operator [] (CORBA::ULong IT_i) const; + + void encodeOp (CORBA::Request &IT_r) const; + void decodeOp (CORBA::Request &IT_r); + void decodeInOutOp (CORBA::Request &IT_r); +}; + +static const CORBA::TypeCode_ptr _tc__IDL_SEQUENCE_Marshal_Marshal_Recursive; + +#ifndef Marshal__IDL_SEQUENCE_Marshal_Marshal_RecursiveVarH +#define Marshal__IDL_SEQUENCE_Marshal_Marshal_RecursiveVarH + +#ifndef Marshal__IDL_SEQUENCE_Marshal_Marshal_RecursivevPtr +#define Marshal__IDL_SEQUENCE_Marshal_Marshal_RecursivevPtr +typedef _IDL_SEQUENCE_Marshal_Marshal_Recursive* _IDL_SEQUENCE_Marshal_Marshal_Recursive_vPtr; +typedef const _IDL_SEQUENCE_Marshal_Marshal_Recursive* _IDL_SEQUENCE_Marshal_Marshal_Recursive_cvPtr; +#endif + +class _IDL_SEQUENCE_Marshal_Marshal_Recursive_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const _IDL_SEQUENCE_Marshal_Marshal_Recursive_var &IT_s) { + if (!IT_s._ptr) { + _ptr = IT_s._ptr; + } else + { + _ptr = new _IDL_SEQUENCE_Marshal_Marshal_Recursive; + *(_ptr) = *(IT_s._ptr); + } + return 1; + } + + public: + + _IDL_SEQUENCE_Marshal_Marshal_Recursive_var (const _IDL_SEQUENCE_Marshal_Marshal_Recursive_var &IT_s) { + (void) copyHelper (IT_s); + } + + _IDL_SEQUENCE_Marshal_Marshal_Recursive_var () { + _ptr = NULL; + } + + _IDL_SEQUENCE_Marshal_Marshal_Recursive_var (_IDL_SEQUENCE_Marshal_Marshal_Recursive *IT_p) { + _ptr = IT_p; + } + + _IDL_SEQUENCE_Marshal_Marshal_Recursive_var &operator= (_IDL_SEQUENCE_Marshal_Marshal_Recursive *IT_p) { + if (_ptr != IT_p) { + delete _ptr; + } + _ptr = IT_p; + return (*this); + } + + _IDL_SEQUENCE_Marshal_Marshal_Recursive_var &operator= (const _IDL_SEQUENCE_Marshal_Marshal_Recursive_var &IT_s) { + if (_ptr != IT_s._ptr) { + delete _ptr; + } + _ptr = new _IDL_SEQUENCE_Marshal_Marshal_Recursive; + *(_ptr) = *(IT_s._ptr); + return (*this); + } + + ~_IDL_SEQUENCE_Marshal_Marshal_Recursive_var () { + delete _ptr; + } + + _IDL_SEQUENCE_Marshal_Marshal_Recursive* operator-> () { + return _ptr; + } + + operator _IDL_SEQUENCE_Marshal_Marshal_Recursive_cvPtr () const { return _ptr;} + operator _IDL_SEQUENCE_Marshal_Marshal_Recursive_vPtr& () { return _ptr;} + operator _IDL_SEQUENCE_Marshal_Marshal_Recursive& () const { return * _ptr;} + + const Marshal_Recursive& operator[] (CORBA::ULong index) const; + + Marshal_Recursive& operator[] (CORBA::ULong index); + + protected: + _IDL_SEQUENCE_Marshal_Marshal_Recursive *_ptr; + private: + _IDL_SEQUENCE_Marshal_Marshal_Recursive_var &operator= (const CORBA::_var &IT_s); + _IDL_SEQUENCE_Marshal_Marshal_Recursive_var (const CORBA::_var &IT_s); +}; + +#endif + + +#endif + + +#ifndef Marshal_Marshal_Recursive_defined +#define Marshal_Marshal_Recursive_defined + +struct Marshal_Recursive { + CORBA::any value; + _IDL_SEQUENCE_Marshal_Marshal_Recursive next; + + void encodeOp (CORBA::Request &IT_r) const; + void decodeOp (CORBA::Request &IT_r); + void decodeInOutOp (CORBA::Request &IT_r); + static void* IT_anySupport (CORBA::Request &IT_r, + void *&, void*, const CORBA::Flags&); + static const void *IT_fn; + Marshal_Recursive(const Marshal_Recursive &); + Marshal_Recursive(); + ~Marshal_Recursive(); + Marshal_Recursive& operator= (const Marshal_Recursive&); +}; + +static const CORBA::TypeCode_ptr _tc_Marshal_Recursive; + +#ifndef Marshal_Marshal_RecursiveVarH +#define Marshal_Marshal_RecursiveVarH + +#ifndef Marshal_Marshal_RecursivevPtr +#define Marshal_Marshal_RecursivevPtr +typedef Marshal_Recursive* Marshal_Recursive_vPtr; +typedef const Marshal_Recursive* Marshal_Recursive_cvPtr; +#endif + +class Marshal_Recursive_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const Marshal_Recursive_var &IT_s) { + if (!IT_s._ptr) { + _ptr = IT_s._ptr; + } else + { + _ptr = new Marshal_Recursive; + *(_ptr) = *(IT_s._ptr); + } + return 1; + } + + public: + + Marshal_Recursive_var (const Marshal_Recursive_var &IT_s) { + (void) copyHelper (IT_s); + } + + Marshal_Recursive_var () { + _ptr = NULL; + } + + Marshal_Recursive_var (Marshal_Recursive *IT_p) { + _ptr = IT_p; + } + + Marshal_Recursive_var &operator= (Marshal_Recursive *IT_p) { + if (_ptr != IT_p) { + delete _ptr; + } + _ptr = IT_p; + return (*this); + } + + Marshal_Recursive_var &operator= (const Marshal_Recursive_var &IT_s) { + if (_ptr != IT_s._ptr) { + delete _ptr; + } + _ptr = new Marshal_Recursive; + *(_ptr) = *(IT_s._ptr); + return (*this); + } + + ~Marshal_Recursive_var () { + delete _ptr; + } + + Marshal_Recursive* operator-> () { + return _ptr; + } + + operator Marshal_Recursive_cvPtr () const { return _ptr;} + operator Marshal_Recursive_vPtr& () { return _ptr;} + operator Marshal_Recursive& () const { return * _ptr;} + + protected: + Marshal_Recursive *_ptr; + private: + Marshal_Recursive_var &operator= (const CORBA::_var &IT_s); + Marshal_Recursive_var (const CORBA::_var &IT_s); +}; + +#endif + + +#endif + + virtual void test_short (CORBA::Short s1, CORBA::Short& s2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual void test_long (CORBA::Long l1, CORBA::Long& l2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual void test_octet (CORBA::Octet o1, CORBA::Octet& o2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual void test_char (CORBA::Char c1, CORBA::Char& c2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual void test_double (CORBA::Double d1, CORBA::Double& d2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual void test_struct (const Marshal_Struct& ms1, Marshal_Struct& ms2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual void test_union (const Marshal_Union& u1, Marshal_Union& u2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual void test_any (const CORBA::any& a1, CORBA::any*& a2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual void test_sequence (const AnySeq& as1, AnySeq*& as2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); + virtual void test_recursive (const Marshal_Recursive& mr1, Marshal_Recursive*& mr2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException); +}; + +extern const CORBA::TypeCode_ptr _tc_MarshalRef; + +#ifndef MarshalVarH +#define MarshalVarH + +#ifndef MarshalvPtr +#define MarshalvPtr +typedef Marshal* Marshal_vPtr; +typedef const Marshal* Marshal_cvPtr; +#endif + +class Marshal_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const Marshal_var &IT_s) { + { + _ptr = Marshal_duplicate (IT_s._ptr); + } + return 1; + } + + public: + + Marshal_var (const Marshal_var &IT_s) { + (void) copyHelper (IT_s); + } + + Marshal_var () { + _ptr = Marshal_nil (); + } + + Marshal_var (Marshal *IT_p) { + _ptr = IT_p; + } + + Marshal_var &operator= (Marshal *IT_p) { + Marshal_release (_ptr); + _ptr = IT_p; + return (*this); + } + + Marshal_var &operator= (const Marshal_var &IT_s) { + Marshal_release (_ptr); + _ptr = Marshal_duplicate (IT_s._ptr); + return (*this); + } + + ~Marshal_var () { + Marshal_release (_ptr); + } + + Marshal* operator-> () { + return _ptr; + } + + operator Marshal_cvPtr () const { return _ptr;} + operator Marshal_vPtr& () { return _ptr;} + + protected: + Marshal *_ptr; + private: + Marshal_var &operator= (const CORBA::_var &IT_s); + Marshal_var (const CORBA::_var &IT_s); + Marshal_var &operator= (const CORBA::_mgr &IT_s); + Marshal_var &operator= (const CORBA::_SeqElem &IT_s); + Marshal_var (const CORBA::_mgr &IT_s); + Marshal_var (const CORBA::_SeqElem &IT_s); +}; + +#endif + + +#ifndef MarshalMgrH +#define MarshalMgrH + +class Marshal_mgr : public CORBA::_mgr +{ + public: + + Marshal_mgr () { + _ptr = Marshal_nil (); + _release = 1; + } + + Marshal_mgr (const Marshal_mgr &IT_s) { + _ptr = Marshal_duplicate (IT_s._ptr); + _release = 1; + } + + Marshal_mgr &operator= (Marshal *IT_p) { + if (_ptr && _release) + Marshal_release (_ptr); + _ptr = IT_p; + _release = 1; + return (*this); + } + + Marshal_mgr &operator= (const Marshal_mgr &IT_s) { + if (_ptr && _release) + Marshal_release (_ptr); + _ptr = Marshal_duplicate(IT_s._ptr); + _release = 1; + return (*this); + } + + Marshal_mgr &operator= (Marshal_var &IT_s) { + if (_ptr && _release) + Marshal_release (_ptr); + _ptr = Marshal_duplicate(IT_s); + _release = 1; + return (*this); + } + + ~Marshal_mgr () { + if (_release) + Marshal_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 Marshal* () const { + return (Marshal*) _ptr; + } + + Marshal_ptr operator-> () const { + return _ptr; + } + + Marshal *_ptr; + + protected: + + unsigned char _release; +}; + +typedef Marshal_mgr Marshal_mgr_IT_const; +#endif + +#ifndef MarshalSeqElemH +#define MarshalSeqElemH + +class Marshal_SeqElem : public CORBA::_SeqElem +{ + public: + + Marshal_SeqElem (Marshal_ptr* IT_p, unsigned char rel) { + _ptr = IT_p; + _release = rel; + } + + Marshal_SeqElem &operator= (Marshal_ptr IT_p) { + if (_ptr) { + if (*(_ptr) && _release) + Marshal_release (*(_ptr)); + *(_ptr) = IT_p; + } + return (*this); + } + + Marshal_SeqElem &operator= (const Marshal_SeqElem &IT_s) { + if (_ptr && IT_s._ptr) { + if (*(_ptr) && _release) + Marshal_release (*(_ptr)); + *(_ptr) = Marshal_duplicate(*(IT_s._ptr)); + } + return (*this); + } + + operator Marshal_ptr () const { + return _ptr ? (Marshal_ptr) (*_ptr) : Marshal_nil(); + } + + Marshal_ptr operator->() const { return *_ptr;} + + protected: + Marshal_ptr *_ptr; + unsigned char _release; +}; + +#endif + + +#define TIE_Marshal(X) Marshal##X + +#define DEF_TIE_Marshal(X) \ + class Marshal##X : public virtual Marshal { \ + X* m_obj; \ + public: \ + \ + \ + Marshal##X (X *objp, const char* m="", CORBA::LoaderClass *l=0)\ + : Marshal(), m_obj(objp) { \ + m_pptr = new Marshal_dispatch \ + (( Marshal*)this,(CORBA::Object*)this,m,l,Marshal_IR,m_obj); \ + } \ + Marshal##X (CORBA::Object *IT_p, const char* IT_m="", void *IT_q=0)\ + : Marshal() { \ + m_pptr = new Marshal_dispatch \ + (( Marshal*)this,(CORBA::Object*)this,IT_m,Marshal_IR,IT_p,IT_q); \ + m_obj = (X*)(m_pptr->getImplObj ()); \ + } \ + \ + virtual ~Marshal##X () { \ + if (_okToDeleteImpl ()) delete m_obj; } \ + virtual void* _deref () { \ + return m_obj; } \ + \ +virtual void test_short (CORBA::Short s1, CORBA::Short& s2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_short ( s1, s2,IT_env);\ +}\ + \ +virtual void test_long (CORBA::Long l1, CORBA::Long& l2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_long ( l1, l2,IT_env);\ +}\ + \ +virtual void test_octet (CORBA::Octet o1, CORBA::Octet& o2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_octet ( o1, o2,IT_env);\ +}\ + \ +virtual void test_char (CORBA::Char c1, CORBA::Char& c2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_char ( c1, c2,IT_env);\ +}\ + \ +virtual void test_double (CORBA::Double d1, CORBA::Double& d2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_double ( d1, d2,IT_env);\ +}\ + \ +virtual void test_struct (const Marshal::Marshal_Struct& ms1, Marshal::Marshal_Struct& ms2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_struct ( ms1, ms2,IT_env);\ +}\ + \ +virtual void test_union (const Marshal::Marshal_Union& u1, Marshal::Marshal_Union& u2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_union ( u1, u2,IT_env);\ +}\ + \ +virtual void test_any (const CORBA::any& a1, CORBA::any*& a2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_any ( a1, a2,IT_env);\ +}\ + \ +virtual void test_sequence (const Marshal::AnySeq& as1, Marshal::AnySeq*& as2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_sequence ( as1, as2,IT_env);\ +}\ + \ +virtual void test_recursive (const Marshal::Marshal_Recursive& mr1, Marshal::Marshal_Recursive*& mr2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_recursive ( mr1, mr2,IT_env);\ +}\ + \ + }; \ + + +#define QUALS_Marshal \ +virtual void test_short (CORBA::Short s1, CORBA::Short& s2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_short ( s1, s2,IT_env);\ +}\ + \ +virtual void test_long (CORBA::Long l1, CORBA::Long& l2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_long ( l1, l2,IT_env);\ +}\ + \ +virtual void test_octet (CORBA::Octet o1, CORBA::Octet& o2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_octet ( o1, o2,IT_env);\ +}\ + \ +virtual void test_char (CORBA::Char c1, CORBA::Char& c2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_char ( c1, c2,IT_env);\ +}\ + \ +virtual void test_double (CORBA::Double d1, CORBA::Double& d2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_double ( d1, d2,IT_env);\ +}\ + \ +virtual void test_struct (const Marshal_Struct& ms1, Marshal_Struct& ms2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_struct ( ms1, ms2,IT_env);\ +}\ + \ +virtual void test_union (const Marshal_Union& u1, Marshal_Union& u2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_union ( u1, u2,IT_env);\ +}\ + \ +virtual void test_any (const CORBA::any& a1, CORBA::any*& a2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_any ( a1, a2,IT_env);\ +}\ + \ +virtual void test_sequence (const AnySeq& as1, AnySeq*& as2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_sequence ( as1, as2,IT_env);\ +}\ + \ +virtual void test_recursive (const Marshal_Recursive& mr1, Marshal_Recursive*& mr2, CORBA::Environment &IT_env) throw (CORBA::SystemException){\ +m_obj->test_recursive ( mr1, mr2,IT_env);\ +}\ + + + + +class MarshalProxyFactoryClass : public virtual CORBA::ObjectFactoryClass { +public: + MarshalProxyFactoryClass (unsigned char IT_p=0) + : CORBA::ProxyFactory (Marshal_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 MarshalProxyFactoryClass MarshalProxyFactory; + +class MarshalBOAImpl : public virtual Marshal { +public: + MarshalBOAImpl (const char *m="", CORBA::LoaderClass *l=NULL) { + if (CORBA::PPTR::isOK (m_pptr, Marshal_IR)) + m_pptr = new Marshal_dispatch ( (Marshal*)this, + (CORBA::Object*)this, m, l, Marshal_IR, this); +} + + virtual void test_short (CORBA::Short s1, CORBA::Short& s2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual void test_long (CORBA::Long l1, CORBA::Long& l2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual void test_octet (CORBA::Octet o1, CORBA::Octet& o2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual void test_char (CORBA::Char c1, CORBA::Char& c2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual void test_double (CORBA::Double d1, CORBA::Double& d2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual void test_struct (const Marshal_Struct& ms1, Marshal_Struct& ms2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual void test_union (const Marshal_Union& u1, Marshal_Union& u2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual void test_any (const CORBA::any& a1, CORBA::any*& a2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual void test_sequence (const AnySeq& as1, AnySeq*& as2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; + virtual void test_recursive (const Marshal_Recursive& mr1, Marshal_Recursive*& mr2, CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException) =0; +}; + + +#endif + + +#ifndef _IDL_SEQUENCE_Marshal_Marshal_Recursive_defined +#define _IDL_SEQUENCE_Marshal_Marshal_Recursive_defined + +class _IDL_SEQUENCE_Marshal_Marshal_Recursive { + CORBA::ULong _maximum; + CORBA::ULong _length; + Marshal::Marshal_Recursive* _buffer; + unsigned char _release; + + public: + _IDL_SEQUENCE_Marshal_Marshal_Recursive& operator= (const _IDL_SEQUENCE_Marshal_Marshal_Recursive&); + _IDL_SEQUENCE_Marshal_Marshal_Recursive (const _IDL_SEQUENCE_Marshal_Marshal_Recursive&); + + _IDL_SEQUENCE_Marshal_Marshal_Recursive (CORBA::ULong max); + _IDL_SEQUENCE_Marshal_Marshal_Recursive (CORBA::ULong max, CORBA::ULong length, Marshal::Marshal_Recursive* data, CORBA::Boolean release = 0); + _IDL_SEQUENCE_Marshal_Marshal_Recursive (); + + ~_IDL_SEQUENCE_Marshal_Marshal_Recursive (); + + static Marshal::Marshal_Recursive* allocbuf(CORBA::ULong nelems); + static void freebuf(Marshal::Marshal_Recursive* data); + + CORBA::ULong maximum() const; + CORBA::ULong length() const; + void length (CORBA::ULong len); + + Marshal::Marshal_Recursive& operator [] (CORBA::ULong IT_i); + + const Marshal::Marshal_Recursive& operator [] (CORBA::ULong IT_i) const; + + void encodeOp (CORBA::Request &IT_r) const; + void decodeOp (CORBA::Request &IT_r); + void decodeInOutOp (CORBA::Request &IT_r); +}; + +extern const CORBA::TypeCode_ptr _tc__IDL_SEQUENCE_Marshal_Marshal_Recursive; + +#ifndef _IDL_SEQUENCE_Marshal_Marshal_RecursiveVarH +#define _IDL_SEQUENCE_Marshal_Marshal_RecursiveVarH + +#ifndef _IDL_SEQUENCE_Marshal_Marshal_RecursivevPtr +#define _IDL_SEQUENCE_Marshal_Marshal_RecursivevPtr +typedef _IDL_SEQUENCE_Marshal_Marshal_Recursive* _IDL_SEQUENCE_Marshal_Marshal_Recursive_vPtr; +typedef const _IDL_SEQUENCE_Marshal_Marshal_Recursive* _IDL_SEQUENCE_Marshal_Marshal_Recursive_cvPtr; +#endif + +class _IDL_SEQUENCE_Marshal_Marshal_Recursive_var : public CORBA::_var +{ + private: + + unsigned char copyHelper (const _IDL_SEQUENCE_Marshal_Marshal_Recursive_var &IT_s) { + if (!IT_s._ptr) { + _ptr = IT_s._ptr; + } else + { + _ptr = new _IDL_SEQUENCE_Marshal_Marshal_Recursive; + *(_ptr) = *(IT_s._ptr); + } + return 1; + } + + public: + + _IDL_SEQUENCE_Marshal_Marshal_Recursive_var (const _IDL_SEQUENCE_Marshal_Marshal_Recursive_var &IT_s) { + (void) copyHelper (IT_s); + } + + _IDL_SEQUENCE_Marshal_Marshal_Recursive_var () { + _ptr = NULL; + } + + _IDL_SEQUENCE_Marshal_Marshal_Recursive_var (_IDL_SEQUENCE_Marshal_Marshal_Recursive *IT_p) { + _ptr = IT_p; + } + + _IDL_SEQUENCE_Marshal_Marshal_Recursive_var &operator= (_IDL_SEQUENCE_Marshal_Marshal_Recursive *IT_p) { + if (_ptr != IT_p) { + delete _ptr; + } + _ptr = IT_p; + return (*this); + } + + _IDL_SEQUENCE_Marshal_Marshal_Recursive_var &operator= (const _IDL_SEQUENCE_Marshal_Marshal_Recursive_var &IT_s) { + if (_ptr != IT_s._ptr) { + delete _ptr; + } + _ptr = new _IDL_SEQUENCE_Marshal_Marshal_Recursive; + *(_ptr) = *(IT_s._ptr); + return (*this); + } + + ~_IDL_SEQUENCE_Marshal_Marshal_Recursive_var () { + delete _ptr; + } + + _IDL_SEQUENCE_Marshal_Marshal_Recursive* operator-> () { + return _ptr; + } + + operator _IDL_SEQUENCE_Marshal_Marshal_Recursive_cvPtr () const { return _ptr;} + operator _IDL_SEQUENCE_Marshal_Marshal_Recursive_vPtr& () { return _ptr;} + operator _IDL_SEQUENCE_Marshal_Marshal_Recursive& () const { return * _ptr;} + + const Marshal::Marshal_Recursive& operator[] (CORBA::ULong index) const; + + Marshal::Marshal_Recursive& operator[] (CORBA::ULong index); + + protected: + _IDL_SEQUENCE_Marshal_Marshal_Recursive *_ptr; + private: + _IDL_SEQUENCE_Marshal_Marshal_Recursive_var &operator= (const CORBA::_var &IT_s); + _IDL_SEQUENCE_Marshal_Marshal_Recursive_var (const CORBA::_var &IT_s); +}; + +#endif + + +#endif + + +void operator<<= (CORBA::any &IT_a, const Marshal::Marshal_Union& IT_t); +CORBA::Boolean operator>>= (const CORBA::any &IT_a, Marshal::Marshal_Union*& IT_t); + + +void operator<<= (CORBA::any &IT_a, const Marshal::Marshal_Recursive& IT_t); +CORBA::Boolean operator>>= (const CORBA::any &IT_a, Marshal::Marshal_Recursive*& IT_t); + + +void operator<<= (CORBA::any &IT_a, Marshal_ptr IT_t); +CORBA::Boolean operator>>= (const CORBA::any &IT_a, Marshal_ptr& IT_t); + + +void operator<<= (CORBA::any &IT_a, const Marshal::_IDL_SEQUENCE_Marshal_Marshal_Recursive& IT_t); +CORBA::Boolean operator>>= (const CORBA::any &IT_a, Marshal::_IDL_SEQUENCE_Marshal_Marshal_Recursive*& IT_t); + + +void operator<<= (CORBA::any &IT_a, const _IDL_SEQUENCE_Marshal_Marshal_Recursive& IT_t); +CORBA::Boolean operator>>= (const CORBA::any &IT_a, _IDL_SEQUENCE_Marshal_Marshal_Recursive*& IT_t); + + +void operator<<= (CORBA::any &IT_a, Marshal::discrim IT_t); +CORBA::Boolean operator>>= (const CORBA::any &IT_a, Marshal::discrim& IT_t); + + +void operator<<= (CORBA::any &IT_a, const _IDL_SEQUENCE_any& IT_t); +CORBA::Boolean operator>>= (const CORBA::any &IT_a, _IDL_SEQUENCE_any*& IT_t); + + +void operator<<= (CORBA::any &IT_a, const Marshal::Marshal_Struct& IT_t); +CORBA::Boolean operator>>= (const CORBA::any &IT_a, Marshal::Marshal_Struct*& IT_t); + + +#endif diff --git a/TAO/Benchmark/Marshal_Test/Orbix/marshal.idl b/TAO/Benchmark/Marshal_Test/Orbix/marshal.idl new file mode 100644 index 00000000000..16d60e1064f --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/marshal.idl @@ -0,0 +1,88 @@ +// Interface for the marshal benchmark + +interface Marshal +{ + struct Marshal_Struct + { + short s; + long l; + char c; + octet o; + double d; + }; + + enum discrim {e_0th, e_1st, e_2nd, e_3rd, e_4th, e_5th, e_6th}; + + union Marshal_Union + switch (discrim) + { + case e_0th: + short s; + case e_1st: + long l; + case e_2nd: + char c; + case e_3rd: + octet o; + case e_4th: + double d; + default: // this will test typecode indirection + Marshal_Struct ms; + }; + + /* + typedef sequence<short> ShortSeq; + typedef sequence<long> LongSeq; + typedef sequence<octet> OctetSeq; + typedef sequence<char> CharSeq; + typedef sequence<double> DoubleSeq; + typedef sequence<Marshal_Struct> StructSeq; + typedef sequence<Marshal_Union> UnionSeq; + */ + // for testing sequences of Any + typedef sequence<any> AnySeq; + + // testing recursive behavior + // complex. + struct Marshal_Recursive + { + // we use this to test the limited recursion allowed by IDL. This is an + // ideal test for indirected typecodes. + + // simulate a behavior of a list node + any value; + sequence <Marshal_Recursive> next; + }; + + void test_short (in short s1, out short s2); // test a short + void test_long (in long l1, out long l2); // test a long + void test_octet (in octet o1, out octet o2); // test an octet + void test_char (in char c1, out char c2); // test a char + void test_double (in double d1, out double d2); // test a double + void test_struct (in Marshal_Struct ms1, out Marshal_Struct ms2); // test a + // struct + void test_union (in Marshal_Union u1, out Marshal_Union u2); // test a + // union. + void test_any (in any a1, out any a2); // test an Any + /* + void test_sequence (in ShortSeq ss1, in LongSeq ls1, in OctetSeq os1, in + CharSeq cs1, in DoubleSeq ds1, in StructSeq Ss1, in + UnionSeq us1, in AnySeq as1, + out ShortSeq ss2, out LongSeq ls2, out OctetSeq os2, out + CharSeq cs2, out DoubleSeq ds2, out StructSeq Ss2, out + UnionSeq us2, out AnySeq as2); + */ + void test_sequence (in AnySeq as1, out AnySeq as2); // this will result in a + // 3 level indirection - + // sequence, any, and its + // value type + void test_recursive (in Marshal_Recursive mr1, out Marshal_Recursive mr2); // + // very complicated +}; + + + + + + + diff --git a/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_client.cpp b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_client.cpp new file mode 100644 index 00000000000..94058ebac1a --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_client.cpp @@ -0,0 +1,1334 @@ +// ============================================================================ +// +// = LIBRARY +// CORBA Orbix marshal benchmark +// +// = FILENAME +// orbix_marshal_proxy.cpp +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +//#define USE_INIT +#include "orbix_marshal_client.h" + +#if !defined (__ACE_INLINE__) +#include "orbix_marshal_client.i" +#endif /* __ACE_INLINE__ */ + +int +Orbix_Marshal_Client_Proxy::run (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) +{ + char **argv; + int argc; + CORBA::Object_ptr target; + char *markerserver; + int mlen=0, slen=0; // length of marker and service name + +#if 0 + // get the argument list to be passed on to the ORB_init method + argv = options.orb_init_args (argc); + + // get the orb. Pass any ORB_init arguments + this->orb_ = CORBA::ORB_init (argc, (char *const *)argv, "Orbix"); + if (this->orb_ == 0) + { + ACE_DEBUG ((LM_DEBUG, "ORB_init failed\n")); + return -1; + } +#endif + + // create a marker server + if (options.service_name ()) + slen = ACE_OS::strlen (options.service_name ()); + if (options.object_name ()) + mlen = ACE_OS::strlen (options.object_name ()); + + if (slen > 0) + { + markerserver = new char [mlen+slen+1+1]; + ACE_OS::sprintf (markerserver, "%s:%s", (mlen ? options.object_name ():""), + options.service_name ()); + ACE_DEBUG ((LM_DEBUG, "markerserver = %s\n", markerserver)); + } + else // server name is required + { + markerserver = NULL; + } + + // get the obj ref by binding it to the specified host using the specified obj_name + try { + target = Marshal::_bind (markerserver, options.hostname ()); + } + catch (CORBA::SystemException &se) + { + cerr << "failed to bind: " << &se << endl; + return 0; + } + if (CORBA::is_nil (target)) + { + ACE_DEBUG ((LM_DEBUG, "bind call failed\n")); + return -1; + } + + this->ref_ = Marshal::_narrow (target); + if (CORBA::is_nil (this->ref_)) + { + ACE_DEBUG ((LM_DEBUG, "narrow to Marshal failed\n")); + return -1; + } + + // tell the "results" object what file it must store the results into + results.filename (options.filename ()); + + // use SII or DII accordingly + switch (options.policy ()) + { + case CORBA_Marshal_Options::STATIC : // use SII + return this->use_sii (options, results); + break; + case CORBA_Marshal_Options::DYNAMIC : // use DII + return this->use_dii (options, results); + break; + default: + ACE_DEBUG ((LM_DEBUG, "bad policy\n")); + return -1; + } + // hopefully we are never here, else something is seriously wrong + return -1; +} + +int +Orbix_Marshal_Client_Proxy::use_sii (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) +{ + int i; + int status = 0; + // This method tests the static invocation interface + + for (i=0; i < options.iterations () && !status; i++) + { + switch (options.data_type ()) + { + // shorts + case CORBA_Marshal_Options::SHORT: + status = sii_test_short (options, results); + break; + // longs + case CORBA_Marshal_Options::LONG: + status = sii_test_long (options, results); + break; + // octets + case CORBA_Marshal_Options::OCTET: + status = sii_test_octet (options, results); + break; + // chars + case CORBA_Marshal_Options::CHAR: + status = sii_test_char (options, results); + break; + // doubles + case CORBA_Marshal_Options::DOUBLE: + status = sii_test_double (options, results); + break; + // Structs + case CORBA_Marshal_Options::STRUCT: + status = sii_test_struct (options, results); + break; + // unions + case CORBA_Marshal_Options::UNION: + status = sii_test_union (options, results); + break; + // anys + case CORBA_Marshal_Options::ANY: + status = sii_test_any (options, results); + break; + // sequences + case CORBA_Marshal_Options::SEQUENCE: + status = sii_test_sequence (options, results); + break; + // longs + case CORBA_Marshal_Options::RECURSIVE: + // status = sii_test_recursive (options, results); + // doesn't work + break; + default: + status = -1; + } // end of switch + } // for loop + + if (!status) + return 0; + else + return -1; +} + +int +Orbix_Marshal_Client_Proxy::use_dii (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) +{ + int i; + int status = 0; + // This method tests the dynamic invocation interface + + for (i=0; i < options.iterations () && !status; i++) + { + switch (options.data_type ()) + { + // shorts + case CORBA_Marshal_Options::SHORT: + status = dii_test_short (options, results); + break; + // longs + case CORBA_Marshal_Options::LONG: + status = dii_test_long (options, results); + break; + // octets + case CORBA_Marshal_Options::OCTET: + status = dii_test_octet (options, results); + break; + // chars + case CORBA_Marshal_Options::CHAR: + status = dii_test_char (options, results); + break; + // doubles + case CORBA_Marshal_Options::DOUBLE: + status = dii_test_double (options, results); + break; + // Structs + case CORBA_Marshal_Options::STRUCT: + status = dii_test_struct (options, results); + break; + // unions + case CORBA_Marshal_Options::UNION: + status = dii_test_union (options, results); + break; + // anys + case CORBA_Marshal_Options::ANY: + status = dii_test_any (options, results); + break; + // sequences + case CORBA_Marshal_Options::SEQUENCE: + status = dii_test_sequence (options, results); + break; + // longs + case CORBA_Marshal_Options::RECURSIVE: + // status = dii_test_recursive (options, results); + // doesn't work + break; + default: + status = -1; + } // end of switch + } // for loop + + if (!status) + return 0; + else + return -1; +} + + +// all helper functions : SII +int +Orbix_Marshal_Client_Proxy::sii_test_short (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) +{ + CORBA::Short s1, s2; + s1 = 3; + ref_->test_short (s1, s2); + if (s2 == 2*s1) + { + ACE_DEBUG ((LM_DEBUG, "SII test_short success: s1 = %d, s2 = %d\n", s1, s2)); + return 0; + } + else + { + ACE_DEBUG ((LM_DEBUG, "SII test_short failed: s1 = %d, s2 = %d\n", s1, s2)); + return -1; + } +} + +int +Orbix_Marshal_Client_Proxy::sii_test_long (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) +{ + CORBA::Long l1, l2; + l1 = 256; + ref_->test_long (l1, l2); + if (l2 == 3*l1) + { + ACE_DEBUG ((LM_DEBUG, "SII test_long success: l1 = %d, l2 = %d\n", l1, l2)); + return 0; + } + else + { + ACE_DEBUG ((LM_DEBUG, "SII test_long failed: l1 = %d, l2 = %d\n", l1, l2)); + return -1; + } +} + +int +Orbix_Marshal_Client_Proxy::sii_test_octet (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) + // octets +{ + CORBA::Octet o1, o2; + o1 = (CORBA::Octet) 127; + ref_->test_octet (o1, o2); + if (o1 == o2) + { + ACE_DEBUG ((LM_DEBUG, "SII test_octet success: o1 = %c, o2 = %c\n", o1, o2)); + return 0; + } + else + { + ACE_DEBUG ((LM_DEBUG, "SII test_octet failed: o1 = %c, o2 = %c\n", o1, o2)); + return -1; + } +} + +int +Orbix_Marshal_Client_Proxy::sii_test_char (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) + // chars +{ + CORBA::Char c1, c2; + c1 = 'B'; + ref_->test_char (c1, c2); + if (c1 == c2) + { + ACE_DEBUG ((LM_DEBUG, "SII test_char success: c1 = %c, c2 = %c\n", c1, c2)); + return 0; + } + else + { + ACE_DEBUG ((LM_DEBUG, "SII test_char failed: c1 = %c, c2 = %c\n", c1, c2)); + return -1; + } +} + +int +Orbix_Marshal_Client_Proxy::sii_test_double (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) + // doubles +{ + CORBA::Double d1, d2; + d1 = 3.1415; + ref_->test_double (d1, d2); + if (d2 == d1/2) + { + ACE_DEBUG ((LM_DEBUG, "SII test_double success: d1 = %f, d2 = %f\n", d1, d2)); + return 0; + } + else + { + ACE_DEBUG ((LM_DEBUG, "SII test_double failed: d1 = %f, d2 = %f\n", d1, d2)); + return -1; + } +} + +int +Orbix_Marshal_Client_Proxy::sii_test_struct (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) + // structs +{ + Marshal::Marshal_Struct ms1, ms2; + + ms1.s = 3; + ms1.l = 256; + ms1.c = 'B'; + ms1.o = (CORBA::Octet) 127; + ms1.d = 3.1415; + + ref_->test_struct (ms1, ms2); + if (ms1.s == ms2.s && ms1.l == ms2.l && ms1.c == ms2.c && ms1.o == ms2.o && + ms1.d == ms2.d) + { + ACE_DEBUG ((LM_DEBUG, "SII test_struct success\n")); + return 0; + } + else + { + ACE_DEBUG ((LM_DEBUG, "SII test_struct failed\n")); + return -1; + } +} + +int +Orbix_Marshal_Client_Proxy::sii_test_union (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) + // unions +{ + Marshal::Marshal_Union u1, u2; + Marshal::Marshal_Struct ms; + + // first test an enumerated case + // u1._d (Marshal::e_1st); Orbix does this on its own + u1.l (4567); + + ref_->test_union (u1, u2); + if ( (u1._d () == u2._d()) && (u1.l () == u2.l ())) + { + ACE_DEBUG ((LM_DEBUG, "SII test_union for long (case e_1st) success\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "SII test_union for long (case e_1st) failed\n")); + return -1; + } + + // now test the default case + // In Orbix, setting each field like this will not work because the poor + // Union has no clue what discriminant it must set to. +#if 0 + u1.ms ().s = 3; + u1.ms ().l = 256; + u1.ms ().c = 'B'; + u1.ms ().o = (CORBA::Octet) 127; + u1.ms ().d = 3.1415; +#endif + ms.s = 3; + ms.l = 256; + ms.c = 'B'; + ms.o = (CORBA::Octet) 127; + ms.d = 3.1415; + + u1.ms (ms); + + ref_->test_union (u1, u2); + + if (u1.ms ().s == u2.ms ().s && u1.ms ().l == u2.ms ().l && u1.ms ().c == u2.ms ().c && u1.ms ().o == u2.ms ().o && + u1.ms ().d == u2.ms ().d) + { + ACE_DEBUG ((LM_DEBUG, "SII test_union for default (case e_6th) success\n")); + return 0; + } + else + { + ACE_DEBUG ((LM_DEBUG, "SII test_union for default (case e_6th) failed\n")); + return -1; + } +} + +int +Orbix_Marshal_Client_Proxy::sii_test_any (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) +{ + // we send a struct thru the any + CORBA::Any a1, *a2; + Marshal::Marshal_Struct ms1, *ms2; + + ms1.s = 3; + ms1.l = 256; + ms1.c = 'B'; + ms1.o = (CORBA::Octet) 127; + ms1.d = 3.1415; + + // populate the any with a MarshalStruct + a1 <<= ms1; + + a2 = new CORBA::Any; + + // now test it + ref_->test_any (a1, a2); + + // check if the two typecodes are equal + if (a2->type ()->equal (Marshal::_tc_Marshal_Struct)) + { + // now see if the values are same + ms2 = (Marshal::Marshal_Struct *)a2->value (); + if (ms1.s == ms2->s && ms1.l == ms2->l && ms1.c == ms2->c && ms1.o == ms2->o && + ms1.d == ms2->d) + { + ACE_DEBUG ((LM_DEBUG, "SII test_any success\n")); + return 0; + } + else + { + ACE_DEBUG ((LM_DEBUG, "SII test_any value match failed\n")); + return -1; + } + } + else + { + ACE_DEBUG ((LM_DEBUG, "SII test_any failed due to typecode mismatch\n")); + } + return 0; +} + +int +Orbix_Marshal_Client_Proxy::sii_test_sequence (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) +{ + // make a sequence of Anys and fill each one with a different data type + Marshal::AnySeq as1 (7), *as2; + Marshal::Marshal_Struct ms; + Marshal::Marshal_Union u; + + ms.s = 3; + ms.l = 256; + ms.c = 'B'; + ms.o = (CORBA::Octet) 127; + ms.d = 3.1415; + + u.ms (ms); + + // it looks like we must tell the sequence how many elements it is going to + // carry. By just fixing the max value does not work. + + as1.length (7); + + as1[0] <<= (CORBA::Short)3; + as1[1] <<= (CORBA::Long) 256; + as1[2] <<= CORBA::Any::from_octet ((CORBA::Octet)127); + as1[3] <<= CORBA::Any::from_char ('B'); + as1[4] <<= (CORBA::Double)3.1415; // double + as1[5] <<= ms; // struct + as1[6] <<= u; // union + + as2 = new Marshal::AnySeq; + + ref_->test_sequence (as1, as2); + + ACE_DEBUG ((LM_DEBUG, "SII test_sequence\n")); + if (as1.length () == as2->length ()) + { + // now make sure that the elements are same + for (int i=0; i < as1.length (); i++) + { + if (as1[i].type ()->equal ((*as2)[i].type ())) + { + // now see if the values are same + switch (i) + { + case 0: + if (*(CORBA::Short *)as1[i].value () == *(CORBA::Short + *)(*as2)[i].value ()) + { + ACE_DEBUG ((LM_DEBUG, "\tSII test_sequence, shorts matched\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "\tSII test_sequence failed on shorts match\n")); + } + break; + case 1: + if (*(CORBA::Long *)as1[i].value () == *(CORBA::Long + *)(*as2)[i].value ()) + { + ACE_DEBUG ((LM_DEBUG, "\tSII test_sequence, longs matched\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "\tSII test_sequence failed on longs match\n")); + } + break; + case 2: + if (*(CORBA::Octet *)as1[i].value () == *(CORBA::Octet + *)(*as2)[i].value ()) + { + ACE_DEBUG ((LM_DEBUG, "\tSII test_sequence, octets matched\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "\tSII test_sequence failed on octets match\n")); + } + break; + case 3: + if (*(CORBA::Char *)as1[i].value () == *(CORBA::Char + *)(*as2)[i].value ()) + { + ACE_DEBUG ((LM_DEBUG, "\tSII test_sequence, chars matched\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "\tSII test_sequence failed on chars match\n")); + } + break; + case 4: + if (*(CORBA::Double *)as1[i].value () == *(CORBA::Double + *)(*as2)[i].value ()) + { + ACE_DEBUG ((LM_DEBUG, "\tSII test_sequence, doubles matched\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "\tSII test_sequence failed on doubles match\n")); + } + break; + case 5: + { + Marshal::Marshal_Struct *ms1, *ms2; + + ms1 = (Marshal::Marshal_Struct *)as1[i].value (); + ms2 = (Marshal::Marshal_Struct *)(*as2)[i].value (); + + if (ms1->s == ms2->s && ms1->l == ms2->l && ms1->c == ms2->c && ms1->o == ms2->o && + ms1->d == ms2->d) + { + ACE_DEBUG ((LM_DEBUG, "\tSII test_sequence, structs matched\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "\tSII test_sequence failed on structs match\n")); + } + } + break; + case 6: + { + Marshal::Marshal_Union *u1, *u2; + + u1 = (Marshal::Marshal_Union *)as1[i].value (); + u2 = (Marshal::Marshal_Union *)(*as2)[i].value (); + + if (u1->_d () == u2->_d () && u1->ms ().s == u2->ms ().s && + u1->ms ().l == u2->ms ().l && + u1->ms ().c == u2->ms ().c && u1->ms ().o == u2->ms ().o && + u1->ms ().d == u2->ms ().d) + { + ACE_DEBUG ((LM_DEBUG, "\tSII test_sequence, unions matched\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "\tSII test_sequence failed on unions match\n")); + } + } + break; + } + } + else + { + ACE_DEBUG ((LM_DEBUG, + "SII test_sequence: typecode mismatch for element %d\n", i)); + break; + } + } + } + else + { + ACE_DEBUG ((LM_DEBUG, "SII test_sequence failed: as2->length = %d\n", + as2->length ())); + } + return 0; +} + +int +Orbix_Marshal_Client_Proxy::sii_test_recursive (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) +{ + // we will try a simple one here + Marshal::Marshal_Recursive mr1, *elem1, *mr2, *elem2; + + mr1.value <<= (CORBA::Long)1; + mr1.next.length (1); // sequence of length 1 + + // fill the element + elem1 = &mr1.next[0]; + elem1->value <<= CORBA::Any::from_char ('D'); + elem1->next.length (0); // end of seq + + mr2 = new Marshal::Marshal_Recursive; + + try { + ref_->test_recursive (mr1, mr2); + } + catch (CORBA::SystemException &se){ + cerr << "error invoking request: " << se << endl; + } + + elem2 = &mr2->next[0]; + + if ((*(CORBA::Long *)mr1.value.value () == *(CORBA::Long*)mr2->value.value ()) + && (mr1.next.length () == mr2->next.length ()) // same length sequence + && (*(CORBA::Char *)elem1->value.value () == *(CORBA::Char *)elem2->value.value ()) + && (elem1->next.length () == elem2->next.length ())) + { + ACE_DEBUG ((LM_DEBUG, "SII test_recursive success\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "SII test_recursive failure\n")); + } + + return 0; +} + +// ------------------------------------------------------- +// all helper functions : DII +// ------------------------------------------------------- + +int +Orbix_Marshal_Client_Proxy::dii_test_short (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) +{ + // DII variables + CORBA::Request_ptr request = CORBA::Request::_nil(); // DII request + CORBA::NVList_ptr arglist = CORBA::NVList::_nil(); // argument list + CORBA::Context_ptr ctx = CORBA::Context::_nil(); // context + CORBA::NVList_ptr result_list = CORBA::NVList::_nil(); // result list + CORBA::NamedValue_ptr result = CORBA::NamedValue::_nil();// actual result + CORBA::Short s1, s2; + + s1 = 3; + s2 = 0; + + orb_->create_list(2, arglist); // 2 arguments to be added + *(arglist->add (CORBA::ARG_IN)->value ()) <<= s1; + // this usage is also correct. All we care is to supply a storage area for + // the OUT parameter + // arglist->add (CORBA::ARG_OUT)->value ()->replace (CORBA::_tc_short, &s2); + *(arglist->add (CORBA::ARG_OUT)->value ()) <<= s2; + orb_->create_list(1, result_list); // 1 result + result = result_list->item (0); + + // create a request + ref_->_create_request(ctx, + "test_short", + arglist, + result, + request, + 0); + + request->invoke (); // 2 way + *(arglist->item(1)->value()) >>= s2; + + if (s2 == 2*s1) + { + ACE_DEBUG ((LM_DEBUG, "DII test_short success: s1 = %d, s2 = %d\n", s1, s2)); + } + else + { + ACE_DEBUG ((LM_DEBUG, "DII test_short failed: s1 = %d, s2 = %d\n", s1, s2)); + } + CORBA::release (request); + CORBA::release (arglist); + CORBA::release (result); + CORBA::release (result_list); + return 0; +} + +int +Orbix_Marshal_Client_Proxy::dii_test_long (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) +{ + // DII variables + CORBA::Request_ptr request = CORBA::Request::_nil(); // DII request + CORBA::NVList_ptr arglist = CORBA::NVList::_nil(); // argument list + CORBA::Context_ptr ctx = CORBA::Context::_nil(); // context + CORBA::NVList_ptr result_list = CORBA::NVList::_nil(); // result list + CORBA::NamedValue_ptr result = CORBA::NamedValue::_nil();// actual result + CORBA::Long l1, l2; + + l1 = 256; + + orb_->create_list(2, arglist); // 2 arguments to be added + *(arglist->add(CORBA::ARG_IN)->value()) <<= l1; + arglist->add(CORBA::ARG_OUT)->value()->replace (CORBA::_tc_long, &l2); + orb_->create_list(1, result_list); // 1 result + result = result_list->item(0); + + // create a request + ref_->_create_request(ctx, + "test_long", + arglist, + result, + request, + 0); + + request->invoke (); // 2 way + *(arglist->item(1)->value()) >>= l2; + + if (l2 == 3*l1) + { + ACE_DEBUG ((LM_DEBUG, "DII: test_long success: l1 = %d, l2 = %d\n", l1, l2)); + } + else + { + ACE_DEBUG ((LM_DEBUG, "DII: test_long failed: l1 = %d, l2 = %d\n", l1, l2)); + } + CORBA::release (request); + CORBA::release (arglist); + CORBA::release (result); + CORBA::release (result_list); + return 0; +} + +int +Orbix_Marshal_Client_Proxy::dii_test_octet (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) + // octets +{ + // DII variables + CORBA::Request_ptr request = CORBA::Request::_nil(); // DII request + CORBA::NVList_ptr arglist = CORBA::NVList::_nil(); // argument list + CORBA::Context_ptr ctx = CORBA::Context::_nil(); // context + CORBA::NVList_ptr result_list = CORBA::NVList::_nil(); // result list + CORBA::NamedValue_ptr result = CORBA::NamedValue::_nil();// actual result + CORBA::Octet o1, o2; + + o1 = (CORBA::Octet) 127; + + orb_->create_list(2, arglist); // 2 arguments to be added + *(arglist->add(CORBA::ARG_IN)->value()) <<= CORBA::Any::from_octet (o1); + arglist->add(CORBA::ARG_OUT)->value()->replace (CORBA::_tc_octet, &o2); + orb_->create_list(1, result_list); // 1 result + result = result_list->item(0); + + // create a request + ref_->_create_request(ctx, + "test_octet", + arglist, + result, + request, + 0); + + request->invoke (); // 2 way + *(arglist->item(1)->value()) >>= CORBA::Any::to_octet (o2); + + if (o1 == o2) + { + ACE_DEBUG ((LM_DEBUG, "DII test_octet success: o1 = %c, o2 = %c\n", o1, o2)); + } + else + { + ACE_DEBUG ((LM_DEBUG, "DII test_octet failed: o1 = %c, o2 = %c\n", o1, o2)); + } + CORBA::release (request); + CORBA::release (arglist); + CORBA::release (result); + CORBA::release (result_list); + return 0; +} + +int +Orbix_Marshal_Client_Proxy::dii_test_char (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) + // chars +{ + // DII variables + CORBA::Request_ptr request = CORBA::Request::_nil(); // DII request + CORBA::NVList_ptr arglist = CORBA::NVList::_nil(); // argument list + CORBA::Context_ptr ctx = CORBA::Context::_nil(); // context + CORBA::NVList_ptr result_list = CORBA::NVList::_nil(); // result list + CORBA::NamedValue_ptr result = CORBA::NamedValue::_nil();// actual result + CORBA::Char c1, c2; + + c1 = 'B'; + + orb_->create_list(2, arglist); // 2 arguments to be added + *(arglist->add(CORBA::ARG_IN)->value()) <<= CORBA::Any::from_char (c1); + arglist->add(CORBA::ARG_OUT)->value()->replace (CORBA::_tc_char, &c2); + orb_->create_list(1, result_list); // 1 result + result = result_list->item(0); + + // create a request + ref_->_create_request(ctx, + "test_char", + arglist, + result, + request, + 0); + + request->invoke (); // 2 way + *(arglist->item(1)->value()) >>= CORBA::Any::to_char (c2); + + if (c1 == c2) + { + ACE_DEBUG ((LM_DEBUG, "DII test_char success: c1 = %c, c2 = %c\n", c1, c2)); + } + else + { + ACE_DEBUG ((LM_DEBUG, "DII test_char failed: c1 = %c, c2 = %c\n", c1, c2)); + } + CORBA::release (request); + CORBA::release (arglist); + CORBA::release (result); + CORBA::release (result_list); + return 0; +} + +int +Orbix_Marshal_Client_Proxy::dii_test_double (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) + // doubles +{ + // DII variables + CORBA::Request_ptr request = CORBA::Request::_nil(); // DII request + CORBA::NVList_ptr arglist = CORBA::NVList::_nil(); // argument list + CORBA::Context_ptr ctx = CORBA::Context::_nil(); // context + CORBA::NVList_ptr result_list = CORBA::NVList::_nil(); // result list + CORBA::NamedValue_ptr result = CORBA::NamedValue::_nil();// actual result + CORBA::Double d1, d2; + + d1 = 3.1415; + + orb_->create_list(2, arglist); // 2 arguments to be added + *(arglist->add(CORBA::ARG_IN)->value()) <<= d1; + arglist->add(CORBA::ARG_OUT)->value()->replace (CORBA::_tc_double, &d2); + orb_->create_list(1, result_list); // 1 result + result = result_list->item(0); + + // create a request + ref_->_create_request(ctx, + "test_double", + arglist, + result, + request, + 0); + + request->invoke (); // 2 way + *(arglist->item(1)->value()) >>= d2; + + if (d2 == d1/2) + { + ACE_DEBUG ((LM_DEBUG, "DII test_double success: d1 = %f, d2 = %f\n", d1, d2)); + } + else + { + ACE_DEBUG ((LM_DEBUG, "DII test_double failed: d1 = %f, d2 = %f\n", d1, d2)); + } + CORBA::release (request); + CORBA::release (arglist); + CORBA::release (result); + CORBA::release (result_list); + return 0; +} + +int +Orbix_Marshal_Client_Proxy::dii_test_struct (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) + // structs +{ + // DII variables + CORBA::Request_ptr request = CORBA::Request::_nil(); // DII request + CORBA::NVList_ptr arglist = CORBA::NVList::_nil(); // argument list + CORBA::Context_ptr ctx = CORBA::Context::_nil(); // context + CORBA::NVList_ptr result_list = CORBA::NVList::_nil(); // result list + CORBA::NamedValue_ptr result = CORBA::NamedValue::_nil();// actual result + Marshal::Marshal_Struct ms1, *ms2=0; + + ms1.s = 3; + ms1.l = 256; + ms1.c = 'B'; + ms1.o = (CORBA::Octet) 127; + ms1.d = 3.1415; + + orb_->create_list(2, arglist); // 2 arguments to be added + *(arglist->add(CORBA::ARG_IN)->value()) <<= ms1; + arglist->add(CORBA::ARG_OUT)->value()->replace (Marshal::_tc_Marshal_Struct, ms2); + orb_->create_list(1, result_list); // 1 result + result = result_list->item(0); + + // create a request + ref_->_create_request(ctx, + "test_struct", + arglist, + result, + request, + 0); + + request->invoke (); // 2 way + *(arglist->item(1)->value()) >>= ms2; + + if (ms1.s == ms2->s && ms1.l == ms2->l && ms1.c == ms2->c && ms1.o == ms2->o && + ms1.d == ms2->d) + { + ACE_DEBUG ((LM_DEBUG, "DII test_struct success\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "DII test_struct failed\n")); + } + CORBA::release (request); + CORBA::release (arglist); + CORBA::release (result); + CORBA::release (result_list); + return 0; +} + +int +Orbix_Marshal_Client_Proxy::dii_test_union (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) + // unions +{ + // DII variables + CORBA::Request_ptr request = CORBA::Request::_nil(); // DII request + CORBA::NVList_ptr arglist = CORBA::NVList::_nil(); // argument list + CORBA::Context_ptr ctx = CORBA::Context::_nil(); // context + CORBA::NVList_ptr result_list = CORBA::NVList::_nil(); // result list + CORBA::NamedValue_ptr result = CORBA::NamedValue::_nil();// actual result + Marshal::Marshal_Union u1, *u2 = 0; + Marshal::Marshal_Struct ms; + + + // first test an enumerated case + // u1._d (Marshal::e_1st); + u1.l (4567); + + orb_->create_list(2, arglist); // 2 arguments to be added + *(arglist->add(CORBA::ARG_IN)->value()) <<= u1; + arglist->add(CORBA::ARG_OUT)->value()->replace (Marshal::_tc_Marshal_Union, u2); + orb_->create_list(1, result_list); // 1 result + result = result_list->item(0); + + // create a request + ref_->_create_request(ctx, + "test_union", + arglist, + result, + request, + 0); + + request->invoke (); // 2 way + *(arglist->item(1)->value()) >>= u2; + + if ( (u1._d () == u2->_d()) && (u1.l () == u2->l ())) + { + ACE_DEBUG ((LM_DEBUG, "DII test_union for long (case e_1st) success\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "DII test_union for long (case e_1st) failed\n")); + } + delete u2; + CORBA::release (request); + CORBA::release (arglist); + CORBA::release (result); + CORBA::release (result_list); + + // test the default case + ms.s = 3; + ms.l = 256; + ms.c = 'B'; + ms.o = (CORBA::Octet) 127; + ms.d = 3.1415; + + u1.ms (ms); + u2 = 0; + + orb_->create_list(2, arglist); // 2 arguments to be added + *(arglist->add(CORBA::ARG_IN)->value()) <<= u1; + arglist->add(CORBA::ARG_OUT)->value()->replace (Marshal::_tc_Marshal_Union, u2); + orb_->create_list(1, result_list); // 1 result + result = result_list->item(0); + + // create a request + ref_->_create_request(ctx, + "test_union", + arglist, + result, + request, + 0); + + request->invoke (); // 2 way + *(arglist->item(1)->value()) >>= u2; + + if (u1.ms ().s == u2->ms ().s && u1.ms ().l == u2->ms ().l && u1.ms ().c == u2->ms ().c && u1.ms ().o == u2->ms ().o && + u1.ms ().d == u2->ms ().d) + { + ACE_DEBUG ((LM_DEBUG, "DII test_union for default (case e_6th) success\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "DII test_union for default (case e_6th) failed\n")); + } + CORBA::release (request); + CORBA::release (arglist); + CORBA::release (result); + CORBA::release (result_list); + return 0; +} + +int +Orbix_Marshal_Client_Proxy::dii_test_any (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) +{ + // DII variables + CORBA::Request_ptr request = CORBA::Request::_nil(); // DII request + CORBA::NVList_ptr arglist = CORBA::NVList::_nil(); // argument list + CORBA::Context_ptr ctx = CORBA::Context::_nil(); // context + CORBA::NVList_ptr result_list = CORBA::NVList::_nil(); // result list + CORBA::NamedValue_ptr result = CORBA::NamedValue::_nil();// actual result + // we send a struct thru the any + CORBA::Any a1, *a2; + Marshal::Marshal_Struct ms1, *ms2; + + ms1.s = 3; + ms1.l = 256; + ms1.c = 'B'; + ms1.o = (CORBA::Octet) 127; + ms1.d = 3.1415; + + // populate the any with a MarshalStruct + a1 <<= ms1; + + a2 = new CORBA::Any; + + // now test it + orb_->create_list(2, arglist); // 2 arguments to be added + *(arglist->add(CORBA::ARG_IN)->value()) <<= a1; + arglist->add(CORBA::ARG_OUT)->value()->replace (CORBA::_tc_any, a2); + orb_->create_list(1, result_list); // 1 result + result = result_list->item(0); + + // create a request + ref_->_create_request(ctx, + "test_any", + arglist, + result, + request, + 0); + + request->invoke (); // 2 way + *(arglist->item(1)->value()) >>= (*a2); + + // check if the two typecodes are equal + if (a2->type ()->equal (Marshal::_tc_Marshal_Struct)) + { + // now see if the values are same + ms2 = (Marshal::Marshal_Struct *)a2->value (); + if (ms1.s == ms2->s && ms1.l == ms2->l && ms1.c == ms2->c && ms1.o == ms2->o && + ms1.d == ms2->d) + { + ACE_DEBUG ((LM_DEBUG, "DII test_any success\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "DII test_any value match failed\n")); + } + } + else + { + ACE_DEBUG ((LM_DEBUG, "DII test_any failed due to typecode mismatch\n")); + } + CORBA::release (request); + CORBA::release (arglist); + CORBA::release (result); + CORBA::release (result_list); + return 0; +} + +int +Orbix_Marshal_Client_Proxy::dii_test_sequence (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) +{ + // DII variables + CORBA::Request_ptr request = CORBA::Request::_nil(); // DII request + CORBA::NVList_ptr arglist = CORBA::NVList::_nil(); // argument list + CORBA::Context_ptr ctx = CORBA::Context::_nil(); // context + CORBA::NVList_ptr result_list = CORBA::NVList::_nil(); // result list + CORBA::NamedValue_ptr result = CORBA::NamedValue::_nil();// actual result + // make a sequence of Anys and fill each one with a different data type + Marshal::AnySeq as1 (7), *as2; + Marshal::Marshal_Struct ms; + Marshal::Marshal_Union u; + + ms.s = 3; + ms.l = 256; + ms.c = 'B'; + ms.o = (CORBA::Octet) 127; + ms.d = 3.1415; + + u.ms (ms); + + // it looks like we must tell the sequence how many elements it is going to + // carry. By just fixing the max value does not work. + + as1.length (7); + + as1[0] <<= (CORBA::Short)3; + as1[1] <<= (CORBA::Long) 256; + as1[2] <<= CORBA::Any::from_octet ((CORBA::Octet)127); + as1[3] <<= CORBA::Any::from_char ('B'); + as1[4] <<= (CORBA::Double)3.1415; // double + as1[5] <<= ms; // struct + as1[6] <<= u; // union + + as2 = new Marshal::AnySeq; + + orb_->create_list(2, arglist); // 2 arguments to be added + *(arglist->add(CORBA::ARG_IN)->value()) <<= as1; + arglist->add(CORBA::ARG_OUT)->value()->replace (Marshal::_tc_AnySeq, as2); + orb_->create_list(1, result_list); // 1 result + result = result_list->item(0); + + // create a request + ref_->_create_request(ctx, + "test_sequence", + arglist, + result, + request, + 0); + + request->invoke (); // 2 way + *(arglist->item(1)->value()) >>= as2; + + ACE_DEBUG ((LM_DEBUG, "DII test_sequence\n")); + if (as1.length () == as2->length ()) + { + // now make sure that the elements are same + for (int i=0; i < as1.length (); i++) + { + if (as1[i].type ()->equal ((*as2)[i].type ())) + { + // now see if the values are same + switch (i) + { + case 0: + if (*(CORBA::Short *)as1[i].value () == *(CORBA::Short + *)(*as2)[i].value ()) + { + ACE_DEBUG ((LM_DEBUG, "\tDII test_sequence, shorts matched\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "\tDII test_sequence failed on shorts match\n")); + } + break; + case 1: + if (*(CORBA::Long *)as1[i].value () == *(CORBA::Long + *)(*as2)[i].value ()) + { + ACE_DEBUG ((LM_DEBUG, "\tDII test_sequence, longs matched\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "\tDII test_sequence failed on longs match\n")); + } + break; + case 2: + if (*(CORBA::Octet *)as1[i].value () == *(CORBA::Octet + *)(*as2)[i].value ()) + { + ACE_DEBUG ((LM_DEBUG, "\tDII test_sequence, octets matched\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "\tDII test_sequence failed on octets match\n")); + } + break; + case 3: + if (*(CORBA::Char *)as1[i].value () == *(CORBA::Char + *)(*as2)[i].value ()) + { + ACE_DEBUG ((LM_DEBUG, "\tDII test_sequence, chars matched\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "\tDII test_sequence failed on chars match\n")); + } + break; + case 4: + if (*(CORBA::Double *)as1[i].value () == *(CORBA::Double + *)(*as2)[i].value ()) + { + ACE_DEBUG ((LM_DEBUG, "\tDII test_sequence, doubles matched\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "\tDII test_sequence failed on doubles match\n")); + } + break; + case 5: + { + Marshal::Marshal_Struct *ms1, *ms2; + + ms1 = (Marshal::Marshal_Struct *)as1[i].value (); + ms2 = (Marshal::Marshal_Struct *)(*as2)[i].value (); + + if (ms1->s == ms2->s && ms1->l == ms2->l && ms1->c == ms2->c && ms1->o == ms2->o && + ms1->d == ms2->d) + { + ACE_DEBUG ((LM_DEBUG, "\tDII test_sequence, structs matched\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "\tDII test_sequence failed on structs match\n")); + } + } + break; + case 6: + { + Marshal::Marshal_Union *u1, *u2; + + u1 = (Marshal::Marshal_Union *)as1[i].value (); + u2 = (Marshal::Marshal_Union *)(*as2)[i].value (); + + if (u1->_d () == u2->_d () && u1->ms ().s == u2->ms ().s && + u1->ms ().l == u2->ms ().l && + u1->ms ().c == u2->ms ().c && u1->ms ().o == u2->ms ().o && + u1->ms ().d == u2->ms ().d) + { + ACE_DEBUG ((LM_DEBUG, "\tDII test_sequence, unions matched\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "\tDII test_sequence failed on unions match\n")); + } + } + break; + } + } + else + { + ACE_DEBUG ((LM_DEBUG, + "DII test_sequence: typecode mismatch for element %d\n", i)); + break; + } + } + } + else + { + ACE_DEBUG ((LM_DEBUG, "DII test_sequence failed: as2->length = %d\n", + as2->length ())); + } + CORBA::release (request); + CORBA::release (arglist); + CORBA::release (result); + CORBA::release (result_list); + return 0; +} + +int +Orbix_Marshal_Client_Proxy::dii_test_recursive (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) +{ + // we will try a simple one here + Marshal::Marshal_Recursive mr1, *elem1, *mr2, *elem2; + + mr1.value <<= (CORBA::Long)1; + mr1.next.length (1); // sequence of length 1 + + // fill the element + elem1 = &mr1.next[0]; + elem1->value <<= CORBA::Any::from_char ('D'); + elem1->next.length (0); // end of seq + + mr2 = new Marshal::Marshal_Recursive; + + try { + ref_->test_recursive (mr1, mr2); + } + catch (CORBA::SystemException &se){ + cerr << "error invoking request: " << se << endl; + } + + elem2 = &mr2->next[0]; + + if ((*(CORBA::Long *)mr1.value.value () == *(CORBA::Long*)mr2->value.value ()) + && (mr1.next.length () == mr2->next.length ()) // same length sequence + && (*(CORBA::Char *)elem1->value.value () == *(CORBA::Char *)elem2->value.value ()) + && (elem1->next.length () == elem2->next.length ())) + { + ACE_DEBUG ((LM_DEBUG, "DII test_recursive success\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "DII test_recursive failure\n")); + } + + return 0; +} + diff --git a/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_client.h b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_client.h new file mode 100644 index 00000000000..c1d06d03c06 --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_client.h @@ -0,0 +1,123 @@ +// ============================================================================ +// +// = LIBRARY +// CORBA Marshal Orbix Benchmark +// +// = FILENAME +// orbix_marshal_client.h +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +#if !defined(_ORBIX_MARSHAL_CLIENT_H_) +#define _ORBIX_MARSHAL_CLIENT_H_ + +// benchmark library includes +#include "benchmark/marshal_options.h" +#include "benchmark/marshal_results.h" +#include "benchmark/marshal_proxy.h" + +// include Orbix specific include files +#include "marshal.h" // generated by IDL compiler + +class Orbix_Marshal_Client_Proxy : public CORBA_Marshal_Proxy +{ + // =TITLE + // Orbix_Marshal_Client_Proxy + // =DESCRIPTION + // Orbix client size specialization of the CORBA Marshal proxy class +public: + Orbix_Marshal_Client_Proxy (void); + // constructor + + ~Orbix_Marshal_Client_Proxy (void); + // destructor + + virtual int run (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + // do the actual work + + virtual int use_sii (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + // use the static invocation interface + + virtual int use_dii (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + // use the dynamic invocation interface +private: + // =helper functions + int sii_test_short (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int sii_test_long (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int sii_test_octet (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int sii_test_char (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int sii_test_double (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int sii_test_struct (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int sii_test_union (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int sii_test_any (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int sii_test_sequence (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int sii_test_recursive (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + // all the DII helpers + int dii_test_short (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int dii_test_long (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int dii_test_octet (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int dii_test_char (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int dii_test_double (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int dii_test_struct (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int dii_test_union (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int dii_test_any (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int dii_test_sequence (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + int dii_test_recursive (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + + CORBA::ORB_ptr orb_; + // handle to the underlying orb + + Marshal_ptr ref_; + // the object reference +}; + +#if defined (__ACE_INLINE__) +#include "orbix_marshal_client.i" +#endif /* __ACE_INLINE__ */ + +#endif diff --git a/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_client.i b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_client.i new file mode 100644 index 00000000000..1165f92fde8 --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_client.i @@ -0,0 +1,21 @@ + +ACE_INLINE +Orbix_Marshal_Client_Proxy::Orbix_Marshal_Client_Proxy (void) + : orb_ (CORBA::ORB::_nil ()), + ref_ (0) +{ +} + +ACE_INLINE +Orbix_Marshal_Client_Proxy::~Orbix_Marshal_Client_Proxy (void) +{ + // releasing order is important + + // release the reference + CORBA::release (ref_); + + // release the ORB + CORBA::release (orb_); +} + + diff --git a/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_impl.cpp b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_impl.cpp new file mode 100644 index 00000000000..877b8bd1626 --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_impl.cpp @@ -0,0 +1,309 @@ +#include "orbix_marshal_impl.h" + +#if !defined (__ACE_INLINE__) +#include "orbix_marshal_impl.i" +#endif /* __ACE_INLINE__ */ + +// All the methods of the SSI class +void +Marshal_SSI_Impl::test_short (CORBA::Short s1, + CORBA::Short &s2, + CORBA::Environment &IT_env) +{ + s2 = 2*s1; +} + +void +Marshal_SSI_Impl::test_long (CORBA::Long l1, + CORBA::Long &l2, + CORBA::Environment &IT_env) +{ + l2 = 3*l1; +} + +void +Marshal_SSI_Impl::test_octet (CORBA::Octet o1, + CORBA::Octet &o2, + CORBA::Environment &IT_env) +{ + o2 = o1; +} + +void +Marshal_SSI_Impl::test_char (CORBA::Char c1, + CORBA::Char &c2, + CORBA::Environment &IT_env) +{ + c2 = c1; +} + +void +Marshal_SSI_Impl::test_double (CORBA::Double d1, + CORBA::Double &d2, + CORBA::Environment &IT_env) +{ + d2 = d1/2; +} + +void +Marshal_SSI_Impl::test_struct (const Marshal::Marshal_Struct& ms1, + Marshal::Marshal_Struct& ms2, + CORBA::Environment &IT_env) +{ + ms2.s = ms1.s; + ms2.l = ms1.l; + ms2.c = ms1.c; + ms2.o = ms1.o; + ms2.d = ms1.d; +} + +void +Marshal_SSI_Impl::test_union (const Marshal::Marshal_Union& u1, + Marshal::Marshal_Union& u2, + CORBA::Environment &IT_env) +{ + switch (u1._d ()) + { + case Marshal::e_0th: + u2.s (u1.s ()); // set short + break; + case Marshal::e_1st: + u2.l (u1.l ()); // set long + break; + case Marshal::e_2nd: + u2.c (u1.c ()); // set char + break; + case Marshal::e_3rd: + u2.o (u1.o ()); // set octet + break; + case Marshal::e_4th: + u2.d (u1.d ()); // set double + break; + case Marshal::e_5th: + default: + u2.ms (u1. ms ()); // set structs + break; + } +} + +void +Marshal_SSI_Impl::test_any (const CORBA::Any &a1, + CORBA::Any *&a2, + CORBA::Environment &IT_env) +{ + a2 = new CORBA::Any (a1.type (), (void *)a1.value ()); // will do a deep copy +} + +void +Marshal_SSI_Impl::test_sequence (const Marshal::AnySeq& as1, + Marshal::AnySeq *& as2, + CORBA::Environment &IT_env) +{ + as2 = new Marshal::AnySeq (as1); +} + +void +Marshal_SSI_Impl::test_recursive (const Marshal::Marshal_Recursive &mr1, + Marshal::Marshal_Recursive *&mr2, + CORBA::Environment &IT_env) +{ +} + +//---------------------------------------------------------------------------- +//the methods of the DSI implementation class + +void +Marshal_DSI_Impl::invoke (CORBA::ServerRequest& req, CORBA::Environment_ptr + ep, CORBA::Environment &IT_env) +{ + ACE_DEBUG ((LM_DEBUG, "************ inside invoke **********\n")); + // parse the incoming request and find out for what operation it is. We use a + // simple linear search here + if (!ACE_OS::strcmp (req.op_name (IT_env), "test_short")) + { + test_short_skel (req); + } + else if (!ACE_OS::strcmp (req.op_name (), "test_long")) + { + } + else if (!ACE_OS::strcmp (req.op_name (), "test_octet")) + { + } + else if (!ACE_OS::strcmp (req.op_name (), "test_char")) + { + } + else if (!ACE_OS::strcmp (req.op_name (), "test_double")) + { + } + else if (!ACE_OS::strcmp (req.op_name (), "test_struct")) + { + } + else if (!ACE_OS::strcmp (req.op_name (), "test_union")) + { + } + else if (!ACE_OS::strcmp (req.op_name (), "test_any")) + { + } + else if (!ACE_OS::strcmp (req.op_name (), "test_sequence")) + { + } +} + +void +Marshal_DSI_Impl::test_short (CORBA::Short s1, + CORBA::Short &s2) +{ + s2 = 5*s1; +} + +void +Marshal_DSI_Impl::test_long (CORBA::Long l1, + CORBA::Long &l2) +{ + l2 = l1; +} + +void +Marshal_DSI_Impl::test_octet (CORBA::Octet o1, + CORBA::Octet &o2) +{ + o2 = o1; +} + +void +Marshal_DSI_Impl::test_char (CORBA::Char c1, + CORBA::Char &c2) +{ + c2 = c1; +} + +void +Marshal_DSI_Impl::test_double (CORBA::Double d1, + CORBA::Double &d2) +{ + d2 = d1; +} + +void +Marshal_DSI_Impl::test_struct (const Marshal::Marshal_Struct& ms1, + Marshal::Marshal_Struct& ms2) +{ + ms2.s = ms1.s; + ms2.l = ms1.l; + ms2.c = ms1.c; + ms2.o = ms1.o; + ms2.d = ms1.d; +} + +void +Marshal_DSI_Impl::test_union (const Marshal::Marshal_Union& u1, + Marshal::Marshal_Union& u2) +{ + switch (u1._d ()) + { + case Marshal::e_0th: + u2.s (u1.s ()); // set short + break; + case Marshal::e_1st: + u2.l (u1.l ()); // set long + break; + case Marshal::e_2nd: + u2.c (u1.c ()); // set char + break; + case Marshal::e_3rd: + u2.o (u1.o ()); // set octet + break; + case Marshal::e_4th: + u2.d (u1.d ()); // set double + break; + case Marshal::e_5th: + default: + u2.ms (u1. ms ()); // set structs + break; + } +} + +void +Marshal_DSI_Impl::test_any (const CORBA::Any &a1, + CORBA::Any *&a2) +{ + a2 = new CORBA::Any (a1.type (), (void *)a1.value ()); // will do a deep copy +} + +void +Marshal_DSI_Impl::test_sequence (const Marshal::AnySeq& as1, + Marshal::AnySeq *& as2) +{ + as2 = new Marshal::AnySeq (as1); +} + +void +Marshal_DSI_Impl::test_recursive (const Marshal::Marshal_Recursive &mr1, + Marshal::Marshal_Recursive *&mr2) +{ +} + +// all the helper functions for the DSI class +void +Marshal_DSI_Impl::test_short_skel (CORBA::ServerRequest& req) +{ + CORBA::NVList_ptr short_nv; + CORBA::Any *any_s1, *any_s2; + CORBA::Short s1 = 0, s2 = 0; + + orb_->create_list (2, short_nv); // parse 2 args + any_s1 = new CORBA::Any (CORBA::_tc_short, &s1, 0); + any_s2 = new CORBA::Any (CORBA::_tc_short, &s2, 0); + short_nv->add_value ("s1", *any_s1, CORBA::ARG_IN); + short_nv->add_value ("s2", *any_s2, CORBA::ARG_OUT); + + req.params (short_nv); + + test_short (s1, s2); + ACE_DEBUG ((LM_DEBUG, ">>>>>>>s1 = %d and s2 = %d\n<<<<<<<<", s1, s2)); +} + +void +Marshal_DSI_Impl::test_long_skel (CORBA::ServerRequest& req) +{ +} + +void +Marshal_DSI_Impl::test_octet_skel (CORBA::ServerRequest& req) +{ +} + +void +Marshal_DSI_Impl::test_char_skel (CORBA::ServerRequest& req) +{ +} + +void +Marshal_DSI_Impl::test_double_skel (CORBA::ServerRequest& req) +{ +} + +void +Marshal_DSI_Impl::test_struct_skel (CORBA::ServerRequest& req) +{ +} + +void +Marshal_DSI_Impl::test_union_skel (CORBA::ServerRequest& req) +{ +} + +void +Marshal_DSI_Impl::test_any_skel (CORBA::ServerRequest& req) +{ +} + +void +Marshal_DSI_Impl::test_sequence_skel (CORBA::ServerRequest& req) +{ +} + +void +Marshal_DSI_Impl::test_recursive_skel (CORBA::ServerRequest& req) +{ +} diff --git a/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_impl.h b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_impl.h new file mode 100644 index 00000000000..850e99c2bee --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_impl.h @@ -0,0 +1,189 @@ +#if !defined (ORBIX_MARSHAL_IMPL_H) +#define ORBIX_MARSHAL_IMPL_H + +// to include DSI related files + +#include "ace/OS.h" + +#include "marshal.h" + + +class Marshal_SSI_Impl + : public virtual MarshalBOAImpl +{ + // =TITLE + // Marshal_SSI_Impl + // =DESCRIPTION + // Implementation of the interface using the static skeleton interface +public: + Marshal_SSI_Impl (const char *object_name = (const char *)NULL); + // constructor + + ~Marshal_SSI_Impl (void); + // destructor + + virtual void test_short (CORBA::Short s1, + CORBA::Short& s2, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + // test short + + virtual void test_long (CORBA::Long l1, + CORBA::Long& l2, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + // test long + + virtual void test_octet (CORBA::Octet o1, + CORBA::Octet& o2, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + // test octet + + virtual void test_char (CORBA::Char c1, + CORBA::Char& c2, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + // test char + + virtual void test_double (CORBA::Double d1, + CORBA::Double& d2, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + // test double + + virtual void test_struct (const Marshal::Marshal_Struct& ms1, + Marshal::Marshal_Struct& ms2, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + // test struct + + virtual void test_union (const Marshal::Marshal_Union& u1, + Marshal::Marshal_Union& u2, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + // test union + + virtual void test_any (const CORBA::Any& a1, + CORBA::Any *& a2, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + // test any + + /* + virtual void test_sequence (const Marshal::ShortSeq& s1, + const Marshal::LongSeq& l1, + const Marshal::OctetSeq& o1, + const Marshal::CharSeq& c1, + const Marshal::DoubleSeq& d1, + const Marshal::StructSeq& S1, + const Marshal::UnionSeq& U1, + const Marshal::AnySeq& a1, + Marshal::ShortSeq *& s2, + Marshal::LongSeq *& l2, + Marshal::OctetSeq *& o2, + Marshal::CharSeq *& c2, + Marshal::DoubleSeq *& d2, + Marshal::StructSeq *& S2, + Marshal::UnionSeq *& U2, + Marshal::AnySeq *& a2); + */ + virtual void test_sequence (const Marshal::AnySeq& a1, + Marshal::AnySeq *& a2, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + // test sequence + + virtual void test_recursive (const Marshal::Marshal_Recursive& mr1, + Marshal::Marshal_Recursive *& mr2, + CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()); + // test struct + +}; + +class Marshal_DSI_Impl : public CORBA::DynamicImplementation +{ + // =TITLE + // Marshal_DSI_Impl + // =DESCRIPTION + // Implementation of the interface using the dynamic skeleton interface +public: + Marshal_DSI_Impl (CORBA::ORB_ptr orb, const char *object_name = (const char *)NULL); + // constructor + + ~Marshal_DSI_Impl (void); + // destructor + +private: + virtual void invoke (CORBA::ServerRequest& req, CORBA::Environment_ptr, + CORBA::Environment&IT_env = + CORBA::IT_chooseDefaultEnv()); + // This method is a must + + void test_short (CORBA::Short s1, + CORBA::Short& s2); + // test short + + void test_long (CORBA::Long l1, + CORBA::Long& l2); + // test long + + void test_octet (CORBA::Octet o1, + CORBA::Octet& o2); + // test octet + + void test_char (CORBA::Char c1, + CORBA::Char& c2); + // test char + + void test_double (CORBA::Double d1, + CORBA::Double& d2); + // test double + + void test_struct (const Marshal::Marshal_Struct& ms1, + Marshal::Marshal_Struct& ms2); + // test struct + + void test_union (const Marshal::Marshal_Union& u1, + Marshal::Marshal_Union& u2); + // test union + + void test_any (const CORBA::Any& a1, + CORBA::Any *& a2); + // test any + + void test_sequence (const Marshal::AnySeq& a1, + Marshal::AnySeq *& a2); + // test sequence + + void test_recursive (const Marshal::Marshal_Recursive& mr1, + Marshal::Marshal_Recursive *& mr2); + // test struct + +private: + //= helper functions - they behave as if they were skeletons + void test_short_skel (CORBA::ServerRequest& req); + void test_long_skel (CORBA::ServerRequest& req); + void test_octet_skel (CORBA::ServerRequest& req); + void test_char_skel (CORBA::ServerRequest& req); + void test_double_skel (CORBA::ServerRequest& req); + void test_struct_skel (CORBA::ServerRequest& req); + void test_union_skel (CORBA::ServerRequest& req); + void test_any_skel (CORBA::ServerRequest& req); + void test_sequence_skel (CORBA::ServerRequest& req); + void test_recursive_skel (CORBA::ServerRequest& req); + + // we need the orb to create argument lists (NVList) for us + CORBA::ORB_ptr orb_; // not owned by us + +#if 0 + CORBA::NVList_ptr short_nv_; + CORBA::NVList_ptr long_nv_; + CORBA::NVList_ptr octet_nv_; + CORBA::NVList_ptr char_nv_; + CORBA::NVList_ptr double_nv_; + CORBA::NVList_ptr struct_nv_; + CORBA::NVList_ptr union_nv_; + CORBA::NVList_ptr any_nv_; + CORBA::NVList_ptr seq_nv_; + CORBA::NVList_ptr recursive_nv_; + CORBA::Any_ptr result_; // void result +#endif +}; + +#if defined (__ACE_INLINE__) +#include "orbix_marshal_impl.i" +#endif /* __ACE_INLINE__ */ + +#endif // defined (ORBIX_MARSHAL_IMPL_H) diff --git a/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_impl.i b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_impl.i new file mode 100644 index 00000000000..4ea7ef56421 --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_impl.i @@ -0,0 +1,27 @@ +// constructor +ACE_INLINE +Marshal_SSI_Impl::Marshal_SSI_Impl (const char *obj_name) + : MarshalBOAImpl (obj_name) +{ +} + +// destructor +ACE_INLINE +Marshal_SSI_Impl::~Marshal_SSI_Impl (void) +{ +} + +// constructor +ACE_INLINE +Marshal_DSI_Impl::Marshal_DSI_Impl (CORBA::ORB_ptr orb, const char *obj_name) + : orb_ (orb) +{ +} + +// destructor +ACE_INLINE +Marshal_DSI_Impl::~Marshal_DSI_Impl (void) +{ + orb_ = CORBA::ORB::_nil (); +} + diff --git a/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_server.cpp b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_server.cpp new file mode 100644 index 00000000000..fb060a2b5e8 --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_server.cpp @@ -0,0 +1,93 @@ +// ============================================================================ +// +// = LIBRARY +// CORBA Orbix marshal benchmark +// +// = FILENAME +// orbix_marshal_server.cpp +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +//#define USE_INIT + +#include "orbix_marshal_server.h" + +#if !defined (__ACE_INLINE__) +#include "orbix_marshal_server.i" +#endif /* __ACE_INLINE__ */ + +int +Orbix_Marshal_Server_Proxy::run (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results) +{ + char **argv; + int argc; + +#if 0 + // get the argument list to be passed on to the ORB_init method + argv = options.orb_init_args (argc); + + // get the orb. Pass any ORB_init arguments + this->orb_ = CORBA::ORB_init (argc, (char *const *)argv, "Orbix"); + if (this->orb_ == 0) + { + ACE_DEBUG ((LM_DEBUG, "ORB_init failed\n")); + return -1; + } + + // get the argument list to be passed on to the BOA_init method + argv = options.orb_init_args (argc); + + // get the orb. Pass any ORB_init arguments + this->boa_ = this->orb_->BOA_init (argc, (char *const *)argv, "Orbix_BOA"); + if (this->boa_ == 0) + { + ACE_DEBUG ((LM_DEBUG, "ORB_init failed\n")); + return -1; + } +#endif + // tell the "results" object what file it must store the results into + results.filename (options.filename ()); + + // use SII or DII accordingly + switch (options.policy ()) + { + case CORBA_Marshal_Options::STATIC : // use SSI + this->ssi_ = new Marshal_SSI_Impl (options.object_name ()); + break; + case CORBA_Marshal_Options::DYNAMIC : // use DSI + // this->dsi_ = new Marshal_DSI_Impl (this->orb_, ACE_OS::strdup (options.object_name ())); + this->dsi_ = new Marshal_DSI_Impl (&CORBA::Orbix, ACE_OS::strdup (options.object_name ())); + // register with the BOA + try { + // we need to do a setImpl + //this->boa_->setImpl ("Marshal", *this->dsi_); + CORBA::Orbix.setImpl ("Marshal", *this->dsi_); + } + catch (CORBA::SystemException &se) + { + cerr << "system exception in obj_is_ready" << se << endl; + } + break; + default: + ACE_DEBUG ((LM_DEBUG, "bad policy\n")); + return -1; + } + + ACE_DEBUG ((LM_DEBUG, "Calling impl is ready\n")); + try { + // call impl_is_ready + // this->boa_->impl_is_ready ((char *)options.service_name ()); + CORBA::Orbix.impl_is_ready ("marshalDSI"); + } + catch (CORBA::SystemException &se) + { + cerr << "system exception: " << se << endl; + } + + return 0; +} + diff --git a/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_server.h b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_server.h new file mode 100644 index 00000000000..fe72344a8bb --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_server.h @@ -0,0 +1,57 @@ +// ============================================================================ +// +// = LIBRARY +// CORBA Marshal Orbix Benchmark +// +// = FILENAME +// orbix_marshal_server.h +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +#if !defined(_ORBIX_MARSHAL_SERVER_H_) +#define _ORBIX_MARSHAL_SERVER_H_ + +// benchmark library includes +#include "benchmark/marshal_options.h" +#include "benchmark/marshal_results.h" +#include "benchmark/marshal_proxy.h" + +// implementation classes +#include "orbix_marshal_impl.h" + +// include Orbix specific include files +#include "marshal.h" // generated by IDL compiler + +class Orbix_Marshal_Server_Proxy : public CORBA_Marshal_Proxy +{ +public: + Orbix_Marshal_Server_Proxy (void); + // constructor + + ~Orbix_Marshal_Server_Proxy (void); + // destructor + + virtual int run (CORBA_Marshal_Proxy::OPTIONS &options, + CORBA_Marshal_Proxy::RESULTS &results); + // do the actual work +private: + CORBA::ORB_ptr orb_; + // underlying orb; + + CORBA::BOA_ptr boa_; + // underlying boa; + + Marshal_SSI_Impl *ssi_; + Marshal_DSI_Impl *dsi_; + // the implementation (SSI or DSI) +}; + + +#if defined (__ACE_INLINE__) +#include "orbix_marshal_server.i" +#endif /* __ACE_INLINE__ */ + +#endif diff --git a/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_server.i b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_server.i new file mode 100644 index 00000000000..f6c5fe36fd3 --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/orbix_marshal_server.i @@ -0,0 +1,26 @@ +// constructor +ACE_INLINE +Orbix_Marshal_Server_Proxy::Orbix_Marshal_Server_Proxy (void) + : orb_ (0), + boa_ (0), + ssi_ (0), + dsi_ (0) +{ +} + +// destructor +ACE_INLINE +Orbix_Marshal_Server_Proxy::~Orbix_Marshal_Server_Proxy (void) +{ + // releasing order is important + + // release the impl + delete ssi_; + delete dsi_; + + // release the BOA + CORBA::release (boa_); + + // release the ORB + CORBA::release (orb_); +} diff --git a/TAO/Benchmark/Marshal_Test/Orbix/run_client b/TAO/Benchmark/Marshal_Test/Orbix/run_client new file mode 100755 index 00000000000..b0f7503d7bc --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/run_client @@ -0,0 +1,23 @@ +echo "********* Static Invocation Interface **********" +client -i 1 -h mambo -R s -P S -o ssi_marshal -n marshalSSI -T s +client -i 1 -h mambo -R s -P S -o ssi_marshal -n marshalSSI -T l +client -i 1 -h mambo -R s -P S -o ssi_marshal -n marshalSSI -T o +client -i 1 -h mambo -R s -P S -o ssi_marshal -n marshalSSI -T c +client -i 1 -h mambo -R s -P S -o ssi_marshal -n marshalSSI -T d +client -i 1 -h mambo -R s -P S -o ssi_marshal -n marshalSSI -T S +client -i 1 -h mambo -R s -P S -o ssi_marshal -n marshalSSI -T U +client -i 1 -h mambo -R s -P S -o ssi_marshal -n marshalSSI -T A +client -i 1 -h mambo -R s -P S -o ssi_marshal -n marshalSSI -T Q +#client -i 1 -h mambo -R s -P S -o ssi_marshal -n marshalSSI -T R +# +echo "********* Dynamic Invocation Interface **********" +client -i 1 -h mambo -R s -P D -o ssi_marshal -n marshalSSI -T s +client -i 1 -h mambo -R s -P D -o ssi_marshal -n marshalSSI -T l +client -i 1 -h mambo -R s -P D -o ssi_marshal -n marshalSSI -T o +client -i 1 -h mambo -R s -P D -o ssi_marshal -n marshalSSI -T c +client -i 1 -h mambo -R s -P D -o ssi_marshal -n marshalSSI -T d +client -i 1 -h mambo -R s -P D -o ssi_marshal -n marshalSSI -T S +client -i 1 -h mambo -R s -P D -o ssi_marshal -n marshalSSI -T U +client -i 1 -h mambo -R s -P D -o ssi_marshal -n marshalSSI -T A +client -i 1 -h mambo -R s -P D -o ssi_marshal -n marshalSSI -T Q + diff --git a/TAO/Benchmark/Marshal_Test/Orbix/run_dsi b/TAO/Benchmark/Marshal_Test/Orbix/run_dsi new file mode 100755 index 00000000000..f44f488aee7 --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/run_dsi @@ -0,0 +1,4 @@ +echo "********* Static Invocation Interface **********" +client -i 1 -h mambo -R s -P S -n marshalDSI -T s +echo "********* Dynamic Invocation Interface **********" +client -i 1 -h mambo -R s -P D -n marshalDSI -T s diff --git a/TAO/Benchmark/Marshal_Test/Orbix/run_dsi_server b/TAO/Benchmark/Marshal_Test/Orbix/run_dsi_server new file mode 100755 index 00000000000..19dc309e0dc --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/run_dsi_server @@ -0,0 +1 @@ +putit marshalDSI "${TAO_ROOT}/Benchmark/Marshal_Test/Orbix/server -R r -P D -I V -o dsi_marshal -n marshalDSI"
\ No newline at end of file diff --git a/TAO/Benchmark/Marshal_Test/Orbix/run_ssi b/TAO/Benchmark/Marshal_Test/Orbix/run_ssi new file mode 100755 index 00000000000..9a1ca614e4e --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/run_ssi @@ -0,0 +1,4 @@ +echo "********* Static Invocation Interface **********" +client -i 1 -h mambo -R s -P S -o ssi_marshal -n marshalSSI -T s +echo "********* Dynamic Invocation Interface **********" +client -i 1 -h mambo -R s -P D -o ssi_marshal -n marshalSSI -T s diff --git a/TAO/Benchmark/Marshal_Test/Orbix/run_ssi_server b/TAO/Benchmark/Marshal_Test/Orbix/run_ssi_server new file mode 100755 index 00000000000..a0af5a0dcf4 --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/run_ssi_server @@ -0,0 +1 @@ +putit marshalSSI "${TAO_ROOT}/Benchmark/Marshal_Test/Orbix/server -R r -P S -I V -o ssi_marshal -n marshalSSI"
\ No newline at end of file diff --git a/TAO/Benchmark/Marshal_Test/Orbix/server.cpp b/TAO/Benchmark/Marshal_Test/Orbix/server.cpp new file mode 100644 index 00000000000..dd6902a012d --- /dev/null +++ b/TAO/Benchmark/Marshal_Test/Orbix/server.cpp @@ -0,0 +1,12 @@ +#include "benchmark/driver.h" +#include "orbix_marshal_server.h" + +int main (int argc, char *argv []) +{ + // instantiate a DRIVER with the Orbix_Client_Proxy as the template + CORBA_Benchmark_Driver<Orbix_Marshal_Server_Proxy> driver (new + Orbix_Marshal_Server_Proxy ()); + + // let the driver do everything for us so that we remain very simple + return driver.run (argc, argv); +} |