diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-03-21 22:16:06 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-03-21 22:16:06 +0000 |
commit | acc8c468587dc93336b0f31ea19a226e88ae3cb7 (patch) | |
tree | 9c2cf25de119917df8bc34bafed8f194d47580b4 | |
parent | 990dceee7b95cb87c667e38845e52caa8d7a773f (diff) | |
download | ATCD-acc8c468587dc93336b0f31ea19a226e88ae3cb7.tar.gz |
*** empty log message ***
21 files changed, 832 insertions, 44 deletions
diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index 52d3828e031..32810a1ccba 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,3 +1,39 @@ +Fri Mar 21 15:51:57 2003 Nanbor Wang <nanbor@cs.wustl.edu> + + * docs/new_components.html: Revised naming convention for + user-defined component executor impl IDL. + + * bin/generate_component_mpc.pl: Added an option for adding + user-defined component executor impl IDL automatically, + according the the naming convention. Fixed the dependencies to + "dependent" libraries. + + * examples/handcrafted/Display/RateGen/RateGen.csd: + * examples/handcrafted/Display/RateGen/RateGen.ssd: Simplified the + XML descriptors. + + * examples/handcrafted/Display/RateGen/RateGen.mpc: + * examples/handcrafted/Display/RateGen/RateGenEI.idl: + * examples/handcrafted/Display/RateGen/RateGen_exec.h: Fixed + dependencies and naming convention. + + * examples/handcrafted/Display/GPS/GPS.csd: + * examples/handcrafted/Display/GPS/GPS.mpc: + * examples/handcrafted/Display/GPS/GPS.ssd: + * examples/handcrafted/Display/GPS/GPSEI.idl: + * examples/handcrafted/Display/GPS/GPS_exec.cpp: + * examples/handcrafted/Display/GPS/GPS_exec.h: + + * examples/handcrafted/Display/NavDisplay/NavDisplay.csd: + * examples/handcrafted/Display/NavDisplay/NavDisplay.mpc: + * examples/handcrafted/Display/NavDisplay/NavDisplay.ssd: + * examples/handcrafted/Display/NavDisplay/NavDisplayEI.idl: + * examples/handcrafted/Display/NavDisplay/NavDisplay_exec.cpp: + * examples/handcrafted/Display/NavDisplay/NavDisplay_exec.h: + + * examples/handcrafted/Display/CIAO_Installation_Data.ini: Added + component implementaions for GPS and NavDisplay. + Thu Mar 20 21:50:07 2003 Nanbor Wang <nanbor@cs.wustl.edu> * ciao/ComponentInstallation_Impl.cpp: Added a more comprehensive diff --git a/TAO/CIAO/bin/generate_component_mpc.pl b/TAO/CIAO/bin/generate_component_mpc.pl index d586eea49a1..254a76d91ae 100755 --- a/TAO/CIAO/bin/generate_component_mpc.pl +++ b/TAO/CIAO/bin/generate_component_mpc.pl @@ -12,12 +12,13 @@ use Getopt::Std; $flags = join (" ", @ARGV); -if (!getopts ('dcnp:l:h') || $opt_h) { +if (!getopts ('dcnip:l:h') || $opt_h) { print "generate_component_mpc.pl [-d] [-h] component_name\n"; print "\n"; print " -d Turn on debug mode\n"; print " -p Dependent component name\n"; print " -l Dependent component path\n"; + print " -i Use an executor definition IDL file\n"; print " -n Supress component make/project\n"; print " -c Create a client makefile\n"; print "\n"; @@ -49,7 +50,7 @@ $UCOM_NAME = uc $com_name; if (defined $opt_p) { $stub_depend = "depends += $opt_p".'_stub'; $svnt_depend = "$opt_p".'_svnt'; - $lib_depend = "$opt_p".'_stub'; + $lib_depend = "$opt_p".'_stub '."$opt_p".'_svnt'; } if (defined $opt_l) { @@ -59,7 +60,7 @@ if (defined $opt_l) { if (defined $opt_c) { $client_def = ' -project (client) : ciao_client { +project ('."$com_name".'_client) : ciao_client { exename = client depends += '."$com_name".'_stub @@ -73,22 +74,30 @@ project (client) : ciao_client { '; } +if (defined $opt_i) { + $exec_impl_idl = "$com_name".'EI.idl'; + $exec_impl_cpp = "$com_name".'EIC.cpp'; +} + + if (! defined $opt_n) { $component_def = ' project('."$com_name".'_exec) : ciao_server { depends += '."$com_name".'_svnt sharedname = '."$com_name".'_exec - libs += '."$com_name".'_stub '."$lib_depend $com_name".'_svnt'." + libs += '."$com_name".'_stub '."$com_name".'_svnt'." $lib_depend $lib_paths".' idlflags += -Wb,export_macro='."$UCOM_NAME".'_EXEC_Export -Wb,export_include='."$com_name".'_exec_export.h dllflags = '."$UCOM_NAME".'_EXEC_BUILD_DLL - IDL_Files { + IDL_Files {'." + $exec_impl_idl".' } - Source_Files { - '."$com_name".'_exec.cpp + Source_Files {'." + $exec_impl_cpp + $com_name".'_exec.cpp } } '; diff --git a/TAO/CIAO/docs/new_components.html b/TAO/CIAO/docs/new_components.html index a67b316fd38..db10fca2103 100644 --- a/TAO/CIAO/docs/new_components.html +++ b/TAO/CIAO/docs/new_components.html @@ -111,10 +111,12 @@ to deal with manually... file is currently being generated manually thou a template should really be generated by CIAO's CIDL compiler.<p> - <li><code><b>Orc</b>.mpc</code> - Makefile Project Creator - definition file. We need a perl script to generate a minimal - MPC definition so people can use it to implement the simplest - component implementation outlined in this file.<p> + <li><font color="red"><code><b>Orc</b>.mpc</code></font> - Makefile + Project Creator definition file. There is a perl script to + generate a minimal MPC definition at + <code>$(CIAO_ROOT)/bin/generate_component_mpc.pl</code> so + people can use it to implement the simplest component + implementation outlined in this file.<p> </ol> @@ -122,6 +124,6 @@ to deal with manually... <hr> <address></address> <!-- hhmts start --> -Last modified: Mon Mar 10 16:43:56 Central Standard Time 2003 +Last modified: Fri Mar 21 16:06:48 Central Standard Time 2003 <!-- hhmts end --> </body> </html> diff --git a/TAO/CIAO/examples/handcrafted/Display/CIAO_Installation_Data.ini b/TAO/CIAO/examples/handcrafted/Display/CIAO_Installation_Data.ini index 1a923cb9662..ff5f1f63745 100644 --- a/TAO/CIAO/examples/handcrafted/Display/CIAO_Installation_Data.ini +++ b/TAO/CIAO/examples/handcrafted/Display/CIAO_Installation_Data.ini @@ -1,3 +1,7 @@ [ComponentInstallation] DCE:82C2B032-37F0-4315-A59F-7020D3264E4D=RateGen_exec DCE:93D254CF-9538-44e8-BB98-AABCD134ADD3=RateGen_svnt +DCE:3148F760-F2ED-4204-A775-6B972C10E8CB=GPS_exec +DCE:75309233-0E0A-4cfb-B186-3E99F69B1D40=GPS_svnt +DCE:8E6C468D-A39F-46b4-962B-265F1AA8D538=NavDisplay_exec +DCE:CDC06FCA-50FC-43ca-8ECC-BEFBD33FEE78=NavDisplay_svnt diff --git a/TAO/CIAO/examples/handcrafted/Display/GPS/GPS.csd b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS.csd new file mode 100644 index 00000000000..a6e17406f41 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS.csd @@ -0,0 +1,63 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- XML doesn't really support the following $(CIAO_ROOT) syntax :) --> +<!DOCTYPE softpkg SYSTEM "$(CIAO_ROOT)/docs/XML/softpkg.dtd"> + +<!-- GPS's Software Package Descriptor --> +<!-- This file describes various GPS executor --> +<!-- implementations. --> + + +<softpkg name="CIAO-GPS" version="1.0"> + <pkgtype>CORBA Component</pkgtype> + <title>Rate Generator</title> + <author> + <company>Washington University in St. Louis</company> + <webpage href="http://www.cs.wustl.edu/~doc/"/> + </author> + <description>A GPS executor implementation.</description> + <license href="http://www.cs.wustl.edu/~schmidt/ACE-copying.html"/> + <idl id="IDL:HUDisplay/GPS:1.0" homeid="IDL:HUDisplay/GPSHome:1.0"> + <fileinarchive name="GPS.idl"/> + </idl> + + <!-- We don't need a property file for this example. However, --> + <!-- what to do with this element? Cache it in ComponentInstallation? --> + <!-- A better question maybe, when do we actually read the file and --> + <!-- build the attributes defined in the file? By Assembly perhaps? --> + <!-- Notice that this property file applies to the implementation itself. --> + <!-- Whatever that means. --> +<!-- <propertyfile> --> +<!-- <fileinarchive name="empty.cpf"/> --> +<!-- </propertyfile> --> + + <descriptor type="CORBA Component"> + <fileinarchive name="GPS.ccd"/> + </descriptor> + + <implementation id="DCE:3148F760-F2ED-4204-A775-6B972C10E8CB"> + + <!-- CIAO extension --> + <dependency type="CIAODLL"> + <softpkgref> + <!-- .ssd stands for Servant Software Descriptors which is a CIAO extension --> + <fileinarchive name="GPS.ssd"/> + <implref idref="DCE:75309233-0E0A-4cfb-B186-3E99F69B1D40"/> + </softpkgref> + </dependency> + + <!-- What happens when one define descriptors for both softpkg and --> + <!-- implementations? --> + + <code type="DLL"> + <!-- No need to specify extension below since ACE takes care of that, --> + <fileinarchive name="GPS_exec"/> + <entrypoint>createGPSHome_Impl</entrypoint> + </code> + + </implementation> + + <!-- Let's add more implementation description later when we try to --> + <!-- compile this stuff on, say, Solaris and Linux. --> + +</softpkg>
\ No newline at end of file diff --git a/TAO/CIAO/examples/handcrafted/Display/GPS/GPS.mpc b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS.mpc index 45ec6323f66..2826b869621 100644 --- a/TAO/CIAO/examples/handcrafted/Display/GPS/GPS.mpc +++ b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS.mpc @@ -1,5 +1,5 @@ // $Id$ -// This file is generated with "generate_component_mpc.pl -l .. -p HUDisplay GPS" +// This file is generated with "generate_component_mpc.pl -l .. -p HUDisplay -c -i GPS" project(GPS_stub): ciao_client { depends += HUDisplay_stub @@ -19,7 +19,7 @@ project(GPS_stub): ciao_client { project(GPS_svnt) : ciao_server { depends += HUDisplay_svnt GPS_stub sharedname = GPS_svnt - libs += GPS_stub HUDisplay_stub + libs += GPS_stub HUDisplay_stub HUDisplay_svnt libpaths += .. idlflags += -Wb,export_macro=GPS_SVNT_Export -Wb,export_include=GPS_svnt_export.h dllflags = GPS_SVNT_BUILD_DLL @@ -39,18 +39,32 @@ project(GPS_svnt) : ciao_server { project(GPS_exec) : ciao_server { depends += GPS_svnt sharedname = GPS_exec - libs += GPS_stub HUDisplay_stub GPS_svnt + libs += GPS_stub GPS_svnt HUDisplay_stub HUDisplay_svnt libpaths += .. idlflags += -Wb,export_macro=GPS_EXEC_Export -Wb,export_include=GPS_exec_export.h dllflags = GPS_EXEC_BUILD_DLL IDL_Files { + GPSEI.idl } Source_Files { + GPSEIC.cpp GPS_exec.cpp } } +project (GPS_client) : ciao_client { + exename = client + depends += GPS_stub + + IDL_Files { + } + + Source_Files { + client.cpp + } +} + diff --git a/TAO/CIAO/examples/handcrafted/Display/GPS/GPS.ssd b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS.ssd new file mode 100644 index 00000000000..b68e7c62648 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS.ssd @@ -0,0 +1,47 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- XML doesn't really support the following $(CIAO_ROOT) syntax :) --> +<!DOCTYPE softpkg SYSTEM "$(CIAO_ROOT)/docs/XML/softpkg.dtd"> + +<!-- GPS's Servant Software Descriptor --> +<!-- This file describes various GPS servant --> +<!-- implementations. --> + + +<softpkg name="CIAO-GPS-Servant" version="1.0"> + <pkgtype>CIAO Servant</pkgtype> + <title>HUDisplay::GPS Servants</title> + <author> + <company>Washington University in St. Louis</company> + <webpage href="http://www.cs.wustl.edu/~doc/"/> + </author> + <description>A GPS servant implementation.</description> + <license href="http://www.cs.wustl.edu/~schmidt/ACE-copying.html"/> + <idl id="IDL:HUDisplay/GPS:1.0" homeid="IDL:HUDisplay/GPSHome:1.0"> + <fileinarchive name="GPS.idl"/> + </idl> + + <!-- Duplicate information. We should use the copy in GPS.csd --> + <!-- So, do we really need this one? --> + <descriptor type="CORBA Component"> + <fileinarchive name="GPS.ccd"/> + </descriptor> + + <implementation id="DCE:75309233-0E0A-4cfb-B186-3E99F69B1D40"> + + <dependency type="ORB"> + <name>TAO</name> + </dependency> + + <code> + <!-- No need to specify extension below since ACE takes care of that, --> + <fileinarchive name="GPS_svnt"/> + <entrypoint>createGPSHome_Servant</entrypoint> + </code> + + </implementation> + + <!-- Let's add more implementation description later when we try to --> + <!-- compile this stuff on, say, Solaris and Linux. --> + +</softpkg>
\ No newline at end of file diff --git a/TAO/CIAO/examples/handcrafted/Display/GPS/GPSEI.idl b/TAO/CIAO/examples/handcrafted/Display/GPS/GPSEI.idl new file mode 100644 index 00000000000..d7604931f58 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/GPS/GPSEI.idl @@ -0,0 +1,33 @@ +// $Id$ + +/** + * @file GPSEI.idl + * + * Definition of the GPS component implementation. + * + * @author Nanbor Wang <nanbor@cs.wustl.edu> + */ + +#ifndef GPSEI_IDL +#define GPSEI_IDL + +#include "GPSE.idl" + +module HUDisplay +{ + /** + * @interface GPS_Exec + * + * The actually GPS executor inherits from both CCM_GPS and + * CCM_position interfaces as a monolithic implementation. + */ + local interface GPS_Exec : + CCM_GPS, + CCM_position, + Components::SessionComponent + { + }; + +}; + +#endif /* GPSEI_IDL */ diff --git a/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_exec.cpp b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_exec.cpp new file mode 100644 index 00000000000..60f3429f872 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_exec.cpp @@ -0,0 +1,120 @@ +// $Id$ + +#include "GPS_exec.h" + +/// Default constructor. +MyImpl::GPS_exec_impl::GPS_exec_impl () +{ + ACE_OS::srand ((u_int) ACE_OS::time ()); + this->position_ = ACE_OS::rand (); +} + +/// Default destructor. +MyImpl::GPS_exec_impl::~GPS_exec_impl () +{ +} + +// Operations from HUDisplay::GPS + +HUDisplay::CCM_position_ptr +MyImpl::GPS_exec_impl::get_MyLocation (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return HUDisplay::CCM_position::_duplicate (this); +} + +void +MyImpl::GPS_exec_impl::push_Refresh (HUDisplay::tick_ptr ev + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // Refresh position + this->position_ += ACE_OS::rand () % 64 - 32; + + // Nitify others + HUDisplay::tick_var event = new OBV_HUDisplay::tick; + + this->context_->push_Ready (event + ACE_ENV_ARG_PARAMETER); +} + +// Operations from HUDisplay::position + +CORBA::Long +MyImpl::GPS_exec_impl::pos (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return this->position_; +} + +// Operations from Components::SessionComponent +void +MyImpl::GPS_exec_impl::set_session_context (Components::SessionContext_ptr ctx + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::GPS_exec_impl::set_session_context\n")); + + this->context_ = + HUDisplay::CCM_GPS_Context::_narrow (ctx + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (this->context_.in ())) + ACE_THROW (CORBA::INTERNAL ()); + // Urm, we actually discard exceptions thown from this operation. +} + +void +MyImpl::GPS_exec_impl::ccm_activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::GPS_exec_impl::ccm_activate\n")); +} + +void +MyImpl::GPS_exec_impl::ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::GPS_exec_impl::ccm_passivate\n")); +} + +void +MyImpl::GPS_exec_impl::ccm_remove (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::GPS_exec_impl::ccm_remove\n")); +} + +/// Default ctor. +MyImpl::GPSHome_exec_impl::GPSHome_exec_impl () +{ +} + +/// Default dtor. +MyImpl::GPSHome_exec_impl::~GPSHome_exec_impl () +{ +} + +// Explicit home operations. + +// Implicit home operations. + +::Components::EnterpriseComponent_ptr +MyImpl::GPSHome_exec_impl::create (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CreateFailure)) +{ + return new MyImpl::GPS_exec_impl; +} + + +extern "C" GPS_EXEC_Export ::Components::HomeExecutorBase_ptr +createGPSHome_Impl (void) +{ + return new MyImpl::GPSHome_exec_impl; +} diff --git a/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_exec.h b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_exec.h new file mode 100644 index 00000000000..964ed39743c --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_exec.h @@ -0,0 +1,113 @@ +// $Id$ + +/** + * @file GPS_exec.h + * + * Header file for the actual GPS and GPSHome component + * implementations. + * + * @author Nanbor Wang <nanbor@cse.wustl.edu> + */ + +#ifndef GPS_EXEC_H +#define GPS_EXEC_H + +#include "GPSEIC.h" +#include "tao/LocalObject.h" + +namespace MyImpl +{ + /** + * @class GPS_exec_impl + * + * RateGen executor implementation class. + */ + class GPS_EXEC_Export GPS_exec_impl : + public virtual HUDisplay::GPS_Exec, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default constructor. + GPS_exec_impl (); + + /// Default destructor. + ~GPS_exec_impl (); + + // Operations from HUDisplay::GPS + + virtual HUDisplay::CCM_position_ptr + get_MyLocation (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + push_Refresh (HUDisplay::tick_ptr ev + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations from HUDisplay::position + + virtual CORBA::Long + pos (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations from Components::SessionComponent + + virtual void + set_session_context (Components::SessionContext_ptr ctx + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + protected: + CORBA::Long position_; + + /// Copmponent specific context + HUDisplay::CCM_GPS_Context_var context_; + }; + + /** + * @class GPSHome_exec_impl + * + * GPS home executor implementation class. + */ + class GPS_EXEC_Export GPSHome_exec_impl : + public virtual HUDisplay::CCM_GPSHome, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default ctor. + GPSHome_exec_impl (); + + /// Default dtor. + ~GPSHome_exec_impl (); + + // Explicit home operations. + + // Implicit home operations. + + virtual ::Components::EnterpriseComponent_ptr + create (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CreateFailure)); + }; + +} + +extern "C" GPS_EXEC_Export ::Components::HomeExecutorBase_ptr +createGPSHome_Impl (void); + +#endif /* GPS_EXEC_H */ diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay.csd b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay.csd new file mode 100644 index 00000000000..4d32cf58851 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay.csd @@ -0,0 +1,63 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- XML doesn't really support the following $(CIAO_ROOT) syntax :) --> +<!DOCTYPE softpkg SYSTEM "$(CIAO_ROOT)/docs/XML/softpkg.dtd"> + +<!-- NavDisplay's Software Package Descriptor --> +<!-- This file describes various NavDisplay executor --> +<!-- implementations. --> + + +<softpkg name="CIAO-NavDisplay" version="1.0"> + <pkgtype>CORBA Component</pkgtype> + <title>Rate Generator</title> + <author> + <company>Washington University in St. Louis</company> + <webpage href="http://www.cs.wustl.edu/~doc/"/> + </author> + <description>A NavDisplay executor implementation.</description> + <license href="http://www.cs.wustl.edu/~schmidt/ACE-copying.html"/> + <idl id="IDL:HUDisplay/NavDisplay:1.0" homeid="IDL:HUDisplay/NavDisplayHome:1.0"> + <fileinarchive name="NavDisplay.idl"/> + </idl> + + <!-- We don't need a property file for this example. However, --> + <!-- what to do with this element? Cache it in ComponentInstallation? --> + <!-- A better question maybe, when do we actually read the file and --> + <!-- build the attributes defined in the file? By Assembly perhaps? --> + <!-- Notice that this property file applies to the implementation itself. --> + <!-- Whatever that means. --> +<!-- <propertyfile> --> +<!-- <fileinarchive name="empty.cpf"/> --> +<!-- </propertyfile> --> + + <descriptor type="CORBA Component"> + <fileinarchive name="NavDisplay.ccd"/> + </descriptor> + + <implementation id="DCE:8E6C468D-A39F-46b4-962B-265F1AA8D538"> + + <!-- CIAO extension --> + <dependency type="CIAODLL"> + <softpkgref> + <!-- .ssd stands for Servant Software Descriptors which is a CIAO extension --> + <fileinarchive name="NavDisplay.ssd"/> + <implref idref="DCE:CDC06FCA-50FC-43ca-8ECC-BEFBD33FEE78"/> + </softpkgref> + </dependency> + + <!-- What happens when one define descriptors for both softpkg and --> + <!-- implementations? --> + + <code type="DLL"> + <!-- No need to specify extension below since ACE takes care of that, --> + <fileinarchive name="NavDisplay_exec"/> + <entrypoint>createNavDisplayHome_Impl</entrypoint> + </code> + + </implementation> + + <!-- Let's add more implementation description later when we try to --> + <!-- compile this stuff on, say, Solaris and Linux. --> + +</softpkg>
\ No newline at end of file diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay.mpc b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay.mpc index ec15621685f..d8405867925 100644 --- a/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay.mpc +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay.mpc @@ -1,5 +1,5 @@ // $Id$ -// This file is generated with "generate_component_mpc.pl -l .. -p HUDisplay NavDisplay" +// This file is generated with "generate_component_mpc.pl -l .. -p HUDisplay -c -i NavDisplay" project(NavDisplay_stub): ciao_client { depends += HUDisplay_stub @@ -19,7 +19,7 @@ project(NavDisplay_stub): ciao_client { project(NavDisplay_svnt) : ciao_server { depends += HUDisplay_svnt NavDisplay_stub sharedname = NavDisplay_svnt - libs += NavDisplay_stub HUDisplay_stub + libs += NavDisplay_stub HUDisplay_stub HUDisplay_svnt libpaths += .. idlflags += -Wb,export_macro=NAVDISPLAY_SVNT_Export -Wb,export_include=NavDisplay_svnt_export.h dllflags = NAVDISPLAY_SVNT_BUILD_DLL @@ -39,18 +39,32 @@ project(NavDisplay_svnt) : ciao_server { project(NavDisplay_exec) : ciao_server { depends += NavDisplay_svnt sharedname = NavDisplay_exec - libs += NavDisplay_stub HUDisplay_stub NavDisplay_svnt + libs += NavDisplay_stub NavDisplay_svnt HUDisplay_stub HUDisplay_svnt libpaths += .. idlflags += -Wb,export_macro=NAVDISPLAY_EXEC_Export -Wb,export_include=NavDisplay_exec_export.h dllflags = NAVDISPLAY_EXEC_BUILD_DLL IDL_Files { + NavDisplayEI.idl } Source_Files { + NavDisplayEIC.cpp NavDisplay_exec.cpp } } +project (NavDisplay_client) : ciao_client { + exename = client + depends += NavDisplay_stub + + IDL_Files { + } + + Source_Files { + client.cpp + } +} + diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay.ssd b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay.ssd new file mode 100644 index 00000000000..f1e16629f90 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay.ssd @@ -0,0 +1,47 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- XML doesn't really support the following $(CIAO_ROOT) syntax :) --> +<!DOCTYPE softpkg SYSTEM "$(CIAO_ROOT)/docs/XML/softpkg.dtd"> + +<!-- NavDisplay's Servant Software Descriptor --> +<!-- This file describes various NavDisplay servant --> +<!-- implementations. --> + + +<softpkg name="CIAO-NavDisplay-Servant" version="1.0"> + <pkgtype>CIAO Servant</pkgtype> + <title>HUDisplay::NavDisplay Servants</title> + <author> + <company>Washington University in St. Louis</company> + <webpage href="http://www.cs.wustl.edu/~doc/"/> + </author> + <description>A NavDisplay servant implementation.</description> + <license href="http://www.cs.wustl.edu/~schmidt/ACE-copying.html"/> + <idl id="IDL:HUDisplay/NavDisplay:1.0" homeid="IDL:HUDisplay/NavDisplayHome:1.0"> + <fileinarchive name="NavDisplay.idl"/> + </idl> + + <!-- Duplicate information. We should use the copy in NavDisplay.csd --> + <!-- So, do we really need this one? --> + <descriptor type="CORBA Component"> + <fileinarchive name="NavDisplay.ccd"/> + </descriptor> + + <implementation id="DCE:CDC06FCA-50FC-43ca-8ECC-BEFBD33FEE78"> + + <dependency type="ORB"> + <name>TAO</name> + </dependency> + + <code> + <!-- No need to specify extension below since ACE takes care of that, --> + <fileinarchive name="NavDisplay_svnt"/> + <entrypoint>createNavDisplayHome_Servant</entrypoint> + </code> + + </implementation> + + <!-- Let's add more implementation description later when we try to --> + <!-- compile this stuff on, say, Solaris and Linux. --> + +</softpkg>
\ No newline at end of file diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplayEI.idl b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplayEI.idl new file mode 100644 index 00000000000..e82e48244cd --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplayEI.idl @@ -0,0 +1,32 @@ +// $Id$ + +/** + * @file NavDisplayEI.idl + * + * Definition of the NavDisplay (navigation display) component implementation. + * + * @author Nanbor Wang <nanbor@cs.wustl.edu> + */ + +#ifndef NAVDISPLAYEI_IDL +#define NAVDISPLAYEI_IDL + +#include "NavDisplayE.idl" + +module HUDisplay +{ + /** + * @interface NavDisplay_Exec + * + * The actually GPS executor inherits from both CCM_GPS and + * CCM_position interfaces as a monolithic implementation. + */ + local interface NavDisplay_Exec : + CCM_NavDisplay, + Components::SessionComponent + { + }; + +}; + +#endif /* NAVDISPLAYEI_IDL */ diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay_exec.cpp b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay_exec.cpp new file mode 100644 index 00000000000..0dadb738533 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay_exec.cpp @@ -0,0 +1,103 @@ +// $Id$ + +#include "NavDisplay_exec.h" + +/// Default constructor. +MyImpl::NavDisplay_exec_impl::NavDisplay_exec_impl () +{ +} + +/// Default destructor. +MyImpl::NavDisplay_exec_impl::~NavDisplay_exec_impl () +{ +} + +// Operations from HUDisplay::NavDisplay + +void +MyImpl::NavDisplay_exec_impl::push_Refresh (HUDisplay::tick_ptr ev + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // Refresh position + HUDisplay::position_var loc + = this->context_->get_connection_GPSLocation (ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + CORBA::Long position = loc->pos (ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + ACE_DEBUG ((LM_DEBUG, "DISPLAY: Current Location is: %d\n")); +} + +// Operations from Components::SessionComponent +void +MyImpl::NavDisplay_exec_impl::set_session_context (Components::SessionContext_ptr ctx + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::NavDisplay_exec_impl::set_session_context\n")); + + this->context_ = + HUDisplay::CCM_NavDisplay_Context::_narrow (ctx + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (this->context_.in ())) + ACE_THROW (CORBA::INTERNAL ()); + // Urm, we actually discard exceptions thown from this operation. +} + +void +MyImpl::NavDisplay_exec_impl::ccm_activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::NavDisplay_exec_impl::ccm_activate\n")); +} + +void +MyImpl::NavDisplay_exec_impl::ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::NavDisplay_exec_impl::ccm_passivate\n")); +} + +void +MyImpl::NavDisplay_exec_impl::ccm_remove (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::NavDisplay_exec_impl::ccm_remove\n")); +} + +/// Default ctor. +MyImpl::NavDisplayHome_exec_impl::NavDisplayHome_exec_impl () +{ +} + +/// Default dtor. +MyImpl::NavDisplayHome_exec_impl::~NavDisplayHome_exec_impl () +{ +} + +// Explicit home operations. + +// Implicit home operations. + +::Components::EnterpriseComponent_ptr +MyImpl::NavDisplayHome_exec_impl::create (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CreateFailure)) +{ + return new MyImpl::NavDisplay_exec_impl; +} + + +extern "C" NAVDISPLAY_EXEC_Export ::Components::HomeExecutorBase_ptr +createNavDisplayHome_Impl (void) +{ + return new MyImpl::NavDisplayHome_exec_impl; +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay_exec.h b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay_exec.h new file mode 100644 index 00000000000..179d2bd4c79 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay_exec.h @@ -0,0 +1,101 @@ +// $Id$ + +/** + * @file NavDisplay_exec.h + * + * Header file for the actual NavDisplay and NavDisplayHome component + * implementations. + * + * @author Nanbor Wang <nanbor@cse.wustl.edu> + */ + +#ifndef NAVDISPLAY_EXEC_H +#define NAVDISPLAY_EXEC_H + +#include "NavDisplayEIC.h" +#include "tao/LocalObject.h" + +namespace MyImpl +{ + /** + * @class NavDisplay_exec_impl + * + * RateGen executor implementation class. + */ + class NAVDISPLAY_EXEC_Export NavDisplay_exec_impl : + public virtual HUDisplay::NavDisplay_Exec, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default constructor. + NavDisplay_exec_impl (); + + /// Default destructor. + ~NavDisplay_exec_impl (); + + // Operations from HUDisplay::NavDisplay + + virtual void + push_Refresh (HUDisplay::tick_ptr ev + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations from Components::SessionComponent + + virtual void + set_session_context (Components::SessionContext_ptr ctx + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + protected: + /// Copmponent specific context + HUDisplay::CCM_NavDisplay_Context_var context_; + }; + + /** + * @class NavDisplayHome_exec_impl + * + * NavDisplay home executor implementation class. + */ + class NAVDISPLAY_EXEC_Export NavDisplayHome_exec_impl : + public virtual HUDisplay::CCM_NavDisplayHome, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default ctor. + NavDisplayHome_exec_impl (); + + /// Default dtor. + ~NavDisplayHome_exec_impl (); + + // Explicit home operations. + + // Implicit home operations. + + virtual ::Components::EnterpriseComponent_ptr + create (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CreateFailure)); + }; + +} + +extern "C" NAVDISPLAY_EXEC_Export ::Components::HomeExecutorBase_ptr +createNavDisplayHome_Impl (void); + +#endif /* NAVDISPLAY_EXEC_H */ diff --git a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen.csd b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen.csd index 39e88bbdf3e..37d60c4ed1a 100644 --- a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen.csd +++ b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen.csd @@ -36,17 +36,6 @@ </descriptor> <implementation id="DCE:82C2B032-37F0-4315-A59F-7020D3264E4D"> - <!-- Perhaps we can list more OS here as ACE knows what to look for? --> - <!-- Maybe not... But then selecting the right configuration becomes hard. --> - <os name="WinNT" version="4.0"/> - <os name="WinXP" version="5.0"/> - <processor name="x86"/> - <!-- What about configuration? Such as Debug/Release? --> - <compile name="MSVC" version="6.0"/> - <programminglanguage name="C++"/> - <dependency type="ORB"> - <name>TAO</name> - </dependency> <!-- CIAO extension --> <dependency type="CIAODLL"> diff --git a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen.mpc b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen.mpc index 69e0e5b57e7..9f7272e7ff3 100644 --- a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen.mpc +++ b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen.mpc @@ -1,5 +1,5 @@ // $Id$ -// This file is generated with "generate_component_mpc.pl -l .. -p HUDisplay RateGen" +// This file is generated with "generate_component_mpc.pl -l .. -p HUDisplay -i -c RateGen" project(RateGen_stub): ciao_client { depends += HUDisplay_stub @@ -45,15 +45,17 @@ project(RateGen_exec) : ciao_server { dllflags = RATEGEN_EXEC_BUILD_DLL IDL_Files { - RateGen_Impl.idl + RateGenEI.idl } Source_Files { - RateGen_ImplC.cpp + RateGenEIC.cpp RateGen_exec.cpp } } + + project (RateGen_client) : ciao_client { exename = client depends += RateGen_stub @@ -64,4 +66,5 @@ project (RateGen_client) : ciao_client { Source_Files { client.cpp } -}
\ No newline at end of file +} + diff --git a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen.ssd b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen.ssd index 0b0ffcbf352..670969c7ff2 100644 --- a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen.ssd +++ b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen.ssd @@ -28,12 +28,7 @@ </descriptor> <implementation id="DCE:93D254CF-9538-44e8-BB98-AABCD134ADD3"> - <!-- The following stuff should match those defined in csd file. --> - <os name="WinNT" version="4.0"/> - <os name="WinXP" version="5.0"/> - <processor name="x86"/> - <compile name="MSVC" version="6.0"/> - <programminglanguage name="C++"/> + <dependency type="ORB"> <name>TAO</name> </dependency> diff --git a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGenEI.idl b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGenEI.idl index 9913c91c76f..00c01bbb39e 100644 --- a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGenEI.idl +++ b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGenEI.idl @@ -1,15 +1,15 @@ // $Id$ /** - * @file RateGen_Impl.idl + * @file RateGenEI.idl * * Definition of the RateGen (a rate generator) component implementation. * * @author Nanbor Wang <nanbor@cs.wustl.edu> */ -#ifndef RATEGEN_IMPL_IDL -#define RATEGEN_IMPL_IDL +#ifndef RATEGENEI_IDL +#define RATEGENEI_IDL #include "RateGenE.idl" @@ -28,4 +28,4 @@ module HUDisplay }; -#endif /* RATEGEN_IMPL_IDL */ +#endif /* RATEGENEI_IDL */ diff --git a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_exec.h b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_exec.h index a4a9f8939c3..153a6515120 100644 --- a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_exec.h +++ b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_exec.h @@ -12,7 +12,7 @@ #ifndef RATEGEN_EXEC_H #define RATEGEN_EXEC_H -#include "RateGen_ImplC.h" +#include "RateGenEIC.h" #include "tao/LocalObject.h" #include "ace/Thread_Manager.h" #include "ace/Event_Handler.h" |