diff options
| author | Manuel Traut <manut@mecka.net> | 2014-03-31 16:53:55 +0200 |
|---|---|---|
| committer | Manuel Traut <manut@mecka.net> | 2014-03-31 16:53:55 +0200 |
| commit | 1adba473e6917b227e1b0a1118148101dca202e7 (patch) | |
| tree | 13180ede9564ba50c528b274ee5719b4e030ef06 /quellcode/demo1/Receiver | |
| parent | eacbf5bb4d57af21c731f41251015d3b991ad490 (diff) | |
Signed-off-by: Manuel Traut <manut@mecka.net>
Diffstat (limited to 'quellcode/demo1/Receiver')
| -rwxr-xr-x | quellcode/demo1/Receiver/.depend.Receiver_Receiver | 0 | ||||
| -rwxr-xr-x | quellcode/demo1/Receiver/GNUmakefile.Receiver | 226 | ||||
| -rwxr-xr-x | quellcode/demo1/Receiver/Receiver | bin | 0 -> 545814 bytes | |||
| -rwxr-xr-x | quellcode/demo1/Receiver/Receiver.cpp | 67 | ||||
| -rwxr-xr-x | quellcode/demo1/Receiver/Receiver.idl | 10 | ||||
| -rwxr-xr-x | quellcode/demo1/Receiver/Receiver.mpc | 8 | ||||
| -rwxr-xr-x | quellcode/demo1/Receiver/ReceiverC.cpp | 767 | ||||
| -rwxr-xr-x | quellcode/demo1/Receiver/ReceiverC.h | 363 | ||||
| -rwxr-xr-x | quellcode/demo1/Receiver/ReceiverC.inl | 63 | ||||
| -rwxr-xr-x | quellcode/demo1/Receiver/ReceiverS.cpp | 852 | ||||
| -rwxr-xr-x | quellcode/demo1/Receiver/ReceiverS.h | 209 | ||||
| -rwxr-xr-x | quellcode/demo1/Receiver/ReceiverS.inl | 27 | ||||
| -rwxr-xr-x | quellcode/demo1/Receiver/ReceiverS_T.cpp | 41 | ||||
| -rwxr-xr-x | quellcode/demo1/Receiver/ReceiverS_T.h | 155 | ||||
| -rwxr-xr-x | quellcode/demo1/Receiver/ReceiverS_T.inl | 177 | ||||
| -rwxr-xr-x | quellcode/demo1/Receiver/Receiver_i.cpp | 92 | ||||
| -rwxr-xr-x | quellcode/demo1/Receiver/Receiver_i.h | 89 | ||||
| -rwxr-xr-x | quellcode/demo1/Receiver/cpx.cpp | 85 | ||||
| -rwxr-xr-x | quellcode/demo1/Receiver/cpx.h | 73 |
19 files changed, 3304 insertions, 0 deletions
diff --git a/quellcode/demo1/Receiver/.depend.Receiver_Receiver b/quellcode/demo1/Receiver/.depend.Receiver_Receiver new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/quellcode/demo1/Receiver/.depend.Receiver_Receiver diff --git a/quellcode/demo1/Receiver/GNUmakefile.Receiver b/quellcode/demo1/Receiver/GNUmakefile.Receiver new file mode 100755 index 0000000..551e5d8 --- /dev/null +++ b/quellcode/demo1/Receiver/GNUmakefile.Receiver @@ -0,0 +1,226 @@ +# -*- Makefile -*- +#---------------------------------------------------------------------------- +# GNU Makefile +# +# @file GNUmakefile.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.Receiver +DEPENDENCY_FILE = .depend.Receiver +BIN_UNCHECKED = Receiver + +TAO_ROOT ?= $(ACE_ROOT)/TAO + +FILES = \ + ReceiverC.cpp \ + ReceiverS.cpp \ + cpx.cpp \ + Receiver_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)/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 += ReceiverC.inl ReceiverS.inl ReceiverC.h ReceiverS.h ReceiverC.cpp ReceiverS.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) Receiver.idl -nt ReceiverC.inl 2> /dev/null && $(TEST_EXE) Receiver.idl -nt ReceiverS.inl 2> /dev/null && $(TEST_EXE) Receiver.idl -nt ReceiverC.h 2> /dev/null && $(TEST_EXE) Receiver.idl -nt ReceiverS.h 2> /dev/null && $(TEST_EXE) Receiver.idl -nt ReceiverC.cpp 2> /dev/null && $(TEST_EXE) Receiver.idl -nt ReceiverS.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 ReceiverC.inl 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt ReceiverS.inl 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt ReceiverC.h 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt ReceiverS.h 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt ReceiverC.cpp 2> /dev/null && $(TEST_EXE) $(TAO_IDL_DEP) -nt ReceiverS.cpp 2> /dev/null && echo 0),) + .NOTPARALLEL: + endif + endif + else + .NOTPARALLEL: + endif +else +.NOTPARALLEL: +endif +ReceiverC.inl ReceiverS.inl ReceiverC.h ReceiverS.h ReceiverC.cpp ReceiverS.cpp: Receiver.idl $(TAO_IDL_DEP) + $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs Receiver.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 += Receiver$(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 = ReceiverC.cpp ReceiverS.cpp cpx.cpp Receiver_i.cpp Receiver.cpp +FORCED_IDL_STUBS := $(FORCED_IDL_STUBS:ReceiverC.cpp=) +FORCED_IDL_STUBS := $(FORCED_IDL_STUBS:ReceiverS.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/demo1/Receiver/Receiver b/quellcode/demo1/Receiver/Receiver Binary files differnew file mode 100755 index 0000000..0edce79 --- /dev/null +++ b/quellcode/demo1/Receiver/Receiver diff --git a/quellcode/demo1/Receiver/Receiver.cpp b/quellcode/demo1/Receiver/Receiver.cpp new file mode 100755 index 0000000..0dafa79 --- /dev/null +++ b/quellcode/demo1/Receiver/Receiver.cpp @@ -0,0 +1,67 @@ +#include <iostream> + +#include "Receiver_i.h" + +#include "orbsvcs/CosNamingC.h" +#include <tao/RTCORBA/RTCORBA.h> + +int main(int argc, char* argv[]){ + try{ + // initialize ORB + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "ServerORB"); + std::cout<<"ORB initialized"<<std::endl; + + // access RT Extensions + CORBA::Object_var rtorb = orb->resolve_initial_references("RTORB"); + RTCORBA::RTORB_var rtORB = RTCORBA::RTORB::_narrow(rtorb); + std::cout<<"RT Extensions OK"<<std::endl; + + // 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"<<std::endl; + + // create Policy + CORBA::PolicyList benchPolicy(1); + benchPolicy.length(1); + benchPolicy[0] = rtORB->create_priority_model_policy(RTCORBA::CLIENT_PROPAGATED, RTCORBA::maxPriority); + + // create ObjectAdapter, assign Policy + PortableServer::POA_var benchPOA = rootPOA->create_POA("benchPOA", poaManager.in(), benchPolicy); + std::cout<<"Policy assigned"<<std::endl; + + // create the servant + Receiver_Put_i bench_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()); + std::cout<<"Servant activated"<<std::endl; + + // NameService + CORBA::Object_var namingObject = orb->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->rebind(name, benchObj.in()); + std::cout<<"Bound Receiver to NameService"<<std::endl; + + // start ORB + orb->run(); + std::cout<<"ORB ready"<<std::endl; + + //destroy + rootPOA->destroy(1,1); + orb->destroy(); + }catch(CORBA::Exception &any){ + std::cout<<"Exception: "<<any<<std::endl; + } + return 0; +} + diff --git a/quellcode/demo1/Receiver/Receiver.idl b/quellcode/demo1/Receiver/Receiver.idl new file mode 100755 index 0000000..fa26475 --- /dev/null +++ b/quellcode/demo1/Receiver/Receiver.idl @@ -0,0 +1,10 @@ +module Receiver{ + exception invalidRequest{}; + 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); + }; +}; diff --git a/quellcode/demo1/Receiver/Receiver.mpc b/quellcode/demo1/Receiver/Receiver.mpc new file mode 100755 index 0000000..5e7185c --- /dev/null +++ b/quellcode/demo1/Receiver/Receiver.mpc @@ -0,0 +1,8 @@ +project(Receiver): rt_server, naming { + requires += exceptions + Source_Files { + cpx.cpp + Receiver_i.cpp + Receiver.cpp + } +} diff --git a/quellcode/demo1/Receiver/ReceiverC.cpp b/quellcode/demo1/Receiver/ReceiverC.cpp new file mode 100755 index 0000000..b1056ac --- /dev/null +++ b/quellcode/demo1/Receiver/ReceiverC.cpp @@ -0,0 +1,767 @@ +// -*- 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:292 + + +#include "ReceiverC.h" +#include "tao/CDR.h" +#include "tao/Exception_Data.h" +#include "tao/Invocation_Adapter.h" +#include "tao/Object_T.h" +#include "tao/Typecode.h" +#include "tao/Any_Impl_T.h" +#include "tao/Any_Dual_Impl_T.h" +#include "tao/Basic_Arguments.h" +#include "ace/OS_NS_string.h" + +#if defined (__BORLANDC__) +#pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig +#endif /* __BORLANDC__ */ + +#if !defined (__ACE_INLINE__) +#include "ReceiverC.inl" +#endif /* !defined INLINE */ + +// TAO_IDL - Generated from +// be/be_visitor_arg_traits.cpp:68 + +// Arg traits specializations. +namespace TAO +{ +} + + +// TAO_IDL - Generated from +// be/be_visitor_exception/exception_cs.cpp:63 + +Receiver::invalidRequest::invalidRequest (void) + : CORBA::UserException ( + "IDL:Receiver/invalidRequest:1.0", + "invalidRequest" + ) +{ +} + +Receiver::invalidRequest::~invalidRequest (void) +{ +} + +Receiver::invalidRequest::invalidRequest (const ::Receiver::invalidRequest &_tao_excp) + : CORBA::UserException ( + _tao_excp._rep_id (), + _tao_excp._name () + ) +{ +} + +Receiver::invalidRequest& +Receiver::invalidRequest::operator= (const ::Receiver::invalidRequest &_tao_excp) +{ + this->ACE_NESTED_CLASS (CORBA, UserException)::operator= (_tao_excp); + return *this; +} + +void Receiver::invalidRequest::_tao_any_destructor (void *_tao_void_pointer) +{ + invalidRequest *_tao_tmp_pointer = + static_cast<invalidRequest *> (_tao_void_pointer); + delete _tao_tmp_pointer; +} + +Receiver::invalidRequest * +Receiver::invalidRequest::_downcast (CORBA::Exception *_tao_excp) +{ + return dynamic_cast<invalidRequest *> (_tao_excp); +} + +const Receiver::invalidRequest * +Receiver::invalidRequest::_downcast (CORBA::Exception const *_tao_excp) +{ + return dynamic_cast<const invalidRequest *> (_tao_excp); +} + +CORBA::Exception *Receiver::invalidRequest::_alloc (void) +{ + CORBA::Exception *retval = 0; + ACE_NEW_RETURN (retval, ::Receiver::invalidRequest, 0); + return retval; +} + +CORBA::Exception * +Receiver::invalidRequest::_tao_duplicate (void) const +{ + CORBA::Exception *result = 0; + ACE_NEW_RETURN ( + result, + ::Receiver::invalidRequest (*this), + 0 + ); + return result; +} + +void Receiver::invalidRequest::_raise (void) const +{ + TAO_RAISE (*this); +} + +void Receiver::invalidRequest::_tao_encode ( + TAO_OutputCDR &cdr + ACE_ENV_ARG_DECL + ) const +{ + if (cdr << *this) + { + return; + } + + ACE_THROW (CORBA::MARSHAL ()); +} + +void Receiver::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 Receiver::invalidRequest::_type (void) const +{ + return ::Receiver::_tc_invalidRequest; +} + +// TAO_IDL - Generated from +// be/be_visitor_typecode/typecode_defn.cpp:295 + +static const CORBA::Long _oc_Receiver_invalidRequest[] = +{ + TAO_ENCAP_BYTE_ORDER, // byte order + 32, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x52656365), + ACE_NTOHL (0x69766572), + ACE_NTOHL (0x2f696e76), + ACE_NTOHL (0x616c6964), + ACE_NTOHL (0x52657175), + ACE_NTOHL (0x6573743a), + ACE_NTOHL (0x312e3000), // repository ID = IDL:Receiver/invalidRequest:1.0 + 15, + ACE_NTOHL (0x696e7661), + ACE_NTOHL (0x6c696452), + ACE_NTOHL (0x65717565), + ACE_NTOHL (0x73740000), // name = invalidRequest + 0, // member count + }; + +static CORBA::TypeCode _tc_TAO_tc_Receiver_invalidRequest ( + CORBA::tk_except, + sizeof (_oc_Receiver_invalidRequest), + (char *) &_oc_Receiver_invalidRequest, + 0, + 0 + ); + +namespace Receiver +{ + ::CORBA::TypeCode_ptr const _tc_invalidRequest = + &_tc_TAO_tc_Receiver_invalidRequest; +} + +// TAO_IDL - Generated from +// be/be_visitor_interface/interface_cs.cpp:60 + +// Traits specializations for Receiver::Put. + +Receiver::Put_ptr +TAO::Objref_Traits<Receiver::Put>::duplicate ( + Receiver::Put_ptr p + ) +{ + return Receiver::Put::_duplicate (p); +} + +void +TAO::Objref_Traits<Receiver::Put>::release ( + Receiver::Put_ptr p + ) +{ + CORBA::release (p); +} + +Receiver::Put_ptr +TAO::Objref_Traits<Receiver::Put>::nil (void) +{ + return Receiver::Put::_nil (); +} + +CORBA::Boolean +TAO::Objref_Traits<Receiver::Put>::marshal ( + Receiver::Put_ptr p, + TAO_OutputCDR & cdr + ) +{ + return CORBA::Object::marshal (p, cdr); +} + +// Function pointer for collocation factory initialization. +TAO::Collocation_Proxy_Broker * +(*Receiver__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 Receiver::Put::connect ( + + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::Receiver::invalidRequest + )) +{ + if (!this->is_evaluated ()) + { + ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this); + } + + if (this->the_TAO_Put_Proxy_Broker_ == 0) + { + Receiver_Put_setup_collocation (); + } + + ACE_DECLARE_NEW_CORBA_ENV; + TAO::Arg_Traits< void>::ret_val _tao_retval; + + TAO::Argument *_the_tao_operation_signature [] = + { + &_tao_retval + }; + + static TAO::Exception_Data + _tao_Receiver_Put_connect_exceptiondata [] = + { + { + "IDL:Receiver/invalidRequest:1.0", + Receiver::invalidRequest::_alloc, + Receiver::_tc_invalidRequest + } + }; + + TAO::Invocation_Adapter _tao_call ( + this, + _the_tao_operation_signature, + 1, + "connect", + 7, + this->the_TAO_Put_Proxy_Broker_ + ); + + _tao_call.invoke ( + _tao_Receiver_Put_connect_exceptiondata, + 1 + ACE_ENV_ARG_PARAMETER + ); + ACE_CHECK; +} + +// TAO_IDL - Generated from +// be/be_visitor_operation/operation_cs.cpp:78 + +void Receiver::Put::onePort ( + ::CORBA::Short portNo, + ::CORBA::Short value + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::Receiver::invalidRequest + )) +{ + if (!this->is_evaluated ()) + { + ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this); + } + + if (this->the_TAO_Put_Proxy_Broker_ == 0) + { + Receiver_Put_setup_collocation (); + } + + ACE_DECLARE_NEW_CORBA_ENV; + 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_Receiver_Put_onePort_exceptiondata [] = + { + { + "IDL:Receiver/invalidRequest:1.0", + Receiver::invalidRequest::_alloc, + Receiver::_tc_invalidRequest + } + }; + + TAO::Invocation_Adapter _tao_call ( + this, + _the_tao_operation_signature, + 3, + "onePort", + 7, + this->the_TAO_Put_Proxy_Broker_ + ); + + _tao_call.invoke ( + _tao_Receiver_Put_onePort_exceptiondata, + 1 + ACE_ENV_ARG_PARAMETER + ); + ACE_CHECK; +} + +// TAO_IDL - Generated from +// be/be_visitor_operation/operation_cs.cpp:78 + +void Receiver::Put::allPorts ( + ::CORBA::Short valPort1, + ::CORBA::Short valPort2, + ::CORBA::Short valPort3 + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::Receiver::invalidRequest + )) +{ + if (!this->is_evaluated ()) + { + ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this); + } + + if (this->the_TAO_Put_Proxy_Broker_ == 0) + { + Receiver_Put_setup_collocation (); + } + + ACE_DECLARE_NEW_CORBA_ENV; + 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_Receiver_Put_allPorts_exceptiondata [] = + { + { + "IDL:Receiver/invalidRequest:1.0", + Receiver::invalidRequest::_alloc, + Receiver::_tc_invalidRequest + } + }; + + TAO::Invocation_Adapter _tao_call ( + this, + _the_tao_operation_signature, + 4, + "allPorts", + 8, + this->the_TAO_Put_Proxy_Broker_ + ); + + _tao_call.invoke ( + _tao_Receiver_Put_allPorts_exceptiondata, + 1 + ACE_ENV_ARG_PARAMETER + ); + ACE_CHECK; +} + +Receiver::Put::Put (void) + : the_TAO_Put_Proxy_Broker_ (0) +{ + this->Receiver_Put_setup_collocation (); +} + +void +Receiver::Put::Receiver_Put_setup_collocation () +{ + if (::Receiver__TAO_Put_Proxy_Broker_Factory_function_pointer) + { + this->the_TAO_Put_Proxy_Broker_ = + ::Receiver__TAO_Put_Proxy_Broker_Factory_function_pointer (this); + } +} + +Receiver::Put::~Put (void) +{} + +void +Receiver::Put::_tao_any_destructor (void *_tao_void_pointer) +{ + Put *_tao_tmp_pointer = + static_cast<Put *> (_tao_void_pointer); + CORBA::release (_tao_tmp_pointer); +} + +Receiver::Put_ptr +Receiver::Put::_narrow ( + CORBA::Object_ptr _tao_objref + ACE_ENV_ARG_DECL + ) +{ + return + TAO::Narrow_Utils<Put>::narrow ( + _tao_objref, + "IDL:Receiver/Put:1.0", + Receiver__TAO_Put_Proxy_Broker_Factory_function_pointer + ACE_ENV_ARG_PARAMETER + ); +} + +Receiver::Put_ptr +Receiver::Put::_unchecked_narrow ( + CORBA::Object_ptr _tao_objref + ACE_ENV_ARG_DECL + ) +{ + return + TAO::Narrow_Utils<Put>::unchecked_narrow ( + _tao_objref, + "IDL:Receiver/Put:1.0", + Receiver__TAO_Put_Proxy_Broker_Factory_function_pointer + ACE_ENV_ARG_PARAMETER + ); +} + +Receiver::Put_ptr +Receiver::Put::_duplicate (Put_ptr obj) +{ + if (! CORBA::is_nil (obj)) + { + obj->_add_ref (); + } + + return obj; +} + +void +Receiver::Put::_tao_release (Put_ptr obj) +{ + CORBA::release (obj); +} + +CORBA::Boolean +Receiver::Put::_is_a ( + const char *value + ACE_ENV_ARG_DECL + ) +{ + if ( + !ACE_OS::strcmp ( + value, + "IDL:Receiver/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* Receiver::Put::_interface_repository_id (void) const +{ + return "IDL:Receiver/Put:1.0"; +} + +CORBA::Boolean +Receiver::Put::marshal (TAO_OutputCDR &cdr) +{ + return (cdr << this); +} + +// TAO_IDL - Generated from +// be/be_visitor_typecode/typecode_defn.cpp:295 + +static const CORBA::Long _oc_Receiver_Put[] = +{ + TAO_ENCAP_BYTE_ORDER, // byte order + 21, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x52656365), + ACE_NTOHL (0x69766572), + ACE_NTOHL (0x2f507574), + ACE_NTOHL (0x3a312e30), + ACE_NTOHL (0x0), // repository ID = IDL:Receiver/Put:1.0 + 4, + ACE_NTOHL (0x50757400), // name = Put + }; + +static CORBA::TypeCode _tc_TAO_tc_Receiver_Put ( + CORBA::tk_objref, + sizeof (_oc_Receiver_Put), + (char *) &_oc_Receiver_Put, + 0, + 0 + ); + +namespace Receiver +{ + ::CORBA::TypeCode_ptr const _tc_Put = + &_tc_TAO_tc_Receiver_Put; +} + +// TAO_IDL - Generated from +// be/be_visitor_exception/any_op_cs.cpp:50 + +namespace TAO { +template<> +CORBA::Boolean +Any_Dual_Impl_T<Receiver::invalidRequest>::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 Receiver::invalidRequest &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T<Receiver::invalidRequest>::insert_copy ( + _tao_any, + Receiver::invalidRequest::_tao_any_destructor, + Receiver::_tc_invalidRequest, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + Receiver::invalidRequest *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T<Receiver::invalidRequest>::insert ( + _tao_any, + Receiver::invalidRequest::_tao_any_destructor, + Receiver::_tc_invalidRequest, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + Receiver::invalidRequest *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const Receiver::invalidRequest *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const Receiver::invalidRequest *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T<Receiver::invalidRequest>::extract ( + _tao_any, + Receiver::invalidRequest::_tao_any_destructor, + Receiver::_tc_invalidRequest, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be/be_visitor_interface/any_op_cs.cpp:50 + +namespace TAO { +template<> +CORBA::Boolean +Any_Impl_T<Receiver::Put>::to_object ( + CORBA::Object_ptr &_tao_elem + ) const +{ + _tao_elem = CORBA::Object::_duplicate (this->value_); + return true; +} +} + +// Copying insertion. +void +operator<<= ( + CORBA::Any &_tao_any, + Receiver::Put_ptr _tao_elem + ) +{ + Receiver::Put_ptr _tao_objptr = + Receiver::Put::_duplicate (_tao_elem); + _tao_any <<= &_tao_objptr; +} + +// Non-copying insertion. +void +operator<<= ( + CORBA::Any &_tao_any, + Receiver::Put_ptr *_tao_elem + ) +{ + TAO::Any_Impl_T<Receiver::Put>::insert ( + _tao_any, + Receiver::Put::_tao_any_destructor, + Receiver::_tc_Put, + *_tao_elem + ); +} + +CORBA::Boolean +operator>>= ( + const CORBA::Any &_tao_any, + Receiver::Put_ptr &_tao_elem + ) +{ + return + TAO::Any_Impl_T<Receiver::Put>::extract ( + _tao_any, + Receiver::Put::_tao_any_destructor, + Receiver::_tc_Put, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be/be_visitor_exception/cdr_op_cs.cpp:60 + +CORBA::Boolean operator<< ( + TAO_OutputCDR &strm, + const Receiver::invalidRequest &_tao_aggregate + ) +{ + // Marshal the repository ID. + return (strm << _tao_aggregate._rep_id ()); +} + +CORBA::Boolean operator>> ( + TAO_InputCDR &, + Receiver::invalidRequest& + ) +{ + return true; +} + +// TAO_IDL - Generated from +// be/be_visitor_interface/cdr_op_cs.cpp:63 + +CORBA::Boolean operator<< ( + TAO_OutputCDR &strm, + const Receiver::Put_ptr _tao_objref + ) +{ + CORBA::Object_ptr _tao_corba_obj = _tao_objref; + return (strm << _tao_corba_obj); +} + +CORBA::Boolean operator>> ( + TAO_InputCDR &strm, + Receiver::Put_ptr &_tao_objref + ) +{ + CORBA::Object_var obj; + + if (!(strm >> obj.inout ())) + { + return false; + } + + typedef ::Receiver::Put RHS_SCOPED_NAME; + + // Narrow to the right type. + _tao_objref = + TAO::Narrow_Utils<RHS_SCOPED_NAME>::unchecked_narrow ( + obj.in (), + Receiver__TAO_Put_Proxy_Broker_Factory_function_pointer + ); + + return 1; +} diff --git a/quellcode/demo1/Receiver/ReceiverC.h b/quellcode/demo1/Receiver/ReceiverC.h new file mode 100755 index 0000000..5bf7b62 --- /dev/null +++ b/quellcode/demo1/Receiver/ReceiverC.h @@ -0,0 +1,363 @@ +// -*- 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:154 + +#ifndef _TAO_IDL_RECEIVERC_H_ +#define _TAO_IDL_RECEIVERC_H_ + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/ORB.h" +#include "tao/SystemException.h" +#include "tao/Environment.h" +#include "tao/Object.h" +#include "tao/Objref_VarOut_T.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be/be_visitor_root/root_ch.cpp:62 + +namespace TAO +{ + class Collocation_Proxy_Broker; + + template<typename T> class Narrow_Utils; + template<typename T> class AbstractBase_Narrow_Utils; +} + +// TAO_IDL - Generated from +// be/be_visitor_module/module_ch.cpp:48 + +namespace Receiver +{ + + // TAO_IDL - Generated from + // be/be_visitor_exception/exception_ch.cpp:51 + +#if !defined (_RECEIVER_INVALIDREQUEST_CH_) +#define _RECEIVER_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 + ); + + // TAO_IDL - Generated from + // be/be_visitor_exception/exception_ch.cpp:127 + + virtual CORBA::TypeCode_ptr _type (void) const; + }; + + // TAO_IDL - Generated from + // be/be_visitor_typecode/typecode_decl.cpp:44 + + TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr const _tc_invalidRequest; + +#endif /* end #if !defined */ + + // TAO_IDL - Generated from + // be/be_interface.cpp:599 + +#if !defined (_RECEIVER_PUT__VAR_OUT_CH_) +#define _RECEIVER_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 (_RECEIVER_PUT_CH_) +#define _RECEIVER_PUT_CH_ + + class Put + : public virtual CORBA::Object + { + public: + friend class TAO::Narrow_Utils<Put>; + 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<Put_ptr> (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, + ::Receiver::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, + ::Receiver::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, + ::Receiver::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 Receiver_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:44 + + TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr const _tc_Put; + +// TAO_IDL - Generated from +// be/be_visitor_module/module_ch.cpp:66 + +} // module Receiver + +// Proxy Broker Factory function pointer declarations. + +// TAO_IDL - Generated from +// be/be_visitor_root/root.cpp:132 + +extern +TAO::Collocation_Proxy_Broker * +(*Receiver__TAO_Put_Proxy_Broker_Factory_function_pointer) ( + CORBA::Object_ptr obj + ); + +// TAO_IDL - Generated from +// be/be_visitor_traits.cpp:62 + +// Traits specializations. +namespace TAO +{ + +#if !defined (_RECEIVER_PUT__TRAITS_) +#define _RECEIVER_PUT__TRAITS_ + + template<> + struct Objref_Traits< ::Receiver::Put> + { + static ::Receiver::Put_ptr duplicate ( + ::Receiver::Put_ptr + ); + static void release ( + ::Receiver::Put_ptr + ); + static ::Receiver::Put_ptr nil (void); + static CORBA::Boolean marshal ( + ::Receiver::Put_ptr p, + TAO_OutputCDR & cdr + ); + }; + +#endif /* end #if !defined */ +} + +// TAO_IDL - Generated from +// be/be_visitor_exception/any_op_ch.cpp:52 + + void operator<<= (CORBA::Any &, const Receiver::invalidRequest &); // copying version + void operator<<= (CORBA::Any &, Receiver::invalidRequest*); // noncopying version + CORBA::Boolean operator>>= (const CORBA::Any &, Receiver::invalidRequest *&); // deprecated + CORBA::Boolean operator>>= (const CORBA::Any &, const Receiver::invalidRequest *&); + +// TAO_IDL - Generated from +// be/be_visitor_interface/any_op_ch.cpp:52 + + void operator<<= (CORBA::Any &, Receiver::Put_ptr); // copying + void operator<<= (CORBA::Any &, Receiver::Put_ptr *); // non-copying + CORBA::Boolean operator>>= (const CORBA::Any &, Receiver::Put_ptr &); + +// TAO_IDL - Generated from +// be/be_visitor_exception/cdr_op_ch.cpp:52 + + CORBA::Boolean operator<< (TAO_OutputCDR &, const Receiver::invalidRequest &); + CORBA::Boolean operator>> (TAO_InputCDR &, Receiver::invalidRequest &); + +// TAO_IDL - Generated from +// be/be_visitor_interface/cdr_op_ch.cpp:55 + + CORBA::Boolean operator<< (TAO_OutputCDR &, const Receiver::Put_ptr ); + CORBA::Boolean operator>> (TAO_InputCDR &, Receiver::Put_ptr &); + +// TAO_IDL - Generated from +// be/be_codegen.cpp:940 + +#if defined (__ACE_INLINE__) +#include "ReceiverC.inl" +#endif /* defined INLINE */ + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#endif /* ifndef */ + + diff --git a/quellcode/demo1/Receiver/ReceiverC.inl b/quellcode/demo1/Receiver/ReceiverC.inl new file mode 100755 index 0000000..15453ef --- /dev/null +++ b/quellcode/demo1/Receiver/ReceiverC.inl @@ -0,0 +1,63 @@ +// -*- 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 (_RECEIVER_PUT___CI_) +#define _RECEIVER_PUT___CI_ + +ACE_INLINE +Receiver::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->Receiver_Put_setup_collocation (); +} + +ACE_INLINE +Receiver::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/demo1/Receiver/ReceiverS.cpp b/quellcode/demo1/Receiver/ReceiverS.cpp new file mode 100755 index 0000000..2a0f06a --- /dev/null +++ b/quellcode/demo1/Receiver/ReceiverS.cpp @@ -0,0 +1,852 @@ +// -*- 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:588 + +#ifndef _TAO_IDL_RECEIVERS_CPP_ +#define _TAO_IDL_RECEIVERS_CPP_ + + +#include "ReceiverS.h" +#include "tao/PortableServer/Operation_Table_Dynamic_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/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/Typecode.h" +#include "tao/DynamicC.h" +#include "tao/CDR.h" +#include "tao/operation_details.h" +#include "tao/PortableInterceptor.h" +#include "tao/Basic_Arguments.h" +#include "ace/Dynamic_Service.h" +#include "ace/Malloc_Allocator.h" + +#if defined (__BORLANDC__) +#pragma option -w-rvl -w-rch -w-ccc -w-aus +#endif /* __BORLANDC__ */ + +#if !defined (__ACE_INLINE__) +#include "ReceiverS.inl" +#endif /* !defined INLINE */ + +// TAO_IDL - Generated from +// be/be_visitor_arg_traits.cpp:68 + +// Arg traits specializations. +namespace TAO +{ +} + + +// TAO_IDL - Generated from +// be/be_visitor_arg_traits.cpp:68 + +// Arg traits specializations. +namespace TAO +{ +} + + +static const TAO_operation_db_entry Receiver_Put_operations [] = { + {"connect", &POA_Receiver::Put::connect_skel, 0}, + {"onePort", &POA_Receiver::Put::onePort_skel, 0}, + {"allPorts", &POA_Receiver::Put::allPorts_skel, 0}, + {"_is_a", &POA_Receiver::Put::_is_a_skel, 0}, + {"_non_existent", &POA_Receiver::Put::_non_existent_skel, 0}, + {"_component", &POA_Receiver::Put::_component_skel, 0}, + {"_interface", &POA_Receiver::Put::_interface_skel, 0} +}; + +static const CORBA::Long _tao_Receiver_Put_optable_size = sizeof (ACE_Hash_Map_Entry<const char *, TAO::Operation_Skeletons>) * (21); +static char _tao_Receiver_Put_optable_pool [_tao_Receiver_Put_optable_size]; +static ACE_Static_Allocator_Base _tao_Receiver_Put_allocator (_tao_Receiver_Put_optable_pool, _tao_Receiver_Put_optable_size); +static TAO_Dynamic_Hash_OpTable tao_Receiver_Put_optable ( + Receiver_Put_operations, + 7, + 14, + &_tao_Receiver_Put_allocator + ); + + +// TAO_IDL - Generated from +// be/be_visitor_interface/interface_ss.cpp:853 + +TAO::Collocation_Proxy_Broker * +Receiver__TAO_Put_Proxy_Broker_Factory_function (CORBA::Object_ptr) +{ + return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy +} + +int +Receiver__TAO_Put_Proxy_Broker_Factory_Initializer (size_t) +{ + Receiver__TAO_Put_Proxy_Broker_Factory_function_pointer = + Receiver__TAO_Put_Proxy_Broker_Factory_function; + + return 0; +} + +static int +Receiver__TAO_Put_Proxy_Broker_Stub_Factory_Initializer_Scarecrow = + Receiver__TAO_Put_Proxy_Broker_Factory_Initializer ( + reinterpret_cast<size_t> (Receiver__TAO_Put_Proxy_Broker_Factory_Initializer) + ); + + + +// TAO_IDL - Generated from +// be/be_visitor_interface/interface_ss.cpp:103 + +POA_Receiver::Put::Put (void) + : TAO_ServantBase () +{ + this->optable_ = &tao_Receiver_Put_optable; +} + +POA_Receiver::Put::Put (const Put& rhs) + : TAO_Abstract_ServantBase (rhs), + TAO_ServantBase (rhs) +{ +} + +POA_Receiver::Put::~Put (void) +{ +} +namespace POA_Receiver +{ + + + // 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_Receiver::Put * servant) + : servant_ (servant) + { + } + + virtual void execute (ACE_ENV_SINGLE_ARG_DECL) + { + this->servant_->connect ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + } + + private: + POA_Receiver::Put * const servant_; + }; + +} + + +// TAO_IDL - Generated from +// be/be_visitor_operation/operation_ss.cpp:192 + +void POA_Receiver::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[] = + { + Receiver::_tc_invalidRequest + }; + static size_t 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_Receiver::Put * const impl = + static_cast<POA_Receiver::Put *> (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_Receiver +{ + + + // 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_Receiver::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); + + } + + private: + POA_Receiver::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:192 + +void POA_Receiver::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[] = + { + Receiver::_tc_invalidRequest + }; + static size_t 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_Receiver::Put * const impl = + static_cast<POA_Receiver::Put *> (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_Receiver +{ + + + // 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_Receiver::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); + + } + + private: + POA_Receiver::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:192 + +void POA_Receiver::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[] = + { + Receiver::_tc_invalidRequest + }; + static size_t 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_Receiver::Put * const impl = + static_cast<POA_Receiver::Put *> (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; + +} + +// TAO_IDL - Generated from +// be/be_visitor_interface/interface_ss.cpp:169 + +namespace POA_Receiver +{ + + + // 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_Receiver::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); + + } + + private: + POA_Receiver::Put * const servant_; + TAO_Operation_Details const * const operation_details_; + TAO::Argument * const * const args_; + }; + +} +void POA_Receiver::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 size_t 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_Receiver::Put * const impl = + static_cast<POA_Receiver::Put *> (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_Receiver +{ + + + // 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_Receiver::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); + + } + + private: + POA_Receiver::Put * const servant_; + TAO_Operation_Details const * const operation_details_; + TAO::Argument * const * const args_; + }; + +} +void POA_Receiver::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 size_t 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_Receiver::Put * const impl = + static_cast<POA_Receiver::Put *> (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; + +} + + + +// TAO_IDL - Generated from +// be/be_visitor_interface/interface_ss.cpp:393 + + + +void POA_Receiver::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<TAO_IFR_Client_Adapter>::instance ( + TAO_ORB_Core::ifr_client_adapter_name () + ); + + if (_tao_adapter == 0) + { + ACE_THROW (CORBA::INTF_REPOS (CORBA::OMGVMCID | 1, + CORBA::COMPLETED_NO)); + } + + POA_Receiver::Put * const impl = + static_cast<POA_Receiver::Put *> (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_Receiver +{ + + + // 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_Receiver::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); + + } + + private: + POA_Receiver::Put * const servant_; + TAO_Operation_Details const * const operation_details_; + TAO::Argument * const * const args_; + }; + +} +void POA_Receiver::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 size_t 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_Receiver::Put * const impl = + static_cast<POA_Receiver::Put *> (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_Receiver::Put::_is_a ( + const char* value + ACE_ENV_ARG_DECL_NOT_USED + ) +{ + return + ( + !ACE_OS::strcmp ( + value, + "IDL:Receiver/Put:1.0" + ) || + !ACE_OS::strcmp ( + value, + "IDL:omg.org/CORBA/Object:1.0" + ) + ); +} + +const char* POA_Receiver::Put::_interface_repository_id (void) const +{ + return "IDL:Receiver/Put:1.0"; +} + +// TAO_IDL - Generated from +// be/be_visitor_interface/interface_ss.cpp:794 + +void POA_Receiver::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:745 + +Receiver::Put * +POA_Receiver::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 ::Receiver::Put STUB_SCOPED_NAME; + return + TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow ( + obj.in (), + Receiver__TAO_Put_Proxy_Broker_Factory_function_pointer + ); +} + +#endif /* ifndef */ + diff --git a/quellcode/demo1/Receiver/ReceiverS.h b/quellcode/demo1/Receiver/ReceiverS.h new file mode 100755 index 0000000..d893c66 --- /dev/null +++ b/quellcode/demo1/Receiver/ReceiverS.h @@ -0,0 +1,209 @@ +// -*- 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:380 + +#ifndef _TAO_IDL_RECEIVERS_H_ +#define _TAO_IDL_RECEIVERS_H_ + + +#include "ReceiverC.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" + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be/be_visitor_module/module_sh.cpp:49 + +namespace POA_Receiver +{ + + + // 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 ::Receiver::Put _stub_type; + typedef ::Receiver::Put_ptr _stub_ptr_type; + typedef ::Receiver::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 + ); + + virtual void _dispatch ( + TAO_ServerRequest &req, + void * servant_upcall + ACE_ENV_ARG_DECL + ); + + ::Receiver::Put *_this ( + ACE_ENV_SINGLE_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, + ::Receiver::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, + ::Receiver::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, + ::Receiver::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_module/module_sh.cpp:80 + +} // module Receiver + +// TAO_IDL - Generated from +// be/be_codegen.cpp:976 + +#include "ReceiverS_T.h" + +#if defined (__ACE_INLINE__) +#include "ReceiverS.inl" +#endif /* defined INLINE */ + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#endif /* ifndef */ + diff --git a/quellcode/demo1/Receiver/ReceiverS.inl b/quellcode/demo1/Receiver/ReceiverS.inl new file mode 100755 index 0000000..c944d80 --- /dev/null +++ b/quellcode/demo1/Receiver/ReceiverS.inl @@ -0,0 +1,27 @@ +// -*- 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/demo1/Receiver/ReceiverS_T.cpp b/quellcode/demo1/Receiver/ReceiverS_T.cpp new file mode 100755 index 0000000..40269df --- /dev/null +++ b/quellcode/demo1/Receiver/ReceiverS_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:662 + +#ifndef _TAO_IDL_RECEIVERS_T_CPP_ +#define _TAO_IDL_RECEIVERS_T_CPP_ + +#include "ReceiverS_T.h" + +#if !defined (__ACE_INLINE__) +#include "ReceiverS_T.inl" +#endif /* !defined INLINE */ + + +#endif /* ifndef */ diff --git a/quellcode/demo1/Receiver/ReceiverS_T.h b/quellcode/demo1/Receiver/ReceiverS_T.h new file mode 100755 index 0000000..4b8fe5a --- /dev/null +++ b/quellcode/demo1/Receiver/ReceiverS_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:525 + +#ifndef _TAO_IDL_RECEIVERS_T_H_ +#define _TAO_IDL_RECEIVERS_T_H_ + + + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + + +// TAO_IDL - Generated from +// be/be_visitor_root/root_sth.cpp:116 + +namespace POA_Receiver +{ + + // 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 T> + 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, + ::Receiver::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, + ::Receiver::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, + ::Receiver::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 Receiver + +// TAO_IDL - Generated from +// be/be_codegen.cpp:1073 + +#if defined (__ACE_INLINE__) +#include "ReceiverS_T.inl" +#endif /* defined INLINE */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "ReceiverS_T.cpp" +#endif /* defined REQUIRED SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("ReceiverS_T.cpp") +#endif /* defined REQUIRED PRAGMA */ + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#endif /* ifndef */ + diff --git a/quellcode/demo1/Receiver/ReceiverS_T.inl b/quellcode/demo1/Receiver/ReceiverS_T.inl new file mode 100755 index 0000000..3ce8735 --- /dev/null +++ b/quellcode/demo1/Receiver/ReceiverS_T.inl @@ -0,0 +1,177 @@ +// -*- 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 <class T> ACE_INLINE +POA_Receiver::Put_tie<T>::Put_tie (T &t) + : ptr_ (&t), + poa_ (PortableServer::POA::_nil ()), + rel_ (0) +{} + +template <class T> ACE_INLINE +POA_Receiver::Put_tie<T>::Put_tie (T &t, PortableServer::POA_ptr poa) + : ptr_ (&t), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (0) +{} + +template <class T> ACE_INLINE +POA_Receiver::Put_tie<T>::Put_tie (T *tp, CORBA::Boolean release) + : ptr_ (tp), + poa_ (PortableServer::POA::_nil ()), + rel_ (release) +{} + +template <class T> ACE_INLINE +POA_Receiver::Put_tie<T>::Put_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release) + : ptr_ (tp), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (release) +{} + +template <class T> ACE_INLINE +POA_Receiver::Put_tie<T>::~Put_tie (void) +{ + if (this->rel_) + { + delete this->ptr_; + } +} + +template <class T> ACE_INLINE T * +POA_Receiver::Put_tie<T>::_tied_object (void) +{ + return this->ptr_; +} + +template <class T> ACE_INLINE void +POA_Receiver::Put_tie<T>::_tied_object (T &obj) +{ + if (this->rel_) + { + delete this->ptr_; + } + + this->ptr_ = &obj; + this->rel_ = 0; +} + +template <class T> ACE_INLINE void +POA_Receiver::Put_tie<T>::_tied_object (T *obj, CORBA::Boolean release) +{ + if (this->rel_) + { + delete this->ptr_; + } + + this->ptr_ = obj; + this->rel_ = release; +} + +template <class T> ACE_INLINE CORBA::Boolean +POA_Receiver::Put_tie<T>::_is_owner (void) +{ + return this->rel_; +} + +template <class T> ACE_INLINE void +POA_Receiver::Put_tie<T>::_is_owner (CORBA::Boolean b) +{ + this->rel_ = b; +} + +template <class T> ACE_INLINE PortableServer::POA_ptr +POA_Receiver::Put_tie<T>::_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:68 + +template <class T> ACE_INLINE +void POA_Receiver::Put_tie<T>::connect ( + + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::Receiver::invalidRequest + )) +{ + this->ptr_->connect ( + ); +} + +// TAO_IDL - Generated from +// be/be_visitor_operation/tie_si.cpp:68 + +template <class T> ACE_INLINE +void POA_Receiver::Put_tie<T>::onePort ( + ::CORBA::Short portNo, + ::CORBA::Short value + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::Receiver::invalidRequest + )) +{ + this->ptr_->onePort ( + portNo, + value + ); +} + +// TAO_IDL - Generated from +// be/be_visitor_operation/tie_si.cpp:68 + +template <class T> ACE_INLINE +void POA_Receiver::Put_tie<T>::allPorts ( + ::CORBA::Short valPort1, + ::CORBA::Short valPort2, + ::CORBA::Short valPort3 + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::Receiver::invalidRequest + )) +{ + this->ptr_->allPorts ( + valPort1, + valPort2, + valPort3 + ); +} + diff --git a/quellcode/demo1/Receiver/Receiver_i.cpp b/quellcode/demo1/Receiver/Receiver_i.cpp new file mode 100755 index 0000000..3cd094c --- /dev/null +++ b/quellcode/demo1/Receiver/Receiver_i.cpp @@ -0,0 +1,92 @@ +// -*- 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 "Receiver_i.h" + +// Implementation skeleton constructor +Receiver_Put_i::Receiver_Put_i (void) +{ + +} + +// Implementation skeleton destructor +Receiver_Put_i::~Receiver_Put_i (void) +{ +} + +void Receiver_Put_i::connect ( + + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Receiver::invalidRequest + )) +{ + // Add your implementation here + std::cout<<"connecting... "; + cpx = new CPX(); + std::cout<<"ok"<<std::endl; +} + +void Receiver_Put_i::onePort ( + ::CORBA::Short portNo, + ::CORBA::Short value + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Receiver::invalidRequest + )) +{ + // Add your implementation here + std::cout<<"set: "<<portNo<<" - "<<value<<std::endl; + cpx->set(portNo, value); +} + +void Receiver_Put_i::allPorts ( + ::CORBA::Short valPort1, + ::CORBA::Short valPort2, + ::CORBA::Short valPort3 + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Receiver::invalidRequest + )) +{ + // Add your implementation here + + std::cout<<"set: "<<valPort1<<" - "<<valPort2<<" - "<<valPort3<<std::endl; + + cpx->set(1, valPort1); + cpx->set(2, valPort2); + cpx->set(3, valPort3); + +} + + diff --git a/quellcode/demo1/Receiver/Receiver_i.h b/quellcode/demo1/Receiver/Receiver_i.h new file mode 100755 index 0000000..a9f6230 --- /dev/null +++ b/quellcode/demo1/Receiver/Receiver_i.h @@ -0,0 +1,89 @@ +// -*- 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 "ReceiverS.h" + +#include "cpx.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class Receiver_Put_i + : public virtual POA_Receiver::Put +{ +private: + + CPX* cpx; + +public: + // Constructor + Receiver_Put_i (void); + + // Destructor + virtual ~Receiver_Put_i (void); + + virtual + void connect ( + + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Receiver::invalidRequest + )); + + virtual + void onePort ( + ::CORBA::Short portNo, + ::CORBA::Short value + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Receiver::invalidRequest + )); + + virtual + void allPorts ( + ::CORBA::Short valPort1, + ::CORBA::Short valPort2, + ::CORBA::Short valPort3 + ) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Receiver::invalidRequest + )); +}; + + +#endif /* BENCHI_H_ */ + diff --git a/quellcode/demo1/Receiver/cpx.cpp b/quellcode/demo1/Receiver/cpx.cpp new file mode 100755 index 0000000..eebdc65 --- /dev/null +++ b/quellcode/demo1/Receiver/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"<<std::endl; + return(-1); + } + std::cout<<"CPX_Output_1 opened\n"; + + /* setup signal on interrupt */ + param.signal = 1001; + param.pid = getpid(); + + if (ioctl(fd_out, CPX_DIO_IOCTL_ADD_SIG, (void *) ¶m) == -1) { + std::cout<<"signal map failed\n"; + close(fd_out); + return(-1); + } else std::cout<<"signal map ok\n"; + + mapped_out = (u_char*) mmap (NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd_out, 0); + if (mapped_out == MAP_FAILED) { + std::cout<<"PBCIO: mmap failed\n"; + close (fd_out); + return(-2); + } + std::cout<<"mmap ok\n"; + + DOUT = (u_char *) mapped_out; + DIN = (u_char *) mapped_out; + + return 0; +} + +short CPX::get(short port){ + unsigned char value = 0; + + switch(port){ + case 1: + value = DIN[PORT1_IN]; + break; + case 2: + value = DIN[PORT1_IN]; + break; + case 3: + value = DIN[PORT1_IN]; + break; + default: + std::cout<<"portNo: "<<port<<" incorrect\n"; + } + + return (short) value; +} + +void CPX::set(short port, short value){ + switch(port){ + case 1: + DOUT[PORT1_OUT] = value; + break; + case 2: + DOUT[PORT2_OUT] = value; + break; + case 3: + DOUT[PORT3_OUT] = value; + break; + default: + std::cout<<"portNo: "<<port<<" incorrect\n"; + } +} diff --git a/quellcode/demo1/Receiver/cpx.h b/quellcode/demo1/Receiver/cpx.h new file mode 100755 index 0000000..7b4545a --- /dev/null +++ b/quellcode/demo1/Receiver/cpx.h @@ -0,0 +1,73 @@ +/** + * + * \file cpx.h + * \brief read and write DIO + * + * \author Manuel Traut + * \version 2006-10-06 + * + */ + +#ifndef CPX_H +#define CPX_H + +#include <iostream> + +#include <sys/mman.h> +#include <sys/ioctl.h> +#include <fcntl.h> +#include <unistd.h> + +#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 |
