From 1adba473e6917b227e1b0a1118148101dca202e7 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Mon, 31 Mar 2014 16:53:55 +0200 Subject: add quellcode Signed-off-by: Manuel Traut --- quellcode/versuch4/GNUmakefile.Bench_Receiver | 224 ++++ quellcode/versuch4/GNUmakefile.Bench_Supplier | 221 ++++ quellcode/versuch4/GNUmakefile.Benchmark_Receiver | 226 ++++ quellcode/versuch4/GNUmakefile.Benchmark_Supplier | 226 ++++ quellcode/versuch4/Receiver | Bin 0 -> 573339 bytes quellcode/versuch4/Receiver.cpp | 67 ++ quellcode/versuch4/Supplier | Bin 0 -> 363690 bytes quellcode/versuch4/Supplier.cpp | 106 ++ quellcode/versuch4/bench.idl | 21 + quellcode/versuch4/bench.mpc | 23 + quellcode/versuch4/benchC.cpp | 1062 ++++++++++++++++++ quellcode/versuch4/benchC.h | 469 ++++++++ quellcode/versuch4/benchC.inl | 64 ++ quellcode/versuch4/benchI.cpp | 79 ++ quellcode/versuch4/benchI.h | 82 ++ quellcode/versuch4/benchS.cpp | 1138 ++++++++++++++++++++ quellcode/versuch4/benchS.h | 217 ++++ quellcode/versuch4/benchS.inl | 28 + quellcode/versuch4/benchS_T.cpp | 41 + quellcode/versuch4/benchS_T.h | 155 +++ quellcode/versuch4/benchS_T.inl | 193 ++++ quellcode/versuch4/bench_i.cpp | 99 ++ quellcode/versuch4/bench_i.h | 99 ++ quellcode/versuch4/benchmark.mpc | 23 + quellcode/versuch4/buildNcopy | 2 + quellcode/versuch4/burner | Bin 0 -> 8386 bytes quellcode/versuch4/cpx.cpp | 85 ++ quellcode/versuch4/cpx.h | 73 ++ quellcode/versuch4/howto | 230 ++++ quellcode/versuch4/multithreading/ReceiverDual.cpp | 123 +++ quellcode/versuch4/multithreading/SupplierHigh.cpp | 126 +++ quellcode/versuch4/multithreading/SupplierLow.cpp | 126 +++ quellcode/versuch4/multithreading/benchDual.mpc | 35 + quellcode/versuch4/multithreading/benchI.cpp | 137 +++ quellcode/versuch4/multithreading/benchI.h | 130 +++ quellcode/versuch4/multithreading/cpx.cpp | 85 ++ quellcode/versuch4/multithreading/cpx.h | 73 ++ quellcode/versuch4/myBurner.cpp | 13 + quellcode/versuch4/readme | 65 ++ 39 files changed, 6166 insertions(+) create mode 100755 quellcode/versuch4/GNUmakefile.Bench_Receiver create mode 100755 quellcode/versuch4/GNUmakefile.Bench_Supplier create mode 100755 quellcode/versuch4/GNUmakefile.Benchmark_Receiver create mode 100755 quellcode/versuch4/GNUmakefile.Benchmark_Supplier create mode 100755 quellcode/versuch4/Receiver create mode 100755 quellcode/versuch4/Receiver.cpp create mode 100755 quellcode/versuch4/Supplier create mode 100755 quellcode/versuch4/Supplier.cpp create mode 100755 quellcode/versuch4/bench.idl create mode 100755 quellcode/versuch4/bench.mpc create mode 100755 quellcode/versuch4/benchC.cpp create mode 100755 quellcode/versuch4/benchC.h create mode 100755 quellcode/versuch4/benchC.inl create mode 100755 quellcode/versuch4/benchI.cpp create mode 100755 quellcode/versuch4/benchI.h create mode 100755 quellcode/versuch4/benchS.cpp create mode 100755 quellcode/versuch4/benchS.h create mode 100755 quellcode/versuch4/benchS.inl create mode 100755 quellcode/versuch4/benchS_T.cpp create mode 100755 quellcode/versuch4/benchS_T.h create mode 100755 quellcode/versuch4/benchS_T.inl create mode 100755 quellcode/versuch4/bench_i.cpp create mode 100755 quellcode/versuch4/bench_i.h create mode 100755 quellcode/versuch4/benchmark.mpc create mode 100755 quellcode/versuch4/buildNcopy create mode 100755 quellcode/versuch4/burner create mode 100755 quellcode/versuch4/cpx.cpp create mode 100755 quellcode/versuch4/cpx.h create mode 100755 quellcode/versuch4/howto create mode 100755 quellcode/versuch4/multithreading/ReceiverDual.cpp create mode 100755 quellcode/versuch4/multithreading/SupplierHigh.cpp create mode 100755 quellcode/versuch4/multithreading/SupplierLow.cpp create mode 100755 quellcode/versuch4/multithreading/benchDual.mpc create mode 100755 quellcode/versuch4/multithreading/benchI.cpp create mode 100755 quellcode/versuch4/multithreading/benchI.h create mode 100755 quellcode/versuch4/multithreading/cpx.cpp create mode 100755 quellcode/versuch4/multithreading/cpx.h create mode 100755 quellcode/versuch4/myBurner.cpp create mode 100755 quellcode/versuch4/readme (limited to 'quellcode/versuch4') diff --git a/quellcode/versuch4/GNUmakefile.Bench_Receiver b/quellcode/versuch4/GNUmakefile.Bench_Receiver new file mode 100755 index 0000000..e56907b --- /dev/null +++ b/quellcode/versuch4/GNUmakefile.Bench_Receiver @@ -0,0 +1,224 @@ +# -*- Makefile -*- +#---------------------------------------------------------------------------- +# GNU Makefile +# +# @file GNUmakefile.Bench_Receiver +# +# gnu.mpd,v 1.147 2006/02/21 19:25:26 jwillemsen Exp +# +# This file was automatically generated by MPC. Any changes made directly to +# this file will be lost the next time it is generated. +# +#---------------------------------------------------------------------------- +MAKEFILE = GNUmakefile.Bench_Receiver +DEPENDENCY_FILE = .depend.Bench_Receiver +BIN_UNCHECKED = Receiver + +TAO_ROOT ?= $(ACE_ROOT)/TAO + +FILES = \ + benchC.cpp \ + benchS.cpp \ + cpx.cpp \ + bench_i.cpp \ + Receiver.cpp + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- +LDLIBS = -lTAO_CosNaming -lTAO_RTPortableServer -lTAO_RTCORBA -lTAO_PortableServer -lTAO_PI -lTAO_CodecFactory -lTAO_AnyTypeCode -lTAO -lACE +TAO_IDL = $(ACE_ROOT)/bin/tao_idl +TAO_IDL_DEP = $(ACE_ROOT)/bin/tao_idl$(EXEEXT) +TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) + +PRJ_TYPE = rtp + +ifeq ($(INSBIN),.) + ifeq ($(PWD),) + PWD=$(shell pwd) + endif + INSBIN = $(PWD) +endif +OUTPUT_DIRECTORY = $(INSBIN) + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +## We don't need the ACELIB setting from wrapper_macros.GNU +ACELIB = +tao_dont_use_idl_make_rule = 1 +include $(TAO_ROOT)/rules.tao.GNU + +# To build multiple targets in the same directory on AIX, it works +# best to have a template directory per project. +# The compiler/linker isn't too smart about instantiating templates... +ifdef TEMPINCDIR +TEMPINCDIR := $(TEMPINCDIR)/Bench_Receiver +all: $(TEMPINCDIR) +endif + +ifneq ($(OUTPUT_DIRECTORY),) +all: $(OUTPUT_DIRECTORY) +$(OUTPUT_DIRECTORY): + -@$(MKDIR) "$(OUTPUT_DIRECTORY)" +endif + +# turn off libcheck if doing a dry run +ifeq ($(findstring n, $(MAKEFLAGS)),n) + LIBCHECK = 1 +else + # turn off libcheck if keep going was passed too + ifeq ($(findstring k, $(MAKEFLAGS)),k) + LIBCHECK = 1 + else + LIBCHECK ?= $(filter-out $(foreach lib,TAO_CosNaming TAO_RTPortableServer TAO_RTCORBA TAO_PortableServer TAO_PI TAO_CodecFactory TAO_AnyTypeCode TAO ACE,$(findstring $(lib),$(foreach libpath,. $(ACE_ROOT)/lib /usr/lib $(INSLIB),$(wildcard $(libpath)/lib$(lib).* $(libpath)/$(lib).lib)))),TAO_CosNaming TAO_RTPortableServer TAO_RTCORBA TAO_PortableServer TAO_PI TAO_CodecFactory TAO_AnyTypeCode TAO ACE) + ifeq ($(LIBCHECK),) + LIBCHECK = 1 + endif + endif +endif +ifeq ($(rt_corba),1) +ifeq ($(exceptions),1) +ifeq ($(LIBCHECK), 1) +BIN = $(BIN_UNCHECKED)$(EXEEXT) +else + all: lib_warning +endif +else + all: require_warning +endif +else + all: require_warning +endif + +# If it contains ../ at all use notdir. +OBJS = $(foreach var, $(addsuffix .$(OBJEXT), $(basename $(FILES)) $(RESOURCES)), $(if $(findstring ../,$(var)),$(notdir $(var)),$(var))) +SRC = $(FILES) + +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU + +ifneq ($(OUTPUT_DIRECTORY),) +ifneq ($(OUTPUT_DIRECTORY),.) + INSTALL = $(VBIN:%=$(INSBIN)/%) + CLEANUP_INSTALL += $(CLEANUP_BIN:%=$(INSBIN)/%$(VAR)$(EXEEXT)) +endif +endif + +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU +ifeq ($(VXWORKSLINK),true) +include $(TGT_DIR)/h/make/rules.$(PRJ_TYPE) +endif + +ifeq ($(VXWORKSLINK),true) +LDLIBPATH = -L. -L$(ACE_ROOT)/lib +else +LDFLAGS += -L. -L$(ACE_ROOT)/lib +endif +CPPFLAGS += -I$(ACE_ROOT) -I$(TAO_ROOT) -I$(TAO_ROOT)/orbsvcs +ifeq ($(static_libs),1) + CPPFLAGS += -DACE_AS_STATIC_LIBS -DTAO_AS_STATIC_LIBS +endif + +#---------------------------------------------------------------------------- +# Local targets +#---------------------------------------------------------------------------- +lib_warning: + @echo This project will not be built due to the following missing library: + @echo $(LIBCHECK) + +require_warning: + @echo This project will not be built due to one of the following missing features: + @echo rt_corba exceptions + +## Some OS's have /bin/test others only have /usr/bin/test +ifeq ($(wildcard /bin/test), /bin/test) + TEST_EXE = /bin/test +else +ifeq ($(wildcard /usr/bin/test), /usr/bin/test) + TEST_EXE = /usr/bin/test +endif +endif + +DYLD_LIBRARY_PATH := $(DYLD_LIBRARY_PATH):$(ACE_ROOT)/lib +LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):$(ACE_ROOT)/lib +SHLIB_PATH := $(SHLIB_PATH):$(ACE_ROOT)/lib +LIBPATH := $(LIBPATH):$(ACE_ROOT)/lib +PATH := $(PATH):$(ACE_ROOT)/lib + +GENERATED_DIRTY += benchS_T.inl benchS.inl benchC.inl benchC.h benchS.h benchS_T.h benchC.cpp benchS.cpp benchS_T.cpp +OBJS_DEPEND_ON_GENERATED = 1 +## More than one file is generated by the command and therefore +## it can not be run in parallel. Unfortunately, there is no way to +## say that only this rule can't be run in parallel. However, we can +## determine if the generated files have already been generated. If that's +## the case, then we don't need this special rule. +ifeq ($(wildcard $(GENERATED_DIRTY)), $(GENERATED_DIRTY)) + ## If we can find /bin/test, then we will continue + ifneq ($(TEST_EXE),) + ## If all of the generated files are there, then we need to check + ## and make sure that the generated files are up-to-date. If they are not + ## then we need the special rule. + ifneq ($(shell $(TEST_EXE) bench.idl -nt benchS_T.inl 2> /dev/null && $(TEST_EXE) bench.idl -nt benchS.inl 2> /dev/null && $(TEST_EXE) bench.idl -nt benchC.inl 2> /dev/null && $(TEST_EXE) bench.idl -nt benchC.h 2> /dev/null && $(TEST_EXE) bench.idl -nt benchS.h 2> /dev/null && $(TEST_EXE) bench.idl -nt benchS_T.h 2> /dev/null && $(TEST_EXE) bench.idl -nt benchC.cpp 2> /dev/null && $(TEST_EXE) bench.idl -nt benchS.cpp 2> /dev/null && $(TEST_EXE) bench.idl -nt benchS_T.cpp 2> /dev/null && echo 0),) + .NOTPARALLEL: + else + ## By this point, all of the generated files are here and up-to-date + ## with respect to the source file. Now we need to make sure that + ## they are up-to-date with respect to the generation tool. If the tool + ## is newer than the generated files, then we need the special rule. + ifneq ($(shell $(TEST_EXE) $(TAO_IDL_DEP) -nt benchS_T.inl 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchS.inl 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchC.inl 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchC.h 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchS.h 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchS_T.h 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchC.cpp 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchS.cpp 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchS_T.cpp 2> /dev/null && echo 0),) + .NOTPARALLEL: + endif + endif + else + .NOTPARALLEL: + endif +else +.NOTPARALLEL: +endif +benchS_T.inl benchS.inl benchC.inl benchC.h benchS.h benchS_T.h benchC.cpp benchS.cpp benchS_T.cpp: bench.idl $(TAO_IDL_DEP) + $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs bench.idl + +ifneq ($(GENERATED_DIRTY),) +.PRECIOUS: $(GENERATED_DIRTY) +## If the generated files are anything but source files, we need to +## ensure that those files are generated before we attempt to build anything +## else. +ifeq ($(OBJS_DEPEND_ON_GENERATED),1) +$(VDIR)$(ACE_PCH_FILE) $(addprefix $(VDIR), $(OBJS)): $(GENERATED_DIRTY) +$(VSHDIR)$(ACE_PCH_FILE) $(VSHOBJS): $(GENERATED_DIRTY) +endif +endif + +ADDITIONAL_IDL_TARGETS += bench$(IDL_CLIENT_HDR_EXT) +idl_stubs: $(ADDITIONAL_IDL_TARGETS) + +# This assignment forces make to run the idl_stubs +# target before building any of the source files. +FORCED_IDL_STUBS = benchC.cpp benchS.cpp cpx.cpp bench_i.cpp Receiver.cpp +FORCED_IDL_STUBS := $(FORCED_IDL_STUBS:benchC.cpp=) +FORCED_IDL_STUBS := $(FORCED_IDL_STUBS:benchS.cpp=) + +ifneq ($(FORCED_IDL_STUBS),) +$(FORCED_IDL_STUBS): idl_stubs +endif + +ifneq ($(VXWORKSLINK),true) +ifeq ($(static_libs_only), 1) + ifeq ($(use_dep_libs), 1) + DEPLIBS = $(foreach lib, TAO_CosNaming TAO_RTPortableServer TAO_RTCORBA TAO_PortableServer TAO_PI TAO_CodecFactory TAO_AnyTypeCode TAO ACE , $(foreach libpath, . $(ACE_ROOT)/lib, $(wildcard $(libpath)/lib$(lib).a))) + endif +endif + +$(BIN): $(addprefix $(VDIR), $(OBJS)) $(DEPLIBS) +ifndef kylix + $(LINK.cc) $(LDFLAGS) $(CC_OUTPUT_FLAG) $@ $^ $(VLDLIBS) $(POSTLINK) +else + $(LINK.cc) $(LDFLAGS) $(CC_OUTPUT_FLAG) $(VLDLIBS) $(BORINITEXEOBJ) $(POSTLINK) $^, $@,, +endif +endif + +realclean: clean +ifneq ($(GENERATED_DIRTY),) + -$(RM) -r $(GENERATED_DIRTY) +endif + diff --git a/quellcode/versuch4/GNUmakefile.Bench_Supplier b/quellcode/versuch4/GNUmakefile.Bench_Supplier new file mode 100755 index 0000000..f24931b --- /dev/null +++ b/quellcode/versuch4/GNUmakefile.Bench_Supplier @@ -0,0 +1,221 @@ +# -*- Makefile -*- +#---------------------------------------------------------------------------- +# GNU Makefile +# +# @file GNUmakefile.Bench_Supplier +# +# gnu.mpd,v 1.147 2006/02/21 19:25:26 jwillemsen Exp +# +# This file was automatically generated by MPC. Any changes made directly to +# this file will be lost the next time it is generated. +# +#---------------------------------------------------------------------------- +MAKEFILE = GNUmakefile.Bench_Supplier +DEPENDENCY_FILE = .depend.Bench_Supplier +BIN_UNCHECKED = Supplier + +TAO_ROOT ?= $(ACE_ROOT)/TAO + +FILES = \ + cpx.cpp \ + benchC.cpp \ + Supplier.cpp + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- +LDLIBS = -lTAO_CosNaming -lTAO_RTCORBA -lTAO_PI -lTAO_CodecFactory -lTAO_AnyTypeCode -lTAO -lACE +TAO_IDL = $(ACE_ROOT)/bin/tao_idl +TAO_IDL_DEP = $(ACE_ROOT)/bin/tao_idl$(EXEEXT) +TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) + +PRJ_TYPE = rtp + +ifeq ($(INSBIN),.) + ifeq ($(PWD),) + PWD=$(shell pwd) + endif + INSBIN = $(PWD) +endif +OUTPUT_DIRECTORY = $(INSBIN) + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +## We don't need the ACELIB setting from wrapper_macros.GNU +ACELIB = +tao_dont_use_idl_make_rule = 1 +include $(TAO_ROOT)/rules.tao.GNU + +# To build multiple targets in the same directory on AIX, it works +# best to have a template directory per project. +# The compiler/linker isn't too smart about instantiating templates... +ifdef TEMPINCDIR +TEMPINCDIR := $(TEMPINCDIR)/Bench_Supplier +all: $(TEMPINCDIR) +endif + +ifneq ($(OUTPUT_DIRECTORY),) +all: $(OUTPUT_DIRECTORY) +$(OUTPUT_DIRECTORY): + -@$(MKDIR) "$(OUTPUT_DIRECTORY)" +endif + +# turn off libcheck if doing a dry run +ifeq ($(findstring n, $(MAKEFLAGS)),n) + LIBCHECK = 1 +else + # turn off libcheck if keep going was passed too + ifeq ($(findstring k, $(MAKEFLAGS)),k) + LIBCHECK = 1 + else + LIBCHECK ?= $(filter-out $(foreach lib,TAO_CosNaming TAO_RTCORBA TAO_PI TAO_CodecFactory TAO_AnyTypeCode TAO ACE,$(findstring $(lib),$(foreach libpath,. $(ACE_ROOT)/lib /usr/lib $(INSLIB),$(wildcard $(libpath)/lib$(lib).* $(libpath)/$(lib).lib)))),TAO_CosNaming TAO_RTCORBA TAO_PI TAO_CodecFactory TAO_AnyTypeCode TAO ACE) + ifeq ($(LIBCHECK),) + LIBCHECK = 1 + endif + endif +endif +ifeq ($(rt_corba),1) +ifeq ($(exceptions),1) +ifeq ($(LIBCHECK), 1) +BIN = $(BIN_UNCHECKED)$(EXEEXT) +else + all: lib_warning +endif +else + all: require_warning +endif +else + all: require_warning +endif + +# If it contains ../ at all use notdir. +OBJS = $(foreach var, $(addsuffix .$(OBJEXT), $(basename $(FILES)) $(RESOURCES)), $(if $(findstring ../,$(var)),$(notdir $(var)),$(var))) +SRC = $(FILES) + +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU + +ifneq ($(OUTPUT_DIRECTORY),) +ifneq ($(OUTPUT_DIRECTORY),.) + INSTALL = $(VBIN:%=$(INSBIN)/%) + CLEANUP_INSTALL += $(CLEANUP_BIN:%=$(INSBIN)/%$(VAR)$(EXEEXT)) +endif +endif + +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU +ifeq ($(VXWORKSLINK),true) +include $(TGT_DIR)/h/make/rules.$(PRJ_TYPE) +endif + +ifeq ($(VXWORKSLINK),true) +LDLIBPATH = -L. -L$(ACE_ROOT)/lib +else +LDFLAGS += -L. -L$(ACE_ROOT)/lib +endif +CPPFLAGS += -I$(ACE_ROOT) -I$(TAO_ROOT) -I$(TAO_ROOT)/orbsvcs +ifeq ($(static_libs),1) + CPPFLAGS += -DACE_AS_STATIC_LIBS -DTAO_AS_STATIC_LIBS +endif + +#---------------------------------------------------------------------------- +# Local targets +#---------------------------------------------------------------------------- +lib_warning: + @echo This project will not be built due to the following missing library: + @echo $(LIBCHECK) + +require_warning: + @echo This project will not be built due to one of the following missing features: + @echo rt_corba exceptions + +## Some OS's have /bin/test others only have /usr/bin/test +ifeq ($(wildcard /bin/test), /bin/test) + TEST_EXE = /bin/test +else +ifeq ($(wildcard /usr/bin/test), /usr/bin/test) + TEST_EXE = /usr/bin/test +endif +endif + +DYLD_LIBRARY_PATH := $(DYLD_LIBRARY_PATH):$(ACE_ROOT)/lib +LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):$(ACE_ROOT)/lib +SHLIB_PATH := $(SHLIB_PATH):$(ACE_ROOT)/lib +LIBPATH := $(LIBPATH):$(ACE_ROOT)/lib +PATH := $(PATH):$(ACE_ROOT)/lib + +GENERATED_DIRTY += benchS_T.inl benchS.inl benchC.inl benchC.h benchS_T.h benchC.cpp benchS_T.cpp +OBJS_DEPEND_ON_GENERATED = 1 +## More than one file is generated by the command and therefore +## it can not be run in parallel. Unfortunately, there is no way to +## say that only this rule can't be run in parallel. However, we can +## determine if the generated files have already been generated. If that's +## the case, then we don't need this special rule. +ifeq ($(wildcard $(GENERATED_DIRTY)), $(GENERATED_DIRTY)) + ## If we can find /bin/test, then we will continue + ifneq ($(TEST_EXE),) + ## If all of the generated files are there, then we need to check + ## and make sure that the generated files are up-to-date. If they are not + ## then we need the special rule. + ifneq ($(shell $(TEST_EXE) bench.idl -nt benchS_T.inl 2> /dev/null && $(TEST_EXE) bench.idl -nt benchS.inl 2> /dev/null && $(TEST_EXE) bench.idl -nt benchC.inl 2> /dev/null && $(TEST_EXE) bench.idl -nt benchC.h 2> /dev/null && $(TEST_EXE) bench.idl -nt benchS_T.h 2> /dev/null && $(TEST_EXE) bench.idl -nt benchC.cpp 2> /dev/null && $(TEST_EXE) bench.idl -nt benchS_T.cpp 2> /dev/null && echo 0),) + .NOTPARALLEL: + else + ## By this point, all of the generated files are here and up-to-date + ## with respect to the source file. Now we need to make sure that + ## they are up-to-date with respect to the generation tool. If the tool + ## is newer than the generated files, then we need the special rule. + ifneq ($(shell $(TEST_EXE) $(TAO_IDL_DEP) -nt benchS_T.inl 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchS.inl 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchC.inl 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchC.h 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchS_T.h 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchC.cpp 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchS_T.cpp 2> /dev/null && echo 0),) + .NOTPARALLEL: + endif + endif + else + .NOTPARALLEL: + endif +else +.NOTPARALLEL: +endif +benchS_T.inl benchS.inl benchC.inl benchC.h benchS_T.h benchC.cpp benchS_T.cpp: bench.idl $(TAO_IDL_DEP) + $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs bench.idl + +ifneq ($(GENERATED_DIRTY),) +.PRECIOUS: $(GENERATED_DIRTY) +## If the generated files are anything but source files, we need to +## ensure that those files are generated before we attempt to build anything +## else. +ifeq ($(OBJS_DEPEND_ON_GENERATED),1) +$(VDIR)$(ACE_PCH_FILE) $(addprefix $(VDIR), $(OBJS)): $(GENERATED_DIRTY) +$(VSHDIR)$(ACE_PCH_FILE) $(VSHOBJS): $(GENERATED_DIRTY) +endif +endif + +ADDITIONAL_IDL_TARGETS += bench$(IDL_CLIENT_HDR_EXT) +idl_stubs: $(ADDITIONAL_IDL_TARGETS) + +# This assignment forces make to run the idl_stubs +# target before building any of the source files. +FORCED_IDL_STUBS = cpx.cpp benchC.cpp Supplier.cpp +FORCED_IDL_STUBS := $(FORCED_IDL_STUBS:benchC.cpp=) + +ifneq ($(FORCED_IDL_STUBS),) +$(FORCED_IDL_STUBS): idl_stubs +endif + +ifneq ($(VXWORKSLINK),true) +ifeq ($(static_libs_only), 1) + ifeq ($(use_dep_libs), 1) + DEPLIBS = $(foreach lib, TAO_CosNaming TAO_RTCORBA TAO_PI TAO_CodecFactory TAO_AnyTypeCode TAO ACE , $(foreach libpath, . $(ACE_ROOT)/lib, $(wildcard $(libpath)/lib$(lib).a))) + endif +endif + +$(BIN): $(addprefix $(VDIR), $(OBJS)) $(DEPLIBS) +ifndef kylix + $(LINK.cc) $(LDFLAGS) $(CC_OUTPUT_FLAG) $@ $^ $(VLDLIBS) $(POSTLINK) +else + $(LINK.cc) $(LDFLAGS) $(CC_OUTPUT_FLAG) $(VLDLIBS) $(BORINITEXEOBJ) $(POSTLINK) $^, $@,, +endif +endif + +realclean: clean +ifneq ($(GENERATED_DIRTY),) + -$(RM) -r $(GENERATED_DIRTY) +endif + diff --git a/quellcode/versuch4/GNUmakefile.Benchmark_Receiver b/quellcode/versuch4/GNUmakefile.Benchmark_Receiver new file mode 100755 index 0000000..52c7abe --- /dev/null +++ b/quellcode/versuch4/GNUmakefile.Benchmark_Receiver @@ -0,0 +1,226 @@ +# -*- Makefile -*- +#---------------------------------------------------------------------------- +# GNU Makefile +# +# @file GNUmakefile.Benchmark_Receiver +# +# $Id: gnu.mpd,v 1.1.1.2.2.23 2006/03/15 18:51:41 elliottc Exp $ +# +# This file was automatically generated by MPC. Any changes made directly to +# this file will be lost the next time it is generated. +# +#---------------------------------------------------------------------------- +MAKEFILE = GNUmakefile.Benchmark_Receiver +DEPENDENCY_FILE = .depend.Benchmark_Receiver +BIN_UNCHECKED = Receiver + +TAO_ROOT ?= $(ACE_ROOT)/TAO + +FILES = \ + benchC.cpp \ + benchS.cpp \ + cpx.cpp \ + bench_i.cpp \ + Receiver.cpp + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- +LDLIBS = -lTAO_CosNaming -lTAO_RTPortableServer -lTAO_RTCORBA -lTAO_PortableServer -lTAO -lACE +TAO_IDL = $(ACE_ROOT)/bin/tao_idl +TAO_IDL_DEP = $(ACE_ROOT)/bin/tao_idl$(EXEEXT) +TAO_IDLFLAGS = -Sc -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) + +PRJ_TYPE = rtp + +ifeq ($(INSBIN),.) + ifeq ($(PWD),) + PWD=$(shell pwd) + endif + INSBIN = $(PWD) +endif +OUTPUT_DIRECTORY = $(INSBIN) + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +## We don't need the ACELIB setting from wrapper_macros.GNU +ACELIB = +tao_dont_use_idl_make_rule = 1 +include $(TAO_ROOT)/rules.tao.GNU + +ifeq ($(versioned_so),1) +SOVERSION = .1.4a.10 +endif + +# To build multiple targets in the same directory on AIX, it works +# best to have a template directory per project. +# The compiler/linker isn't too smart about instantiating templates... +ifdef TEMPINCDIR +TEMPINCDIR := $(TEMPINCDIR)/Benchmark_Receiver +all: $(TEMPINCDIR) +endif + +ifneq ($(OUTPUT_DIRECTORY),) +all: $(OUTPUT_DIRECTORY) +$(OUTPUT_DIRECTORY): + -@$(MKDIR) "$(OUTPUT_DIRECTORY)" +endif + +# turn off libcheck if doing a dry run +ifeq ($(findstring n, $(MAKEFLAGS)),n) + LIBCHECK = 1 +else + # turn off libcheck if keep going was passed too + ifeq ($(findstring k, $(MAKEFLAGS)),k) + LIBCHECK = 1 + else + LIBCHECK ?= $(filter-out $(foreach lib,TAO_CosNaming TAO_RTPortableServer TAO_RTCORBA TAO_PortableServer TAO ACE,$(findstring $(lib),$(foreach libpath,. $(ACE_ROOT)/lib /usr/lib $(INSLIB),$(wildcard $(libpath)/lib$(lib).* $(libpath)/$(lib).lib)))),TAO_CosNaming TAO_RTPortableServer TAO_RTCORBA TAO_PortableServer TAO ACE) + ifeq ($(LIBCHECK),) + LIBCHECK = 1 + endif + endif +endif +ifeq ($(rt_corba),1) +ifeq ($(exceptions),1) +ifeq ($(LIBCHECK), 1) +BIN = $(BIN_UNCHECKED)$(EXEEXT) +else + all: lib_warning +endif +else + all: require_warning +endif +else + all: require_warning +endif + +# If it contains ../ at all use notdir. +OBJS = $(foreach var, $(addsuffix .$(OBJEXT), $(basename $(FILES)) $(RESOURCES)), $(if $(findstring ../,$(var)),$(notdir $(var)),$(var))) +SRC = $(FILES) + +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU + +ifneq ($(OUTPUT_DIRECTORY),) +ifneq ($(OUTPUT_DIRECTORY),.) + INSTALL = $(VBIN:%=$(INSBIN)/%) + CLEANUP_INSTALL += $(CLEANUP_BIN:%=$(INSBIN)/%$(VAR)$(EXEEXT)) +endif +endif + +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU +ifeq ($(VXWORKSLINK),true) +include $(TGT_DIR)/h/make/rules.$(PRJ_TYPE) +endif + +ifeq ($(VXWORKSLINK),true) +LDLIBPATH = -L. -L$(ACE_ROOT)/lib +else +LDFLAGS += -L. -L$(ACE_ROOT)/lib +endif +CPPFLAGS += -I$(ACE_ROOT) -I$(TAO_ROOT) -I$(TAO_ROOT)/orbsvcs +ifeq ($(static_libs),1) + CPPFLAGS += -DACE_AS_STATIC_LIBS -DTAO_AS_STATIC_LIBS +endif + +#---------------------------------------------------------------------------- +# Local targets +#---------------------------------------------------------------------------- +lib_warning: + @echo This project will not be built due to the following missing library: + @echo $(LIBCHECK) + +require_warning: + @echo This project will not be built due to one of the following missing features: + @echo rt_corba exceptions + +## Some OS's have /bin/test others only have /usr/bin/test +ifeq ($(wildcard /bin/test), /bin/test) + TEST_EXE = /bin/test +else +ifeq ($(wildcard /usr/bin/test), /usr/bin/test) + TEST_EXE = /usr/bin/test +endif +endif + +DYLD_LIBRARY_PATH := $(DYLD_LIBRARY_PATH):$(ACE_ROOT)/lib +LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):$(ACE_ROOT)/lib +SHLIB_PATH := $(SHLIB_PATH):$(ACE_ROOT)/lib +LIBPATH := $(LIBPATH):$(ACE_ROOT)/lib +PATH := $(PATH):$(ACE_ROOT)/lib + +GENERATED_DIRTY += benchC.inl benchS.inl benchC.h benchS.h benchC.cpp benchS.cpp +OBJS_DEPEND_ON_GENERATED = 1 +## More than one file is generated by the command and therefore +## it can not be run in parallel. Unfortunately, there is no way to +## say that only this rule can't be run in parallel. However, we can +## determine if the generated files have already been generated. If that's +## the case, then we don't need this special rule. +ifeq ($(wildcard $(GENERATED_DIRTY)), $(GENERATED_DIRTY)) + ## If we can find /bin/test, then we will continue + ifneq ($(TEST_EXE),) + ## If all of the generated files are there, then we need to check + ## and make sure that the generated files are up-to-date. If they are not + ## then we need the special rule. + ifneq ($(shell $(TEST_EXE) bench.idl -nt benchC.inl 2> /dev/null && $(TEST_EXE) bench.idl -nt benchS.inl 2> /dev/null && $(TEST_EXE) bench.idl -nt benchC.h 2> /dev/null && $(TEST_EXE) bench.idl -nt benchS.h 2> /dev/null && $(TEST_EXE) bench.idl -nt benchC.cpp 2> /dev/null && $(TEST_EXE) bench.idl -nt benchS.cpp 2> /dev/null && echo 0),) + .NOTPARALLEL: + else + ## By this point, all of the generated files are here and up-to-date + ## with respect to the source file. Now we need to make sure that + ## they are up-to-date with respect to the generation tool. If the tool + ## is newer than the generated files, then we need the special rule. + ifneq ($(shell $(TEST_EXE) $(TAO_IDL_DEP) -nt benchC.inl 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchS.inl 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchC.h 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchS.h 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchC.cpp 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchS.cpp 2> /dev/null && echo 0),) + .NOTPARALLEL: + endif + endif + else + .NOTPARALLEL: + endif +else +.NOTPARALLEL: +endif +benchC.inl benchS.inl benchC.h benchS.h benchC.cpp benchS.cpp: bench.idl $(TAO_IDL_DEP) + $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs bench.idl + +ifneq ($(GENERATED_DIRTY),) +.PRECIOUS: $(GENERATED_DIRTY) +## If the generated files are anything but source files, we need to +## ensure that those files are generated before we attempt to build anything +## else. +ifeq ($(OBJS_DEPEND_ON_GENERATED),1) +$(VDIR)$(ACE_PCH_FILE) $(addprefix $(VDIR), $(OBJS)): $(GENERATED_DIRTY) +$(VSHDIR)$(ACE_PCH_FILE) $(VSHOBJS): $(GENERATED_DIRTY) +endif +endif + +ADDITIONAL_IDL_TARGETS += bench$(IDL_CLIENT_HDR_EXT) +idl_stubs: $(ADDITIONAL_IDL_TARGETS) + +# This assignment forces make to run the idl_stubs +# target before building any of the source files. +FORCED_IDL_STUBS = benchC.cpp benchS.cpp cpx.cpp bench_i.cpp Receiver.cpp +FORCED_IDL_STUBS := $(FORCED_IDL_STUBS:benchC.cpp=) +FORCED_IDL_STUBS := $(FORCED_IDL_STUBS:benchS.cpp=) + +ifneq ($(FORCED_IDL_STUBS),) +$(FORCED_IDL_STUBS): idl_stubs +endif + +ifneq ($(VXWORKSLINK),true) +ifeq ($(static_libs_only), 1) + DEPLIBS = $(foreach lib, TAO_CosNaming TAO_RTPortableServer TAO_RTCORBA TAO_PortableServer TAO ACE , $(foreach libpath, . $(ACE_ROOT)/lib, $(wildcard $(libpath)/lib$(lib).a))) +endif + +$(BIN): $(addprefix $(VDIR), $(OBJS)) $(DEPLIBS) +ifndef kylix + $(LINK.cc) $(LDFLAGS) $(CC_OUTPUT_FLAG) $@ $^ $(VLDLIBS) $(POSTLINK) +else + $(LINK.cc) $(LDFLAGS) $(CC_OUTPUT_FLAG) $(VLDLIBS) $(BORINITEXEOBJ) $(POSTLINK) $^, $@,, +endif +endif + +realclean: clean +ifneq ($(GENERATED_DIRTY),) + -$(RM) -r $(GENERATED_DIRTY) +endif + diff --git a/quellcode/versuch4/GNUmakefile.Benchmark_Supplier b/quellcode/versuch4/GNUmakefile.Benchmark_Supplier new file mode 100755 index 0000000..2954847 --- /dev/null +++ b/quellcode/versuch4/GNUmakefile.Benchmark_Supplier @@ -0,0 +1,226 @@ +# -*- Makefile -*- +#---------------------------------------------------------------------------- +# GNU Makefile +# +# @file GNUmakefile.Benchmark_Supplier +# +# $Id: gnu.mpd,v 1.1.1.2.2.23 2006/03/15 18:51:41 elliottc Exp $ +# +# This file was automatically generated by MPC. Any changes made directly to +# this file will be lost the next time it is generated. +# +#---------------------------------------------------------------------------- +MAKEFILE = GNUmakefile.Benchmark_Supplier +DEPENDENCY_FILE = .depend.Benchmark_Supplier +BIN_UNCHECKED = Supplier + +TAO_ROOT ?= $(ACE_ROOT)/TAO + +FILES = \ + benchC.cpp \ + benchS.cpp \ + cpx.cpp \ + bench_i.cpp \ + Supplier.cpp + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- +LDLIBS = -lTAO_CosNaming -lTAO_RTCORBA -lTAO -lACE +TAO_IDL = $(ACE_ROOT)/bin/tao_idl +TAO_IDL_DEP = $(ACE_ROOT)/bin/tao_idl$(EXEEXT) +TAO_IDLFLAGS = -Sc -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) + +PRJ_TYPE = rtp + +ifeq ($(INSBIN),.) + ifeq ($(PWD),) + PWD=$(shell pwd) + endif + INSBIN = $(PWD) +endif +OUTPUT_DIRECTORY = $(INSBIN) + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +## We don't need the ACELIB setting from wrapper_macros.GNU +ACELIB = +tao_dont_use_idl_make_rule = 1 +include $(TAO_ROOT)/rules.tao.GNU + +ifeq ($(versioned_so),1) +SOVERSION = .1.4a.10 +endif + +# To build multiple targets in the same directory on AIX, it works +# best to have a template directory per project. +# The compiler/linker isn't too smart about instantiating templates... +ifdef TEMPINCDIR +TEMPINCDIR := $(TEMPINCDIR)/Benchmark_Supplier +all: $(TEMPINCDIR) +endif + +ifneq ($(OUTPUT_DIRECTORY),) +all: $(OUTPUT_DIRECTORY) +$(OUTPUT_DIRECTORY): + -@$(MKDIR) "$(OUTPUT_DIRECTORY)" +endif + +# turn off libcheck if doing a dry run +ifeq ($(findstring n, $(MAKEFLAGS)),n) + LIBCHECK = 1 +else + # turn off libcheck if keep going was passed too + ifeq ($(findstring k, $(MAKEFLAGS)),k) + LIBCHECK = 1 + else + LIBCHECK ?= $(filter-out $(foreach lib,TAO_CosNaming TAO_RTCORBA TAO ACE,$(findstring $(lib),$(foreach libpath,. $(ACE_ROOT)/lib /usr/lib $(INSLIB),$(wildcard $(libpath)/lib$(lib).* $(libpath)/$(lib).lib)))),TAO_CosNaming TAO_RTCORBA TAO ACE) + ifeq ($(LIBCHECK),) + LIBCHECK = 1 + endif + endif +endif +ifeq ($(rt_corba),1) +ifeq ($(exceptions),1) +ifeq ($(LIBCHECK), 1) +BIN = $(BIN_UNCHECKED)$(EXEEXT) +else + all: lib_warning +endif +else + all: require_warning +endif +else + all: require_warning +endif + +# If it contains ../ at all use notdir. +OBJS = $(foreach var, $(addsuffix .$(OBJEXT), $(basename $(FILES)) $(RESOURCES)), $(if $(findstring ../,$(var)),$(notdir $(var)),$(var))) +SRC = $(FILES) + +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU + +ifneq ($(OUTPUT_DIRECTORY),) +ifneq ($(OUTPUT_DIRECTORY),.) + INSTALL = $(VBIN:%=$(INSBIN)/%) + CLEANUP_INSTALL += $(CLEANUP_BIN:%=$(INSBIN)/%$(VAR)$(EXEEXT)) +endif +endif + +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU +ifeq ($(VXWORKSLINK),true) +include $(TGT_DIR)/h/make/rules.$(PRJ_TYPE) +endif + +ifeq ($(VXWORKSLINK),true) +LDLIBPATH = -L. -L$(ACE_ROOT)/lib +else +LDFLAGS += -L. -L$(ACE_ROOT)/lib +endif +CPPFLAGS += -I$(ACE_ROOT) -I$(TAO_ROOT) -I$(TAO_ROOT)/orbsvcs +ifeq ($(static_libs),1) + CPPFLAGS += -DACE_AS_STATIC_LIBS -DTAO_AS_STATIC_LIBS +endif + +#---------------------------------------------------------------------------- +# Local targets +#---------------------------------------------------------------------------- +lib_warning: + @echo This project will not be built due to the following missing library: + @echo $(LIBCHECK) + +require_warning: + @echo This project will not be built due to one of the following missing features: + @echo rt_corba exceptions + +## Some OS's have /bin/test others only have /usr/bin/test +ifeq ($(wildcard /bin/test), /bin/test) + TEST_EXE = /bin/test +else +ifeq ($(wildcard /usr/bin/test), /usr/bin/test) + TEST_EXE = /usr/bin/test +endif +endif + +DYLD_LIBRARY_PATH := $(DYLD_LIBRARY_PATH):$(ACE_ROOT)/lib +LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):$(ACE_ROOT)/lib +SHLIB_PATH := $(SHLIB_PATH):$(ACE_ROOT)/lib +LIBPATH := $(LIBPATH):$(ACE_ROOT)/lib +PATH := $(PATH):$(ACE_ROOT)/lib + +GENERATED_DIRTY += benchC.inl benchS.inl benchC.h benchS.h benchC.cpp benchS.cpp +OBJS_DEPEND_ON_GENERATED = 1 +## More than one file is generated by the command and therefore +## it can not be run in parallel. Unfortunately, there is no way to +## say that only this rule can't be run in parallel. However, we can +## determine if the generated files have already been generated. If that's +## the case, then we don't need this special rule. +ifeq ($(wildcard $(GENERATED_DIRTY)), $(GENERATED_DIRTY)) + ## If we can find /bin/test, then we will continue + ifneq ($(TEST_EXE),) + ## If all of the generated files are there, then we need to check + ## and make sure that the generated files are up-to-date. If they are not + ## then we need the special rule. + ifneq ($(shell $(TEST_EXE) bench.idl -nt benchC.inl 2> /dev/null && $(TEST_EXE) bench.idl -nt benchS.inl 2> /dev/null && $(TEST_EXE) bench.idl -nt benchC.h 2> /dev/null && $(TEST_EXE) bench.idl -nt benchS.h 2> /dev/null && $(TEST_EXE) bench.idl -nt benchC.cpp 2> /dev/null && $(TEST_EXE) bench.idl -nt benchS.cpp 2> /dev/null && echo 0),) + .NOTPARALLEL: + else + ## By this point, all of the generated files are here and up-to-date + ## with respect to the source file. Now we need to make sure that + ## they are up-to-date with respect to the generation tool. If the tool + ## is newer than the generated files, then we need the special rule. + ifneq ($(shell $(TEST_EXE) $(TAO_IDL_DEP) -nt benchC.inl 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchS.inl 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchC.h 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchS.h 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchC.cpp 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt benchS.cpp 2> /dev/null && echo 0),) + .NOTPARALLEL: + endif + endif + else + .NOTPARALLEL: + endif +else +.NOTPARALLEL: +endif +benchC.inl benchS.inl benchC.h benchS.h benchC.cpp benchS.cpp: bench.idl $(TAO_IDL_DEP) + $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs bench.idl + +ifneq ($(GENERATED_DIRTY),) +.PRECIOUS: $(GENERATED_DIRTY) +## If the generated files are anything but source files, we need to +## ensure that those files are generated before we attempt to build anything +## else. +ifeq ($(OBJS_DEPEND_ON_GENERATED),1) +$(VDIR)$(ACE_PCH_FILE) $(addprefix $(VDIR), $(OBJS)): $(GENERATED_DIRTY) +$(VSHDIR)$(ACE_PCH_FILE) $(VSHOBJS): $(GENERATED_DIRTY) +endif +endif + +ADDITIONAL_IDL_TARGETS += bench$(IDL_CLIENT_HDR_EXT) +idl_stubs: $(ADDITIONAL_IDL_TARGETS) + +# This assignment forces make to run the idl_stubs +# target before building any of the source files. +FORCED_IDL_STUBS = benchC.cpp benchS.cpp cpx.cpp bench_i.cpp Supplier.cpp +FORCED_IDL_STUBS := $(FORCED_IDL_STUBS:benchC.cpp=) +FORCED_IDL_STUBS := $(FORCED_IDL_STUBS:benchS.cpp=) + +ifneq ($(FORCED_IDL_STUBS),) +$(FORCED_IDL_STUBS): idl_stubs +endif + +ifneq ($(VXWORKSLINK),true) +ifeq ($(static_libs_only), 1) + DEPLIBS = $(foreach lib, TAO_CosNaming TAO_RTCORBA TAO ACE , $(foreach libpath, . $(ACE_ROOT)/lib, $(wildcard $(libpath)/lib$(lib).a))) +endif + +$(BIN): $(addprefix $(VDIR), $(OBJS)) $(DEPLIBS) +ifndef kylix + $(LINK.cc) $(LDFLAGS) $(CC_OUTPUT_FLAG) $@ $^ $(VLDLIBS) $(POSTLINK) +else + $(LINK.cc) $(LDFLAGS) $(CC_OUTPUT_FLAG) $(VLDLIBS) $(BORINITEXEOBJ) $(POSTLINK) $^, $@,, +endif +endif + +realclean: clean +ifneq ($(GENERATED_DIRTY),) + -$(RM) -r $(GENERATED_DIRTY) +endif + diff --git a/quellcode/versuch4/Receiver b/quellcode/versuch4/Receiver new file mode 100755 index 0000000..c34b7af Binary files /dev/null and b/quellcode/versuch4/Receiver differ diff --git a/quellcode/versuch4/Receiver.cpp b/quellcode/versuch4/Receiver.cpp new file mode 100755 index 0000000..5a0b880 --- /dev/null +++ b/quellcode/versuch4/Receiver.cpp @@ -0,0 +1,67 @@ +#include + +#include "bench_i.h" + +#include "orbsvcs/CosNamingC.h" +#include + +int main(int argc, char* argv[]){ + try{ + // initialize ORB + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "ServerORB"); + std::cout<<"ORB initialized"<resolve_initial_references("RTORB"); + RTCORBA::RTORB_var rtORB = RTCORBA::RTORB::_narrow(rtorb); + std::cout<<"RT Extensions OK"<resolve_initial_references("RootPOA"); + PortableServer::POA_var rootPOA = PortableServer::POA::_narrow(poa.in()); + + // activate POA Manager + PortableServer::POAManager_var poaManager = rootPOA->the_POAManager(); + poaManager->activate(); + std::cout<<"rootPOA OK"<create_priority_model_policy(RTCORBA::CLIENT_PROPAGATED, 20); + + // create ObjectAdapter, assign Policy + PortableServer::POA_var benchPOA = rootPOA->create_POA("benchPOA", poaManager.in(), benchPolicy); + std::cout<<"Policy assigned"<activate_object(&bench_i); + CORBA::Object_var benchObj = benchPOA->id_to_reference(objectID.in()); + CORBA::String_var ior = orb->object_to_string(benchObj.in()); + std::cout<<"Servant activated"<resolve_initial_references("NameService"); + CosNaming::NamingContext_var namingContext = CosNaming::NamingContext::_narrow(namingObject.in()); + CosNaming::Name name(1); + name.length(1); + name[0].id = CORBA::string_dup("Receiver"); + namingContext->bind(name, benchObj.in()); + std::cout<<"Bound Receiver to NameService"<run(); + std::cout<<"ORB ready"<destroy(1,1); + orb->destroy(); + }catch(CORBA::Exception &any){ + std::cout<<"Exception: "< +#include +#include "benchC.h" +#include "orbsvcs/CosNamingC.h" +#include +#include + +#include "cpx.h" + +benchmark::Put_var put; +CPX cpx; +std::string strData; + +void sigproc(int signo) +{ signal(SIGRTMIN+29, sigproc); + benchmark::dataStruct_var data = new benchmark::dataStruct; + data->data = CORBA::string_alloc(sizeof(strData)); + data->data = CORBA::string_dup((const char*)strData.c_str()); + data->valPort1 = cpx.get(1); + data->valPort2 = cpx.get(2); + data->valPort3 = cpx.get(3); + put->dataAndPorts(data); +} + + +int main(int argc, char* argv[]){ + + if (argc < 2){ + std::cout<<"enter filename as param1\n"; + return 0; + } + + std::string line; + std::ifstream infile (argv[1], std::ios_base::in); + while (getline(infile, line, '\n')) + { + strData += line; + } + + try{ + // initialize ORB + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "ClientORB"); + std::cout<<"ORB ok"<resolve_initial_references("RTORB"); + RTCORBA::RTORB_var rtORB = RTCORBA::RTORB::_narrow(rtorb.in()); + std::cout<<"RTORB ok"<resolve_initial_references("NameService"); + CosNaming::NamingContext_var namingContext = CosNaming::NamingContext::_narrow(namingObject.in()); + std::cout<<"NamingService ok"<resolve(name); + put = benchmark::Put::_narrow(benchObj.in()); + std::cout<<"TransferOjekt ok"<create_private_connection_policy(); + CORBA::Object_var newTran = put->_set_policy_overrides(pcPolicy, CORBA::SET_OVERRIDE); + put = benchmark::Put::_narrow(newTran.in()); + std::cout<<"PrivateConnection ok"<resolve_initial_references("RTCurrent"); + RTCORBA::Current_var rtCurrent = RTCORBA::Current::_narrow(rtCurrentObj.in()); + rtCurrent->the_priority(0); + std::cout<<"PriorityChange ok"<_validate_connection(inconsistentPolicies.out()); + //std::cout<<"explicit bind ok"<connect(); + // put->allPorts(0, 0, 0); + // sleep(1); + // put->onePort(1, 255); + // sleep(1); + // put->allPorts(0, 0, 0); + + // signal handling + signal(SIGRTMIN+29, sigproc); + + while(true){ + pause(); + } + + // destroy ORB + orb->destroy(); + + }catch(CORBA::Exception &any){ + std::cout<<"Exception occured: "< + class Arg_Traits + : public + Var_Size_Arg_Traits_T< + benchmark::dataStruct, + benchmark::dataStruct_var, + benchmark::dataStruct_out, + TAO::Any_Insert_Policy_Stream + > + { + }; + +#endif /* end #if !defined */ +} + +TAO_END_VERSIONED_NAMESPACE_DECL + + + +// TAO_IDL - Generated from +// be/be_visitor_exception/exception_cs.cpp:63 + +benchmark::invalidRequest::invalidRequest (void) + : ::CORBA::UserException ( + "IDL:benchmark/invalidRequest:1.0", + "invalidRequest" + ) +{ +} + +benchmark::invalidRequest::~invalidRequest (void) +{ +} + +benchmark::invalidRequest::invalidRequest (const ::benchmark::invalidRequest &_tao_excp) + : ::CORBA::UserException ( + _tao_excp._rep_id (), + _tao_excp._name () + ) +{ +} + +benchmark::invalidRequest& +benchmark::invalidRequest::operator= (const ::benchmark::invalidRequest &_tao_excp) +{ + this->ACE_NESTED_CLASS ( ::CORBA, UserException)::operator= (_tao_excp); + return *this; +} + +void benchmark::invalidRequest::_tao_any_destructor (void *_tao_void_pointer) +{ + invalidRequest *_tao_tmp_pointer = + static_cast (_tao_void_pointer); + delete _tao_tmp_pointer; +} + +benchmark::invalidRequest * +benchmark::invalidRequest::_downcast ( ::CORBA::Exception *_tao_excp) +{ + return dynamic_cast (_tao_excp); +} + +const benchmark::invalidRequest * +benchmark::invalidRequest::_downcast ( ::CORBA::Exception const *_tao_excp) +{ + return dynamic_cast (_tao_excp); +} + +::CORBA::Exception *benchmark::invalidRequest::_alloc (void) +{ + ::CORBA::Exception *retval = 0; + ACE_NEW_RETURN (retval, ::benchmark::invalidRequest, 0); + return retval; +} + +::CORBA::Exception * +benchmark::invalidRequest::_tao_duplicate (void) const +{ + ::CORBA::Exception *result = 0; + ACE_NEW_RETURN ( + result, + ::benchmark::invalidRequest (*this), + 0 + ); + return result; +} + +void benchmark::invalidRequest::_raise (void) const +{ + TAO_RAISE (*this); +} + +void benchmark::invalidRequest::_tao_encode ( + TAO_OutputCDR &cdr + ACE_ENV_ARG_DECL + ) const +{ + if (cdr << *this) + { + return; + } + + ACE_THROW ( ::CORBA::MARSHAL ()); +} + +void benchmark::invalidRequest::_tao_decode ( + TAO_InputCDR &cdr + ACE_ENV_ARG_DECL + ) +{ + if (cdr >> *this) + { + return; + } + + ACE_THROW ( ::CORBA::MARSHAL ()); +} + +// TAO extension - the virtual _type method. +::CORBA::TypeCode_ptr benchmark::invalidRequest::_tao_type (void) const +{ + return ::benchmark::_tc_invalidRequest; +} + +// TAO_IDL - Generated from +// be/be_visitor_typecode/struct_typecode.cpp:89 + +static TAO::TypeCode::Struct_Field const * const _tao_fields_benchmark_invalidRequest = 0; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_benchmark_invalidRequest ( + ::CORBA::tk_except, + "IDL:benchmark/invalidRequest:1.0", + "invalidRequest", + _tao_fields_benchmark_invalidRequest, + 0); + +namespace benchmark +{ + ::CORBA::TypeCode_ptr const _tc_invalidRequest = + &_tao_tc_benchmark_invalidRequest; +} + + + +// TAO_IDL - Generated from +// be/be_visitor_typecode/struct_typecode.cpp:89 + +static TAO::TypeCode::Struct_Field const _tao_fields_benchmark_dataStruct[] = + { + { "data", &CORBA::_tc_string }, + { "valPort1", &CORBA::_tc_short }, + { "valPort2", &CORBA::_tc_short }, + { "valPort3", &CORBA::_tc_short } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_benchmark_dataStruct ( + ::CORBA::tk_struct, + "IDL:benchmark/dataStruct:1.0", + "dataStruct", + _tao_fields_benchmark_dataStruct, + 4); + +namespace benchmark +{ + ::CORBA::TypeCode_ptr const _tc_dataStruct = + &_tao_tc_benchmark_dataStruct; +} + + + +// TAO_IDL - Generated from +// be/be_visitor_structure/structure_cs.cpp:66 + +void +benchmark::dataStruct::_tao_any_destructor ( + void *_tao_void_pointer + ) +{ + dataStruct *_tao_tmp_pointer = + static_cast (_tao_void_pointer); + delete _tao_tmp_pointer; +} + +// TAO_IDL - Generated from +// be/be_visitor_interface/interface_cs.cpp:60 + +// Traits specializations for benchmark::Put. + +benchmark::Put_ptr +TAO::Objref_Traits::duplicate ( + benchmark::Put_ptr p + ) +{ + return benchmark::Put::_duplicate (p); +} + +void +TAO::Objref_Traits::release ( + benchmark::Put_ptr p + ) +{ + CORBA::release (p); +} + +benchmark::Put_ptr +TAO::Objref_Traits::nil (void) +{ + return benchmark::Put::_nil (); +} + +::CORBA::Boolean +TAO::Objref_Traits::marshal ( + const benchmark::Put_ptr p, + TAO_OutputCDR & cdr + ) +{ + return ::CORBA::Object::marshal (p, cdr); +} + +// Function pointer for collocation factory initialization. +TAO::Collocation_Proxy_Broker * +(*benchmark__TAO_Put_Proxy_Broker_Factory_function_pointer) ( + ::CORBA::Object_ptr obj + ) = 0; + +// TAO_IDL - Generated from +// be/be_visitor_operation/operation_cs.cpp:78 + +void benchmark::Put::connect ( + + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + if (!this->is_evaluated ()) + { + ACE_NESTED_CLASS ( ::CORBA, Object)::tao_object_initialize (this); + } + + if (this->the_TAO_Put_Proxy_Broker_ == 0) + { + benchmark_Put_setup_collocation (); + } + + TAO::Arg_Traits< void>::ret_val _tao_retval; + + TAO::Argument *_the_tao_operation_signature [] = + { + &_tao_retval + }; + + static TAO::Exception_Data + _tao_benchmark_Put_connect_exceptiondata [] = + { + { + "IDL:benchmark/invalidRequest:1.0", + benchmark::invalidRequest::_alloc +#if TAO_HAS_INTERCEPTORS == 1 + , benchmark::_tc_invalidRequest +#endif /* TAO_HAS_INTERCEPTORS */ + } + }; + + TAO::Invocation_Adapter _tao_call ( + this, + _the_tao_operation_signature, + 1, + "connect", + 7, + this->the_TAO_Put_Proxy_Broker_ + ); + + _tao_call.invoke ( + _tao_benchmark_Put_connect_exceptiondata, + 1 + ACE_ENV_ARG_PARAMETER + ); + ACE_CHECK; +} + +// TAO_IDL - Generated from +// be/be_visitor_operation/operation_cs.cpp:78 + +void benchmark::Put::onePort ( + ::CORBA::Short portNo, + ::CORBA::Short value + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + if (!this->is_evaluated ()) + { + ACE_NESTED_CLASS ( ::CORBA, Object)::tao_object_initialize (this); + } + + if (this->the_TAO_Put_Proxy_Broker_ == 0) + { + benchmark_Put_setup_collocation (); + } + + TAO::Arg_Traits< void>::ret_val _tao_retval; + TAO::Arg_Traits< ::CORBA::Short>::in_arg_val _tao_portNo (portNo); + TAO::Arg_Traits< ::CORBA::Short>::in_arg_val _tao_value (value); + + TAO::Argument *_the_tao_operation_signature [] = + { + &_tao_retval, + &_tao_portNo, + &_tao_value + }; + + static TAO::Exception_Data + _tao_benchmark_Put_onePort_exceptiondata [] = + { + { + "IDL:benchmark/invalidRequest:1.0", + benchmark::invalidRequest::_alloc +#if TAO_HAS_INTERCEPTORS == 1 + , benchmark::_tc_invalidRequest +#endif /* TAO_HAS_INTERCEPTORS */ + } + }; + + TAO::Invocation_Adapter _tao_call ( + this, + _the_tao_operation_signature, + 3, + "onePort", + 7, + this->the_TAO_Put_Proxy_Broker_ + ); + + _tao_call.invoke ( + _tao_benchmark_Put_onePort_exceptiondata, + 1 + ACE_ENV_ARG_PARAMETER + ); + ACE_CHECK; +} + +// TAO_IDL - Generated from +// be/be_visitor_operation/operation_cs.cpp:78 + +void benchmark::Put::allPorts ( + ::CORBA::Short valPort1, + ::CORBA::Short valPort2, + ::CORBA::Short valPort3 + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + if (!this->is_evaluated ()) + { + ACE_NESTED_CLASS ( ::CORBA, Object)::tao_object_initialize (this); + } + + if (this->the_TAO_Put_Proxy_Broker_ == 0) + { + benchmark_Put_setup_collocation (); + } + + TAO::Arg_Traits< void>::ret_val _tao_retval; + TAO::Arg_Traits< ::CORBA::Short>::in_arg_val _tao_valPort1 (valPort1); + TAO::Arg_Traits< ::CORBA::Short>::in_arg_val _tao_valPort2 (valPort2); + TAO::Arg_Traits< ::CORBA::Short>::in_arg_val _tao_valPort3 (valPort3); + + TAO::Argument *_the_tao_operation_signature [] = + { + &_tao_retval, + &_tao_valPort1, + &_tao_valPort2, + &_tao_valPort3 + }; + + static TAO::Exception_Data + _tao_benchmark_Put_allPorts_exceptiondata [] = + { + { + "IDL:benchmark/invalidRequest:1.0", + benchmark::invalidRequest::_alloc +#if TAO_HAS_INTERCEPTORS == 1 + , benchmark::_tc_invalidRequest +#endif /* TAO_HAS_INTERCEPTORS */ + } + }; + + TAO::Invocation_Adapter _tao_call ( + this, + _the_tao_operation_signature, + 4, + "allPorts", + 8, + this->the_TAO_Put_Proxy_Broker_ + ); + + _tao_call.invoke ( + _tao_benchmark_Put_allPorts_exceptiondata, + 1 + ACE_ENV_ARG_PARAMETER + ); + ACE_CHECK; +} + +// TAO_IDL - Generated from +// be/be_visitor_operation/operation_cs.cpp:78 + +void benchmark::Put::dataAndPorts ( + const ::benchmark::dataStruct & data + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + if (!this->is_evaluated ()) + { + ACE_NESTED_CLASS ( ::CORBA, Object)::tao_object_initialize (this); + } + + if (this->the_TAO_Put_Proxy_Broker_ == 0) + { + benchmark_Put_setup_collocation (); + } + + TAO::Arg_Traits< void>::ret_val _tao_retval; + TAO::Arg_Traits< ::benchmark::dataStruct>::in_arg_val _tao_data (data); + + TAO::Argument *_the_tao_operation_signature [] = + { + &_tao_retval, + &_tao_data + }; + + static TAO::Exception_Data + _tao_benchmark_Put_dataAndPorts_exceptiondata [] = + { + { + "IDL:benchmark/invalidRequest:1.0", + benchmark::invalidRequest::_alloc +#if TAO_HAS_INTERCEPTORS == 1 + , benchmark::_tc_invalidRequest +#endif /* TAO_HAS_INTERCEPTORS */ + } + }; + + TAO::Invocation_Adapter _tao_call ( + this, + _the_tao_operation_signature, + 2, + "dataAndPorts", + 12, + this->the_TAO_Put_Proxy_Broker_ + ); + + _tao_call.invoke ( + _tao_benchmark_Put_dataAndPorts_exceptiondata, + 1 + ACE_ENV_ARG_PARAMETER + ); + ACE_CHECK; +} + +benchmark::Put::Put (void) + : the_TAO_Put_Proxy_Broker_ (0) +{ + this->benchmark_Put_setup_collocation (); +} + +void +benchmark::Put::benchmark_Put_setup_collocation () +{ + if (::benchmark__TAO_Put_Proxy_Broker_Factory_function_pointer) + { + this->the_TAO_Put_Proxy_Broker_ = + ::benchmark__TAO_Put_Proxy_Broker_Factory_function_pointer (this); + } +} + +benchmark::Put::~Put (void) +{} + +void +benchmark::Put::_tao_any_destructor (void *_tao_void_pointer) +{ + Put *_tao_tmp_pointer = + static_cast (_tao_void_pointer); + CORBA::release (_tao_tmp_pointer); +} + +benchmark::Put_ptr +benchmark::Put::_narrow ( + ::CORBA::Object_ptr _tao_objref + ACE_ENV_ARG_DECL + ) +{ + return + TAO::Narrow_Utils::narrow ( + _tao_objref, + "IDL:benchmark/Put:1.0", + benchmark__TAO_Put_Proxy_Broker_Factory_function_pointer + ACE_ENV_ARG_PARAMETER + ); +} + +benchmark::Put_ptr +benchmark::Put::_unchecked_narrow ( + ::CORBA::Object_ptr _tao_objref + ACE_ENV_ARG_DECL + ) +{ + return + TAO::Narrow_Utils::unchecked_narrow ( + _tao_objref, + "IDL:benchmark/Put:1.0", + benchmark__TAO_Put_Proxy_Broker_Factory_function_pointer + ACE_ENV_ARG_PARAMETER + ); +} + +benchmark::Put_ptr +benchmark::Put::_duplicate (Put_ptr obj) +{ + if (! CORBA::is_nil (obj)) + { + obj->_add_ref (); + } + + return obj; +} + +void +benchmark::Put::_tao_release (Put_ptr obj) +{ + CORBA::release (obj); +} + +::CORBA::Boolean +benchmark::Put::_is_a ( + const char *value + ACE_ENV_ARG_DECL + ) +{ + if ( + !ACE_OS::strcmp ( + value, + "IDL:benchmark/Put:1.0" + ) || + !ACE_OS::strcmp ( + value, + "IDL:omg.org/CORBA/Object:1.0" + ) + ) + { + return true; // success using local knowledge + } + else + { + return this->ACE_NESTED_CLASS ( ::CORBA, Object)::_is_a ( + value + ACE_ENV_ARG_PARAMETER + ); + } +} + +const char* benchmark::Put::_interface_repository_id (void) const +{ + return "IDL:benchmark/Put:1.0"; +} + +::CORBA::Boolean +benchmark::Put::marshal (TAO_OutputCDR &cdr) +{ + return (cdr << this); +} + +// TAO_IDL - Generated from +// be/be_visitor_typecode/objref_typecode.cpp:76 + +static TAO::TypeCode::Objref + _tao_tc_benchmark_Put ( + ::CORBA::tk_objref, + "IDL:benchmark/Put:1.0", + "Put"); + +namespace benchmark +{ + ::CORBA::TypeCode_ptr const _tc_Put = + &_tao_tc_benchmark_Put; +} + + + +// TAO_IDL - Generated from +// be/be_visitor_exception/any_op_cs.cpp:50 +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + + + +namespace TAO +{ + template<> + ::CORBA::Boolean + Any_Dual_Impl_T::demarshal_value ( + TAO_InputCDR & cdr + ) + { + ::CORBA::String_var id; + + if (!(cdr >> id.out ())) + { + return false; + } + + ACE_TRY_NEW_ENV + { + this->value_->_tao_decode (cdr ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + return false; + } + ACE_ENDTRY; + + return true; + } +} + +// Copying insertion. +void operator<<= ( + ::CORBA::Any &_tao_any, + const benchmark::invalidRequest &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + benchmark::invalidRequest::_tao_any_destructor, + benchmark::_tc_invalidRequest, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + ::CORBA::Any &_tao_any, + benchmark::invalidRequest *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + benchmark::invalidRequest::_tao_any_destructor, + benchmark::_tc_invalidRequest, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +::CORBA::Boolean operator>>= ( + const ::CORBA::Any &_tao_any, + benchmark::invalidRequest *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const benchmark::invalidRequest *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +::CORBA::Boolean operator>>= ( + const ::CORBA::Any &_tao_any, + const benchmark::invalidRequest *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + benchmark::invalidRequest::_tao_any_destructor, + benchmark::_tc_invalidRequest, + _tao_elem + ); +} +TAO_END_VERSIONED_NAMESPACE_DECL + + + +// TAO_IDL - Generated from +// be/be_visitor_structure/any_op_cs.cpp:54 + + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +// Copying insertion. +void operator<<= ( + ::CORBA::Any &_tao_any, + const benchmark::dataStruct &_tao_elem + ) +{ + if (0 == &_tao_elem) // Trying to de-reference NULL object + _tao_any <<= static_cast( 0 ); // Use non-copying insertion of a NULL + else + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + benchmark::dataStruct::_tao_any_destructor, + benchmark::_tc_dataStruct, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + ::CORBA::Any &_tao_any, + benchmark::dataStruct *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + benchmark::dataStruct::_tao_any_destructor, + benchmark::_tc_dataStruct, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +::CORBA::Boolean operator>>= ( + const ::CORBA::Any &_tao_any, + benchmark::dataStruct *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const benchmark::dataStruct *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +::CORBA::Boolean operator>>= ( + const ::CORBA::Any &_tao_any, + const benchmark::dataStruct *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + benchmark::dataStruct::_tao_any_destructor, + benchmark::_tc_dataStruct, + _tao_elem + ); +} +TAO_END_VERSIONED_NAMESPACE_DECL + + + +// TAO_IDL - Generated from +// be/be_visitor_interface/any_op_cs.cpp:51 +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + + + +namespace TAO +{ + template<> + ::CORBA::Boolean + Any_Impl_T::to_object ( + ::CORBA::Object_ptr &_tao_elem + ) const + { + _tao_elem = ::CORBA::Object::_duplicate (this->value_); + return true; + } +} +TAO_END_VERSIONED_NAMESPACE_DECL + + + +#if defined (ACE_ANY_OPS_USE_NAMESPACE) + +namespace benchmark +{ + + + // Copying insertion. + void + operator<<= ( + ::CORBA::Any &_tao_any, + Put_ptr _tao_elem + ) + { + Put_ptr _tao_objptr = + Put::_duplicate (_tao_elem); + _tao_any <<= &_tao_objptr; + } + + // Non-copying insertion. + void + operator<<= ( + ::CORBA::Any &_tao_any, + Put_ptr *_tao_elem + ) + { + TAO::Any_Impl_T::insert ( + _tao_any, + Put::_tao_any_destructor, + _tc_Put, + *_tao_elem + ); + } + + ::CORBA::Boolean + operator>>= ( + const ::CORBA::Any &_tao_any, + Put_ptr &_tao_elem + ) + { + return + TAO::Any_Impl_T::extract ( + _tao_any, + Put::_tao_any_destructor, + _tc_Put, + _tao_elem + ); + } +} + +#else + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + + + +// Copying insertion. +void +operator<<= ( + ::CORBA::Any &_tao_any, + benchmark::Put_ptr _tao_elem + ) +{ + benchmark::Put_ptr _tao_objptr = + benchmark::Put::_duplicate (_tao_elem); + _tao_any <<= &_tao_objptr; +} + +// Non-copying insertion. +void +operator<<= ( + ::CORBA::Any &_tao_any, + benchmark::Put_ptr *_tao_elem + ) +{ + TAO::Any_Impl_T::insert ( + _tao_any, + benchmark::Put::_tao_any_destructor, + benchmark::_tc_Put, + *_tao_elem + ); +} + +::CORBA::Boolean +operator>>= ( + const ::CORBA::Any &_tao_any, + benchmark::Put_ptr &_tao_elem + ) +{ + return + TAO::Any_Impl_T::extract ( + _tao_any, + benchmark::Put::_tao_any_destructor, + benchmark::_tc_Put, + _tao_elem + ); +} +TAO_END_VERSIONED_NAMESPACE_DECL + + + +#endif + +// TAO_IDL - Generated from +// be/be_visitor_exception/cdr_op_cs.cpp:60 +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + + + +::CORBA::Boolean operator<< ( + TAO_OutputCDR &strm, + const benchmark::invalidRequest &_tao_aggregate + ) +{ + // Marshal the repository ID. + return (strm << _tao_aggregate._rep_id ()); +} + +::CORBA::Boolean operator>> ( + TAO_InputCDR &, + benchmark::invalidRequest& + ) +{ + return true; +} +TAO_END_VERSIONED_NAMESPACE_DECL + + + +// TAO_IDL - Generated from +// be/be_visitor_structure/cdr_op_cs.cpp:61 + + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +::CORBA::Boolean operator<< ( + TAO_OutputCDR &strm, + const benchmark::dataStruct &_tao_aggregate + ) +{ + return + (strm << _tao_aggregate.data.in ()) && + (strm << _tao_aggregate.valPort1) && + (strm << _tao_aggregate.valPort2) && + (strm << _tao_aggregate.valPort3); +} + +::CORBA::Boolean operator>> ( + TAO_InputCDR &strm, + benchmark::dataStruct &_tao_aggregate + ) +{ + return + (strm >> _tao_aggregate.data.out ()) && + (strm >> _tao_aggregate.valPort1) && + (strm >> _tao_aggregate.valPort2) && + (strm >> _tao_aggregate.valPort3); +} +TAO_END_VERSIONED_NAMESPACE_DECL + + + +// TAO_IDL - Generated from +// be/be_visitor_interface/cdr_op_cs.cpp:63 + + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +::CORBA::Boolean operator<< ( + TAO_OutputCDR &strm, + const benchmark::Put_ptr _tao_objref + ) +{ + ::CORBA::Object_ptr _tao_corba_obj = _tao_objref; + return (strm << _tao_corba_obj); +} + +::CORBA::Boolean operator>> ( + TAO_InputCDR &strm, + benchmark::Put_ptr &_tao_objref + ) +{ + ::CORBA::Object_var obj; + + if (!(strm >> obj.inout ())) + { + return false; + } + + typedef ::benchmark::Put RHS_SCOPED_NAME; + + // Narrow to the right type. + _tao_objref = + TAO::Narrow_Utils::unchecked_narrow ( + obj.in (), + benchmark__TAO_Put_Proxy_Broker_Factory_function_pointer + ); + + return 1; +} +TAO_END_VERSIONED_NAMESPACE_DECL + + + diff --git a/quellcode/versuch4/benchC.h b/quellcode/versuch4/benchC.h new file mode 100755 index 0000000..a212253 --- /dev/null +++ b/quellcode/versuch4/benchC.h @@ -0,0 +1,469 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be/be_codegen.cpp:155 + +#ifndef _TAO_IDL_BENCHC_H_ +#define _TAO_IDL_BENCHC_H_ + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/AnyTypeCode_methods.h" +#include "tao/ORB.h" +#include "tao/SystemException.h" +#include "tao/Environment.h" +#include "tao/Object.h" +#include "tao/Managed_Types.h" +#include "tao/Objref_VarOut_T.h" +#include "tao/VarOut_T.h" +#include "tao/Versioned_Namespace.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO + +// TAO_IDL - Generated from +// be/be_visitor_root/root_ch.cpp:62 +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + + + +namespace TAO +{ + class Collocation_Proxy_Broker; + template class Narrow_Utils; +} +TAO_END_VERSIONED_NAMESPACE_DECL + + + +// TAO_IDL - Generated from +// be/be_visitor_module/module_ch.cpp:49 + +namespace benchmark +{ + + // TAO_IDL - Generated from + // be/be_visitor_exception/exception_ch.cpp:53 + +#if !defined (_BENCHMARK_INVALIDREQUEST_CH_) +#define _BENCHMARK_INVALIDREQUEST_CH_ + + class invalidRequest : public ::CORBA::UserException + { + public: + + invalidRequest (void); + invalidRequest (const invalidRequest &); + ~invalidRequest (void); + + invalidRequest &operator= (const invalidRequest &); + + static void _tao_any_destructor (void *); + + static invalidRequest *_downcast ( ::CORBA::Exception *); + static const invalidRequest *_downcast ( ::CORBA::Exception const *); + + static ::CORBA::Exception *_alloc (void); + + virtual ::CORBA::Exception *_tao_duplicate (void) const; + + virtual void _raise (void) const; + + virtual void _tao_encode ( + TAO_OutputCDR & + ACE_ENV_ARG_DECL + ) const; + + virtual void _tao_decode ( + TAO_InputCDR & + ACE_ENV_ARG_DECL + ); + + virtual ::CORBA::TypeCode_ptr _tao_type (void) const; + }; + + // TAO_IDL - Generated from + // be/be_visitor_typecode/typecode_decl.cpp:49 + + extern ::CORBA::TypeCode_ptr const _tc_invalidRequest; + +#endif /* end #if !defined */ + + // TAO_IDL - Generated from + // be/be_type.cpp:258 + + struct dataStruct; + + typedef + TAO_Var_Var_T< + dataStruct + > + dataStruct_var; + + typedef + TAO_Out_T< + dataStruct, + dataStruct_var + > + dataStruct_out; + + // TAO_IDL - Generated from + // be/be_visitor_structure/structure_ch.cpp:57 + + struct dataStruct + { + typedef dataStruct_var _var_type; + + static void _tao_any_destructor (void *); + TAO_String_Manager data; + ::CORBA::Short valPort1; + ::CORBA::Short valPort2; + ::CORBA::Short valPort3; + }; + + // TAO_IDL - Generated from + // be/be_visitor_typecode/typecode_decl.cpp:49 + + extern ::CORBA::TypeCode_ptr const _tc_dataStruct; + + // TAO_IDL - Generated from + // be/be_interface.cpp:646 + +#if !defined (_BENCHMARK_PUT__VAR_OUT_CH_) +#define _BENCHMARK_PUT__VAR_OUT_CH_ + + class Put; + typedef Put *Put_ptr; + + typedef + TAO_Objref_Var_T< + Put + > + Put_var; + + typedef + TAO_Objref_Out_T< + Put + > + Put_out; + +#endif /* end #if !defined */ + + // TAO_IDL - Generated from + // be/be_visitor_interface/interface_ch.cpp:54 + +#if !defined (_BENCHMARK_PUT_CH_) +#define _BENCHMARK_PUT_CH_ + + class Put + : public virtual ::CORBA::Object + { + public: + friend class TAO::Narrow_Utils; + typedef Put_ptr _ptr_type; + typedef Put_var _var_type; + + // The static operations. + static Put_ptr _duplicate (Put_ptr obj); + + static void _tao_release (Put_ptr obj); + + static Put_ptr _narrow ( + ::CORBA::Object_ptr obj + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ); + + static Put_ptr _unchecked_narrow ( + ::CORBA::Object_ptr obj + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ); + + static Put_ptr _nil (void) + { + return static_cast (0); + } + + static void _tao_any_destructor (void *); + + // TAO_IDL - Generated from + // be/be_visitor_operation/operation_ch.cpp:46 + + virtual void connect ( + + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); + + // TAO_IDL - Generated from + // be/be_visitor_operation/operation_ch.cpp:46 + + virtual void onePort ( + ::CORBA::Short portNo, + ::CORBA::Short value + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); + + // TAO_IDL - Generated from + // be/be_visitor_operation/operation_ch.cpp:46 + + virtual void allPorts ( + ::CORBA::Short valPort1, + ::CORBA::Short valPort2, + ::CORBA::Short valPort3 + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); + + // TAO_IDL - Generated from + // be/be_visitor_operation/operation_ch.cpp:46 + + virtual void dataAndPorts ( + const ::benchmark::dataStruct & data + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); + + // TAO_IDL - Generated from + // be/be_visitor_interface/interface_ch.cpp:210 + + virtual ::CORBA::Boolean _is_a ( + const char *type_id + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ); + + virtual const char* _interface_repository_id (void) const; + virtual ::CORBA::Boolean marshal (TAO_OutputCDR &cdr); + private: + TAO::Collocation_Proxy_Broker *the_TAO_Put_Proxy_Broker_; + + protected: + // Concrete interface only. + Put (void); + + // These methods travese the inheritance tree and set the + // parents piece of the given class in the right mode. + virtual void benchmark_Put_setup_collocation (void); + + // Concrete non-local interface only. + Put ( + IOP::IOR *ior, + TAO_ORB_Core *orb_core = 0 + ); + + // Non-local interface only. + Put ( + TAO_Stub *objref, + ::CORBA::Boolean _tao_collocated = 0, + TAO_Abstract_ServantBase *servant = 0, + TAO_ORB_Core *orb_core = 0 + ); + + virtual ~Put (void); + + private: + // Private and unimplemented for concrete interfaces. + Put (const Put &); + + void operator= (const Put &); + }; + +#endif /* end #if !defined */ + + // TAO_IDL - Generated from + // be/be_visitor_typecode/typecode_decl.cpp:49 + + extern ::CORBA::TypeCode_ptr const _tc_Put; + +// TAO_IDL - Generated from +// be/be_visitor_module/module_ch.cpp:78 + +} // module benchmark + +// Proxy Broker Factory function pointer declarations. + +// TAO_IDL - Generated from +// be/be_visitor_root/root.cpp:139 + +extern +TAO::Collocation_Proxy_Broker * +(*benchmark__TAO_Put_Proxy_Broker_Factory_function_pointer) ( + ::CORBA::Object_ptr obj + ); + +// TAO_IDL - Generated from +// be/be_visitor_traits.cpp:62 +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + + + +// Traits specializations. +namespace TAO +{ + +#if !defined (_BENCHMARK_PUT__TRAITS_) +#define _BENCHMARK_PUT__TRAITS_ + + template<> + struct Objref_Traits< ::benchmark::Put> + { + static ::benchmark::Put_ptr duplicate ( + ::benchmark::Put_ptr + ); + static void release ( + ::benchmark::Put_ptr + ); + static ::benchmark::Put_ptr nil (void); + static ::CORBA::Boolean marshal ( + const ::benchmark::Put_ptr p, + TAO_OutputCDR & cdr + ); + }; + +#endif /* end #if !defined */ +} +TAO_END_VERSIONED_NAMESPACE_DECL + + + +// TAO_IDL - Generated from +// be/be_visitor_exception/any_op_ch.cpp:53 +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + + + + void operator<<= (::CORBA::Any &, const benchmark::invalidRequest &); // copying version + void operator<<= (::CORBA::Any &, benchmark::invalidRequest*); // noncopying version + ::CORBA::Boolean operator>>= (const ::CORBA::Any &, benchmark::invalidRequest *&); // deprecated + ::CORBA::Boolean operator>>= (const ::CORBA::Any &, const benchmark::invalidRequest *&); +TAO_END_VERSIONED_NAMESPACE_DECL + + + +// TAO_IDL - Generated from +// be/be_visitor_structure/any_op_ch.cpp:53 + + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + + void operator<<= (::CORBA::Any &, const benchmark::dataStruct &); // copying version + void operator<<= (::CORBA::Any &, benchmark::dataStruct*); // noncopying version + ::CORBA::Boolean operator>>= (const ::CORBA::Any &, benchmark::dataStruct *&); // deprecated + ::CORBA::Boolean operator>>= (const ::CORBA::Any &, const benchmark::dataStruct *&); +TAO_END_VERSIONED_NAMESPACE_DECL + + + +// TAO_IDL - Generated from +// be/be_visitor_interface/any_op_ch.cpp:54 + + + +#if defined (ACE_ANY_OPS_USE_NAMESPACE) + +namespace benchmark +{ + void operator<<= ( ::CORBA::Any &, Put_ptr); // copying + void operator<<= ( ::CORBA::Any &, Put_ptr *); // non-copying + ::CORBA::Boolean operator>>= (const ::CORBA::Any &, Put_ptr &); +} + +#else + + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + + void operator<<= (::CORBA::Any &, benchmark::Put_ptr); // copying + void operator<<= (::CORBA::Any &, benchmark::Put_ptr *); // non-copying + ::CORBA::Boolean operator>>= (const ::CORBA::Any &, benchmark::Put_ptr &); +TAO_END_VERSIONED_NAMESPACE_DECL + + + +#endif + +// TAO_IDL - Generated from +// be/be_visitor_exception/cdr_op_ch.cpp:52 +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + + + + ::CORBA::Boolean operator<< (TAO_OutputCDR &, const benchmark::invalidRequest &); + ::CORBA::Boolean operator>> (TAO_InputCDR &, benchmark::invalidRequest &); +TAO_END_VERSIONED_NAMESPACE_DECL + + + +// TAO_IDL - Generated from +// be/be_visitor_structure/cdr_op_ch.cpp:54 + + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + + ::CORBA::Boolean operator<< (TAO_OutputCDR &, const benchmark::dataStruct &); + ::CORBA::Boolean operator>> (TAO_InputCDR &, benchmark::dataStruct &); +TAO_END_VERSIONED_NAMESPACE_DECL + + + +// TAO_IDL - Generated from +// be/be_visitor_interface/cdr_op_ch.cpp:55 + + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + + ::CORBA::Boolean operator<< (TAO_OutputCDR &, const benchmark::Put_ptr ); + ::CORBA::Boolean operator>> (TAO_InputCDR &, benchmark::Put_ptr &); +TAO_END_VERSIONED_NAMESPACE_DECL + + + +// TAO_IDL - Generated from +// be/be_codegen.cpp:1093 +#if defined (__ACE_INLINE__) +#include "benchC.inl" +#endif /* defined INLINE */ + +#endif /* ifndef */ + + diff --git a/quellcode/versuch4/benchC.inl b/quellcode/versuch4/benchC.inl new file mode 100755 index 0000000..ff39241 --- /dev/null +++ b/quellcode/versuch4/benchC.inl @@ -0,0 +1,64 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + + +// TAO_IDL - Generated from +// be/be_visitor_interface/interface_ci.cpp:70 + +#if !defined (_BENCHMARK_PUT___CI_) +#define _BENCHMARK_PUT___CI_ + +ACE_INLINE +benchmark::Put::Put ( + TAO_Stub *objref, + ::CORBA::Boolean _tao_collocated, + TAO_Abstract_ServantBase *servant, + TAO_ORB_Core *oc + ) + : ACE_NESTED_CLASS (CORBA, Object) ( + objref, + _tao_collocated, + servant, + oc + ), + the_TAO_Put_Proxy_Broker_ (0) +{ + this->benchmark_Put_setup_collocation (); +} + +ACE_INLINE +benchmark::Put::Put ( + IOP::IOR *ior, + TAO_ORB_Core *oc + ) + : ACE_NESTED_CLASS ( ::CORBA, Object) (ior, oc), + the_TAO_Put_Proxy_Broker_ (0) +{ +} + +#endif /* end #if !defined */ + diff --git a/quellcode/versuch4/benchI.cpp b/quellcode/versuch4/benchI.cpp new file mode 100755 index 0000000..3e0c6e0 --- /dev/null +++ b/quellcode/versuch4/benchI.cpp @@ -0,0 +1,79 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be/be_codegen.cpp:910 + +#include "benchI.h" + +// Implementation skeleton constructor +benchmark_Put_i::benchmark_Put_i (void) +{ +} + +// Implementation skeleton destructor +benchmark_Put_i::~benchmark_Put_i (void) +{ +} + +void benchmark_Put_i::connect ( + + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + // Add your implementation here +} + +void benchmark_Put_i::onePort ( + ::CORBA::Short portNo, + ::CORBA::Short value + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + // Add your implementation here +} + +void benchmark_Put_i::allPorts ( + ::CORBA::Short valPort1, + ::CORBA::Short valPort2, + ::CORBA::Short valPort3 + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + // Add your implementation here +} + + diff --git a/quellcode/versuch4/benchI.h b/quellcode/versuch4/benchI.h new file mode 100755 index 0000000..8651c61 --- /dev/null +++ b/quellcode/versuch4/benchI.h @@ -0,0 +1,82 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be/be_codegen.cpp:844 + +#ifndef BENCHI_H_ +#define BENCHI_H_ + +#include "benchS.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class benchmark_Put_i : public virtual POA_benchmark::Put, public virtual PortableServer::RefCountServantBase +{ +public: + //Constructor + benchmark_Put_i (void); + + //Destructor + virtual ~benchmark_Put_i (void); + + virtual + void connect ( + + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::benchmark::invalidRequest + )); + + virtual + void onePort ( + ::CORBA::Short portNo, + ::CORBA::Short value + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::benchmark::invalidRequest + )); + + virtual + void allPorts ( + ::CORBA::Short valPort1, + ::CORBA::Short valPort2, + ::CORBA::Short valPort3 + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::benchmark::invalidRequest + )); +}; + + +#endif /* BENCHI_H_ */ + diff --git a/quellcode/versuch4/benchS.cpp b/quellcode/versuch4/benchS.cpp new file mode 100755 index 0000000..566cd91 --- /dev/null +++ b/quellcode/versuch4/benchS.cpp @@ -0,0 +1,1138 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + + +// TAO_IDL - Generated from +// be/be_codegen.cpp:577 + +#ifndef _TAO_IDL_BENCHS_CPP_ +#define _TAO_IDL_BENCHS_CPP_ + + +#include "benchS.h" +#include "tao/PortableServer/Operation_Table_Perfect_Hash.h" +#include "tao/PortableServer/Upcall_Command.h" +#include "tao/PortableServer/Upcall_Wrapper.h" +#include "tao/PortableServer/Basic_SArguments.h" +#include "tao/PortableServer/Object_SArgument_T.h" +#include "tao/PortableServer/Special_Basic_SArguments.h" +#include "tao/PortableServer/UB_String_SArguments.h" +#include "tao/PortableServer/Var_Size_SArgument_T.h" +#include "tao/PortableServer/TypeCode_SArg_Traits.h" +#include "tao/PortableServer/Object_SArg_Traits.h" +#include "tao/PortableServer/get_arg.h" +#include "tao/Special_Basic_Arguments.h" +#include "tao/UB_String_Arguments.h" +#include "tao/TAO_Server_Request.h" +#include "tao/ORB_Core.h" +#include "tao/Profile.h" +#include "tao/Stub.h" +#include "tao/IFR_Client_Adapter.h" +#include "tao/Object_T.h" +#include "tao/AnyTypeCode/TypeCode.h" +#include "tao/AnyTypeCode/DynamicC.h" +#include "tao/CDR.h" +#include "tao/operation_details.h" +#include "tao/PortableInterceptor.h" +#include "tao/Basic_Arguments.h" +#include "tao/Var_Size_Argument_T.h" +#include "ace/Dynamic_Service.h" +#include "ace/Malloc_Allocator.h" + +#if !defined (__ACE_INLINE__) +#include "benchS.inl" +#endif /* !defined INLINE */ + +// TAO_IDL - Generated from +// be/be_visitor_arg_traits.cpp:71 +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + + + +// Arg traits specializations. +namespace TAO +{ + + // TAO_IDL - Generated from + // be/be_visitor_arg_traits.cpp:893 + +#if !defined (_BENCHMARK_DATASTRUCT__SARG_TRAITS_) +#define _BENCHMARK_DATASTRUCT__SARG_TRAITS_ + + template<> + class SArg_Traits + : public + Var_Size_SArg_Traits_T< + benchmark::dataStruct, + benchmark::dataStruct_var, + benchmark::dataStruct_out, + TAO::Any_Insert_Policy_Stream + > + { + }; + +#endif /* end #if !defined */ +} + +TAO_END_VERSIONED_NAMESPACE_DECL + + + +// TAO_IDL - Generated from +// be/be_visitor_arg_traits.cpp:71 +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + + + +// Arg traits specializations. +namespace TAO +{ + + // TAO_IDL - Generated from + // be/be_visitor_arg_traits.cpp:893 + +#if !defined (_BENCHMARK_DATASTRUCT__ARG_TRAITS_) +#define _BENCHMARK_DATASTRUCT__ARG_TRAITS_ + + template<> + class Arg_Traits + : public + Var_Size_Arg_Traits_T< + benchmark::dataStruct, + benchmark::dataStruct_var, + benchmark::dataStruct_out, + TAO::Any_Insert_Policy_Stream + > + { + }; + +#endif /* end #if !defined */ +} + +TAO_END_VERSIONED_NAMESPACE_DECL + + + +// TAO_IDL - Generated from +// be/be_interface.cpp:1511 + +class TAO_benchmark_Put_Perfect_Hash_OpTable + : public TAO_Perfect_Hash_OpTable +{ +private: + unsigned int hash (const char *str, unsigned int len); + +public: + const TAO_operation_db_entry * lookup (const char *str, unsigned int len); +}; + +/* C++ code produced by gperf version 2.8 (ACE version) */ +/* Command-line: /opt/ACE_wrappers/1.5/bin/gperf -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_benchmark_Put_Perfect_Hash_OpTable -N lookup */ +unsigned int +TAO_benchmark_Put_Perfect_Hash_OpTable::hash (const char *str, unsigned int len) +{ + static const unsigned char asso_values[] = + { +#if defined (ACE_MVS) + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, + 18, 10, 0, 5, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 0, 0, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, +#else + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 0, 18, 0, 18, 10, + 0, 5, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 0, 18, 18, 18, 0, 0, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, +#endif /* ACE_MVS */ + }; + return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]]; +} + +const TAO_operation_db_entry * +TAO_benchmark_Put_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len) +{ + enum + { + TOTAL_KEYWORDS = 9, + MIN_WORD_LENGTH = 5, + MAX_WORD_LENGTH = 14, + MIN_HASH_VALUE = 5, + MAX_HASH_VALUE = 17, + HASH_VALUE_RANGE = 13, + DUPLICATES = 0, + WORDLIST_SIZE = 14 + }; + + static const TAO_operation_db_entry wordlist[] = + { + {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0}, + {"_is_a", &POA_benchmark::Put::_is_a_skel, 0}, + {"",0,0}, + {"onePort", &POA_benchmark::Put::onePort_skel, 0}, + {"allPorts", &POA_benchmark::Put::allPorts_skel, 0}, + {"",0,0}, + {"_component", &POA_benchmark::Put::_component_skel, 0}, + {"",0,0}, + {"dataAndPorts", &POA_benchmark::Put::dataAndPorts_skel, 0}, + {"_non_existent", &POA_benchmark::Put::_non_existent_skel, 0}, + {"_repository_id", &POA_benchmark::Put::_repository_id_skel, 0}, + {"_interface", &POA_benchmark::Put::_interface_skel, 0}, + {"",0,0}, + {"connect", &POA_benchmark::Put::connect_skel, 0}, + }; + + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + unsigned int key = hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE) + { + const char *s = wordlist[key].opname; + + if (*str == *s && !strncmp (str + 1, s + 1, len - 1)) + return &wordlist[key]; + } + } + return 0; +} + +static TAO_benchmark_Put_Perfect_Hash_OpTable tao_benchmark_Put_optable; + +// TAO_IDL - Generated from +// be/be_visitor_interface/interface_ss.cpp:930 + +TAO::Collocation_Proxy_Broker * +benchmark__TAO_Put_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr) +{ + return reinterpret_cast (0xdead); // Dummy +} + +int +benchmark__TAO_Put_Proxy_Broker_Factory_Initializer (size_t) +{ + benchmark__TAO_Put_Proxy_Broker_Factory_function_pointer = + benchmark__TAO_Put_Proxy_Broker_Factory_function; + + return 0; +} + +static int +benchmark__TAO_Put_Proxy_Broker_Stub_Factory_Initializer_Scarecrow = + benchmark__TAO_Put_Proxy_Broker_Factory_Initializer ( + reinterpret_cast (benchmark__TAO_Put_Proxy_Broker_Factory_Initializer) + ); + +// TAO_IDL - Generated from +// be/be_visitor_interface/interface_ss.cpp:103 + +POA_benchmark::Put::Put (void) + : TAO_ServantBase () +{ + this->optable_ = &tao_benchmark_Put_optable; +} + +POA_benchmark::Put::Put (const Put& rhs) + : TAO_Abstract_ServantBase (rhs), + TAO_ServantBase (rhs) +{ +} + +POA_benchmark::Put::~Put (void) +{ +}namespace POA_benchmark +{ + + + // TAO_IDL - Generated from + // be/be_visitor_operation/upcall_command_ss.cpp:127 + + class connect_Put + : public TAO::Upcall_Command + { + public: + inline connect_Put ( + POA_benchmark::Put * servant) + : servant_ (servant) + { + } + + virtual void execute (ACE_ENV_SINGLE_ARG_DECL) + { + this->servant_->connect ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } + + private: + POA_benchmark::Put * const servant_; + }; +} + + +// TAO_IDL - Generated from +// be/be_visitor_operation/operation_ss.cpp:190 + +void POA_benchmark::Put::connect_skel ( + TAO_ServerRequest & server_request, + void * TAO_INTERCEPTOR (servant_upcall), + void * servant + ACE_ENV_ARG_DECL + ) +{ +#if TAO_HAS_INTERCEPTORS == 1 + static ::CORBA::TypeCode_ptr const exceptions[] = + { + benchmark::_tc_invalidRequest + }; + static ::CORBA::ULong const nexceptions = 1; +#endif /* TAO_HAS_INTERCEPTORS */ + + TAO::SArg_Traits< void>::ret_val retval; + + TAO::Argument * const args[] = + { + &retval + }; + + static size_t const nargs = 1; + + POA_benchmark::Put * const impl = + static_cast (servant); + + connect_Put command ( + impl); + + TAO::Upcall_Wrapper upcall_wrapper; + upcall_wrapper.upcall (server_request + , args + , nargs + , command +#if TAO_HAS_INTERCEPTORS == 1 + , servant_upcall + , exceptions + , nexceptions +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; +}namespace POA_benchmark +{ + + + // TAO_IDL - Generated from + // be/be_visitor_operation/upcall_command_ss.cpp:127 + + class onePort_Put + : public TAO::Upcall_Command + { + public: + inline onePort_Put ( + POA_benchmark::Put * servant, + TAO_Operation_Details const * operation_details, + TAO::Argument * const args[]) + : servant_ (servant) + , operation_details_ (operation_details) + , args_ (args) + { + } + + virtual void execute (ACE_ENV_SINGLE_ARG_DECL) + { + TAO::SArg_Traits< ::CORBA::Short>::in_arg_type arg_1 = + TAO::Portable_Server::get_in_arg< ::CORBA::Short, TAO::SArg_Traits< ::CORBA::Short>::in_arg_type> ( + this->operation_details_, + this->args_, + 1); + + TAO::SArg_Traits< ::CORBA::Short>::in_arg_type arg_2 = + TAO::Portable_Server::get_in_arg< ::CORBA::Short, TAO::SArg_Traits< ::CORBA::Short>::in_arg_type> ( + this->operation_details_, + this->args_, + 2); + + this->servant_->onePort ( + arg_1 + , arg_2 + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + + private: + POA_benchmark::Put * const servant_; + TAO_Operation_Details const * const operation_details_; + TAO::Argument * const * const args_; + }; +} + + +// TAO_IDL - Generated from +// be/be_visitor_operation/operation_ss.cpp:190 + +void POA_benchmark::Put::onePort_skel ( + TAO_ServerRequest & server_request, + void * TAO_INTERCEPTOR (servant_upcall), + void * servant + ACE_ENV_ARG_DECL + ) +{ +#if TAO_HAS_INTERCEPTORS == 1 + static ::CORBA::TypeCode_ptr const exceptions[] = + { + benchmark::_tc_invalidRequest + }; + static ::CORBA::ULong const nexceptions = 1; +#endif /* TAO_HAS_INTERCEPTORS */ + + TAO::SArg_Traits< void>::ret_val retval; + TAO::SArg_Traits< ::CORBA::Short>::in_arg_val _tao_portNo; + TAO::SArg_Traits< ::CORBA::Short>::in_arg_val _tao_value; + + TAO::Argument * const args[] = + { + &retval, + &_tao_portNo, + &_tao_value + }; + + static size_t const nargs = 3; + + POA_benchmark::Put * const impl = + static_cast (servant); + + onePort_Put command ( + impl, + server_request.operation_details (), + args); + + TAO::Upcall_Wrapper upcall_wrapper; + upcall_wrapper.upcall (server_request + , args + , nargs + , command +#if TAO_HAS_INTERCEPTORS == 1 + , servant_upcall + , exceptions + , nexceptions +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; +}namespace POA_benchmark +{ + + + // TAO_IDL - Generated from + // be/be_visitor_operation/upcall_command_ss.cpp:127 + + class allPorts_Put + : public TAO::Upcall_Command + { + public: + inline allPorts_Put ( + POA_benchmark::Put * servant, + TAO_Operation_Details const * operation_details, + TAO::Argument * const args[]) + : servant_ (servant) + , operation_details_ (operation_details) + , args_ (args) + { + } + + virtual void execute (ACE_ENV_SINGLE_ARG_DECL) + { + TAO::SArg_Traits< ::CORBA::Short>::in_arg_type arg_1 = + TAO::Portable_Server::get_in_arg< ::CORBA::Short, TAO::SArg_Traits< ::CORBA::Short>::in_arg_type> ( + this->operation_details_, + this->args_, + 1); + + TAO::SArg_Traits< ::CORBA::Short>::in_arg_type arg_2 = + TAO::Portable_Server::get_in_arg< ::CORBA::Short, TAO::SArg_Traits< ::CORBA::Short>::in_arg_type> ( + this->operation_details_, + this->args_, + 2); + + TAO::SArg_Traits< ::CORBA::Short>::in_arg_type arg_3 = + TAO::Portable_Server::get_in_arg< ::CORBA::Short, TAO::SArg_Traits< ::CORBA::Short>::in_arg_type> ( + this->operation_details_, + this->args_, + 3); + + this->servant_->allPorts ( + arg_1 + , arg_2 + , arg_3 + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + + private: + POA_benchmark::Put * const servant_; + TAO_Operation_Details const * const operation_details_; + TAO::Argument * const * const args_; + }; +} + + +// TAO_IDL - Generated from +// be/be_visitor_operation/operation_ss.cpp:190 + +void POA_benchmark::Put::allPorts_skel ( + TAO_ServerRequest & server_request, + void * TAO_INTERCEPTOR (servant_upcall), + void * servant + ACE_ENV_ARG_DECL + ) +{ +#if TAO_HAS_INTERCEPTORS == 1 + static ::CORBA::TypeCode_ptr const exceptions[] = + { + benchmark::_tc_invalidRequest + }; + static ::CORBA::ULong const nexceptions = 1; +#endif /* TAO_HAS_INTERCEPTORS */ + + TAO::SArg_Traits< void>::ret_val retval; + TAO::SArg_Traits< ::CORBA::Short>::in_arg_val _tao_valPort1; + TAO::SArg_Traits< ::CORBA::Short>::in_arg_val _tao_valPort2; + TAO::SArg_Traits< ::CORBA::Short>::in_arg_val _tao_valPort3; + + TAO::Argument * const args[] = + { + &retval, + &_tao_valPort1, + &_tao_valPort2, + &_tao_valPort3 + }; + + static size_t const nargs = 4; + + POA_benchmark::Put * const impl = + static_cast (servant); + + allPorts_Put command ( + impl, + server_request.operation_details (), + args); + + TAO::Upcall_Wrapper upcall_wrapper; + upcall_wrapper.upcall (server_request + , args + , nargs + , command +#if TAO_HAS_INTERCEPTORS == 1 + , servant_upcall + , exceptions + , nexceptions +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; +}namespace POA_benchmark +{ + + + // TAO_IDL - Generated from + // be/be_visitor_operation/upcall_command_ss.cpp:127 + + class dataAndPorts_Put + : public TAO::Upcall_Command + { + public: + inline dataAndPorts_Put ( + POA_benchmark::Put * servant, + TAO_Operation_Details const * operation_details, + TAO::Argument * const args[]) + : servant_ (servant) + , operation_details_ (operation_details) + , args_ (args) + { + } + + virtual void execute (ACE_ENV_SINGLE_ARG_DECL) + { + TAO::SArg_Traits< ::benchmark::dataStruct>::in_arg_type arg_1 = + TAO::Portable_Server::get_in_arg< ::benchmark::dataStruct, TAO::SArg_Traits< ::benchmark::dataStruct>::in_arg_type> ( + this->operation_details_, + this->args_, + 1); + + this->servant_->dataAndPorts ( + arg_1 + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + + private: + POA_benchmark::Put * const servant_; + TAO_Operation_Details const * const operation_details_; + TAO::Argument * const * const args_; + }; +} + + +// TAO_IDL - Generated from +// be/be_visitor_operation/operation_ss.cpp:190 + +void POA_benchmark::Put::dataAndPorts_skel ( + TAO_ServerRequest & server_request, + void * TAO_INTERCEPTOR (servant_upcall), + void * servant + ACE_ENV_ARG_DECL + ) +{ +#if TAO_HAS_INTERCEPTORS == 1 + static ::CORBA::TypeCode_ptr const exceptions[] = + { + benchmark::_tc_invalidRequest + }; + static ::CORBA::ULong const nexceptions = 1; +#endif /* TAO_HAS_INTERCEPTORS */ + + TAO::SArg_Traits< void>::ret_val retval; + TAO::SArg_Traits< ::benchmark::dataStruct>::in_arg_val _tao_data; + + TAO::Argument * const args[] = + { + &retval, + &_tao_data + }; + + static size_t const nargs = 2; + + POA_benchmark::Put * const impl = + static_cast (servant); + + dataAndPorts_Put command ( + impl, + server_request.operation_details (), + args); + + TAO::Upcall_Wrapper upcall_wrapper; + upcall_wrapper.upcall (server_request + , args + , nargs + , command +#if TAO_HAS_INTERCEPTORS == 1 + , servant_upcall + , exceptions + , nexceptions +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; +} + +// TAO_IDL - Generated from +// be/be_visitor_interface/interface_ss.cpp:169 + +namespace POA_benchmark +{ + + + // TAO_IDL - Generated from + // be/be_visitor_operation/upcall_command_ss.cpp:127 + + class _is_a_Put_Upcall_Command + : public TAO::Upcall_Command + { + public: + inline _is_a_Put_Upcall_Command ( + POA_benchmark::Put * servant, + TAO_Operation_Details const * operation_details, + TAO::Argument * const args[]) + : servant_ (servant) + , operation_details_ (operation_details) + , args_ (args) + { + } + + virtual void execute (ACE_ENV_SINGLE_ARG_DECL) + { + TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval = + TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean, TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type> ( + this->operation_details_, + this->args_); + + TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 = + TAO::Portable_Server::get_in_arg< ::CORBA::Char *, TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type> ( + this->operation_details_, + this->args_, + 1); + + retval = + this->servant_-> _is_a ( + arg_1 + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + + private: + POA_benchmark::Put * const servant_; + TAO_Operation_Details const * const operation_details_; + TAO::Argument * const * const args_; + }; +} + + +void POA_benchmark::Put::_is_a_skel ( + TAO_ServerRequest & server_request, + void * TAO_INTERCEPTOR (servant_upcall), + void * servant + ACE_ENV_ARG_DECL + ) +{ +#if TAO_HAS_INTERCEPTORS == 1 + static ::CORBA::TypeCode_ptr const * const exceptions = 0; + static ::CORBA::ULong const nexceptions = 0; +#endif /* TAO_HAS_INTERCEPTORS */ + + TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval; + TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id; + + TAO::Argument * const args[] = + { + &retval, + &_tao_repository_id + }; + + static size_t const nargs = 2; + + POA_benchmark::Put * const impl = + static_cast (servant); + + _is_a_Put_Upcall_Command command ( + impl, + server_request.operation_details (), + args); + + TAO::Upcall_Wrapper upcall_wrapper; + upcall_wrapper.upcall (server_request + , args + , nargs + , command +#if TAO_HAS_INTERCEPTORS == 1 + , servant_upcall + , exceptions + , nexceptions +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; +}namespace POA_benchmark +{ + + + // TAO_IDL - Generated from + // be/be_visitor_operation/upcall_command_ss.cpp:127 + + class _non_existent_Put_Upcall_Command + : public TAO::Upcall_Command + { + public: + inline _non_existent_Put_Upcall_Command ( + POA_benchmark::Put * servant, + TAO_Operation_Details const * operation_details, + TAO::Argument * const args[]) + : servant_ (servant) + , operation_details_ (operation_details) + , args_ (args) + { + } + + virtual void execute (ACE_ENV_SINGLE_ARG_DECL) + { + TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval = + TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean, TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type> ( + this->operation_details_, + this->args_); + + retval = + this->servant_-> _non_existent ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } + + private: + POA_benchmark::Put * const servant_; + TAO_Operation_Details const * const operation_details_; + TAO::Argument * const * const args_; + }; +} + + +void POA_benchmark::Put::_non_existent_skel ( + TAO_ServerRequest & server_request, + void * TAO_INTERCEPTOR (servant_upcall), + void * servant + ACE_ENV_ARG_DECL + ) +{ +#if TAO_HAS_INTERCEPTORS == 1 + static ::CORBA::TypeCode_ptr const * const exceptions = 0; + static ::CORBA::ULong const nexceptions = 0; +#endif /* TAO_HAS_INTERCEPTORS */ + + TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval; + + TAO::Argument * const args[] = + { + &retval + }; + + static size_t const nargs = 1; + + POA_benchmark::Put * const impl = + static_cast (servant); + + _non_existent_Put_Upcall_Command command ( + impl, + server_request.operation_details (), + args); + + TAO::Upcall_Wrapper upcall_wrapper; + upcall_wrapper.upcall (server_request + , args + , nargs + , command +#if TAO_HAS_INTERCEPTORS == 1 + , servant_upcall + , exceptions + , nexceptions +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; +}namespace POA_benchmark +{ + + + // TAO_IDL - Generated from + // be/be_visitor_operation/upcall_command_ss.cpp:127 + + class _repository_id_Put_Upcall_Command + : public TAO::Upcall_Command + { + public: + inline _repository_id_Put_Upcall_Command ( + POA_benchmark::Put * servant, + TAO_Operation_Details const * operation_details, + TAO::Argument * const args[]) + : servant_ (servant) + , operation_details_ (operation_details) + , args_ (args) + { + } + + virtual void execute (ACE_ENV_SINGLE_ARG_DECL) + { + TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval = + TAO::Portable_Server::get_ret_arg< ::CORBA::Char *, TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type> ( + this->operation_details_, + this->args_); + + retval = + this->servant_-> _repository_id ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } + + private: + POA_benchmark::Put * const servant_; + TAO_Operation_Details const * const operation_details_; + TAO::Argument * const * const args_; + }; +} + + +void POA_benchmark::Put::_repository_id_skel ( + TAO_ServerRequest & server_request, + void * TAO_INTERCEPTOR (servant_upcall), + void * servant + ACE_ENV_ARG_DECL + ) +{ +#if TAO_HAS_INTERCEPTORS == 1 + static ::CORBA::TypeCode_ptr const * const exceptions = 0; + static ::CORBA::ULong const nexceptions = 0; +#endif /* TAO_HAS_INTERCEPTORS */ + + TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval; + + TAO::Argument * const args[] = + { + &retval + }; + + static size_t const nargs = 1; + + POA_benchmark::Put * const impl = + static_cast (servant); + + _repository_id_Put_Upcall_Command command ( + impl, + server_request.operation_details (), + args); + + TAO::Upcall_Wrapper upcall_wrapper; + upcall_wrapper.upcall (server_request + , args + , nargs + , command +#if TAO_HAS_INTERCEPTORS == 1 + , servant_upcall + , exceptions + , nexceptions +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; +} + +// TAO_IDL - Generated from +// be/be_visitor_interface/interface_ss.cpp:502 + +void POA_benchmark::Put::_interface_skel ( + TAO_ServerRequest & server_request, + void * /* servant_upcall */, + void * servant + ACE_ENV_ARG_DECL + ) +{ + TAO_IFR_Client_Adapter *_tao_adapter = + ACE_Dynamic_Service::instance ( + TAO_ORB_Core::ifr_client_adapter_name () + ); + + if (_tao_adapter == 0) + { + ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1, + ::CORBA::COMPLETED_NO)); + } + + POA_benchmark::Put * const impl = + static_cast (servant); + ::CORBA::InterfaceDef_ptr _tao_retval = + impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + server_request.init_reply (); + TAO_OutputCDR &_tao_out = *server_request.outgoing (); + + ::CORBA::Boolean const _tao_result = + _tao_adapter->interfacedef_cdr_insert ( + _tao_out, + _tao_retval + ); + + _tao_adapter->dispose (_tao_retval); + + if (_tao_result == 0) + { + ACE_THROW ( ::CORBA::MARSHAL ()); + } +}namespace POA_benchmark +{ + + + // TAO_IDL - Generated from + // be/be_visitor_operation/upcall_command_ss.cpp:127 + + class _get_component_Put_Upcall_Command + : public TAO::Upcall_Command + { + public: + inline _get_component_Put_Upcall_Command ( + POA_benchmark::Put * servant, + TAO_Operation_Details const * operation_details, + TAO::Argument * const args[]) + : servant_ (servant) + , operation_details_ (operation_details) + , args_ (args) + { + } + + virtual void execute (ACE_ENV_SINGLE_ARG_DECL) + { + TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval = + TAO::Portable_Server::get_ret_arg< ::CORBA::Object, TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type> ( + this->operation_details_, + this->args_); + + retval = + this->servant_-> _get_component ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } + + private: + POA_benchmark::Put * const servant_; + TAO_Operation_Details const * const operation_details_; + TAO::Argument * const * const args_; + }; +} + + +void POA_benchmark::Put::_component_skel ( + TAO_ServerRequest & server_request, + void * TAO_INTERCEPTOR (servant_upcall), + void * servant + ACE_ENV_ARG_DECL + ) +{ +#if TAO_HAS_INTERCEPTORS == 1 + static ::CORBA::TypeCode_ptr const * const exceptions = 0; + static ::CORBA::ULong const nexceptions = 0; +#endif /* TAO_HAS_INTERCEPTORS */ + + TAO::SArg_Traits< ::CORBA::Object>::ret_val retval; + + TAO::Argument * const args[] = + { + &retval + }; + + static size_t const nargs = 1; + + POA_benchmark::Put * const impl = + static_cast (servant); + + _get_component_Put_Upcall_Command command ( + impl, + server_request.operation_details (), + args); + + TAO::Upcall_Wrapper upcall_wrapper; + upcall_wrapper.upcall (server_request + , args + , nargs + , command +#if TAO_HAS_INTERCEPTORS == 1 + , servant_upcall + , exceptions + , nexceptions +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; +} + +::CORBA::Boolean POA_benchmark::Put::_is_a ( + const char* value + ACE_ENV_ARG_DECL_NOT_USED + ) +{ + return + ( + !ACE_OS::strcmp ( + value, + "IDL:benchmark/Put:1.0" + ) || + !ACE_OS::strcmp ( + value, + "IDL:omg.org/CORBA/Object:1.0" + ) + ); +} + +const char* POA_benchmark::Put::_interface_repository_id (void) const +{ + return "IDL:benchmark/Put:1.0"; +} + +// TAO_IDL - Generated from +// be/be_visitor_interface/interface_ss.cpp:867 + +void POA_benchmark::Put::_dispatch ( + TAO_ServerRequest & req, + void * servant_upcall + ACE_ENV_ARG_DECL + ) +{ + this->synchronous_upcall_dispatch (req, + servant_upcall, + this + ACE_ENV_ARG_PARAMETER); +} + +// TAO_IDL - Generated from +// be/be_visitor_interface/interface_ss.cpp:815 + +benchmark::Put * +POA_benchmark::Put::_this (ACE_ENV_SINGLE_ARG_DECL) +{ + TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + TAO_Stub_Auto_Ptr safe_stub (stub); + ::CORBA::Object_ptr tmp = CORBA::Object::_nil (); + + ::CORBA::Boolean _tao_opt_colloc = + stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects (); + + ACE_NEW_RETURN ( + tmp, + ::CORBA::Object (stub, _tao_opt_colloc, this), + 0 + ); + + ::CORBA::Object_var obj = tmp; + (void) safe_stub.release (); + + typedef ::benchmark::Put STUB_SCOPED_NAME; + return + TAO::Narrow_Utils::unchecked_narrow ( + obj.in (), + benchmark__TAO_Put_Proxy_Broker_Factory_function_pointer + ); +} + +#endif /* ifndef */ + diff --git a/quellcode/versuch4/benchS.h b/quellcode/versuch4/benchS.h new file mode 100755 index 0000000..3601619 --- /dev/null +++ b/quellcode/versuch4/benchS.h @@ -0,0 +1,217 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be/be_codegen.cpp:387 + +#ifndef _TAO_IDL_BENCHS_H_ +#define _TAO_IDL_BENCHS_H_ + + +#include "benchC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/Collocation_Proxy_Broker.h" +#include "tao/PortableServer/PortableServer.h" +#include "tao/PortableServer/Servant_Base.h" + +// TAO_IDL - Generated from +// be/be_visitor_module/module_sh.cpp:49 + +namespace POA_benchmark +{ + + + // TAO_IDL - Generated from + // be/be_visitor_interface/interface_sh.cpp:87 + + class Put; + typedef Put *Put_ptr; + + class Put + : public virtual PortableServer::ServantBase + { + protected: + Put (void); + + public: + // Useful for template programming. + typedef ::benchmark::Put _stub_type; + typedef ::benchmark::Put_ptr _stub_ptr_type; + typedef ::benchmark::Put_var _stub_var_type; + + Put (const Put& rhs); + virtual ~Put (void); + + virtual ::CORBA::Boolean _is_a ( + const char* logical_type_id + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ); + + static void _is_a_skel ( + TAO_ServerRequest & req, + void * servant_upcall, + void * servant + ACE_ENV_ARG_DECL + ); + + static void _non_existent_skel ( + TAO_ServerRequest & req, + void * servant_upcall, + void * servant + ACE_ENV_ARG_DECL + ); + + static void _interface_skel ( + TAO_ServerRequest & req, + void * servant_upcall, + void * servant + ACE_ENV_ARG_DECL + ); + + static void _component_skel ( + TAO_ServerRequest & req, + void * servant_upcall, + void * servant + ACE_ENV_ARG_DECL + ); + + static void _repository_id_skel ( + TAO_ServerRequest & req, + void * servant_upcall, + void * servant + ACE_ENV_ARG_DECL + ); + + virtual void _dispatch ( + TAO_ServerRequest & req, + void * servant_upcall + ACE_ENV_ARG_DECL + ); + + ::benchmark::Put *_this ( + + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ); + + virtual const char* _interface_repository_id (void) const; + + // TAO_IDL - Generated from + // be/be_visitor_operation/operation_sh.cpp:45 + + virtual void connect ( + + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) = 0; + + static void connect_skel ( + TAO_ServerRequest & server_request, + void * servant_upcall, + void * servant + ACE_ENV_ARG_DECL + ); + + // TAO_IDL - Generated from + // be/be_visitor_operation/operation_sh.cpp:45 + + virtual void onePort ( + ::CORBA::Short portNo, + ::CORBA::Short value + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) = 0; + + static void onePort_skel ( + TAO_ServerRequest & server_request, + void * servant_upcall, + void * servant + ACE_ENV_ARG_DECL + ); + + // TAO_IDL - Generated from + // be/be_visitor_operation/operation_sh.cpp:45 + + virtual void allPorts ( + ::CORBA::Short valPort1, + ::CORBA::Short valPort2, + ::CORBA::Short valPort3 + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) = 0; + + static void allPorts_skel ( + TAO_ServerRequest & server_request, + void * servant_upcall, + void * servant + ACE_ENV_ARG_DECL + ); + + // TAO_IDL - Generated from + // be/be_visitor_operation/operation_sh.cpp:45 + + virtual void dataAndPorts ( + const ::benchmark::dataStruct & data + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) = 0; + + static void dataAndPorts_skel ( + TAO_ServerRequest & server_request, + void * servant_upcall, + void * servant + ACE_ENV_ARG_DECL + ); + }; + +// TAO_IDL - Generated from +// be/be_visitor_module/module_sh.cpp:80 + +} // module benchmark + +// TAO_IDL - Generated from +// be/be_codegen.cpp:1148 + +#include "benchS_T.h" + +#if defined (__ACE_INLINE__) +#include "benchS.inl" +#endif /* defined INLINE */ + +#endif /* ifndef */ + diff --git a/quellcode/versuch4/benchS.inl b/quellcode/versuch4/benchS.inl new file mode 100755 index 0000000..38aa325 --- /dev/null +++ b/quellcode/versuch4/benchS.inl @@ -0,0 +1,28 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + + diff --git a/quellcode/versuch4/benchS_T.cpp b/quellcode/versuch4/benchS_T.cpp new file mode 100755 index 0000000..e100665 --- /dev/null +++ b/quellcode/versuch4/benchS_T.cpp @@ -0,0 +1,41 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be/be_codegen.cpp:656 + +#ifndef _TAO_IDL_BENCHS_T_CPP_ +#define _TAO_IDL_BENCHS_T_CPP_ + +#include "benchS_T.h" + +#if !defined (__ACE_INLINE__) +#include "benchS_T.inl" +#endif /* !defined INLINE */ + + +#endif /* ifndef */ diff --git a/quellcode/versuch4/benchS_T.h b/quellcode/versuch4/benchS_T.h new file mode 100755 index 0000000..6abb7ea --- /dev/null +++ b/quellcode/versuch4/benchS_T.h @@ -0,0 +1,155 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be/be_codegen.cpp:520 + +#ifndef _TAO_IDL_BENCHS_T_H_ +#define _TAO_IDL_BENCHS_T_H_ + + + +// TAO_IDL - Generated from +// be/be_visitor_root/root_sth.cpp:116 + +namespace POA_benchmark +{ + + // TAO_IDL - Generated from + // be/be_visitor_interface/tie_sh.cpp:87 + + // TIE class: Refer to CORBA v2.2, Section 20.34.4 + template + class Put_tie : public Put + { + public: + Put_tie (T &t); + // the T& ctor + Put_tie (T &t, PortableServer::POA_ptr poa); + // ctor taking a POA + Put_tie (T *tp, ::CORBA::Boolean release = 1); + // ctor taking pointer and an ownership flag + Put_tie ( + T *tp, + PortableServer::POA_ptr poa, + ::CORBA::Boolean release = 1 + ); + // ctor with T*, ownership flag and a POA + ~Put_tie (void); + // dtor + + // TIE specific functions + T *_tied_object (void); + // return the underlying object + void _tied_object (T &obj); + // set the underlying object + void _tied_object (T *obj, ::CORBA::Boolean release = 1); + // set the underlying object and the ownership flag + ::CORBA::Boolean _is_owner (void); + // do we own it + void _is_owner ( ::CORBA::Boolean b); + // set the ownership + + // overridden ServantBase operations + PortableServer::POA_ptr _default_POA ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS + ); + + // TAO_IDL - Generated from + // be/be_visitor_operation/tie_sh.cpp:60 + + void connect ( + + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); + + // TAO_IDL - Generated from + // be/be_visitor_operation/tie_sh.cpp:60 + + void onePort ( + ::CORBA::Short portNo, + ::CORBA::Short value + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); + + // TAO_IDL - Generated from + // be/be_visitor_operation/tie_sh.cpp:60 + + void allPorts ( + ::CORBA::Short valPort1, + ::CORBA::Short valPort2, + ::CORBA::Short valPort3 + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); + + // TAO_IDL - Generated from + // be/be_visitor_operation/tie_sh.cpp:60 + + void dataAndPorts ( + const ::benchmark::dataStruct & data + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); + + private: + T *ptr_; + PortableServer::POA_var poa_; + ::CORBA::Boolean rel_; + + // copy and assignment are not allowed + Put_tie (const Put_tie &); + void operator= (const Put_tie &); + }; +} // module benchmark + +// TAO_IDL - Generated from +// be/be_codegen.cpp:1251 +#if defined (__ACE_INLINE__) +#include "benchS_T.inl" +#endif /* defined INLINE */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "benchS_T.cpp" +#endif /* defined REQUIRED SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("benchS_T.cpp") +#endif /* defined REQUIRED PRAGMA */ + +#endif /* ifndef */ + diff --git a/quellcode/versuch4/benchS_T.inl b/quellcode/versuch4/benchS_T.inl new file mode 100755 index 0000000..a606ef4 --- /dev/null +++ b/quellcode/versuch4/benchS_T.inl @@ -0,0 +1,193 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + + +// TAO_IDL - Generated from +// be/be_visitor_interface/tie_si.cpp:96 + +template ACE_INLINE +POA_benchmark::Put_tie::Put_tie (T &t) + : ptr_ (&t), + poa_ (PortableServer::POA::_nil ()), + rel_ (0) +{} + +template ACE_INLINE +POA_benchmark::Put_tie::Put_tie (T &t, PortableServer::POA_ptr poa) + : ptr_ (&t), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (0) +{} + +template ACE_INLINE +POA_benchmark::Put_tie::Put_tie (T *tp, ::CORBA::Boolean release) + : ptr_ (tp), + poa_ (PortableServer::POA::_nil ()), + rel_ (release) +{} + +template ACE_INLINE +POA_benchmark::Put_tie::Put_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release) + : ptr_ (tp), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (release) +{} + +template ACE_INLINE +POA_benchmark::Put_tie::~Put_tie (void) +{ + if (this->rel_) + { + delete this->ptr_; + } +} + +template ACE_INLINE T * +POA_benchmark::Put_tie::_tied_object (void) +{ + return this->ptr_; +} + +template ACE_INLINE void +POA_benchmark::Put_tie::_tied_object (T &obj) +{ + if (this->rel_) + { + delete this->ptr_; + } + + this->ptr_ = &obj; + this->rel_ = 0; +} + +template ACE_INLINE void +POA_benchmark::Put_tie::_tied_object (T *obj, ::CORBA::Boolean release) +{ + if (this->rel_) + { + delete this->ptr_; + } + + this->ptr_ = obj; + this->rel_ = release; +} + +template ACE_INLINE ::CORBA::Boolean +POA_benchmark::Put_tie::_is_owner (void) +{ + return this->rel_; +} + +template ACE_INLINE void +POA_benchmark::Put_tie::_is_owner ( ::CORBA::Boolean b) +{ + this->rel_ = b; +} + +template ACE_INLINE PortableServer::POA_ptr +POA_benchmark::Put_tie::_default_POA (ACE_ENV_SINGLE_ARG_DECL) +{ + if (! CORBA::is_nil (this->poa_.in ())) + { + return PortableServer::POA::_duplicate (this->poa_.in ()); + } + + return this->Put::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +// TAO_IDL - Generated from +// be/be_visitor_operation/tie_si.cpp:101 + +template ACE_INLINE +void POA_benchmark::Put_tie::connect ( + + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + this->ptr_->connect ( + ); +} + +// TAO_IDL - Generated from +// be/be_visitor_operation/tie_si.cpp:101 + +template ACE_INLINE +void POA_benchmark::Put_tie::onePort ( + ::CORBA::Short portNo, + ::CORBA::Short value + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + this->ptr_->onePort ( + portNo, + value + ); +} + +// TAO_IDL - Generated from +// be/be_visitor_operation/tie_si.cpp:101 + +template ACE_INLINE +void POA_benchmark::Put_tie::allPorts ( + ::CORBA::Short valPort1, + ::CORBA::Short valPort2, + ::CORBA::Short valPort3 + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + this->ptr_->allPorts ( + valPort1, + valPort2, + valPort3 + ); +} + +// TAO_IDL - Generated from +// be/be_visitor_operation/tie_si.cpp:101 + +template ACE_INLINE +void POA_benchmark::Put_tie::dataAndPorts ( + const ::benchmark::dataStruct & data + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + this->ptr_->dataAndPorts ( + data + ); +} diff --git a/quellcode/versuch4/bench_i.cpp b/quellcode/versuch4/bench_i.cpp new file mode 100755 index 0000000..44f00e0 --- /dev/null +++ b/quellcode/versuch4/bench_i.cpp @@ -0,0 +1,99 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be/be_codegen.cpp:1063 + +#include "bench_i.h" + +// Implementation skeleton constructor +benchmark_Put_i::benchmark_Put_i (void) +{ +} + +// Implementation skeleton destructor +benchmark_Put_i::~benchmark_Put_i (void) +{ +} + +void benchmark_Put_i::connect ( + + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + // Add your implementation here + cpx = new CPX(); +} + +void benchmark_Put_i::onePort ( + ::CORBA::Short portNo, + ::CORBA::Short value + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + // Add your implementation here + cpx->set(portNo, value); +} + +void benchmark_Put_i::allPorts ( + ::CORBA::Short valPort1, + ::CORBA::Short valPort2, + ::CORBA::Short valPort3 + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + // Add your implementation here + cpx->set(1, valPort1); + cpx->set(2, valPort2); + cpx->set(3, valPort3); +} + +void benchmark_Put_i::dataAndPorts ( + const ::benchmark::dataStruct & data + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + // Add your implementation here + cpx->set(1, data.valPort1); + cpx->set(2, data.valPort2); + cpx->set(3, data.valPort3); + lastString = data.data; +} + + diff --git a/quellcode/versuch4/bench_i.h b/quellcode/versuch4/bench_i.h new file mode 100755 index 0000000..954f3b8 --- /dev/null +++ b/quellcode/versuch4/bench_i.h @@ -0,0 +1,99 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be/be_codegen.cpp:1001 + +#ifndef BENCHI_H_ +#define BENCHI_H_ + +#include "benchS.h" + +#include "cpx.h" +#include + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class benchmark_Put_i + : public virtual POA_benchmark::Put +{ +private: + CPX* cpx; + std::string lastString; + +public: + // Constructor + benchmark_Put_i (void); + + // Destructor + virtual ~benchmark_Put_i (void); + + virtual + void connect ( + + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); + + virtual + void onePort ( + ::CORBA::Short portNo, + ::CORBA::Short value + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); + + virtual + void allPorts ( + ::CORBA::Short valPort1, + ::CORBA::Short valPort2, + ::CORBA::Short valPort3 + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); + + virtual + void dataAndPorts ( + const ::benchmark::dataStruct & data + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); +}; + + +#endif /* BENCHI_H_ */ + diff --git a/quellcode/versuch4/benchmark.mpc b/quellcode/versuch4/benchmark.mpc new file mode 100755 index 0000000..13eb950 --- /dev/null +++ b/quellcode/versuch4/benchmark.mpc @@ -0,0 +1,23 @@ +project(*Receiver): rt_server, naming { + requires += exceptions + Source_Files { + cpx.cpp + bench_i.cpp + Receiver.cpp + } + Header_Files { + cpx.h + } +} + +project(*Supplier): rt_client, naming { + requires += exceptions + Source_Files { + cpx.cpp + bench_i.cpp + Supplier.cpp + } + Header_Files { + cpx.h + } +} diff --git a/quellcode/versuch4/buildNcopy b/quellcode/versuch4/buildNcopy new file mode 100755 index 0000000..6b29778 --- /dev/null +++ b/quellcode/versuch4/buildNcopy @@ -0,0 +1,2 @@ +#!/bin/bash +make static_libs=1 shared_libs_only=0 static_libs_only=1 -f GNUmakefile.Benchmark_Receiver && make static_libs=1 shared_libs_only=0 static_libs_only=1 -f GNUmakefile.Benchmark_Supplier && scp Receiver root@136.230.189.129:/opt/acetao/tests && scp Supplier root@136.230.189.135:/opt/acetao/tests diff --git a/quellcode/versuch4/burner b/quellcode/versuch4/burner new file mode 100755 index 0000000..7914765 Binary files /dev/null and b/quellcode/versuch4/burner differ diff --git a/quellcode/versuch4/cpx.cpp b/quellcode/versuch4/cpx.cpp new file mode 100755 index 0000000..eebdc65 --- /dev/null +++ b/quellcode/versuch4/cpx.cpp @@ -0,0 +1,85 @@ +/** + * + * \file cpx.cpp + * \brief read and write DIO + * + * \author Manuel Traut + * \version 2006-10-06 + * + */ + +#include "cpx.h" + +CPX::CPX(){ + init(); + std::cout<<"\n\n init ok\n\n"; +} + +int CPX::init(){ + + int fd_out = open(CPX_Input, O_RDWR | O_SYNC); + if (fd_out == -1){ + std::cout<<"PBCIO: open failed"< + +#include +#include +#include +#include + +#define CPX_Input "/dev/iio2" +#define CPX_Input_1 "/dev/iio2_in" +#define CPX_Output_1 "/dev/iio2_out" + +#define PORT1_OUT 0x2c00 +#define PORT2_OUT 0x3c00 +#define PORT3_OUT 0x4c00 + +#define PORT1_IN 0x5c00 +#define PORT2_IN 0x6c00 +#define PORT3_IN 0x7c00 + +# ifndef PROT_READ +# define PROT_READ 0x01 +# endif +# ifndef PROT_WRITE +# define PROT_WRITE 0x02 +# endif +# ifndef MAP_SHARED +# define MAP_SHARED 0x01 +# endif +# ifndef MAP_PRIVATE +# define MAP_PRIVATE 0x02 +# endif + +// ioctl (file descriptor, CPX_DIO_IOCTL_SET_SIGNAL, irq_send_signal_param*) +// enable sending signal on interrupt +// cpx_dio_set_signal_param.signal = signal to be sent to process +#define CPX_DIO_IOCTL_BASE 0xCD + +typedef struct{ + int signal; /* IN parameter: LINUX signal to be sent */ + int pid; /* IN parameter: process id where signal should be sent to */ +}cpx_dio_set_signal_param; + +#define CPX_DIO_IOCTL_ADD_SIG _IOW(CPX_DIO_IOCTL_BASE, 3, cpx_dio_set_signal_param) +#define CPX_DIO_IOCTL_DEL_SIG _IOW(CPX_DIO_IOCTL_BASE, 4, cpx_dio_set_signal_param) + +class CPX{ + public: + CPX(); + void set(short port, short value); + short get(short port); + private: + int init(); + unsigned char *mapped_in; + unsigned char *mapped_out; + volatile u_char *DOUT; + volatile u_char *DIN; + cpx_dio_set_signal_param param; +}; + +#endif diff --git a/quellcode/versuch4/howto b/quellcode/versuch4/howto new file mode 100755 index 0000000..74992c2 --- /dev/null +++ b/quellcode/versuch4/howto @@ -0,0 +1,230 @@ +Quick RTCORBA - Client - Server - HOWTO (ACE/TAO) +================================================= + +1.) define Interface (hosted Objects) + +create file interface.idl: + +----// interface.idl //---------------------------------------- + +module benchmark{ + + exception invalidRequest{}; + + struct dataStruct{ + string data; + short valPort1; + short valPort2; + short valPort3; + }; + + interface Put{ + void connect() raises(invalidRequest); + void onePort(in short portNo, in short value) raises(invalidRequest); + void allPorts( in short valPort1, + in short valPort2, + in short valPort3) raises(invalidRequest); + + void dataAndPorts( in dataStruct data) raises(invalidRequest); + }; +}; + +---------------------------------------------------------------------- + +2.) generate implementation files + +tao_idl -GI interface.idl + +3.) rename implementation files + +mv interfaceI.h interface_i.h +mv interfaceI.cpp interface_i.cpp + +4.) change interfaceI.h include in interface_i.cpp in interface_i.h + +5.) implement functionality of hosted objects into interface_i.cpp + +6.) write RTCORBA Server + +----// Server.cpp //---------------------------------------------------- + +include "interface_i.h" + +#include "orbsvcs/CosNamingC.h" +#include + +#include + +int main(int argc, char* argv[]){ + try{ + // initialize ORB + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "ServerORB"); + std::cout<<"ORB initialized"<resolve_initial_references("RTORB"); + RTCORBA::RTORB_var rtORB = RTCORBA::RTORB::_narrow(rtorb); + std::cout<<"RT Extensions OK"<resolve_initial_references("RootPOA"); + PortableServer::POA_var rootPOA = PortableServer::POA::_narrow(poa.in()); + + // activate POA Manager + PortableServer::POAManager_var poaManager = rootPOA->the_POAManager(); + poaManager->activate(); + std::cout<<"rootPOA OK"<create_priority_model_policy(RTCORBA::CLIENT_PROPAGATED, 9879 /*Priority*/ ); + + // create ObjectAdapter, assign Policy + PortableServer::POA_var benchPOA = rootPOA->create_POA("benchPOA", poaManager.in(), benchPolicy); + std::cout<<"Policy assigned"<activate_object(&bench_i); + CORBA::Object_var benchObj = benchPOA->id_to_reference(objectID.in()); + CORBA::String_var ior = orb->object_to_string(benchObj.in()); + std::cout<<"Servant activated"<resolve_initial_references("NameService"); + CosNaming::NamingContext_var namingContext = CosNaming::NamingContext::_narrow(namingObject.in()); + CosNaming::Name name(1); + name.length(1); + name[0].id = CORBA::string_dup("Receiver"); + namingContext->bind(name, benchObj.in()); + std::cout<<"Bound Receiver to NameService"<run(); + std::cout<<"ORB ready"<destroy(1,1); + orb->destroy(); + }catch(CORBA::Exception &any){ + std::cout<<"Exception: "< +#include "interfaceC.h" +#include "orbsvcs/CosNamingC.h" +#include + +#include "cpx.h" + +benchmark::Put_var put; +CPX cpx; + +int main(int argc, char* argv[]){ + + try{ + // initialize ORB + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "ClientORB"); + std::cout<<"ORB ok"<resolve_initial_references("RTORB"); + RTCORBA::RTORB_var rtORB = RTCORBA::RTORB::_narrow(rtorb.in()); + std::cout<<"RTORB ok"<resolve_initial_references("NameService"); + CosNaming::NamingContext_var namingContext = CosNaming::NamingContext::_narrow(namingObject.in()); + std::cout<<"NamingService ok"<resolve(name); + put = benchmark::Put::_narrow(benchObj.in()); + std::cout<<"TransferOjekt ok"<resolve_initial_references("RTCurrent"); + RTCORBA::Current_var rtCurrent = RTCORBA::Current::_narrow(rtCurrentObj.in()); + rtCurrent->the_priority(RTCORBA::maxPriority); + std::cout<<"PriorityChange ok"<connect(); + put->allPorts(0, 0, 0); + + // destroy ORB + orb->destroy(); + + }catch(CORBA::Exception &any){ + std::cout<<"Exception occured: "< +#include + + +//#include + +#include "benchI.h" + +#include "orbsvcs/CosNamingC.h" +#include + +COBA::ULong static_threads = 2; +long nap_time = 1000; + +int registerServant(CORBA::Policy_ptr threadpoolPolicy, const char* poaName, PortableServer::POAManager_ptr poaManager, PortableServer::POA_ptr rootPOA, CORBA::ORB_ptr orb, RTCORBA::RTORB rtORB) { + return 0; +} + +int main(int argc, char* argv[]){ + + struct sched_param schedparam; + schedparam.sched_priority = 99; + + if (sched_setscheduler(0, SCHED_FIFO, &schedparam) != 0) { + fprintf(stderr, "%s: PID %d: sched_setscheduler() failed errno = %d\n", __FUNCTION__, getpid(), errno); + } + + try{ + // initialize ORB + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "ServerORB"); + std::cout<<"ORB initialized"<resolve_initial_references("RTORB"); + RTCORBA::RTORB_var rtORB = RTCORBA::RTORB::_narrow(rtorb); + std::cout<<"RT Extensions OK"<create_tcp_protocol_properties( + sendBufferSize, recvBufferSize, keepAlive, dontRoute, noDelay, 1 /*network priority*/); + + tcpProperties->enable_network_priority(1); + + RTCORBA::ProtocolList protocols; + protocols.length(1); + protocols[0].protocol_type = 0; //TAO_TAG_IIOP_PROFILE; + protocols[0].transport_protocol_properties = RTCORBA::ProtocolProperties::_duplicate(tcpProperties.in()); + + // obtain rootPOA + CORBA::Object_var poa = orb->resolve_initial_references("RootPOA"); + PortableServer::POA_var rootPOA = PortableServer::POA::_narrow(poa.in()); + + // activate POA Manager + PortableServer::POAManager_var poaManager = rootPOA->the_POAManager(); + poaManager->activate(); + std::cout<<"rootPOA OK"<create_priority_model_policy(RTCORBA::CLIENT_PROPAGATED, RTCORBA::maxPriority); + benchPolicy[1] = rtORB->create_server_protocol_policy(protocols); + + //// create low Priority Policy + CORBA::PolicyList benchLowPolicy(2); + benchLowPolicy.length(2); + benchLowPolicy[0] = rtORB->create_priority_model_policy(RTCORBA::CLIENT_PROPAGATED, RTCORBA::minPriority); + benchLowPolicy[1] = rtORB->create_server_protocol_policy(protocols); + + // create ObjectAdapter, assign Policy + PortableServer::POA_var benchPOA = rootPOA->create_POA("benchPOA", poaManager.in(), benchPolicy); + std::cout<<"Policy assigned"<create_POA("benchLowPOA", poaManager.in(), benchLowPolicy); + + // create the servant + benchmark_PutHigh_i bench_i; + benchmark_PutLow_i lowBench_i; + + // activate servant + PortableServer::ObjectId_var objectID = benchPOA->activate_object(&bench_i); + CORBA::Object_var benchObj = benchPOA->id_to_reference(objectID.in()); + CORBA::String_var ior = orb->object_to_string(benchObj.in()); + + PortableServer::ObjectId_var objectLowID = benchLowPOA->activate_object(&lowBench_i); + CORBA::Object_var lowBenchObj = benchLowPOA->id_to_reference(objectLowID.in()); + CORBA::String_var ior2 = orb->object_to_string(lowBenchObj.in()); + std::cout<<"Servant activated"<resolve_initial_references("NameService"); + CosNaming::NamingContext_var namingContext = CosNaming::NamingContext::_narrow(namingObject.in()); + CosNaming::Name name(1); + name.length(1); + name[0].id = CORBA::string_dup("HighReceiver"); + namingContext->bind(name, benchObj.in()); + std::cout<<"Bound Receiver to NameService"<bind(name, lowBenchObj.in()); + std::cout<<"Bound LowReceiver to NameService"<run(); + std::cout<<"ORB ready"<destroy(1,1); + orb->destroy(); + //enable_irq(18); + }catch(CORBA::Exception &any){ + std::cout<<"Exception: "< +#include "benchC.h" +#include "orbsvcs/CosNamingC.h" +#include +#include + +#include "cpx.h" + +//benchmark::Put_var put; +benchmark::PutHigh_var highPut; +CPX cpx; + +void sigproc(int signo) +{ signal(SIGRTMIN+29, sigproc); +// int i1 = cpx.get(1); +// int i2 /*= cpx.get(2)*/; +// int i3 /*= cpx.get(3)*/; +// put->allPorts(i1, i2, i3); + highPut->onePort(1, cpx.get(1)); +// put->allPorts(cpx.get(1), -1, -1); +// put->onePort(3, cpx.get(3)); +} + + +int main(int argc, char* argv[]){ + + struct sched_param schedparam; + schedparam.sched_priority = 99; + + if (sched_setscheduler(0, SCHED_FIFO, &schedparam) != 0) { + fprintf(stderr, "%s: PID %d: sched_setscheduler() failed errno = %d\n", __FUNCTION__, getpid(), errno); + } + + try{ + // initialize ORB + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "Client2ORB"); + std::cout<<"ORB ok"<resolve_initial_references("RTORB"); + RTCORBA::RTORB_var rtORB = RTCORBA::RTORB::_narrow(rtorb.in()); + std::cout<<"RTORB ok"<create_tcp_protocol_properties( + sendBufferSize, recvBufferSize, keepAlive, dontRoute, noDelay, RTCORBA::maxPriority /*network priority*/); + + tcpProperties->enable_network_priority(1); + + RTCORBA::ProtocolList protocols; + protocols.length(1); + protocols[0].protocol_type = 0; //TAO_TAG_IIOP_PROFILE; + protocols[0].transport_protocol_properties = RTCORBA::ProtocolProperties::_duplicate(tcpProperties.in()); + + // NamingService + CORBA::Object_var namingObject = orb->resolve_initial_references("NameService"); + CosNaming::NamingContext_var namingContext = CosNaming::NamingContext::_narrow(namingObject.in()); + std::cout<<"NamingService ok"<resolve(name); +// put = benchmark::Put::_narrow(benchObj.in()); + + name[0].id = CORBA::string_dup("HighReceiver"); + CORBA::Object_var lowBenchObj = namingContext->resolve(name); + highPut = benchmark::PutHigh::_narrow(lowBenchObj.in()); + + std::cout<<"TransferOjekt ok"<create_private_connection_policy(); + pcPolicy[1] = rtORB->create_client_protocol_policy(protocols); + + CORBA::Object_var newTran = highPut->_set_policy_overrides(pcPolicy, CORBA::SET_OVERRIDE); + highPut = benchmark::PutHigh::_narrow(newTran.in()); + highPut = benchmark::PutHigh::_narrow(newTran.in()); + std::cout<<"PrivateConnection, RTProtocol ok"<resolve_initial_references("RTCurrent"); + //RTCORBA::Current_var rtCurrent = RTCORBA::Current::_narrow(rtCurrentObj.in()); + //rtCurrent->the_priority(RTCORBA::maxPriority); + //std::cout<<"PriorityChange ok"<_validate_connection(inconsistentPolicies.out()); + //std::cout<<"explicit bind ok"<connect(); + //lowPut->connect(); + highPut->allPorts(0, 0, 0); + sleep(1); + highPut->onePort(1, 255); + sleep(1); + highPut->allPorts(0, 0, 0); + + // signal handling + signal(SIGRTMIN+29, sigproc); + + while(true){ + pause(); + } + + // destroy ORB + orb->destroy(); + + }catch(CORBA::Exception &any){ + std::cout<<"Exception occured: "< +#include "benchC.h" +#include "orbsvcs/CosNamingC.h" +#include +#include + +#include "cpx.h" + +//benchmark::Put_var put; +benchmark::PutLow_var lowPut; +CPX cpx; + +void sigproc(int signo) +{ signal(SIGRTMIN+29, sigproc); +// int i1 = cpx.get(1); +// int i2 /*= cpx.get(2)*/; +// int i3 /*= cpx.get(3)*/; +// put->allPorts(i1, i2, i3); + lowPut->onePort(3, cpx.get(1)); +// put->allPorts(cpx.get(1), -1, -1); +// put->onePort(3, cpx.get(3)); +} + + +int main(int argc, char* argv[]){ + + struct sched_param schedparam; + schedparam.sched_priority = 99; + + if (sched_setscheduler(0, SCHED_FIFO, &schedparam) != 0) { + fprintf(stderr, "%s: PID %d: sched_setscheduler() failed errno = %d\n", __FUNCTION__, getpid(), errno); + } + + try{ + // initialize ORB + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "ClientORB"); + std::cout<<"ORB ok"<resolve_initial_references("RTORB"); + RTCORBA::RTORB_var rtORB = RTCORBA::RTORB::_narrow(rtorb.in()); + std::cout<<"RTORB ok"<create_tcp_protocol_properties( + sendBufferSize, recvBufferSize, keepAlive, dontRoute, noDelay, RTCORBA::maxPriority /*network priority*/); + + tcpProperties->enable_network_priority(1); + + RTCORBA::ProtocolList protocols; + protocols.length(1); + protocols[0].protocol_type = 0; //TAO_TAG_IIOP_PROFILE; + protocols[0].transport_protocol_properties = RTCORBA::ProtocolProperties::_duplicate(tcpProperties.in()); + + // NamingService + CORBA::Object_var namingObject = orb->resolve_initial_references("NameService"); + CosNaming::NamingContext_var namingContext = CosNaming::NamingContext::_narrow(namingObject.in()); + std::cout<<"NamingService ok"<resolve(name); +// put = benchmark::Put::_narrow(benchObj.in()); + + name[0].id = CORBA::string_dup("LowReceiver"); + CORBA::Object_var lowBenchObj = namingContext->resolve(name); + lowPut = benchmark::PutLow::_narrow(lowBenchObj.in()); + + std::cout<<"TransferOjekt ok"<create_private_connection_policy(); + pcPolicy[1] = rtORB->create_client_protocol_policy(protocols); + + CORBA::Object_var newTran = lowPut->_set_policy_overrides(pcPolicy, CORBA::SET_OVERRIDE); + lowPut = benchmark::PutLow::_narrow(newTran.in()); + lowPut = benchmark::PutLow::_narrow(newTran.in()); + std::cout<<"PrivateConnection, RTProtocol ok"<resolve_initial_references("RTCurrent"); + //RTCORBA::Current_var rtCurrent = RTCORBA::Current::_narrow(rtCurrentObj.in()); + //rtCurrent->the_priority(RTCORBA::maxPriority); + //std::cout<<"PriorityChange ok"<_validate_connection(inconsistentPolicies.out()); + //std::cout<<"explicit bind ok"<connect(); + //lowPut->connect(); + lowPut->allPorts(0, 0, 0); + sleep(1); + lowPut->onePort(1, 255); + sleep(1); + lowPut->allPorts(0, 0, 0); + + // signal handling + signal(SIGRTMIN+29, sigproc); + + while(true){ + pause(); + } + + // destroy ORB + orb->destroy(); + + }catch(CORBA::Exception &any){ + std::cout<<"Exception occured: "<set(portNo, value); +} + +void benchmark_PutLow_i::allPorts ( + ::CORBA::Short valPort1, + ::CORBA::Short valPort2, + ::CORBA::Short valPort3 + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + // Add your implementation here + if(valPort1>=0) cpx->set(1, valPort1); + if(valPort2>=0) cpx->set(2, valPort2); + if(valPort3>=0) cpx->set(3, valPort3); +} + +// Implementation skeleton constructor +benchmark_PutHigh_i::benchmark_PutHigh_i (void) +{ +} + +// Implementation skeleton destructor +benchmark_PutHigh_i::~benchmark_PutHigh_i (void) +{ +} + +void benchmark_PutHigh_i::connect ( + + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + // Add your implementation here + cpx = new CPX(); +} + +void benchmark_PutHigh_i::onePort ( + ::CORBA::Short portNo, + ::CORBA::Short value + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + // Add your implementation here + cpx->set(portNo, value); +} + +void benchmark_PutHigh_i::allPorts ( + ::CORBA::Short valPort1, + ::CORBA::Short valPort2, + ::CORBA::Short valPort3 + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )) +{ + // Add your implementation here + if(valPort1>=0) cpx->set(1, valPort1); + if(valPort2>=0) cpx->set(2, valPort2); + if(valPort3>=0) cpx->set(3, valPort3); +} + + diff --git a/quellcode/versuch4/multithreading/benchI.h b/quellcode/versuch4/multithreading/benchI.h new file mode 100755 index 0000000..fb33928 --- /dev/null +++ b/quellcode/versuch4/multithreading/benchI.h @@ -0,0 +1,130 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be/be_codegen.cpp:1001 + +#ifndef BENCHI_H_ +#define BENCHI_H_ + +#include "benchS.h" +#include "cpx.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class benchmark_PutLow_i + : public virtual POA_benchmark::PutLow +{ +private: + CPX* cpx; +public: + // Constructor + benchmark_PutLow_i (void); + + // Destructor + virtual ~benchmark_PutLow_i (void); + + virtual + void connect ( + + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); + + virtual + void onePort ( + ::CORBA::Short portNo, + ::CORBA::Short value + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); + + virtual + void allPorts ( + ::CORBA::Short valPort1, + ::CORBA::Short valPort2, + ::CORBA::Short valPort3 + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); +}; + +class benchmark_PutHigh_i + : public virtual POA_benchmark::PutHigh +{ + +private: + CPX* cpx; +public: + // Constructor + benchmark_PutHigh_i (void); + + // Destructor + virtual ~benchmark_PutHigh_i (void); + + virtual + void connect ( + + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); + + virtual + void onePort ( + ::CORBA::Short portNo, + ::CORBA::Short value + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); + + virtual + void allPorts ( + ::CORBA::Short valPort1, + ::CORBA::Short valPort2, + ::CORBA::Short valPort3 + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::benchmark::invalidRequest + )); +}; + + +#endif /* BENCHI_H_ */ + diff --git a/quellcode/versuch4/multithreading/cpx.cpp b/quellcode/versuch4/multithreading/cpx.cpp new file mode 100755 index 0000000..eebdc65 --- /dev/null +++ b/quellcode/versuch4/multithreading/cpx.cpp @@ -0,0 +1,85 @@ +/** + * + * \file cpx.cpp + * \brief read and write DIO + * + * \author Manuel Traut + * \version 2006-10-06 + * + */ + +#include "cpx.h" + +CPX::CPX(){ + init(); + std::cout<<"\n\n init ok\n\n"; +} + +int CPX::init(){ + + int fd_out = open(CPX_Input, O_RDWR | O_SYNC); + if (fd_out == -1){ + std::cout<<"PBCIO: open failed"< + +#include +#include +#include +#include + +#define CPX_Input "/dev/iio2" +#define CPX_Input_1 "/dev/iio2_in" +#define CPX_Output_1 "/dev/iio2_out" + +#define PORT1_OUT 0x2c00 +#define PORT2_OUT 0x3c00 +#define PORT3_OUT 0x4c00 + +#define PORT1_IN 0x5c00 +#define PORT2_IN 0x6c00 +#define PORT3_IN 0x7c00 + +# ifndef PROT_READ +# define PROT_READ 0x01 +# endif +# ifndef PROT_WRITE +# define PROT_WRITE 0x02 +# endif +# ifndef MAP_SHARED +# define MAP_SHARED 0x01 +# endif +# ifndef MAP_PRIVATE +# define MAP_PRIVATE 0x02 +# endif + +// ioctl (file descriptor, CPX_DIO_IOCTL_SET_SIGNAL, irq_send_signal_param*) +// enable sending signal on interrupt +// cpx_dio_set_signal_param.signal = signal to be sent to process +#define CPX_DIO_IOCTL_BASE 0xCD + +typedef struct{ + int signal; /* IN parameter: LINUX signal to be sent */ + int pid; /* IN parameter: process id where signal should be sent to */ +}cpx_dio_set_signal_param; + +#define CPX_DIO_IOCTL_ADD_SIG _IOW(CPX_DIO_IOCTL_BASE, 3, cpx_dio_set_signal_param) +#define CPX_DIO_IOCTL_DEL_SIG _IOW(CPX_DIO_IOCTL_BASE, 4, cpx_dio_set_signal_param) + +class CPX{ + public: + CPX(); + void set(short port, short value); + short get(short port); + private: + int init(); + unsigned char *mapped_in; + unsigned char *mapped_out; + volatile u_char *DOUT; + volatile u_char *DIN; + cpx_dio_set_signal_param param; +}; + +#endif diff --git a/quellcode/versuch4/myBurner.cpp b/quellcode/versuch4/myBurner.cpp new file mode 100755 index 0000000..318b9c8 --- /dev/null +++ b/quellcode/versuch4/myBurner.cpp @@ -0,0 +1,13 @@ +#include +#include + +int foo(int what){ + if(what == 1) return 1; + int fac = what * foo(what-1); + return fac; +} + +int main(){ + while(1) foo(33); + return 0; +} diff --git a/quellcode/versuch4/readme b/quellcode/versuch4/readme new file mode 100755 index 0000000..e331092 --- /dev/null +++ b/quellcode/versuch4/readme @@ -0,0 +1,65 @@ +CPU Burn-in README +------------------ + +What is CPU Burn-in? +------------------- + +CPU Burn-in v1.0 by Michal Mienik is the ultimate stability testing tool for overclockers. +The program heats up any x86 CPU to the maximum possible operating temperature that is achievable +by using ordinary software. This allows the user to adjust the CPU speed up to the practical +maximum while still being sure that stability is achieved even under the most stressful conditions. +The program continuously monitors for erroneous calculations ensuring the CPU does not +generate errors during calculations. + + +Why use CPU Burn-in? +------------------- + +In the past overclocking stability was tested by running intensive software such as +Distributed.Net clients or SETI@home. Running either piece of software for 24 hours would generally +show up instability. A looping Quake3 timedemo was also a good choice. + +However, there are inherent limitations in these tests: + +Not every error caused by overclocking causes a program to crash or the system to hang. Some +errors may be more subtle, such as a slight miscalculation. If such an event occurs and causes a pixel +to render a slightly different colour in Quake3 for example, the user is unlikely to notice and overall +this is no big deal. However such small errors can have a potentially devastating on distributed projects +such as SETI@home, which rely on the reliable processing of data. + +CPU Burn-in consistently delivers a higher CPU operating temperature than the above mentioned +applications. This allows CPU Burn-in to be particularly effective at testing overclocking stability +and cooling effectiveness. + +How does it work? +---------------- + +CPU Burn-in constantly cycles FPU intensive functions for a user specified period of time. The +resultant calculations are constantly checked for data integrity. If the program detects erroneous +data the user is immediately informed. Applications such as SETI@home and Distributed.Net perform no +such data checking. The user must rely on those programs to crash or the system to hang before a +problem can be noticed. + +Instructions: +------------ + +Please Note: Overclocking can potentially be harmful to your CPU. It may fry or fail prematurely +in the long term. I cannot and will not be responsible for any damage you do to your hardware. +By it's very nature, CPU Burn-in pushes the CPU to the max. Increasing the voltage, Mhz, or PCI/AGP +above the recommended levels can cause damage. + +CPU Burn-in runs best as a high priority process on an otherwise idle system. + +Run the program with one command line value to specify the length of time to run the test: + +eg. + "./cpuburn-in 10" will run the test for ten minutes. + + +Contact: +------- + +If your system experiences instability during the burn-in test or you receive error messages it's likely +the system has been overclocked too far. + +If you believe a bug in the program has been found please email cluster2k@hotmail.com -- cgit v1.2.3