diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-02 23:30:04 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-02 23:30:04 +0000 |
commit | 5b3c6252ecd58b25f5baa41cff0b7943f4d10e69 (patch) | |
tree | 866e19f9c135a839eb03309c3bab5f60abd24172 | |
parent | d16e1f7379f94583aad74b7f7addc45f6a166bc7 (diff) | |
download | ATCD-5b3c6252ecd58b25f5baa41cff0b7943f4d10e69.tar.gz |
backup
58 files changed, 4785 insertions, 312 deletions
diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index 0fa2e904a05..a73f7e7ec98 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,3 +1,63 @@ +Wed Apr 02 17:08:00 2003 Nanbor Wang <nanbor@cs.wustl.edu> + +M bin/generate_component_mpc.pl +M docs/XML/componentassembly.dtd +M examples/handcrafted/Display/CIAO_Installation_Data.ini +A examples/handcrafted/Display/HUDisplay.cad +M examples/handcrafted/Display/NavDisplay/NavDisplay.mpc +A examples/handcrafted/Display/NavDisplay/client.cpp +A examples/handcrafted/Display/NavDisplay/run_test.pl +A examples/handcrafted/Display/NavDisplayGUI_exec/AddNavUnitCmd.cpp +A examples/handcrafted/Display/NavDisplayGUI_exec/AddNavUnitCmd.h +A examples/handcrafted/Display/NavDisplayGUI_exec/Command.h +A examples/handcrafted/Display/NavDisplayGUI_exec/DetailView.cpp +A examples/handcrafted/Display/NavDisplayGUI_exec/DetailView.h +A examples/handcrafted/Display/NavDisplayGUI_exec/MapView.cpp +A examples/handcrafted/Display/NavDisplayGUI_exec/MapView.h +A examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayEIC.cpp +A examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI.csd +A examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI.mpc +A examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI.ssd +A examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.cpp +A examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.h +A examples/handcrafted/Display/NavDisplayGUI_exec/NavUnit.cpp +A examples/handcrafted/Display/NavDisplayGUI_exec/NavUnit.h +A examples/handcrafted/Display/NavDisplayGUI_exec/NodeItem.cpp +A examples/handcrafted/Display/NavDisplayGUI_exec/NodeItem.h +A examples/handcrafted/Display/NavDisplayGUI_exec/QuitCmd.cpp +A examples/handcrafted/Display/NavDisplayGUI_exec/QuitCmd.h +A examples/handcrafted/Display/NavDisplayGUI_exec/README +A examples/handcrafted/Display/NavDisplayGUI_exec/RootPanel.cpp +A examples/handcrafted/Display/NavDisplayGUI_exec/RootPanel.h +A examples/handcrafted/Display/NavDisplayGUI_exec/UpdatePositionCmd.cpp +A examples/handcrafted/Display/NavDisplayGUI_exec/UpdatePositionCmd.h +A examples/handcrafted/Display/NavDisplayGUI_exec/Worker.cpp +A examples/handcrafted/Display/NavDisplayGUI_exec/Worker.h +A examples/handcrafted/Display/NavDisplayGUI_exec/moc_DetailView.cpp +A examples/handcrafted/Display/NavDisplayGUI_exec/moc_MapView.cpp +A examples/handcrafted/Display/NavDisplayGUI_exec/moc_NodeItem.cpp +A examples/handcrafted/Display/NavDisplayGUI_exec/moc_RootPanel.cpp +A examples/handcrafted/Display/NavDisplayGUI_exec/run_test.pl +A examples/handcrafted/Display/NavDisplayGUI_exec/trolltech.gif +A examples/handcrafted/Display/NavDisplayGUI_exec/worldmap1.gif +M examples/handcrafted/Hello/client.dsp +M examples/handcrafted/Hello/hello_executors.dsp +M examples/handcrafted/Hello/hello_servants.dsp +M examples/handcrafted/Hello/hello_stub.dsp +A tools/XML_Helpers/Assembly_Handlers.cpp +A tools/XML_Helpers/Assembly_Handlers.h +A tools/XML_Helpers/Assembly_Handlers.inl +A tools/XML_Helpers/Assembly_Spec.cpp +A tools/XML_Helpers/Assembly_Spec.h +A tools/XML_Helpers/Assembly_Spec.inl +M tools/XML_Helpers/Helper_Test.dsp +M tools/XML_Helpers/Softpkg_Handlers.cpp +M tools/XML_Helpers/Softpkg_Handlers.h +M tools/XML_Helpers/Softpkg_Handlers.inl +M tools/XML_Helpers/XML_Utils.cpp +M tools/XML_Helpers/XML_Utils.h +M tools/XML_Helpers/main.cpp + Mon Mar 24 16:17:21 2003 Nanbor Wang <nanbor@cs.wustl.edu> * examples/handcrafted/Display/GPS/GPS_svnt.cpp: diff --git a/TAO/CIAO/bin/generate_component_mpc.pl b/TAO/CIAO/bin/generate_component_mpc.pl index 254a76d91ae..2998faea2c1 100755 --- a/TAO/CIAO/bin/generate_component_mpc.pl +++ b/TAO/CIAO/bin/generate_component_mpc.pl @@ -51,6 +51,10 @@ if (defined $opt_p) { $stub_depend = "depends += $opt_p".'_stub'; $svnt_depend = "$opt_p".'_svnt'; $lib_depend = "$opt_p".'_stub '."$opt_p".'_svnt'; + $client_depend = "$com_name".'_stub '."$opt_p"."_stub"; +} +else { + $client_depend = "$com_name".'_stub'; } if (defined $opt_l) { @@ -62,7 +66,7 @@ if (defined $opt_c) { ' project ('."$com_name".'_client) : ciao_client { exename = client - depends += '."$com_name".'_stub + depends += '."$client_depend".' IDL_Files { } diff --git a/TAO/CIAO/docs/XML/componentassembly.dtd b/TAO/CIAO/docs/XML/componentassembly.dtd index 3d191e458e9..38fdb7e7dc3 100644 --- a/TAO/CIAO/docs/XML/componentassembly.dtd +++ b/TAO/CIAO/docs/XML/componentassembly.dtd @@ -95,7 +95,7 @@ , ( providesport | componentsupportedinterface | existinginterface - | hoameinterface + | homeinterface ) ) > <!ATTLIST connectinterface diff --git a/TAO/CIAO/examples/handcrafted/Display/CIAO_Installation_Data.ini b/TAO/CIAO/examples/handcrafted/Display/CIAO_Installation_Data.ini index ff5f1f63745..cc1a16affd5 100644 --- a/TAO/CIAO/examples/handcrafted/Display/CIAO_Installation_Data.ini +++ b/TAO/CIAO/examples/handcrafted/Display/CIAO_Installation_Data.ini @@ -1,7 +1,8 @@ [ComponentInstallation] +DCE:75309233-0E0A-4cfb-B186-3E99F69B1D40=GPS_svnt 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 +DCE:3148F760-F2ED-4204-A775-6B972C10E8CB=GPS_exec +DCE:D7984625-8561-431d-9927-4E498B317C02=NavDisplayGUI_exec diff --git a/TAO/CIAO/examples/handcrafted/Display/HUDisplay.cad b/TAO/CIAO/examples/handcrafted/Display/HUDisplay.cad new file mode 100644 index 00000000000..d4bb3da1905 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/HUDisplay.cad @@ -0,0 +1,78 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- XML doesn't really support the following $(CIAO_ROOT) syntax :) --> +<!DOCTYPE softpkg SYSTEM "$(CIAO_ROOT)/docs/XML/componentassembly.dtd"> + +<componentassembly id="Single-process HUDisplay assembly"> + <componentfiles> + <componentfile id="com-RateGen"> + <fileinarchive name="RateGen/RateGen.csd"/> + </componentfile> + <componentfile id="com-GPS"> + <fileinarchive name="GPS/GPS.csd"/> + </componentfile> + <componentfile id="com-NavDisplay"> + <fileinarchive name="NavDisplay/NavDisplay.csd"/> + </componentfile> + </componentfiles> + + <partitioning> + + <!-- A plain vanilla partition. We don't even need the processcollocation tag here. --> + <processcollocation> + + <homeplacement id="a_RateGenHome"> + <componentfileref idref="com-RateGen"/> + <componentinstantiation id="a_RateGen"/> + </homeplacement> + + <homeplacement id="a_GPSHome"> + <componentfileref idref="com-GPS"/> + <componentinstantiation id="a_GPS"/> + </homeplacement> + + <homeplacement id="a_NavDisplayHome"> + <componentfileref idref="com-NavDisplay"/> + <componentinstantiation id="a_NavDisplay"/> + </homeplacement> + + </processcollocation> + </partitioning> + + <connections> + + <connectevent> + <consumesport> + <consumesidentifier>Refresh</consumesidentifier> + <componentinstantiationref idref="a_GPS"/> + </consumesport> + <publishesport> + <publishesidentifier>Pulse</publishesidentifier> + <componentinstantiationref idref="a_RateGen"/> + </publishesport> + </connectevent> + + <connectevent> + <consumesport> + <consumesidentifier>Refresh</consumesidentifier> + <componentinstantiationref idref="a_NavDisplay"/> + </consumesport> + <publishesport> + <publishesidentifier>Ready</publishesidentifier> + <componentinstantiationref idref="a_GPS"/> + </publishesport> + </connectevent> + + <connectinterface> + <usesport> + <usesidentifier>GPSLocation</usesidentifier> + <componentinstantiationref idref="a_NavDisplay"/> + </usesport> + <providesport> + <providesidentifier>MyLocation</providesidentifier> + </providesport> + </connectinterface> + + </connections> + +</componentassembly>
\ 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 d8405867925..58d7a396071 100644 --- a/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay.mpc +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay.mpc @@ -58,7 +58,7 @@ project(NavDisplay_exec) : ciao_server { project (NavDisplay_client) : ciao_client { exename = client - depends += NavDisplay_stub + depends += NavDisplay_stub HUDisplay_stub IDL_Files { } diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplay/client.cpp b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/client.cpp new file mode 100644 index 00000000000..6ccd27f4454 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/client.cpp @@ -0,0 +1,67 @@ +// $Id$ + +#include "NavDisplayC.h" + +int +main (int argc, char *argv[]) +{ + ACE_TRY_NEW_ENV + { + // Initialize orb + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv ACE_ENV_ARG_PARAMETER); + + // Resolve HomeFinder interface + + CORBA::Object_var obj + = orb->string_to_object ("file://NavDisplayHome.ior" ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + HUDisplay::NavDisplayHome_var home + = HUDisplay::NavDisplayHome::_narrow (obj + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (CORBA::is_nil (home.in ())) + ACE_ERROR_RETURN ((LM_ERROR, "Unable to acquire NavDisplayHome objref\n"), -1); + + HUDisplay::NavDisplay_var navdisplay + = home->create(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + HUDisplay::tickConsumer_var consumer_refresh = + navdisplay->get_consumer_Refresh(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + HUDisplay::tick_var ev = new OBV_HUDisplay::tick (); + + ACE_Time_Value sleep_time (0, 20000); // 20 milliseconds + + for(unsigned i = 0; i < 1000; i++) + { + consumer_refresh->push_tick(ev.in() + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + ACE_OS::sleep(sleep_time); + } + + ACE_OS::sleep (5); + + home->remove_component (navdisplay.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Who is the culprit \n"); + cerr << "Uncaught CORBA exception" << endl; + return 1; + } + ACE_ENDTRY; + + return 0; +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplay/run_test.pl b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/run_test.pl new file mode 100644 index 00000000000..78bf1f98e49 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/run_test.pl @@ -0,0 +1,108 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "../../../../../../bin"; +use PerlACE::Run_Test; + +$status = 0; +$daemon_ior = PerlACE::LocalFile ("daemon.ior"); +$svr_ior = PerlACE::LocalFile ("server.ior"); +$home_ior = PerlACE::LocalFile ("NavDisplayHome.ior"); + +unlink $daemon_ior; +unlink $svr_ior; +unlink $home_ior; + +# CIAO Daemon command line arguments +$daemon_args = "-o $daemon_ior -i ../CIAO_Installation_Data.ini -n ../../../../tools/ComponentServer/ComponentServer"; + +# CIAO Daemon Controller location: +$controller = "../../../../tools/Daemon/DaemonController"; + +# Daemon controller common command line arguments +$common_args = "-ORBInitRef CIAODaemon=file://$daemon_ior"; + +# Daemon controller start_home command +$start_args = "start_home -s NavDisplay.csd -m $home_ior -c $svr_ior"; + +# Daemon controller end_home command +$end_args = "end_home -c file://$svr_ior"; + +# Daemon controller shutdown command +$shutdown_args = "shutdown"; + +# Client program command line arguments +$cl_args = ""; + +# Naming_Service process definition +$DS = new PerlACE::Process ("../../../../tools/Daemon/CIAO_Daemon", + "$daemon_args"); + +# Client process definition +$CL = new PerlACE::Process ("client", + "$cl_args"); + +## Starting up the CIAO daemon +$DS->Spawn (); +if (PerlACE::waitforfile_timed ($daemon_ior, 15) == -1) { + print STDERR "ERROR: Could not find daemon ior file <$daemon_ior>\n"; + $DS->Kill (); + exit 1; +} + +## Starting up a ComponentServer running the RateGen home. +$DC = new PerlACE::Process ("$controller", + "$common_args $start_args"); + +$DC->SpawnWaitKill (60); +if (PerlACE::waitforfile_timed ($home_ior, 15) == -1) { + print STDERR "ERROR: Could not find home ior file <$home_ior>\n"; + $DS->Kill (); + exit 1; +} + +$client = $CL->SpawnWaitKill (60); + +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; +} + +## Terminating the ComponentServer running the RateGen home. +$DC = new PerlACE::Process ("$controller", + "$common_args $end_args"); + +$ctrl = $DC->SpawnWaitKill (60); +if ($ctrl != 0) { + print STDERR "ERROR: Fail to end component server\n"; + $DS->Kill (); + exit 1; +} + +## Terminating the ComponentServer running the RateGen home. +$DC = new PerlACE::Process ("$controller", + "$common_args $shutdown_args"); + +$ctrl = $DC->SpawnWaitKill (60); +if ($ctrl != 0) { + print STDERR "ERROR: Fail to shutdown CIAODaemon\n"; + $DS->Kill (); + exit 1; +} + +$ctrl = $DS->WaitKill (60); +if ($ctrl != 0) { + print STDERR "ERROR: CIAODaemon didn't shutdown gracefully $ctrl\n"; + $DS->Kill (); + exit 1; +} + +unlink $daemon_ior; +unlink $svr_ior; +unlink $home_ior; + +exit $status; diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/AddNavUnitCmd.cpp b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/AddNavUnitCmd.cpp new file mode 100644 index 00000000000..32572eaf742 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/AddNavUnitCmd.cpp @@ -0,0 +1,28 @@ +// $Id$ + +#include "AddNavUnitCmd.h" +#include "RootPanel.h" +#include "NavUnit.h" + + +AddNavUnitCmd::AddNavUnitCmd() +{ +} + + +AddNavUnitCmd * +AddNavUnitCmd::create(RootPanel *form, NavUnit *unit) +{ + AddNavUnitCmd *cmd = new AddNavUnitCmd(); + cmd->form_ = form; + cmd->unit_ = unit; + return cmd; +} + + +int +AddNavUnitCmd::execute(void *context) +{ + this->form_->addUnit(this->unit_); + return 0; +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/AddNavUnitCmd.h b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/AddNavUnitCmd.h new file mode 100644 index 00000000000..d156a8008ed --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/AddNavUnitCmd.h @@ -0,0 +1,27 @@ +// $Id$ + +#ifndef __ADDNAVUNITCMD_H +#define __ADDNAVUNITCMD_H + +#include "Command.h" + +class RootPanel; +class NavUnit; + +class AddNavUnitCmd : public CommandBase +{ +public: + static AddNavUnitCmd *create(RootPanel *form, NavUnit *unit); + +public: + virtual int execute(void *context = NULL); + +protected: + AddNavUnitCmd(); + + RootPanel *form_; + NavUnit *unit_; +}; + + +#endif // __ADDNAVUNITCMD_H diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/Command.h b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/Command.h new file mode 100644 index 00000000000..3c1e9ef6cdd --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/Command.h @@ -0,0 +1,20 @@ +// $Id$ + +#ifndef __COMMAND_H +#define __COMMAND_H + +#include <qdatetime.h> + +class CommandBase +{ +public: + CommandBase() {timestamp_ = QTime::currentTime();} + virtual ~CommandBase() {} + +public: + virtual int execute(void *context = NULL) = 0; + QTime timestamp_; +}; + + +#endif // __COMMAND_H diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/DetailView.cpp b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/DetailView.cpp new file mode 100644 index 00000000000..5f1464022b1 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/DetailView.cpp @@ -0,0 +1,154 @@ +// $Id$ + +#include "DetailView.h" +#include <qlayout.h> +#include <qpushbutton.h> +#include <qtabwidget.h> +#include <qtable.h> +#include <qlabel.h> +#include <qlineedit.h> +#include <qspinbox.h> + + +DetailView::DetailView(QWidget *parent, const char *name) +: QWidget(parent, name), current_unit(NULL) +{ + QGridLayout *grid = new QGridLayout(this, 8, 10); + + // Create a label containing a QMovie + separatorlabel = new QLabel(this, "label0" ); + + grid->addMultiCellWidget(separatorlabel, 0, 0, 0, 9); + + QLabel *sem_id_label = new QLabel("FDN:", this); + grid->addWidget(sem_id_label, 1, 0); + sem_id_val = new QLineEdit(this); + sem_id_val->setReadOnly(1); + grid->addMultiCellWidget(sem_id_val, 1, 1, 1, 7); + + QLabel *descr_label = new QLabel("Description:", this); + grid->addWidget(descr_label, 2, 0); + descr_edit = new QLineEdit(this); + grid->addMultiCellWidget(descr_edit, 2, 2, 1, 7); + + QLabel *x_label = new QLabel("X coordinate:", this); + grid->addWidget(x_label, 3, 0); + x_edit = new QSpinBox(this); + x_edit->setMinValue(0); + x_edit->setMaxValue(65535); + grid->addWidget(x_edit, 3, 1); + + QLabel *y_label = new QLabel("Y coordinate:", this); + grid->addWidget(y_label, 3, 3); + y_edit = new QSpinBox(this); + y_edit->setMinValue(0); + y_edit->setMaxValue(65535); + grid->addWidget(y_edit, 3, 4); + + QLabel *z_label = new QLabel("Z coordinate:", this); + grid->addWidget(z_label, 3, 6); + z_edit = new QSpinBox(this); + z_edit->setMinValue(0); + z_edit->setMaxValue(65535); + grid->addWidget(z_edit, 3, 7); + + // Create a label containing a QMovie + movie = QMovie("trolltech.gif"); + movielabel = new QLabel(this, "label1" ); + movie.connectStatus(this, SLOT(movieStatus(int))); + movie.connectUpdate(this, SLOT(movieUpdate(const QRect&))); + movielabel->setFrameStyle( QFrame::Box | QFrame::Plain ); + movielabel->setMovie(movie); + movielabel->setFixedSize( 128+movielabel->frameWidth()*2, + 64+movielabel->frameWidth()*2 ); + grid->addMultiCellWidget(new QLabel("", this), 1, 4, 8, 8); + grid->addMultiCellWidget(movielabel, 1, 4, 9, 9); + + + QPushButton *apply = new QPushButton("Apply", this); + apply->setDefault(1); + grid->addWidget(apply, 7, 9); + + connect(apply, SIGNAL(clicked()), this, SLOT(apply())); + + QTabWidget *tabs = new QTabWidget(this); + + + child_list = new QTable(0, 6, tabs); + child_list->setSelectionMode(QTable::Single); + child_list->horizontalHeader()->setLabel(0, "FDN"); + child_list->horizontalHeader()->setLabel(1, "Description"); + child_list->horizontalHeader()->setLabel(2, "X Coordinate"); + child_list->horizontalHeader()->setLabel(3, "Y Coordinate"); + child_list->horizontalHeader()->setLabel(4, "Z Coordinate"); + child_list->horizontalHeader()->setLabel(5, "Color"); + + parent_list = new QTable(0, 6, tabs); + parent_list->setSelectionMode(QTable::Single); + parent_list->horizontalHeader()->setLabel(0, "FDN"); + parent_list->horizontalHeader()->setLabel(1, "Description"); + parent_list->horizontalHeader()->setLabel(2, "X Coordinate"); + parent_list->horizontalHeader()->setLabel(3, "Y Coordinate"); + parent_list->horizontalHeader()->setLabel(4, "Z Coordinate"); + parent_list->horizontalHeader()->setLabel(5, "Color"); + + tabs->addTab(child_list, "Property set &1"); + tabs->addTab(parent_list, "Property set &2"); + + grid->addMultiCellWidget(new QLabel(this), 4, 4, 0, 9); + grid->addMultiCellWidget(tabs, 5, 5, 0, 9); +} + + +DetailView::~DetailView() +{ +} + + +void +DetailView::currentNode(NavUnit *unit) +{ + UnitLocation loc = unit->getLocation(); + descr_edit->setText(unit->getShortDescr()); + this->updateLocation(loc); +} + +void +DetailView::updateLocation(const UnitLocation &loc) +{ + x_edit->setValue(loc.x_); + y_edit->setValue(loc.y_); + z_edit->setValue(loc.z_); +} + +void +DetailView::apply() +{ +} + + +void +DetailView::movieUpdate( const QRect& ) +{ + // Uncomment this to test animated icons on your window manager + //setIcon( movie.framePixmap() ); +} + + +void +DetailView::movieStatus( int s ) +{ + switch ( s ) { + case QMovie::SourceEmpty: + case QMovie::UnrecognizedFormat: + { + QPixmap pm("tt-logo.png"); + movielabel->setPixmap(pm); + movielabel->setFixedSize(pm.size()); + } + break; + default: + if ( movielabel->movie() ) // for flicker-free animation: + movielabel->setBackgroundMode( NoBackground ); + } +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/DetailView.h b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/DetailView.h new file mode 100644 index 00000000000..ef9e0070884 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/DetailView.h @@ -0,0 +1,51 @@ +// $Id$ + +#ifndef __DETAILVIEW_H +#define __DETAILVIEW_H + + +#include "NavUnit.h" +#include <qwidget.h> +#include <qmovie.h> + + +class QLabel; +class QLineEdit; +class QSpinBox; +class QTable; + + +class DetailView : public QWidget +{ + Q_OBJECT + +public: + DetailView(QWidget *parent, const char *name = 0); + virtual ~DetailView(); + +public slots: + void movieStatus(int); + void movieUpdate(const QRect&); + void currentNode(NavUnit *unit); + void updateLocation(const UnitLocation &loc); + void apply(); + +private: + QLineEdit *sem_id_val; + QLineEdit *descr_edit; + QSpinBox *x_edit; + QSpinBox *y_edit; + QSpinBox *z_edit; + QTable *child_list; + QTable *parent_list; + QLabel *movielabel; + QMovie movie; + QLabel *separatorlabel; + QMovie separator; + + + NavUnit *current_unit; +}; + + +#endif // __DETAILVIEW_H diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/MapView.cpp b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/MapView.cpp new file mode 100644 index 00000000000..498ed51f4cd --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/MapView.cpp @@ -0,0 +1,41 @@ +// $Id$ + +#include "MapView.h" + + +MapView::MapView( + QCanvas& c, + QWidget* parent, + const char* name, + WFlags f) + : + bg_pixmap_("worldmap1.gif"), + //bg_pixmap_("ukraine-map.gif"), + QCanvasView(&c, parent, name, f) +{ + bg_pixmap_.load("worldmap1.gif"); + //bg_pixmap_.load("ukraine-map.gif"); + + viewport()->setBackgroundMode(NoBackground); + enableClipper(TRUE); + if(!bg_pixmap_.isNull()) + { + resizeContents(bg_pixmap_.width(), bg_pixmap_.height()); + } + else + resizeContents(100, 100); + + canvas()->setBackgroundPixmap(bg_pixmap_); +} + + +void +MapView::clear() +{ + /*QCanvasItemList list = canvas()->allItems(); + for(QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) + { + if(*it) + delete *it; + }*/ +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/MapView.h b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/MapView.h new file mode 100644 index 00000000000..e640a63c985 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/MapView.h @@ -0,0 +1,23 @@ +// $Id$ + +#ifndef __MAPVIEW_H +#define __MAPVIEW_H + +#include <qcanvas.h> +#include <qpixmap.h> + +class MapView : public QCanvasView +{ + Q_OBJECT + +public: + MapView(QCanvas&, QWidget* parent=0, const char* name=0, WFlags f=0); + void clear(); + +protected: + QPixmap bg_pixmap_; +}; + + + +#endif // __MAPVIEW_H diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayEIC.cpp b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayEIC.cpp new file mode 100644 index 00000000000..e937f2a8125 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayEIC.cpp @@ -0,0 +1,541 @@ +// -*- 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/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:314 + + +#include "NavDisplayEIC.h" +#include "tao/Stub.h" +#include "tao/Invocation.h" +#include "tao/PortableInterceptor.h" + +#if TAO_HAS_INTERCEPTORS == 1 +#include "tao/RequestInfo_Util.h" +#include "tao/ClientRequestInfo_i.h" +#include "tao/ClientInterceptorAdapter.h" +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + + +#if defined (__BORLANDC__) +#pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig +#endif /* __BORLANDC__ */ + +#if !defined (__ACE_INLINE__) +#include "NavDisplayEIC.i" +#endif /* !defined INLINE */ + +// TAO_IDL - Generated from +// c:\usr\src\ace_wrappers\tao\tao_idl\be\be_visitor_interface/interface_cs.cpp:61 + +int HUDisplay::NavDisplay_Exec::_tao_class_id = 0; + +HUDisplay::NavDisplay_Exec_ptr +tao_HUDisplay_NavDisplay_Exec_duplicate ( + HUDisplay::NavDisplay_Exec_ptr p + ) +{ + return HUDisplay::NavDisplay_Exec::_duplicate (p); +} + +void +tao_HUDisplay_NavDisplay_Exec_release ( + HUDisplay::NavDisplay_Exec_ptr p + ) +{ + CORBA::release (p); +} + +HUDisplay::NavDisplay_Exec_ptr +tao_HUDisplay_NavDisplay_Exec_nil ( + void + ) +{ + return HUDisplay::NavDisplay_Exec::_nil (); +} + +HUDisplay::NavDisplay_Exec_ptr +tao_HUDisplay_NavDisplay_Exec_narrow ( + CORBA::Object *p + ACE_ENV_ARG_DECL + ) +{ + return HUDisplay::NavDisplay_Exec::_narrow (p ACE_ENV_ARG_PARAMETER); +} + +CORBA::Object * +tao_HUDisplay_NavDisplay_Exec_upcast ( + void *src + ) +{ + HUDisplay::NavDisplay_Exec **tmp = + ACE_static_cast (HUDisplay::NavDisplay_Exec **, src); + return *tmp; +} + +// TAO_IDL - Generated from +// be\be_interface.cpp:715 + +// ************************************************************* +// HUDisplay::NavDisplay_Exec_var +// ************************************************************* + +HUDisplay::NavDisplay_Exec_var::NavDisplay_Exec_var (void) + : ptr_ (NavDisplay_Exec::_nil ()) +{} + +::HUDisplay::NavDisplay_Exec_ptr +HUDisplay::NavDisplay_Exec_var::ptr (void) const +{ + return this->ptr_; +} + +HUDisplay::NavDisplay_Exec_var::NavDisplay_Exec_var (const ::HUDisplay::NavDisplay_Exec_var &p) + : TAO_Base_var (), + ptr_ (NavDisplay_Exec::_duplicate (p.ptr ())) +{} + +HUDisplay::NavDisplay_Exec_var::~NavDisplay_Exec_var (void) +{ + CORBA::release (this->ptr_); +} + +HUDisplay::NavDisplay_Exec_var & +HUDisplay::NavDisplay_Exec_var::operator= (NavDisplay_Exec_ptr p) +{ + CORBA::release (this->ptr_); + this->ptr_ = p; + return *this; +} + +HUDisplay::NavDisplay_Exec_var & +HUDisplay::NavDisplay_Exec_var::operator= (const ::HUDisplay::NavDisplay_Exec_var &p) +{ + if (this != &p) + { + CORBA::release (this->ptr_); + this->ptr_ = ::HUDisplay::NavDisplay_Exec::_duplicate (p.ptr ()); + } + return *this; +} + +HUDisplay::NavDisplay_Exec_var::operator const ::HUDisplay::NavDisplay_Exec_ptr &() const // cast +{ + return this->ptr_; +} + +HUDisplay::NavDisplay_Exec_var::operator ::HUDisplay::NavDisplay_Exec_ptr &() // cast +{ + return this->ptr_; +} + +::HUDisplay::NavDisplay_Exec_ptr +HUDisplay::NavDisplay_Exec_var::operator-> (void) const +{ + return this->ptr_; +} + +::HUDisplay::NavDisplay_Exec_ptr +HUDisplay::NavDisplay_Exec_var::in (void) const +{ + return this->ptr_; +} + +::HUDisplay::NavDisplay_Exec_ptr & +HUDisplay::NavDisplay_Exec_var::inout (void) +{ + return this->ptr_; +} + +::HUDisplay::NavDisplay_Exec_ptr & +HUDisplay::NavDisplay_Exec_var::out (void) +{ + CORBA::release (this->ptr_); + this->ptr_ = ::HUDisplay::NavDisplay_Exec::_nil (); + return this->ptr_; +} + +::HUDisplay::NavDisplay_Exec_ptr +HUDisplay::NavDisplay_Exec_var::_retn (void) +{ + // yield ownership of managed obj reference + ::HUDisplay::NavDisplay_Exec_ptr val = this->ptr_; + this->ptr_ = ::HUDisplay::NavDisplay_Exec::_nil (); + return val; +} + +::HUDisplay::NavDisplay_Exec_ptr +HUDisplay::NavDisplay_Exec_var::tao_duplicate (NavDisplay_Exec_ptr p) +{ + return ::HUDisplay::NavDisplay_Exec::_duplicate (p); +} + +void +HUDisplay::NavDisplay_Exec_var::tao_release (NavDisplay_Exec_ptr p) +{ + CORBA::release (p); +} + +::HUDisplay::NavDisplay_Exec_ptr +HUDisplay::NavDisplay_Exec_var::tao_nil (void) +{ + return ::HUDisplay::NavDisplay_Exec::_nil (); +} + +::HUDisplay::NavDisplay_Exec_ptr +HUDisplay::NavDisplay_Exec_var::tao_narrow ( + CORBA::Object *p + ACE_ENV_ARG_DECL + ) +{ + return ::HUDisplay::NavDisplay_Exec::_narrow (p ACE_ENV_ARG_PARAMETER); +} + +CORBA::Object * +HUDisplay::NavDisplay_Exec_var::tao_upcast (void *src) +{ + NavDisplay_Exec **tmp = + ACE_static_cast (NavDisplay_Exec **, src); + return *tmp; +} + +// TAO_IDL - Generated from +// be\be_interface.cpp:1024 + +// ************************************************************* +// HUDisplay::NavDisplay_Exec_out +// ************************************************************* + +HUDisplay::NavDisplay_Exec_out::NavDisplay_Exec_out (NavDisplay_Exec_ptr &p) + : ptr_ (p) +{ + this->ptr_ = ::HUDisplay::NavDisplay_Exec::_nil (); +} + +HUDisplay::NavDisplay_Exec_out::NavDisplay_Exec_out (NavDisplay_Exec_var &p) + : ptr_ (p.out ()) +{ + CORBA::release (this->ptr_); + this->ptr_ = ::HUDisplay::NavDisplay_Exec::_nil (); +} + +HUDisplay::NavDisplay_Exec_out::NavDisplay_Exec_out (const ::HUDisplay::NavDisplay_Exec_out &p) + : ptr_ (ACE_const_cast (NavDisplay_Exec_out &, p).ptr_) +{} + +::HUDisplay::NavDisplay_Exec_out & +HUDisplay::NavDisplay_Exec_out::operator= (const ::HUDisplay::NavDisplay_Exec_out &p) +{ + this->ptr_ = ACE_const_cast (NavDisplay_Exec_out&, p).ptr_; + return *this; +} + +HUDisplay::NavDisplay_Exec_out & +HUDisplay::NavDisplay_Exec_out::operator= (const ::HUDisplay::NavDisplay_Exec_var &p) +{ + this->ptr_ = ::HUDisplay::NavDisplay_Exec::_duplicate (p.ptr ()); + return *this; +} + +HUDisplay::NavDisplay_Exec_out & +HUDisplay::NavDisplay_Exec_out::operator= (NavDisplay_Exec_ptr p) +{ + this->ptr_ = p; + return *this; +} + +HUDisplay::NavDisplay_Exec_out::operator ::HUDisplay::NavDisplay_Exec_ptr &() // cast +{ + return this->ptr_; +} + +::HUDisplay::NavDisplay_Exec_ptr & +HUDisplay::NavDisplay_Exec_out::ptr (void) +{ + return this->ptr_; +} + +::HUDisplay::NavDisplay_Exec_ptr +HUDisplay::NavDisplay_Exec_out::operator-> (void) +{ + return this->ptr_; +} + +// TAO_IDL - Generated from +// c:\usr\src\ace_wrappers\tao\tao_idl\be\be_visitor_interface/interface_cs.cpp:225 + +HUDisplay::NavDisplay_Exec::NavDisplay_Exec (void) +{} + +HUDisplay::NavDisplay_Exec::~NavDisplay_Exec (void) +{} + +void +HUDisplay::NavDisplay_Exec::_tao_any_destructor (void *_tao_void_pointer) +{ + NavDisplay_Exec *tmp = ACE_static_cast (NavDisplay_Exec *, _tao_void_pointer); + CORBA::release (tmp); +} + +HUDisplay::NavDisplay_Exec_ptr +HUDisplay::NavDisplay_Exec::_narrow ( + CORBA::Object_ptr obj + ACE_ENV_ARG_DECL + ) +{ + return NavDisplay_Exec::_unchecked_narrow (obj ACE_ENV_ARG_PARAMETER); +} + +HUDisplay::NavDisplay_Exec_ptr +HUDisplay::NavDisplay_Exec::_unchecked_narrow ( + CORBA::Object_ptr obj + ACE_ENV_ARG_DECL_NOT_USED + ) +{ + if (CORBA::is_nil (obj)) + { + return NavDisplay_Exec::_nil (); + } + + return + ACE_reinterpret_cast ( + NavDisplay_Exec_ptr, + obj->_tao_QueryInterface ( + ACE_reinterpret_cast ( + ptr_arith_t, + &NavDisplay_Exec::_tao_class_id + ) + ) + ); +} + +HUDisplay::NavDisplay_Exec_ptr +HUDisplay::NavDisplay_Exec::_duplicate (NavDisplay_Exec_ptr obj) +{ + if (! CORBA::is_nil (obj)) + { + obj->_add_ref (); + } + + return obj; +} + +void *HUDisplay::NavDisplay_Exec::_tao_QueryInterface (ptr_arith_t type) +{ + void *retv = 0; + + if (type == ACE_reinterpret_cast ( + ptr_arith_t, + &ACE_NESTED_CLASS (::HUDisplay, NavDisplay_Exec)::_tao_class_id) + ) + { + retv = ACE_reinterpret_cast (void*, this); + } + else if (type == ACE_reinterpret_cast ( + ptr_arith_t, + &::HUDisplay::CCM_NavDisplay::_tao_class_id) + ) + { + retv = + ACE_reinterpret_cast ( + void *, + ACE_static_cast ( + HUDisplay::CCM_NavDisplay_ptr, + this + ) + ); + } + else if (type == ACE_reinterpret_cast ( + ptr_arith_t, + &::Components::SessionComponent::_tao_class_id) + ) + { + retv = + ACE_reinterpret_cast ( + void *, + ACE_static_cast ( + Components::SessionComponent_ptr, + this + ) + ); + } + else if (type == ACE_reinterpret_cast ( + ptr_arith_t, + &::Components::EnterpriseComponent::_tao_class_id) + ) + { + retv = + ACE_reinterpret_cast ( + void *, + ACE_static_cast ( + Components::EnterpriseComponent_ptr, + this + ) + ); + } + else if (type == ACE_reinterpret_cast ( + ptr_arith_t, + &CORBA::Object::_tao_class_id) + ) + { + retv = + ACE_reinterpret_cast ( + void *, + ACE_static_cast (CORBA::Object_ptr, this) + ); + } + + if (retv != 0) + { + this->_add_ref (); + } + + return retv; +} + +const char* HUDisplay::NavDisplay_Exec::_interface_repository_id (void) const +{ + return "IDL:HUDisplay/NavDisplay_Exec:1.0"; +} + +// TAO_IDL - Generated from +// c:\usr\src\ace_wrappers\tao\tao_idl\be\be_visitor_typecode/typecode_defn.cpp:284 + +static const CORBA::Long _oc_HUDisplay_NavDisplay_Exec[] = +{ + TAO_ENCAP_BYTE_ORDER, // byte order + 34, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x48554469), + ACE_NTOHL (0x73706c61), + ACE_NTOHL (0x792f4e61), + ACE_NTOHL (0x76446973), + ACE_NTOHL (0x706c6179), + ACE_NTOHL (0x5f457865), + ACE_NTOHL (0x633a312e), + ACE_NTOHL (0x30000000), // repository ID = IDL:HUDisplay/NavDisplay_Exec:1.0 + 16, + ACE_NTOHL (0x4e617644), + ACE_NTOHL (0x6973706c), + ACE_NTOHL (0x61795f45), + ACE_NTOHL (0x78656300), // name = NavDisplay_Exec +}; + +static CORBA::TypeCode _tc_TAO_tc_HUDisplay_NavDisplay_Exec ( + CORBA::tk_objref, + sizeof (_oc_HUDisplay_NavDisplay_Exec), + (char *) &_oc_HUDisplay_NavDisplay_Exec, + 0, + sizeof (HUDisplay::NavDisplay_Exec) + ); + +TAO_NAMESPACE_TYPE (CORBA::TypeCode_ptr) +TAO_NAMESPACE_BEGIN (HUDisplay) +TAO_NAMESPACE_DEFINE ( + ::CORBA::TypeCode_ptr, + _tc_NavDisplay_Exec, + &_tc_TAO_tc_HUDisplay_NavDisplay_Exec + ) +TAO_NAMESPACE_END + +// TAO_IDL - Generated from +// c:\usr\src\ace_wrappers\tao\tao_idl\be\be_visitor_interface/any_op_cs.cpp:52 + +// Copying version. +void +operator<<= ( + CORBA::Any &_tao_any, + HUDisplay::NavDisplay_Exec_ptr _tao_elem + ) +{ + _tao_any._tao_replace ( + HUDisplay::_tc_NavDisplay_Exec, + 1, + HUDisplay::NavDisplay_Exec::_duplicate (_tao_elem), + HUDisplay::NavDisplay_Exec::_tao_any_destructor + ); + + _tao_any.contains_local (1); +} + +// Non-copying version. +void +operator<<= ( + CORBA::Any &_tao_any, + HUDisplay::NavDisplay_Exec_ptr *_tao_elem + ) +{ + _tao_any._tao_replace ( + HUDisplay::_tc_NavDisplay_Exec, + 1, + *_tao_elem, + HUDisplay::NavDisplay_Exec::_tao_any_destructor + ); + + _tao_any.contains_local (1); +} + +CORBA::Boolean +operator>>= ( + const CORBA::Any &_tao_any, + HUDisplay::NavDisplay_Exec_ptr &_tao_elem + ) +{ + ACE_TRY_NEW_ENV + { + _tao_elem = HUDisplay::NavDisplay_Exec::_nil (); + CORBA::TypeCode_var type = _tao_any.type (); + + CORBA::Boolean _tao_result = + type->equivalent ( + HUDisplay::_tc_NavDisplay_Exec + ACE_ENV_ARG_PARAMETER + ); + ACE_TRY_CHECK; + + if (!_tao_result) + { + return 0; // not equivalent + } + + _tao_elem = + ACE_reinterpret_cast ( + HUDisplay::NavDisplay_Exec_ptr, + ACE_const_cast (void *, _tao_any.value ()) + ); + + return 1; + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + _tao_elem = HUDisplay::NavDisplay_Exec::_nil (); + return 0; +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) || \ + defined (ACE_HAS_GNU_REPO) + template class TAO_Object_Manager<HUDisplay::NavDisplay_Exec,HUDisplay::NavDisplay_Exec_var>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +# pragma instantiate TAO_Object_Manager<HUDisplay::NavDisplay_Exec,HUDisplay::NavDisplay_Exec_var> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI.csd b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI.csd new file mode 100644 index 00000000000..1c8b3e9cfe4 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI.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="NavDisplayGUI.ccd"/> + </descriptor> + + <implementation id="DCE:D7984625-8561-431d-9927-4E498B317C02"> + + <!-- CIAO extension --> + <dependency type="CIAODLL"> + <softpkgref> + <!-- .ssd stands for Servant Software Descriptors which is a CIAO extension --> + <fileinarchive name="NavDisplayGUI.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="NavDisplayGUI_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/NavDisplayGUI_exec/NavDisplayGUI.mpc b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI.mpc new file mode 100644 index 00000000000..ce3dc106420 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI.mpc @@ -0,0 +1,31 @@ +// $Id$ +project(NavDisplayGUI_exec) : ciao_server { + depends += NavDisplay_exec + sharedname = NavDisplayGUI_exec + lit_libs += qtmain qt-mt230nc + libs += NavDisplay_stub NavDisplay_svnt HUDisplay_stub HUDisplay_svnt + libpaths += .. ../NavDisplay $(QTDIR)/lib + dllflags = NAVDISPLAY_EXEC_BUILD_DLL QT_DLL QT_THREAD_SUPPORT + includes += ../NavDisplay $(QTDIR)/include + + IDL_Files { + } + + Source_Files { + AddNavUnitCmd.cpp + DetailView.cpp + MapView.cpp + moc_DetailView.cpp + moc_MapView.cpp + moc_NodeItem.cpp + moc_RootPanel.cpp + NavUnit.cpp + NodeItem.cpp + QuitCmd.cpp + RootPanel.cpp + UpdatePositionCmd.cpp + Worker.cpp + ../NavDisplay/NavDisplayEIC.cpp + NavDisplayGUI_exec.cpp + } +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI.ssd b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI.ssd new file mode 100644 index 00000000000..dac071cb28f --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI.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="NavDisplayGUI.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/NavDisplayGUI_exec/NavDisplayGUI_exec.cpp b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.cpp new file mode 100644 index 00000000000..0dcda8f7595 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.cpp @@ -0,0 +1,186 @@ +// $Id$ + +#include "NavDisplayGUI_exec.h" +#include "CIAO/CIAO_common.h" +#include <qapplication.h> +#include <qevent.h> + +#include "UpdatePositionCmd.h" +#include "QuitCmd.h" +#include "AddNavUnitCmd.h" +#include "Worker.h" + +static char *argv[] = +{ + "NavDisplayGUI" +}; + +/// Default constructor. +MyImpl::NavDisplayGUI_exec_impl::NavDisplayGUI_exec_impl () +: unit_(1, "Model T3+"), loc_(50, 20, 0), dx_(1), dy_(2) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::NavDisplayGUI_exec_impl::NavDisplayGUI_exec_impl ()\n")); +} + +/// Default destructor. +MyImpl::NavDisplayGUI_exec_impl::~NavDisplayGUI_exec_impl () +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::NavDisplayGUI_exec_impl::~NavDisplayGUI_exec_impl ()\n")); +} + +// Operations from HUDisplay::NavDisplay + +void +MyImpl::NavDisplayGUI_exec_impl::push_Refresh (HUDisplay::tick_ptr ev + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + //ACE_DEBUG ((LM_DEBUG, "ENTER: MyImpl::NavDisplayGUI_exec_impl::push_Refresh()\n")); + + // 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;*/ + + mutex_.acquire(); + + loc_.x_ += dx_; + loc_.y_ += dy_; + + if(loc_.x_ > 500) dx_ = -1; + if(loc_.x_ < 10) dx_ = 1; + if(loc_.y_ > 300) dy_ = -1; + if(loc_.y_ < 10) dy_ = 1; + + this->unit_.setLocation(loc_); + + mutex_.release(); + + //ACE_DEBUG ((LM_DEBUG, "DISPLAY: Current Location is: %d %d\n", int(attrs.x_), int(attrs.y_))); + + RootPanel *root_pane = worker_->getMainWindow(); + if(root_pane) + { + UpdatePositionCmd *cmd = UpdatePositionCmd::create( + root_pane, &(this->unit_)); + QCustomEvent *evt = new QCustomEvent(QEvent::User, cmd); + QApplication::postEvent(root_pane, evt); + } + + //ACE_DEBUG ((LM_DEBUG, "LEAVE: MyImpl::NavDisplayGUI_exec_impl::push_Refresh()\n")); +} + +// Operations from Components::SessionComponent +void +MyImpl::NavDisplayGUI_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::NavDisplayGUI_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::NavDisplayGUI_exec_impl::ccm_activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "ENTER: MyImpl::NavDisplayGUI_exec_impl::ccm_activate\n")); + + int argc = sizeof(argv)/sizeof(argv[0]); + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv ACE_ENV_ARG_PARAMETER); + + CIAO_REGISTER_VALUE_FACTORY (orb.in(), HUDisplay::tick_init, + HUDisplay::tick); + + worker_ = new Worker(sizeof(argv)/sizeof(argv[0]), argv); + + if (worker_->activate(THR_NEW_LWP | THR_JOINABLE, 1) != 0) + { + ACE_DEBUG((LM_ERROR, + "Cannot activate client threads\n")); + ACE_THROW(Components::CCMException()); + } + + worker_->waitUntillInitialized(); + + AddNavUnitCmd *cmd = AddNavUnitCmd::create( + worker_->getMainWindow(), &(this->unit_)); + QCustomEvent *evt = new QCustomEvent(QEvent::User, cmd); + QApplication::postEvent(worker_->getMainWindow(), evt); + + + ACE_DEBUG ((LM_DEBUG, "LEAVE: MyImpl::NavDisplayGUI_exec_impl::ccm_activate\n")); +} + +void +MyImpl::NavDisplayGUI_exec_impl::ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::NavDisplayGUI_exec_impl::ccm_passivate\n")); + + RootPanel *target = worker_->getMainWindow(); + if(target) + { + QuitCmd *cmd = QuitCmd::create(target); + QCustomEvent *evt = new QCustomEvent(QEvent::User, cmd); + QApplication::postEvent(target, evt); + worker_->thr_mgr()->wait(); + } + + delete worker_; +} + +void +MyImpl::NavDisplayGUI_exec_impl::ccm_remove (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::NavDisplayGUI_exec_impl::ccm_remove\n")); +} + +/// Default ctor. +MyImpl::NavDisplayGUIHome_exec_impl::NavDisplayGUIHome_exec_impl () +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::NavDisplayGUI_exec_impl::NavDisplayGUIHome_exec_impl ()\n")); +} + +/// Default dtor. +MyImpl::NavDisplayGUIHome_exec_impl::~NavDisplayGUIHome_exec_impl () +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::NavDisplayGUI_exec_impl::~NavDisplayGUIHome_exec_impl ()\n")); +} + +// Explicit home operations. + +// Implicit home operations. + +::Components::EnterpriseComponent_ptr +MyImpl::NavDisplayGUIHome_exec_impl::create (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CreateFailure)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::NavDisplayGUIHome_exec_impl::create()\n")); + return new MyImpl::NavDisplayGUI_exec_impl; +} + + +extern "C" NAVDISPLAY_EXEC_Export ::Components::HomeExecutorBase_ptr +createNavDisplayHome_Impl (void) +{ + ACE_DEBUG ((LM_DEBUG, "createNavDisplayHome_Impl()\n")); + return new MyImpl::NavDisplayGUIHome_exec_impl; +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.h b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.h new file mode 100644 index 00000000000..535be6b5727 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.h @@ -0,0 +1,111 @@ +// $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 "ace/Synch.h" +#include "tao/LocalObject.h" +#include "NavUnit.h" + +class Worker; + + +namespace MyImpl +{ + /** + * @class NavDisplayGUI_exec_impl + * + * RateGen executor implementation class. + */ + class NAVDISPLAY_EXEC_Export NavDisplayGUI_exec_impl : + public virtual HUDisplay::NavDisplay_Exec, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default constructor. + NavDisplayGUI_exec_impl (); + + /// Default destructor. + ~NavDisplayGUI_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_; + Worker *worker_; + NavUnit unit_; + UnitLocation loc_; + int dx_, dy_; + ACE_Thread_Mutex mutex_; + }; + + /** + * @class NavDisplayGUIHome_exec_impl + * + * NavDisplay home executor implementation class. + */ + class NAVDISPLAY_EXEC_Export NavDisplayGUIHome_exec_impl : + public virtual HUDisplay::CCM_NavDisplayHome, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default ctor. + NavDisplayGUIHome_exec_impl (); + + /// Default dtor. + ~NavDisplayGUIHome_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/NavDisplayGUI_exec/NavUnit.cpp b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavUnit.cpp new file mode 100644 index 00000000000..809117728f6 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavUnit.cpp @@ -0,0 +1,9 @@ +// $Id$ + +#include "NavUnit.h" + + +NavUnit::NavUnit(const UnitID &id, const char *short_descr) +: id_(id), short_descr_(short_descr) +{ +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavUnit.h b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavUnit.h new file mode 100644 index 00000000000..86dd2cccbd7 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NavUnit.h @@ -0,0 +1,57 @@ +// $Id$ + +#ifndef __NAVUNIT_H +#define __NAVUNIT_H + +#include "ace/SString.h" + + +class UnitLocation +{ +public: + UnitLocation() {x_ = y_ = z_ = 0.0;} + UnitLocation( + double x, + double y, + double z) : + x_(x), y_(y), z_(z) {} + + UnitLocation(const UnitLocation &ul) { operator = (ul); } + +public: + UnitLocation & operator = (const UnitLocation &ul) + { + x_ = ul.x_; + y_ = ul.y_; + z_ = ul.z_; + return *this; + } + +public: + double x_, y_, z_; +}; + +typedef unsigned long UnitID; + +class NavUnit +{ +public: + NavUnit(const UnitID &id, const char *short_descr); + virtual ~NavUnit() {} + +public: + UnitID getID() const {return id_;} + + const char *getShortDescr() const {return short_descr_.c_str();} + void setShortDescr(const char *short_descr) {short_descr_ = short_descr;} + + UnitLocation getLocation() const {return loc_;} + void setLocation(const UnitLocation &loc) {loc_ = loc;} + +protected: + UnitID id_; + ACE_CString short_descr_; + UnitLocation loc_; +}; + +#endif // __NAVUNIT_H diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NodeItem.cpp b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NodeItem.cpp new file mode 100644 index 00000000000..e6fb43b7eab --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NodeItem.cpp @@ -0,0 +1,63 @@ +// $Id$ + +#include "NodeItem.h" +#include <qbrush.h> + + +QBrush *NodeItem::normal = new QBrush(red); +QBrush *NodeItem::highlighted = new QBrush(green); + + +NodeItem::NodeItem(QCanvas *canvas, NavUnit &unit) + : QCanvasEllipse(8, 8, canvas), + unit_(unit), + blink_timer(canvas), + is_selected_(0) +{ + setBrush(*normal); + setZ(128); +} + + +void NodeItem::moveBy(double dx, double dy, double dz) +{ + QCanvasEllipse::moveBy(dx, dy); +} + + +void +NodeItem::timerDone() +{ + if(selected()) + { + if(brush() == *normal) + setBrush(*highlighted); + else + setBrush(*normal); + + canvas()->update(); + } +} + + +void +NodeItem::setSelected(bool yes) +{ + is_selected_ = yes; + + if(yes) + { + connect(&blink_timer, SIGNAL(timeout()), + SLOT(timerDone())); + + blink_timer.start(500); + } + else + { + blink_timer.stop(); + disconnect(SIGNAL(timeout()), this, + SLOT(timerDone())); + setBrush(*normal); + canvas()->update(); + } +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NodeItem.h b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NodeItem.h new file mode 100644 index 00000000000..4ccc5599359 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/NodeItem.h @@ -0,0 +1,49 @@ +// $Id$ + +#ifndef __NODEITEM_H +#define __NODEITEM_H + +#include "NavUnit.h" +#include <qcanvas.h> +#include <qlist.h> +#include <qtimer.h> +#include <qbrush.h> +#include <qobject.h> + + + +class NodeItem: public QObject, public QCanvasEllipse +{ + Q_OBJECT + +public: + NodeItem(QCanvas *canvas, NavUnit &unit); + + ~NodeItem() {} + + enum { + nodeRTTI = 1 + }; + + void moveBy(double dx, double dy, double dz); + + virtual int rtti() const {return nodeRTTI;} + + virtual void setSelected(bool yes); + virtual bool selected() const {return is_selected_;} + +public slots: + void timerDone(); + +private: + NavUnit &unit_; + QTimer blink_timer; + bool is_selected_; + + static QBrush *normal; + static QBrush *highlighted; +}; + + + +#endif // __NODEITEM_H diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/QuitCmd.cpp b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/QuitCmd.cpp new file mode 100644 index 00000000000..b8495973ead --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/QuitCmd.cpp @@ -0,0 +1,25 @@ +// $Id$ + +#include "QuitCmd.h" +#include "RootPanel.h" + + +QuitCmd::QuitCmd() +{ +} + + +QuitCmd * +QuitCmd::create(RootPanel *form) +{ + QuitCmd *cmd = new QuitCmd(); + cmd->form_ = form; + return cmd; +} + + +int +QuitCmd::execute(void *context) +{ + return form_->close(); +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/QuitCmd.h b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/QuitCmd.h new file mode 100644 index 00000000000..a80d749640e --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/QuitCmd.h @@ -0,0 +1,25 @@ +// $Id$ + +#ifndef __QUITCMD_H +#define __QUITCMD_H + +#include "Command.h" + +class RootPanel; + +class QuitCmd : public CommandBase +{ +public: + static QuitCmd *create(RootPanel *form); + +public: + virtual int execute(void *context = NULL); + +protected: + QuitCmd(); + + RootPanel *form_; +}; + + +#endif // __QUITCMD_H diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/README b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/README new file mode 100644 index 00000000000..ab73f830a59 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/README @@ -0,0 +1,16 @@ +This example is the Qt-based GUI implementation of NavDisplay component. + +It is NOT necessary to compile ACE/TAO/CIAO with Qt support, +i.e. ACE_HAS_QT since this example does not relyes on Qt Reactor and +communicates with GUI part using QApplication::postMessage() and +simple Command Pattern based framework. But be sure that QTDIR +environment variable is pointed to your Qt instalation directory. + +This example uses the test client application from ../NavDisplay +directory. You can use run_test.pl located in this directory (not in +../NavDisplay) to run the example. + +The expected behaviour - you should be able to see the moving red dot +over the map and changing values of x and y coordinates in +corresponding edit boxes. After several seconds the red dot stops and +then after five seconds the application will be automatically closed. diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/RootPanel.cpp b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/RootPanel.cpp new file mode 100644 index 00000000000..c6737ee96c0 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/RootPanel.cpp @@ -0,0 +1,90 @@ +// $Id$ + +#include "RootPanel.h" +#include <qmenubar.h> +#include <qapplication.h> +#include <qprogressdialog.h> +#include <stdlib.h> +#include <qsplitter.h> +#include "NodeItem.h" +#include "Command.h" + + +RootPanel::RootPanel(QCanvas &c, QWidget *parent, const char *name) +: QMainWindow(parent, name), canvas(c) +{ + QSplitter *s1 = new QSplitter( QSplitter::Vertical, this , "main" ); + + + navview = new MapView(canvas, s1); + s1->moveToFirst(navview); + + details = new DetailView(s1); + + QMenuBar* menu = menuBar(); + + QPopupMenu* file = new QPopupMenu; + //file->insertItem("&Fill canvas", this, SLOT(init()), CTRL+Key_F); + //file->insertItem("&Erase canvas", this, SLOT(clear()), CTRL+Key_E); + //file->insertItem("&New view", this, SLOT(newView()), CTRL+Key_N); + file->insertSeparator(); + file->insertItem("E&xit", qApp, SLOT(quit()), CTRL+Key_Q); + menu->insertItem("&File", file); + + setCentralWidget(s1); +} + + +RootPanel::~RootPanel() +{ + clear(); +} + + +void +RootPanel::addUnit(NavUnit *unit) +{ + NodeItem *el = new NodeItem(&canvas, *unit); + nodeMap.bind(unit->getID(), el); + UnitLocation loc = unit->getLocation(); + el->move(loc.x_, loc.y_); + el->show(); + this->details->currentNode(unit); +} + +void +RootPanel::updateUnit(NavUnit *unit) +{ + NodeItem *el = NULL; + nodeMap.find(unit->getID(), el); + UnitLocation loc = unit->getLocation(); + el->move(loc.x_, loc.y_); + //canvas.update(); + + this->details->updateLocation(loc); +} + + +void +RootPanel::clear() +{ + navview->clear(); +} + +void +RootPanel::customEvent(QCustomEvent *e) +{ + CommandBase *cmd = (CommandBase*)(e->data()); + cmd->execute(); + delete cmd; +/* + int elapsed = time.restart(); + int fps = (elapsed == 0 ? 1000 : 1000 / elapsed); + + if(prev_fps != fps) + { + prev_fps = fps; + ups->setNum(prev_fps); + } +*/ +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/RootPanel.h b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/RootPanel.h new file mode 100644 index 00000000000..e3b9b0c11a9 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/RootPanel.h @@ -0,0 +1,45 @@ +// $Id$ + +#ifndef __ROOTPANEL_H +#define __ROOTPANEL_H + +#include "MapView.h" +#include "DetailView.h" +#include <qmainwindow.h> +#include "ace/Hash_Map_Manager.h" + + +class NodeItem; +class QMouseEvent; + +class RootPanel : public QMainWindow +{ + Q_OBJECT + +typedef ACE_Hash_Map_Manager_Ex<ACE_UINT64, + NodeItem*, + ACE_Hash<ACE_UINT64>, + ACE_Equal_To<ACE_UINT64>, + ACE_Null_Mutex> NodeItemMap; + +public: + RootPanel(QCanvas&, QWidget *parent = 0, const char *name = 0); + ~RootPanel(); + +public: + void addUnit(NavUnit* unit); + void updateUnit(NavUnit *unit); + +protected: + void clear(); + virtual void customEvent(QCustomEvent *e); + + QCanvas& canvas; + MapView *navview; + DetailView *details; + + QPopupMenu* options; + NodeItemMap nodeMap; +}; + +#endif // __ROOTPANEL_H diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/UpdatePositionCmd.cpp b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/UpdatePositionCmd.cpp new file mode 100644 index 00000000000..65bc87e26bb --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/UpdatePositionCmd.cpp @@ -0,0 +1,30 @@ +// $Id$ + +#include "UpdatePositionCmd.h" +#include <qlcdnumber.h> +#include "RootPanel.h" +#include "NavUnit.h" + + +UpdatePositionCmd::UpdatePositionCmd() +{ +} + + +UpdatePositionCmd * +UpdatePositionCmd::create( + RootPanel *form, NavUnit *unit) +{ + UpdatePositionCmd *cmd = new UpdatePositionCmd(); + cmd->form_ = form; + cmd->unit_ = unit; + return cmd; +} + + +int +UpdatePositionCmd::execute(void *context) +{ + this->form_->updateUnit(this->unit_); + return 0; +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/UpdatePositionCmd.h b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/UpdatePositionCmd.h new file mode 100644 index 00000000000..4ba20755c3e --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/UpdatePositionCmd.h @@ -0,0 +1,28 @@ +// $Id$ + +#ifndef __UPDATEPOSITIONCM_H +#define __UPDATEPOSITIONCM_H + +#include "Command.h" + +class RootPanel; +class NavUnit; + +class UpdatePositionCmd : public CommandBase +{ +public: + static UpdatePositionCmd *create( + RootPanel *form, NavUnit *unit); + +public: + virtual int execute(void *context = NULL); + +protected: + UpdatePositionCmd(); + + RootPanel *form_; + NavUnit *unit_; +}; + + +#endif // __UPDATEPOSITIONCM_H diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/Worker.cpp b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/Worker.cpp new file mode 100644 index 00000000000..4257dd69f46 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/Worker.cpp @@ -0,0 +1,48 @@ +// $Id$ + +#include "Worker.h" +#include <qapplication.h> +#include <qmotifstyle.h> +#include <qcdestyle.h> +#include <qwindowsstyle.h> +#include <qplatinumstyle.h> +#include <qsgistyle.h> + + +int +Worker::svc (void) +{ + ACE_DEBUG((LM_DEBUG, "ENTER: Worker::svc()\n")); + + QApplication a(argc_, argv_); + a.setStyle(new QPlatinumStyle); + QCanvas canvas(600, 387); + //QCanvas canvas(566, 679); + //QCanvas canvas(550, 723); + canvas.setAdvancePeriod(30); + RootPanel root_panel(canvas); + root_panel.resize(root_panel.sizeHint()); + + root_panel.resize(600, 650); + root_panel.setCaption("NavDisplay"); + + a.setMainWidget(&root_panel); + + QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) ); + + if(QApplication::desktop()->width() > 550 + && QApplication::desktop()->height() > 366) + root_panel.show(); + else + root_panel.showMaximized(); + + main_wnd_ = &root_panel; + init_complete_.signal(); + + int retval = a.exec(); + + main_wnd_ = NULL; + + ACE_DEBUG((LM_DEBUG, "LEAVE: Worker::svc()\n")); + return retval; +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/Worker.h b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/Worker.h new file mode 100644 index 00000000000..6005b88e775 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/Worker.h @@ -0,0 +1,35 @@ +// $Id$ + +#ifndef __WORKER_H +#define __WORKER_H + +#include "ace/Task.h" +#include "tao/CORBA.h" +#include "ace/Synch.h" +#include "RootPanel.h" + +class Worker : public ACE_Task_Base +{ +public: + Worker (int argc, char *argv[]) + : argc_(argc), argv_(argv) {} + // ctor + + virtual int svc (void); + // The thread entry point. + + void waitUntillInitialized() {init_complete_.wait();} + // blocks the calling thread until the GUI is initialized + + RootPanel* getMainWindow() const {return main_wnd_;} + // Returns the pointer to main application window + +private: + RootPanel *main_wnd_; + int argc_; + char **argv_; + + ACE_Manual_Event init_complete_; +}; + +#endif // __WORKER_H diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/moc_DetailView.cpp b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/moc_DetailView.cpp new file mode 100644 index 00000000000..f11389116e0 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/moc_DetailView.cpp @@ -0,0 +1,98 @@ +/**************************************************************************** +** DetailView meta object code from reading C++ file 'DetailView.h' +** +** Created: Thu Mar 27 11:59:11 2003 +** by: The Qt MOC ($Id$) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#define Q_MOC_DetailView +#if !defined(Q_MOC_OUTPUT_REVISION) +#define Q_MOC_OUTPUT_REVISION 8 +#elif Q_MOC_OUTPUT_REVISION != 8 +#error "Moc format conflict - please regenerate all moc files" +#endif + +#include "DetailView.h" +#include <qmetaobject.h> +#include <qapplication.h> + +#if defined(Q_SPARCWORKS_FUNCP_BUG) +#define Q_AMPERSAND +#else +#define Q_AMPERSAND & +#endif + + +const char *DetailView::className() const +{ + return "DetailView"; +} + +QMetaObject *DetailView::metaObj = 0; + +void DetailView::initMetaObject() +{ + if ( metaObj ) + return; + if ( strcmp(QWidget::className(), "QWidget") != 0 ) + badSuperclassWarning("DetailView","QWidget"); + (void) staticMetaObject(); +} + +#ifndef QT_NO_TRANSLATION +QString DetailView::tr(const char* s) +{ + return ((QNonBaseApplication*)qApp)->translate("DetailView",s); +} + +#endif // QT_NO_TRANSLATION +QMetaObject* DetailView::staticMetaObject() +{ + if ( metaObj ) + return metaObj; + (void) QWidget::staticMetaObject(); +#ifndef QT_NO_PROPERTIES +#endif // QT_NO_PROPERTIES + typedef void(DetailView::*m1_t0)(int); + typedef void(DetailView::*m1_t1)(const QRect&); + typedef void(DetailView::*m1_t2)(NavUnit*); + typedef void(DetailView::*m1_t3)(const UnitLocation&); + typedef void(DetailView::*m1_t4)(); + m1_t0 v1_0 = Q_AMPERSAND DetailView::movieStatus; + m1_t1 v1_1 = Q_AMPERSAND DetailView::movieUpdate; + m1_t2 v1_2 = Q_AMPERSAND DetailView::currentNode; + m1_t3 v1_3 = Q_AMPERSAND DetailView::updateLocation; + m1_t4 v1_4 = Q_AMPERSAND DetailView::apply; + QMetaData *slot_tbl = QMetaObject::new_metadata(5); + QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(5); + slot_tbl[0].name = "movieStatus(int)"; + slot_tbl[0].ptr = *((QMember*)&v1_0); + slot_tbl_access[0] = QMetaData::Public; + slot_tbl[1].name = "movieUpdate(const QRect&)"; + slot_tbl[1].ptr = *((QMember*)&v1_1); + slot_tbl_access[1] = QMetaData::Public; + slot_tbl[2].name = "currentNode(NavUnit*)"; + slot_tbl[2].ptr = *((QMember*)&v1_2); + slot_tbl_access[2] = QMetaData::Public; + slot_tbl[3].name = "updateLocation(const UnitLocation&)"; + slot_tbl[3].ptr = *((QMember*)&v1_3); + slot_tbl_access[3] = QMetaData::Public; + slot_tbl[4].name = "apply()"; + slot_tbl[4].ptr = *((QMember*)&v1_4); + slot_tbl_access[4] = QMetaData::Public; + metaObj = QMetaObject::new_metaobject( + "DetailView", "QWidget", + slot_tbl, 5, + 0, 0, +#ifndef QT_NO_PROPERTIES + 0, 0, + 0, 0, +#endif // QT_NO_PROPERTIES + 0, 0 ); + metaObj->set_slot_access( slot_tbl_access ); +#ifndef QT_NO_PROPERTIES +#endif // QT_NO_PROPERTIES + return metaObj; +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/moc_MapView.cpp b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/moc_MapView.cpp new file mode 100644 index 00000000000..f1f9b2c977c --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/moc_MapView.cpp @@ -0,0 +1,72 @@ +/**************************************************************************** +** MapView meta object code from reading C++ file 'MapView.h' +** +** Created: Thu Mar 27 10:41:52 2003 +** by: The Qt MOC ($Id$) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#define Q_MOC_MapView +#if !defined(Q_MOC_OUTPUT_REVISION) +#define Q_MOC_OUTPUT_REVISION 8 +#elif Q_MOC_OUTPUT_REVISION != 8 +#error "Moc format conflict - please regenerate all moc files" +#endif + +#include "MapView.h" +#include <qmetaobject.h> +#include <qapplication.h> + +#if defined(Q_SPARCWORKS_FUNCP_BUG) +#define Q_AMPERSAND +#else +#define Q_AMPERSAND & +#endif + + +const char *MapView::className() const +{ + return "MapView"; +} + +QMetaObject *MapView::metaObj = 0; + +void MapView::initMetaObject() +{ + if ( metaObj ) + return; + if ( strcmp(QCanvasView::className(), "QCanvasView") != 0 ) + badSuperclassWarning("MapView","QCanvasView"); + (void) staticMetaObject(); +} + +#ifndef QT_NO_TRANSLATION +QString MapView::tr(const char* s) +{ + return ((QNonBaseApplication*)qApp)->translate("MapView",s); +} + +#endif // QT_NO_TRANSLATION +QMetaObject* MapView::staticMetaObject() +{ + if ( metaObj ) + return metaObj; + (void) QCanvasView::staticMetaObject(); +#ifndef QT_NO_PROPERTIES +#endif // QT_NO_PROPERTIES + QMetaData::Access *slot_tbl_access = 0; + metaObj = QMetaObject::new_metaobject( + "MapView", "QCanvasView", + 0, 0, + 0, 0, +#ifndef QT_NO_PROPERTIES + 0, 0, + 0, 0, +#endif // QT_NO_PROPERTIES + 0, 0 ); + metaObj->set_slot_access( slot_tbl_access ); +#ifndef QT_NO_PROPERTIES +#endif // QT_NO_PROPERTIES + return metaObj; +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/moc_NodeItem.cpp b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/moc_NodeItem.cpp new file mode 100644 index 00000000000..7a038d98075 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/moc_NodeItem.cpp @@ -0,0 +1,78 @@ +/**************************************************************************** +** NodeItem meta object code from reading C++ file 'NodeItem.h' +** +** Created: Thu Mar 27 10:37:28 2003 +** by: The Qt MOC ($Id$) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#define Q_MOC_NodeItem +#if !defined(Q_MOC_OUTPUT_REVISION) +#define Q_MOC_OUTPUT_REVISION 8 +#elif Q_MOC_OUTPUT_REVISION != 8 +#error "Moc format conflict - please regenerate all moc files" +#endif + +#include "NodeItem.h" +#include <qmetaobject.h> +#include <qapplication.h> + +#if defined(Q_SPARCWORKS_FUNCP_BUG) +#define Q_AMPERSAND +#else +#define Q_AMPERSAND & +#endif + + +const char *NodeItem::className() const +{ + return "NodeItem"; +} + +QMetaObject *NodeItem::metaObj = 0; + +void NodeItem::initMetaObject() +{ + if ( metaObj ) + return; + if ( strcmp(QObject::className(), "QObject") != 0 ) + badSuperclassWarning("NodeItem","QObject"); + (void) staticMetaObject(); +} + +#ifndef QT_NO_TRANSLATION +QString NodeItem::tr(const char* s) +{ + return ((QNonBaseApplication*)qApp)->translate("NodeItem",s); +} + +#endif // QT_NO_TRANSLATION +QMetaObject* NodeItem::staticMetaObject() +{ + if ( metaObj ) + return metaObj; + (void) QObject::staticMetaObject(); +#ifndef QT_NO_PROPERTIES +#endif // QT_NO_PROPERTIES + typedef void(NodeItem::*m1_t0)(); + m1_t0 v1_0 = Q_AMPERSAND NodeItem::timerDone; + QMetaData *slot_tbl = QMetaObject::new_metadata(1); + QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(1); + slot_tbl[0].name = "timerDone()"; + slot_tbl[0].ptr = *((QMember*)&v1_0); + slot_tbl_access[0] = QMetaData::Public; + metaObj = QMetaObject::new_metaobject( + "NodeItem", "QObject", + slot_tbl, 1, + 0, 0, +#ifndef QT_NO_PROPERTIES + 0, 0, + 0, 0, +#endif // QT_NO_PROPERTIES + 0, 0 ); + metaObj->set_slot_access( slot_tbl_access ); +#ifndef QT_NO_PROPERTIES +#endif // QT_NO_PROPERTIES + return metaObj; +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/moc_RootPanel.cpp b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/moc_RootPanel.cpp new file mode 100644 index 00000000000..bb3a9bb98fd --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/moc_RootPanel.cpp @@ -0,0 +1,72 @@ +/**************************************************************************** +** RootPanel meta object code from reading C++ file 'RootPanel.h' +** +** Created: Thu Mar 27 10:37:28 2003 +** by: The Qt MOC ($Id$) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#define Q_MOC_RootPanel +#if !defined(Q_MOC_OUTPUT_REVISION) +#define Q_MOC_OUTPUT_REVISION 8 +#elif Q_MOC_OUTPUT_REVISION != 8 +#error "Moc format conflict - please regenerate all moc files" +#endif + +#include "RootPanel.h" +#include <qmetaobject.h> +#include <qapplication.h> + +#if defined(Q_SPARCWORKS_FUNCP_BUG) +#define Q_AMPERSAND +#else +#define Q_AMPERSAND & +#endif + + +const char *RootPanel::className() const +{ + return "RootPanel"; +} + +QMetaObject *RootPanel::metaObj = 0; + +void RootPanel::initMetaObject() +{ + if ( metaObj ) + return; + if ( strcmp(QMainWindow::className(), "QMainWindow") != 0 ) + badSuperclassWarning("RootPanel","QMainWindow"); + (void) staticMetaObject(); +} + +#ifndef QT_NO_TRANSLATION +QString RootPanel::tr(const char* s) +{ + return ((QNonBaseApplication*)qApp)->translate("RootPanel",s); +} + +#endif // QT_NO_TRANSLATION +QMetaObject* RootPanel::staticMetaObject() +{ + if ( metaObj ) + return metaObj; + (void) QMainWindow::staticMetaObject(); +#ifndef QT_NO_PROPERTIES +#endif // QT_NO_PROPERTIES + QMetaData::Access *slot_tbl_access = 0; + metaObj = QMetaObject::new_metaobject( + "RootPanel", "QMainWindow", + 0, 0, + 0, 0, +#ifndef QT_NO_PROPERTIES + 0, 0, + 0, 0, +#endif // QT_NO_PROPERTIES + 0, 0 ); + metaObj->set_slot_access( slot_tbl_access ); +#ifndef QT_NO_PROPERTIES +#endif // QT_NO_PROPERTIES + return metaObj; +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/run_test.pl b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/run_test.pl new file mode 100644 index 00000000000..a90be35e0bd --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/run_test.pl @@ -0,0 +1,108 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "../../../../../../bin"; +use PerlACE::Run_Test; + +$status = 0; +$daemon_ior = PerlACE::LocalFile ("daemon.ior"); +$svr_ior = PerlACE::LocalFile ("server.ior"); +$home_ior = PerlACE::LocalFile ("NavDisplayHome.ior"); + +unlink $daemon_ior; +unlink $svr_ior; +unlink $home_ior; + +# CIAO Daemon command line arguments +$daemon_args = "-o $daemon_ior -i ../CIAO_Installation_Data.ini -n ../../../../tools/ComponentServer/ComponentServer"; + +# CIAO Daemon Controller location: +$controller = "../../../../tools/Daemon/DaemonController"; + +# Daemon controller common command line arguments +$common_args = "-ORBInitRef CIAODaemon=file://$daemon_ior"; + +# Daemon controller start_home command +$start_args = "start_home -s NavDisplayGUI.csd -m $home_ior -c $svr_ior"; + +# Daemon controller end_home command +$end_args = "end_home -c file://$svr_ior"; + +# Daemon controller shutdown command +$shutdown_args = "shutdown"; + +# Client program command line arguments +$cl_args = ""; + +# Naming_Service process definition +$DS = new PerlACE::Process ("../../../../tools/Daemon/CIAO_Daemon", + "$daemon_args"); + +# Client process definition +$CL = new PerlACE::Process ("../NavDisplay/client", + "$cl_args"); + +## Starting up the CIAO daemon +$DS->Spawn (); +if (PerlACE::waitforfile_timed ($daemon_ior, 15) == -1) { + print STDERR "ERROR: Could not find daemon ior file <$daemon_ior>\n"; + $DS->Kill (); + exit 1; +} + +## Starting up a ComponentServer running the RateGen home. +$DC = new PerlACE::Process ("$controller", + "$common_args $start_args"); + +$DC->SpawnWaitKill (60); +if (PerlACE::waitforfile_timed ($home_ior, 15) == -1) { + print STDERR "ERROR: Could not find home ior file <$home_ior>\n"; + $DS->Kill (); + exit 1; +} + +$client = $CL->SpawnWaitKill (60); + +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; +} + +## Terminating the ComponentServer running the RateGen home. +$DC = new PerlACE::Process ("$controller", + "$common_args $end_args"); + +$ctrl = $DC->SpawnWaitKill (60); +if ($ctrl != 0) { + print STDERR "ERROR: Fail to end component server\n"; + $DS->Kill (); + exit 1; +} + +## Terminating the ComponentServer running the RateGen home. +$DC = new PerlACE::Process ("$controller", + "$common_args $shutdown_args"); + +$ctrl = $DC->SpawnWaitKill (60); +if ($ctrl != 0) { + print STDERR "ERROR: Fail to shutdown CIAODaemon\n"; + $DS->Kill (); + exit 1; +} + +$ctrl = $DS->WaitKill (60); +if ($ctrl != 0) { + print STDERR "ERROR: CIAODaemon didn't shutdown gracefully $ctrl\n"; + $DS->Kill (); + exit 1; +} + +unlink $daemon_ior; +unlink $svr_ior; +unlink $home_ior; + +exit $status; diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/trolltech.gif b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/trolltech.gif Binary files differnew file mode 100644 index 00000000000..f674369efc4 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/trolltech.gif diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/worldmap1.gif b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/worldmap1.gif Binary files differnew file mode 100644 index 00000000000..99fe78a7673 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplayGUI_exec/worldmap1.gif diff --git a/TAO/CIAO/examples/handcrafted/Hello/client.dsp b/TAO/CIAO/examples/handcrafted/Hello/client.dsp index ba712821c94..a489bc555c5 100644 --- a/TAO/CIAO/examples/handcrafted/Hello/client.dsp +++ b/TAO/CIAO/examples/handcrafted/Hello/client.dsp @@ -1,25 +1,26 @@ -# Microsoft Developer Studio Project File - Name="client" - Package Owner=<4>
+# Microsoft Developer Studio Project File - Name="client EXE" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
-CFG=client - Win32 Debug
+CFG=client EXE - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
+!MESSAGE run the tool that generated this project file and specify the
+!MESSAGE nmake output type. You can then use the following command:
+!MESSAGE
!MESSAGE NMAKE /f "client.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "client.mak" CFG="client - Win32 Debug"
-!MESSAGE
+!MESSAGE
+!MESSAGE NMAKE /f "client.mak" CFG="client EXE - Win32 Debug"
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "client - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "client - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
+!MESSAGE
+!MESSAGE "client EXE - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "client EXE - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
@@ -28,63 +29,45 @@ CFG=client - Win32 Debug CPP=cl.exe
RSC=rc.exe
-!IF "$(CFG)" == "client - Win32 Release"
+!IF "$(CFG)" == "client EXE - Win32 Release"
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ""
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release\client"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\..\.." /I "..\..\..\.." /I "..\..\.." /I "..\..\..\..\orbsvcs\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
+# ADD CPP /nologo /W3 /GX /O2 /MD /GR /I "..\..\.." /I "..\..\..\ciao" /I "..\..\..\.." /I "..\..\..\..\tao" /I "..\..\..\..\.." /D NDEBUG=1 /D WIN32=1 /D _CONSOLE=1 /FD /c
+# SUBTRACT CPP /YX
+# ADD RSC /l 0x409 /d NDEBUG=1 /i "..\..\.." /i "..\..\..\ciao" /i "..\..\..\.." /i "..\..\..\..\tao" /i "..\..\..\..\.."
BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
+# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 hello_stub.lib ace.lib tao.lib TAO_IFR_Client.lib CIAO_Client.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\..\ace" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\tao\IFR_Client" /libpath:"..\..\..\ciao"
+# ADD LINK32 advapi32.lib user32.lib /INCREMENTAL:NO TAO.lib TAO_IFR_Client.lib CIAO_Client.lib ACE.lib /libpath:"..\..\..\..\tao\IFR_Client" /libpath:"..\..\..\ciao" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace" /nologo /version:1.3.1 /subsystem:console /pdb:"Release\client.pdb" /machine:I386 /out:"Release\client.exe"
-!ELSEIF "$(CFG)" == "client - Win32 Debug"
+!ELSEIF "$(CFG)" == "client EXE - Win32 Debug"
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "client___Win32_Debug"
-# PROP BASE Intermediate_Dir "client___Win32_Debug"
-# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
+# PROP Output_Dir "."
+# PROP Intermediate_Dir "Debug\client"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\.." /I "..\..\..\.." /I "..\..\.." /I "..\..\..\..\orbsvcs\orbsvcs" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
+# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /MDd /GR /Gy /I "..\..\.." /I "..\..\..\ciao" /I "..\..\..\.." /I "..\..\..\..\tao" /I "..\..\..\..\.." /D _DEBUG=1 /D WIN32=1 /D _CONSOLE=1 /FD /c
+# SUBTRACT CPP /YX
+# ADD RSC /l 0x409 /d _DEBUG=1 /i "..\..\.." /i "..\..\..\ciao" /i "..\..\..\.." /i "..\..\..\..\tao" /i "..\..\..\..\.."
BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
+# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 hello_stubd.lib aced.lib taod.lib TAO_IFR_Clientd.lib CIAO_Clientd.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\..\ace" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\tao\IFR_Client" /libpath:"..\..\..\ciao"
+# ADD LINK32 advapi32.lib user32.lib /INCREMENTAL:NO TAOd.lib TAO_IFR_Clientd.lib CIAO_Clientd.lib ACEd.lib /libpath:"..\..\..\..\tao\IFR_Client" /libpath:"..\..\..\ciao" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace" /nologo /version:1.3.1 /subsystem:console /pdb:".\client.pdb" /debug /machine:I386 /out:".\client.exe"
-!ENDIF
+!ENDIF
# Begin Target
-# Name "client - Win32 Release"
-# Name "client - Win32 Debug"
+# Name "client EXE - Win32 Release"
+# Name "client EXE - Win32 Debug"
# Begin Group "Source Files"
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# PROP Default_Filter "cpp;cxx;c"
# Begin Source File
SOURCE=.\client.cpp
@@ -92,11 +75,71 @@ SOURCE=.\client.cpp # End Group
# Begin Group "Header Files"
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# PROP Default_Filter "h;hpp;hxx;hh"
+# Begin Source File
+
+SOURCE=.\hello_executors.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\hello_executors_export.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\hello_servants.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\hello_servants_export.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\hello_stub_export.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\helloC.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\helloEC.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\helloES.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\helloS.h
+# End Source File
+# End Group
+# Begin Group "Inline Files"
+
+# PROP Default_Filter "i;inl"
+# Begin Source File
+
+SOURCE=.\helloC.i
+# End Source File
+# Begin Source File
+
+SOURCE=.\helloEC.i
+# End Source File
+# Begin Source File
+
+SOURCE=.\helloES.i
+# End Source File
+# Begin Source File
+
+SOURCE=.\helloS.i
+# End Source File
# End Group
-# Begin Group "Resource Files"
+# Begin Group "Documentation"
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\README
+# End Source File
# End Group
# End Target
# End Project
diff --git a/TAO/CIAO/examples/handcrafted/Hello/hello_executors.dsp b/TAO/CIAO/examples/handcrafted/Hello/hello_executors.dsp index ff4a4676cb4..43910abe08f 100644 --- a/TAO/CIAO/examples/handcrafted/Hello/hello_executors.dsp +++ b/TAO/CIAO/examples/handcrafted/Hello/hello_executors.dsp @@ -1,95 +1,75 @@ -# Microsoft Developer Studio Project File - Name="hello_executors" - Package Owner=<4>
+# Microsoft Developer Studio Project File - Name="hello_executors DLL" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-CFG=hello_executors - Win32 Debug
+CFG=hello_executors DLL - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
+!MESSAGE run the tool that generated this project file and specify the
+!MESSAGE nmake output type. You can then use the following command:
+!MESSAGE
!MESSAGE NMAKE /f "hello_executors.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "hello_executors.mak" CFG="hello_executors - Win32 Debug"
-!MESSAGE
+!MESSAGE
+!MESSAGE NMAKE /f "hello_executors.mak" CFG="hello_executors DLL - Win32 Debug"
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "hello_executors - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "hello_executors - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
+!MESSAGE
+!MESSAGE "hello_executors DLL - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "hello_executors DLL - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
-MTL=midl.exe
RSC=rc.exe
-!IF "$(CFG)" == "hello_executors - Win32 Release"
+!IF "$(CFG)" == "hello_executors DLL - Win32 Release"
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ""
-# PROP Intermediate_Dir "Release"
+# PROP Output_Dir "."
+# PROP Intermediate_Dir "Release\hello_executors"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HELLO_EXECUTORS_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\..\.." /I "..\..\..\.." /I "..\..\.." /I "..\..\..\..\orbsvcs\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HELLO_EXECUTOR_BUILD_DLL" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
+# ADD CPP /nologo /W3 /GX /O2 /MD /Zi /Ob2 /GR /I "..\..\..\..\orbsvcs\orbsvcs" /I "..\..\.." /I "..\..\..\ciao" /I "..\..\..\.." /I "..\..\..\..\tao" /I "..\..\..\..\.." /D NDEBUG=1 /D WIN32=1 /D _WINDOWS=1 /D HELLO_EXECUTOR_BUILD_DLL=1 /FD /c
+# SUBTRACT CPP /YX
+# ADD RSC /l 0x409 /d NDEBUG=1 /i "..\..\..\..\orbsvcs\orbsvcs" /i "..\..\.." /i "..\..\..\ciao" /i "..\..\..\.." /i "..\..\..\..\tao" /i "..\..\..\..\.."
BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
+# ADD BSC32 /nologo /o".\hello_executors.bsc"
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 ace.lib tao.lib hello_stub.lib TAO_IFR_Client.lib CIAO_Container.lib TAO_PortableServer.lib TAO_Security.lib /nologo /dll /machine:I386 /libpath:"..\..\..\..\..\ace" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\tao\PortableServer" /libpath:"..\..\..\..\tao\IFR_Client" /libpath:"..\..\..\ciao" /libpath:"..\..\..\..\orbsvcs\orbsvcs"
+# ADD LINK32 advapi32.lib user32.lib /INCREMENTAL:NO hello_stub.lib hello_servants.lib CIAO_Server.lib TAO_PortableServer.lib TAO_Security.lib CIAO_Container.lib TAO.lib TAO_IFR_Client.lib CIAO_Client.lib ACE.lib /libpath:"..\..\..\..\tao\PortableServer" /libpath:"..\..\..\..\orbsvcs\orbsvcs" /libpath:"..\..\..\..\tao\IFR_Client" /libpath:"..\..\..\ciao" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace" /nologo /version:1.3.1 /subsystem:windows /pdb:"..\..\..\..\..\bin\hello_executors.pdb" /dll /machine:I386 /out:"..\..\..\..\..\bin\hello_executors.dll"
-!ELSEIF "$(CFG)" == "hello_executors - Win32 Debug"
+!ELSEIF "$(CFG)" == "hello_executors DLL - Win32 Debug"
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
-# PROP Intermediate_Dir "Debug"
+# PROP Output_Dir "."
+# PROP Intermediate_Dir "Debug\hello_executors"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HELLO_EXECUTORS_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\.." /I "..\..\..\.." /I "..\..\.." /I "..\..\..\..\orbsvcs\orbsvcs" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HELLO_EXECUTOR_BUILD_DLL" /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
+# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /MDd /GR /Gy /I "..\..\..\..\orbsvcs\orbsvcs" /I "..\..\.." /I "..\..\..\ciao" /I "..\..\..\.." /I "..\..\..\..\tao" /I "..\..\..\..\.." /D _DEBUG=1 /D WIN32=1 /D _WINDOWS=1 /D HELLO_EXECUTOR_BUILD_DLL=1 /FD /c
+# SUBTRACT CPP /Fr /YX
+# ADD RSC /l 0x409 /d _DEBUG=1 /i "..\..\..\..\orbsvcs\orbsvcs" /i "..\..\.." /i "..\..\..\ciao" /i "..\..\..\.." /i "..\..\..\..\tao" /i "..\..\..\..\.."
BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
+# ADD BSC32 /nologo /o".\hello_executors.bsc"
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib taod.lib hello_stubd.lib TAO_IFR_Clientd.lib CIAO_Containerd.lib TAO_PortableServerd.lib TAO_Securityd.lib /nologo /dll /debug /machine:I386 /out:"hello_executorsd.dll" /pdbtype:sept /libpath:"..\..\..\..\..\ace" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\tao\PortableServer" /libpath:"..\..\..\..\tao\IFR_Client" /libpath:"..\..\..\ciao" /libpath:"..\..\..\..\orbsvcs\orbsvcs"
+# ADD LINK32 advapi32.lib user32.lib /INCREMENTAL:NO hello_stubd.lib hello_servantsd.lib CIAO_Serverd.lib TAO_PortableServerd.lib TAO_Securityd.lib CIAO_Containerd.lib TAOd.lib TAO_IFR_Clientd.lib CIAO_Clientd.lib ACEd.lib /libpath:"..\..\..\..\tao\PortableServer" /libpath:"..\..\..\..\orbsvcs\orbsvcs" /libpath:"..\..\..\..\tao\IFR_Client" /libpath:"..\..\..\ciao" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace" /nologo /version:1.3.1 /subsystem:windows /pdb:"..\..\..\..\..\bin\hello_executorsd.pdb" /dll /debug /machine:I386 /out:"..\..\..\..\..\bin\hello_executorsd.dll"
-!ENDIF
+!ENDIF
# Begin Target
-# Name "hello_executors - Win32 Release"
-# Name "hello_executors - Win32 Debug"
+# Name "hello_executors DLL - Win32 Release"
+# Name "hello_executors DLL - Win32 Debug"
# Begin Group "Source Files"
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# PROP Default_Filter "cpp;cxx;c"
# Begin Source File
SOURCE=.\hello_executors.cpp
@@ -97,23 +77,39 @@ SOURCE=.\hello_executors.cpp # End Group
# Begin Group "Header Files"
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# PROP Default_Filter "h;hpp;hxx;hh"
# Begin Source File
SOURCE=.\hello_executors.h
# End Source File
+# End Group
+# Begin Group "Inline Files"
+
+# PROP Default_Filter "i;inl"
# Begin Source File
-SOURCE=.\hello_executors_export.h
+SOURCE=.\helloC.i
# End Source File
-# End Group
-# Begin Group "Resource Files"
+# Begin Source File
+
+SOURCE=.\helloEC.i
+# End Source File
+# Begin Source File
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+SOURCE=.\helloES.i
+# End Source File
+# Begin Source File
+
+SOURCE=.\helloS.i
+# End Source File
# End Group
-# Begin Group "Inline Files"
+# Begin Group "Documentation"
+
+# PROP Default_Filter ""
+# Begin Source File
-# PROP Default_Filter "i,inl"
+SOURCE=.\README
+# End Source File
# End Group
# End Target
# End Project
diff --git a/TAO/CIAO/examples/handcrafted/Hello/hello_servants.dsp b/TAO/CIAO/examples/handcrafted/Hello/hello_servants.dsp index c7a20c59917..2f3839da2bb 100644 --- a/TAO/CIAO/examples/handcrafted/Hello/hello_servants.dsp +++ b/TAO/CIAO/examples/handcrafted/Hello/hello_servants.dsp @@ -1,95 +1,75 @@ -# Microsoft Developer Studio Project File - Name="hello_servants" - Package Owner=<4>
+# Microsoft Developer Studio Project File - Name="hello_servants DLL" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-CFG=hello_servants - Win32 Debug
+CFG=hello_servants DLL - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
+!MESSAGE run the tool that generated this project file and specify the
+!MESSAGE nmake output type. You can then use the following command:
+!MESSAGE
!MESSAGE NMAKE /f "hello_servants.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "hello_servants.mak" CFG="hello_servants - Win32 Debug"
-!MESSAGE
+!MESSAGE
+!MESSAGE NMAKE /f "hello_servants.mak" CFG="hello_servants DLL - Win32 Debug"
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "hello_servants - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "hello_servants - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
+!MESSAGE
+!MESSAGE "hello_servants DLL - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "hello_servants DLL - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
-MTL=midl.exe
RSC=rc.exe
-!IF "$(CFG)" == "hello_servants - Win32 Release"
+!IF "$(CFG)" == "hello_servants DLL - Win32 Release"
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ""
-# PROP Intermediate_Dir "Release"
+# PROP Output_Dir "."
+# PROP Intermediate_Dir "Release\hello_servants"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HELLO_SERVANTS_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\..\.." /I "..\..\..\.." /I "..\..\.." /I "..\..\..\..\orbsvcs\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HELLO_SERVANT_BUILD_DLL" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
+# ADD CPP /nologo /W3 /GX /O2 /MD /Zi /Ob2 /GR /I "..\..\..\..\orbsvcs\orbsvcs" /I "..\..\.." /I "..\..\..\ciao" /I "..\..\..\.." /I "..\..\..\..\tao" /I "..\..\..\..\.." /D NDEBUG=1 /D WIN32=1 /D _WINDOWS=1 /D HELLO_SERVANT_BUILD_DLL=1 /FD /c
+# SUBTRACT CPP /YX
+# ADD RSC /l 0x409 /d NDEBUG=1 /i "..\..\..\..\orbsvcs\orbsvcs" /i "..\..\.." /i "..\..\..\ciao" /i "..\..\..\.." /i "..\..\..\..\tao" /i "..\..\..\..\.."
BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
+# ADD BSC32 /nologo /o".\hello_servants.bsc"
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 ace.lib tao.lib hello_stub.lib TAO_IFR_Client.lib CIAO_Container.lib CIAO_Client.lib TAO_PortableServer.lib TAO_Security.lib /nologo /dll /machine:I386 /libpath:"..\..\..\..\..\ace" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\tao\PortableServer" /libpath:"..\..\..\..\tao\IFR_Client" /libpath:"..\..\..\ciao" /libpath:"..\..\..\..\orbsvcs\orbsvcs"
+# ADD LINK32 advapi32.lib user32.lib /INCREMENTAL:NO hello_stub.lib CIAO_Server.lib TAO_PortableServer.lib TAO_Security.lib CIAO_Container.lib TAO.lib TAO_IFR_Client.lib CIAO_Client.lib ACE.lib /libpath:"..\..\..\..\tao\PortableServer" /libpath:"..\..\..\..\orbsvcs\orbsvcs" /libpath:"..\..\..\..\tao\IFR_Client" /libpath:"..\..\..\ciao" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace" /nologo /version:1.3.1 /subsystem:windows /pdb:"..\..\..\..\..\bin\hello_servants.pdb" /dll /machine:I386 /out:"..\..\..\..\..\bin\hello_servants.dll"
-!ELSEIF "$(CFG)" == "hello_servants - Win32 Debug"
+!ELSEIF "$(CFG)" == "hello_servants DLL - Win32 Debug"
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
-# PROP Intermediate_Dir "Debug"
+# PROP Output_Dir "."
+# PROP Intermediate_Dir "Debug\hello_servants"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HELLO_SERVANTS_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\.." /I "..\..\..\.." /I "..\..\.." /I "..\..\..\..\orbsvcs\orbsvcs" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HELLO_SERVANT_BUILD_DLL" /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
+# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /MDd /GR /Gy /I "..\..\..\..\orbsvcs\orbsvcs" /I "..\..\.." /I "..\..\..\ciao" /I "..\..\..\.." /I "..\..\..\..\tao" /I "..\..\..\..\.." /D _DEBUG=1 /D WIN32=1 /D _WINDOWS=1 /D HELLO_SERVANT_BUILD_DLL=1 /FD /c
+# SUBTRACT CPP /Fr /YX
+# ADD RSC /l 0x409 /d _DEBUG=1 /i "..\..\..\..\orbsvcs\orbsvcs" /i "..\..\.." /i "..\..\..\ciao" /i "..\..\..\.." /i "..\..\..\..\tao" /i "..\..\..\..\.."
BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
+# ADD BSC32 /nologo /o".\hello_servants.bsc"
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib taod.lib hello_stubd.lib TAO_IFR_Clientd.lib CIAO_Containerd.lib CIAO_Clientd.lib TAO_PortableServerd.lib TAO_Securityd.lib CIAO_serverd.lib /nologo /dll /debug /machine:I386 /out:"hello_servantsd.dll" /pdbtype:sept /libpath:"..\..\..\..\..\ace" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\tao\PortableServer" /libpath:"..\..\..\..\tao\IFR_Client" /libpath:"..\..\..\ciao" /libpath:"..\..\..\..\orbsvcs\orbsvcs"
+# ADD LINK32 advapi32.lib user32.lib /INCREMENTAL:NO hello_stubd.lib CIAO_Serverd.lib TAO_PortableServerd.lib TAO_Securityd.lib CIAO_Containerd.lib TAOd.lib TAO_IFR_Clientd.lib CIAO_Clientd.lib ACEd.lib /libpath:"..\..\..\..\tao\PortableServer" /libpath:"..\..\..\..\orbsvcs\orbsvcs" /libpath:"..\..\..\..\tao\IFR_Client" /libpath:"..\..\..\ciao" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace" /nologo /version:1.3.1 /subsystem:windows /pdb:"..\..\..\..\..\bin\hello_servantsd.pdb" /dll /debug /machine:I386 /out:"..\..\..\..\..\bin\hello_servantsd.dll"
-!ENDIF
+!ENDIF
# Begin Target
-# Name "hello_servants - Win32 Release"
-# Name "hello_servants - Win32 Debug"
+# Name "hello_servants DLL - Win32 Release"
+# Name "hello_servants DLL - Win32 Debug"
# Begin Group "Source Files"
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# PROP Default_Filter "cpp;cxx;c"
# Begin Source File
SOURCE=.\hello_servants.cpp
@@ -105,17 +85,13 @@ SOURCE=.\helloS.cpp # End Group
# Begin Group "Header Files"
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# PROP Default_Filter "h;hpp;hxx;hh"
# Begin Source File
SOURCE=.\hello_servants.h
# End Source File
# Begin Source File
-SOURCE=.\hello_servants_export.h
-# End Source File
-# Begin Source File
-
SOURCE=.\helloEC.h
# End Source File
# Begin Source File
@@ -123,13 +99,9 @@ SOURCE=.\helloEC.h SOURCE=.\helloS.h
# End Source File
# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
# Begin Group "Inline Files"
-# PROP Default_Filter "i,inl"
+# PROP Default_Filter "i;inl"
# Begin Source File
SOURCE=.\helloEC.i
@@ -139,57 +111,86 @@ SOURCE=.\helloEC.i SOURCE=.\helloS.i
# End Source File
# End Group
-# Begin Group "IDL Files"
+# Begin Group "Documentation"
# PROP Default_Filter ""
# Begin Source File
+SOURCE=.\README
+# End Source File
+# End Group
+# Begin Group "IDL Files"
+
+# PROP Default_Filter "idl"
+# Begin Source File
+
SOURCE=.\helloE.idl
-!IF "$(CFG)" == "hello_servants - Win32 Release"
+!IF "$(CFG)" == "hello_servants DLL - Win32 Release"
# PROP Ignore_Default_Tool 1
# Begin Custom Build - Invoking TAO_IDL Compiler on $(InputPath)
InputPath=.\helloE.idl
InputName=helloE
+InputDir=.
+OutDir=.
BuildCmds= \
- ..\..\..\..\..\bin\release\tao_idl -I ../../.. -I ../../../.. -I ../../../../orbsvcs/orbsvcs -Wb,export_macro=HELLO_SERVANT_Export -Wb,export_include=hello_servants_export.h -Wb,pre_include="ace/pre.h" -Wb,post_include="ace/post.h" -Sc -Ge 1 $(InputName).idl \
- del *S.* \
- del *S_T.* \
-
+ ..\..\..\..\..\bin\tao_idl -o $(OutDir) -I ..\..\.. -I ..\..\..\.. -I ..\..\..\..\orbsvcs\orbsvcs -Wb,export_macro=HELLO_SERVANT_Export -Wb,export_include=hello_servants_export.h -Wb,pre_include="ace\pre.h" -Wb,post_include="ace\post.h" -I..\..\..\.. -I..\..\..\..\CIAO\ciao -Wb,pre_include="ace\pre.h" -Wb,post_include="ace\post.h" -I ..\..\.. -I ..\..\..\.. -I ..\..\..\..\orbsvcs\orbsvcs -Ge 1 -Sc $(InputPath)
+
+"$(OutDir)\$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(OutDir)\$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
-"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
+
+"$(OutDir)\$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
# End Custom Build
-!ELSEIF "$(CFG)" == "hello_servants - Win32 Debug"
+!ELSEIF "$(CFG)" == "hello_servants DLL - Win32 Debug"
# PROP Ignore_Default_Tool 1
# Begin Custom Build - Invoking TAO_IDL Compiler on $(InputPath)
InputPath=.\helloE.idl
InputName=helloE
+InputDir=.
+OutDir=.
BuildCmds= \
- ..\..\..\..\..\bin\tao_idl -I ../../.. -I ../../../.. -I ../../../../orbsvcs/orbsvcs -Wb,export_macro=HELLO_SERVANT_Export -Wb,export_include=hello_servants_export.h -Wb,pre_include="ace/pre.h" -Wb,post_include="ace/post.h" -Sc -Ge 1 $(InputName).idl
+ ..\..\..\..\..\bin\tao_idl -o $(OutDir) -I ..\..\.. -I ..\..\..\.. -I ..\..\..\..\orbsvcs\orbsvcs -Wb,export_macro=HELLO_SERVANT_Export -Wb,export_include=hello_servants_export.h -Wb,pre_include="ace\pre.h" -Wb,post_include="ace\post.h" -I..\..\..\.. -I..\..\..\..\CIAO\ciao -Wb,pre_include="ace\pre.h" -Wb,post_include="ace\post.h" -I ..\..\.. -I ..\..\..\.. -I ..\..\..\..\orbsvcs\orbsvcs -Ge 1 -Sc $(InputPath)
-"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
+
+"$(OutDir)\$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(OutDir)\$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(OutDir)\$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
# End Custom Build
-!ENDIF
+!ENDIF
# End Source File
# End Group
diff --git a/TAO/CIAO/examples/handcrafted/Hello/hello_stub.dsp b/TAO/CIAO/examples/handcrafted/Hello/hello_stub.dsp index 19928f82efd..650d285844b 100644 --- a/TAO/CIAO/examples/handcrafted/Hello/hello_stub.dsp +++ b/TAO/CIAO/examples/handcrafted/Hello/hello_stub.dsp @@ -1,95 +1,75 @@ -# Microsoft Developer Studio Project File - Name="hello_stub" - Package Owner=<4>
+# Microsoft Developer Studio Project File - Name="hello_stub DLL" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-CFG=hello_stub - Win32 Debug
+CFG=hello_stub DLL - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
+!MESSAGE run the tool that generated this project file and specify the
+!MESSAGE nmake output type. You can then use the following command:
+!MESSAGE
!MESSAGE NMAKE /f "hello_stub.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "hello_stub.mak" CFG="hello_stub - Win32 Debug"
-!MESSAGE
+!MESSAGE
+!MESSAGE NMAKE /f "hello_stub.mak" CFG="hello_stub DLL - Win32 Debug"
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "hello_stub - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "hello_stub - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
+!MESSAGE
+!MESSAGE "hello_stub DLL - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "hello_stub DLL - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
-MTL=midl.exe
RSC=rc.exe
-!IF "$(CFG)" == "hello_stub - Win32 Release"
+!IF "$(CFG)" == "hello_stub DLL - Win32 Release"
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ""
-# PROP Intermediate_Dir "Release"
+# PROP Output_Dir "."
+# PROP Intermediate_Dir "Release\hello_stub"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HELLO_STUB_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HELLO_STUB_EXPORTS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
+# ADD CPP /nologo /W3 /GX /O2 /MD /Zi /Ob2 /GR /I "..\..\.." /I "..\..\..\ciao" /I "..\..\..\.." /I "..\..\..\..\tao" /I "..\..\..\..\.." /D NDEBUG=1 /D WIN32=1 /D _WINDOWS=1 /D HELLO_STUB_BUILD_DLL=1 /FD /c
+# SUBTRACT CPP /YX
+# ADD RSC /l 0x409 /d NDEBUG=1 /i "..\..\.." /i "..\..\..\ciao" /i "..\..\..\.." /i "..\..\..\..\tao" /i "..\..\..\..\.."
BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
+# ADD BSC32 /nologo /o".\hello_stub.bsc"
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 ace.lib tao.lib TAO_IFR_Client.lib CIAO_Client.lib /nologo /dll /machine:I386 /libpath:"..\..\..\..\..\ace" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\tao\IFR_Client" /libpath:"..\..\..\ciao"
+# ADD LINK32 advapi32.lib user32.lib /INCREMENTAL:NO TAO.lib TAO_IFR_Client.lib CIAO_Client.lib ACE.lib /libpath:"..\..\..\..\tao\IFR_Client" /libpath:"..\..\..\ciao" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace" /nologo /version:1.3.1 /subsystem:windows /pdb:"..\..\..\..\..\bin\hello_stub.pdb" /dll /machine:I386 /out:"..\..\..\..\..\bin\hello_stub.dll"
-!ELSEIF "$(CFG)" == "hello_stub - Win32 Debug"
+!ELSEIF "$(CFG)" == "hello_stub DLL - Win32 Debug"
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "hello_stub___Win32_Debug"
-# PROP BASE Intermediate_Dir "hello_stub___Win32_Debug"
-# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
-# PROP Intermediate_Dir "Debug"
+# PROP Output_Dir "."
+# PROP Intermediate_Dir "Debug\hello_stub"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HELLO_STUB_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\.." /I "..\..\..\.." /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HELLO_STUB_BUILD_DLL" /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
+# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /MDd /GR /Gy /I "..\..\.." /I "..\..\..\ciao" /I "..\..\..\.." /I "..\..\..\..\tao" /I "..\..\..\..\.." /D _DEBUG=1 /D WIN32=1 /D _WINDOWS=1 /D HELLO_STUB_BUILD_DLL=1 /FD /c
+# SUBTRACT CPP /Fr /YX
+# ADD RSC /l 0x409 /d _DEBUG=1 /i "..\..\.." /i "..\..\..\ciao" /i "..\..\..\.." /i "..\..\..\..\tao" /i "..\..\..\..\.."
BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
+# ADD BSC32 /nologo /o".\hello_stub.bsc"
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib taod.lib TAO_IFR_Clientd.lib CIAO_Clientd.lib /nologo /dll /debug /machine:I386 /out:"hello_stubd.dll" /pdbtype:sept /libpath:"..\..\..\..\..\ace" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\tao\IFR_Client" /libpath:"..\..\..\ciao"
+# ADD LINK32 advapi32.lib user32.lib /INCREMENTAL:NO TAOd.lib TAO_IFR_Clientd.lib CIAO_Clientd.lib ACEd.lib /libpath:"..\..\..\..\tao\IFR_Client" /libpath:"..\..\..\ciao" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace" /nologo /version:1.3.1 /subsystem:windows /pdb:"..\..\..\..\..\bin\hello_stubd.pdb" /dll /debug /machine:I386 /out:"..\..\..\..\..\bin\hello_stubd.dll"
-!ENDIF
+!ENDIF
# Begin Target
-# Name "hello_stub - Win32 Release"
-# Name "hello_stub - Win32 Debug"
+# Name "hello_stub DLL - Win32 Release"
+# Name "hello_stub DLL - Win32 Debug"
# Begin Group "Source Files"
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# PROP Default_Filter "cpp;cxx;c"
# Begin Source File
SOURCE=.\helloC.cpp
@@ -97,11 +77,7 @@ SOURCE=.\helloC.cpp # End Group
# Begin Group "Header Files"
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\hello_stub_export.h
-# End Source File
+# PROP Default_Filter "h;hpp;hxx;hh"
# Begin Source File
SOURCE=.\helloC.h
@@ -109,12 +85,20 @@ SOURCE=.\helloC.h # End Group
# Begin Group "Inline Files"
-# PROP Default_Filter "i,inl"
+# PROP Default_Filter "i;inl"
# Begin Source File
SOURCE=.\helloC.i
# End Source File
# End Group
+# Begin Group "Documentation"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\README
+# End Source File
+# End Group
# Begin Group "IDL Files"
# PROP Default_Filter "idl"
@@ -122,65 +106,71 @@ SOURCE=.\helloC.i SOURCE=.\hello.idl
-!IF "$(CFG)" == "hello_stub - Win32 Release"
+!IF "$(CFG)" == "hello_stub DLL - Win32 Release"
# PROP Ignore_Default_Tool 1
# Begin Custom Build - Invoking TAO_IDL Compiler on $(InputPath)
InputPath=.\hello.idl
InputName=hello
+InputDir=.
+OutDir=.
BuildCmds= \
- ..\..\..\..\..\bin\release\tao_idl -I ../../.. -I ../../../.. -I ../../../../orbsvcs/orbsvcs -Wb,stub_export_macro=HELLO_STUB_Export -Wb,stub_export_include=hello_stub_export.h -Wb,skel_export_macro=HELLO_SERVANT_Export -Wb,skel_export_include=hello_servants_export.h -Wb,pre_include="ace/pre.h" -Wb,post_include="ace/post.h" -Sc -Ge 1 $(InputName).idl
+ ..\..\..\..\..\bin\tao_idl -o $(OutDir) -Wb,stub_export_macro=HELLO_STUB_Export -Wb,stub_export_include=hello_stub_export.h -Wb,skel_export_macro=HELLO_SERVANT_Export -Wb,skel_export_include=hello_servants_export.h -Wb,pre_include="ace\pre.h" -Wb,post_include="ace\post.h" -I ..\..\.. -I ..\..\..\.. -I ..\..\..\..\orbsvcs\orbsvcs -Wb,pre_include="ace\pre.h" -Wb,post_include="ace\post.h" -I ..\..\.. -I ..\..\..\.. -I ..\..\..\..\orbsvcs\orbsvcs -Ge 1 -Sc $(InputPath)
-"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
+
# End Custom Build
-!ELSEIF "$(CFG)" == "hello_stub - Win32 Debug"
+!ELSEIF "$(CFG)" == "hello_stub DLL - Win32 Debug"
# PROP Ignore_Default_Tool 1
# Begin Custom Build - Invoking TAO_IDL Compiler on $(InputPath)
InputPath=.\hello.idl
InputName=hello
+InputDir=.
+OutDir=.
BuildCmds= \
- ..\..\..\..\..\bin\tao_idl -I ../../.. -I ../../../.. -I ../../../../orbsvcs/orbsvcs -Wb,stub_export_macro=HELLO_STUB_Export -Wb,stub_export_include=hello_stub_export.h -Wb,skel_export_macro=HELLO_SERVANT_Export -Wb,skel_export_include=hello_servants_export.h -Wb,pre_include="ace/pre.h" -Wb,post_include="ace/post.h" -Sc -Ge 1 $(InputName).idl
+ ..\..\..\..\..\bin\tao_idl -o $(OutDir) -Wb,stub_export_macro=HELLO_STUB_Export -Wb,stub_export_include=hello_stub_export.h -Wb,skel_export_macro=HELLO_SERVANT_Export -Wb,skel_export_include=hello_servants_export.h -Wb,pre_include="ace\pre.h" -Wb,post_include="ace\post.h" -I ..\..\.. -I ..\..\..\.. -I ..\..\..\..\orbsvcs\orbsvcs -Wb,pre_include="ace\pre.h" -Wb,post_include="ace\post.h" -I ..\..\.. -I ..\..\..\.. -I ..\..\..\..\orbsvcs\orbsvcs -Ge 1 -Sc $(InputPath)
-"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"$(OutDir)\$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
+
# End Custom Build
-!ENDIF
+!ENDIF
# End Source File
# End Group
diff --git a/TAO/CIAO/tools/XML_Helpers/Assembly_Handlers.cpp b/TAO/CIAO/tools/XML_Helpers/Assembly_Handlers.cpp new file mode 100644 index 00000000000..0b76f5d094b --- /dev/null +++ b/TAO/CIAO/tools/XML_Helpers/Assembly_Handlers.cpp @@ -0,0 +1,723 @@ +// $Id$ + +#include "Assembly_Handlers.h" + +#if !defined (__ACE_INLINE__) +# include "Assembly_Handlers.inl" +#endif /* __ACE_INLINE__ */ + +void +CIAO::Assembly_Handler::characters (const ACEXML_Char *cdata, + int start, + int len + ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ +} + +void +CIAO::Assembly_Handler::startElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName, + ACEXML_Attributes *alist + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + switch (this->state_) + { + case START: + if (ACE_OS::strcmp (qName, "componentfiles") == 0) + { + ACE_DEBUG ((LM_DEBUG, "Start componentfiles\n")); + CIAO::XMLHelpers::Cascadable_DocHandler *new_handler; + + ACE_NEW (new_handler, + CIAO::Comp_File_Handler (this->context_, + this->parser_, + this, + namespaceURI, + localName, + qName, + alist + ACEXML_ENV_ARG_PARAMETER)); + ACEXML_CHECK; + + this->push_handler (new_handler, + alist + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + } + return; + + case COMPONENTFILES_DONE: + if (ACE_OS::strcmp (qName, "partitioning") == 0) + { + ACE_DEBUG ((LM_DEBUG, "Start partitioning\n")); + CIAO::XMLHelpers::Cascadable_DocHandler *new_handler; + + ACE_NEW (new_handler, + CIAO::Partitioning_Handler (this->context_, + this->parser_, + this, + namespaceURI, + localName, + qName, + alist + ACEXML_ENV_ARG_PARAMETER)); + ACEXML_CHECK; + + this->push_handler (new_handler, + alist + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + } + return; + + + case PLACEMENT_DONE: + if (ACE_OS::strcmp (qName, "connections") == 0) + { + ACE_DEBUG ((LM_DEBUG, "Start connections\n")); + CIAO::XMLHelpers::Cascadable_DocHandler *new_handler; + + ACE_NEW (new_handler, + CIAO::Connections_Handler (this->context_, + this->parser_, + this, + namespaceURI, + localName, + qName, + alist + ACEXML_ENV_ARG_PARAMETER)); + ACEXML_CHECK; + + this->push_handler (new_handler, + alist + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + } + return; + + case CONNECTION_DONE: + if (ACE_OS::strcmp (qName, "extension") == 0) + { + ACE_DEBUG ((LM_DEBUG, "Start skipping extension\n")); + CIAO::XMLHelpers::Cascadable_DocHandler *new_handler; + + ACE_NEW (new_handler, + CIAO::XMLHelpers::Skip_DocHandler (this->parser_, + this, + namespaceURI, + localName, + qName, + alist + ACEXML_ENV_ARG_PARAMETER)); + ACEXML_CHECK; + + this->push_handler (new_handler, + alist + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + } + return; + + + default: + ACEXML_THROW (ACEXML_SAXException + (ACE_TEXT ("Assembly handler internal error"))); + break; + } + ACEXML_THROW (ACEXML_SAXException + (ACE_TEXT ("Assembly handler internal error"))); +} + +void +CIAO::Assembly_Handler::endElement (const ACEXML_Char *, + const ACEXML_Char *, + const ACEXML_Char *qName + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + switch (this->state_) + { + case START: + if (ACE_OS::strcmp (qName, "componentfiles") == 0) + { + ACE_DEBUG ((LM_DEBUG, "End componentfiles\n")); + this->state_ = COMPONENTFILES_DONE; + } + return; + + case COMPONENTFILES_DONE: + if (ACE_OS::strcmp (qName, "partitioning") == 0) + { + ACE_DEBUG ((LM_DEBUG, "End partitioning\n")); + this->state_ = PLACEMENT_DONE; + } + return; + + case PLACEMENT_DONE: + if (ACE_OS::strcmp (qName, "connections") == 0) + { + ACE_DEBUG ((LM_DEBUG, "End connections\n")); + this->state_ = CONNECTION_DONE; + } + return; + + case CONNECTION_DONE: + if (ACE_OS::strcmp (qName, "extension") == 0) + { + ACE_DEBUG ((LM_DEBUG, "End skipping extension\n")); + this->state_ = DONE; + } + return; + + default: + ACEXML_THROW (ACEXML_SAXException + (ACE_TEXT ("Assembly handler internal error"))); + break; + } + ACEXML_THROW (ACEXML_SAXException + (ACE_TEXT ("Assembly handler internal error"))); +} + +// ================================================================= + +void +CIAO::Comp_File_Handler::endElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + ACE_TRACE ("CIAO::Comp_File_Handler::endElement"); + + --this->element_count_; + if (this->element_count_ == 0) + { + this->parent_->pop_handler (namespaceURI, + localName, + qName + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + } + + if (ACE_OS::strcmp (qName, "componentfile") == 0) + { + // @@ We can only handle fileinarchive for now. + if (this->id_.length () == 0 || this->fileinarchive_.length () == 0) + ACEXML_THROW + (ACEXML_SAXException + ("No valid id or component implementation in element \"componentfile\"")); + + if (this->context_->componentfiles_.bind (this->id_, + this->fileinarchive_) != 0) + ACEXML_THROW + (ACEXML_SAXException + ("File to bind component implementation with id in element \"componentfile\"")); + + this->id_.clear (); + this->fileinarchive_.clear (); + } + +} + +/* +<!ENTITY % simple-link-attributes " + xml:link CDATA #FIXED 'SIMPLE' + href CDATA #REQUIRED +" > + +<!ELEMENT fileinarchive + ( link? ) > +<!ATTLIST fileinarchive + name CDATA #REQUIRED > + +<!ELEMENT codebase EMPTY > +<!ATTLIST codebase + filename CDATA #IMPLIED + %simple-link-attributes; > + +<!ELEMENT link ( #PCDATA ) > +<!ATTLIST link + %simple-link-attributes; > +*/ + +void +CIAO::Comp_File_Handler::startElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName, + ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + ACE_TRACE ("CIAO::Comp_File_Handler::startElement"); + ++this->element_count_; + + if (ACE_OS::strcmp (qName, "componentfile") == 0) + { + for (size_t i = 0; i < atts->getLength (); ++i) + { + if (ACE_OS_String::strcmp (atts->getQName (i), ACE_TEXT ("id")) == 0) + { + this->id_ = atts->getValue (i); + } + else if (ACE_OS_String::strcmp (atts->getQName (i), ACE_TEXT ("type")) == 0) + { + // @@ Discard the value for now. CIAO doesn't support + // things other than CORBA component. + } + else + { + ACEXML_THROW + (ACEXML_SAXException + ("Invalid attribute encountered in element \"componentfile\"")); + } + } + } + else if (ACE_OS::strcmp (qName, "fileinarchive") == 0) + { + for (size_t i = 0; i < atts->getLength (); ++i) + { + if (ACE_OS_String::strcmp (atts->getQName (i), "name") == 0) + { + this->fileinarchive_ = atts->getValue (i); + } + else + { + ACEXML_THROW + (ACEXML_SAXException + ("Invalid attribute encountered in element \"fileinarchive\"")); + } + } + } + else if (ACE_OS::strcmp (qName, "link") == 0) + { + } + else if (ACE_OS::strcmp (qName, "codebase") == 0) + { + } + else if (ACE_OS::strcmp (qName, "componentfiles") == 0) + { + // Do nothing + } + else + { + ACE_DEBUG ((LM_DEBUG, "tag is: %s\n", qName)); + ACEXML_THROW (ACEXML_SAXException + (ACE_TEXT ("Invalid tag encounter while parsing \"componentfiles\""))); + } +} + +// ================================================================= + +void +CIAO::Partitioning_Handler::endElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + ACE_TRACE ("CIAO::Partitioning_Handler::endElement"); + + --this->element_count_; + if (this->element_count_ == 0) + { + this->parent_->pop_handler (namespaceURI, + localName, + qName + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + } + + switch (this->state_) + { + case START: + if (ACE_OS::strcmp (qName, "hostcollocation") == 0) + { + this->context_->partitioning_.insert_tail (this->host_collocation_); + this->host_collocation_ = 0; + } + else if (ACE_OS::strcmp (qName, "processcollocation") == 0) + { + if (this->host_collocation_ != 0) + this->host_collocation_->insert_tail (this->process_collocation_); + else + this->context_->partitioning_.insert_tail (this->process_collocation_); + this->process_collocation_ = 0; + } + else if (ACE_OS::strcmp (qName, "partitioning") == 0) + { + } + else if (ACE_OS::strcmp (qName, "extension") == 0) + { + // Do nothing for now. + } + else if (ACE_OS::strcmp (qName, "destination") == 0) + { + if (this->process_collocation_ != 0) + this->process_collocation_->destination (this->characters_.c_str ()); + else + this->host_collocation_->destination (this->characters_.c_str ()); + } + else if (ACE_OS::strcmp (qName, "usagename") == 0) + { + if (this->process_collocation_ != 0) + this->process_collocation_->usagename (this->characters_.c_str ()); + else + this->host_collocation_->usagename (this->characters_.c_str ()); + } + break; + + case HOMEPLACEMENT: + if (ACE_OS::strcmp (qName, "homeplacement") == 0) + { + this->state_ = START; + if (this->process_collocation_ != 0) + this->process_collocation_->insert_tail (this->home_placement_); + else if (this->host_collocation_ != 0) + this->host_collocation_->insert_tail (this->home_placement_); + else + this->context_->partitioning_.insert_tail (this->home_placement_); + this->home_placement_ = 0; + } + else if (ACE_OS::strcmp (qName, "homeplacement") == 0) + { + this->home_placement_->destination (this->characters_.c_str ()); + } + else if (ACE_OS::strcmp (qName, "usagename") == 0) + { + this->home_placement_->usagename (this->characters_.c_str ()); + } + break; + + case COMPONENT_INSTANTIATION: + if (ACE_OS::strcmp (qName, "componentinstantiation") == 0) + { + this->state_ = HOMEPLACEMENT; + this->home_placement_->insert_tail (this->comp_instance_); + this->comp_instance_ = 0; + } + break; + + default: + break; + } +} + +void +CIAO::Partitioning_Handler::characters (const ACEXML_Char *ch, + int start, + int length + ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + this->characters_.set (ch + start, length); +} + +void +CIAO::Partitioning_Handler::startElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName, + ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + // We are assuming we have a working ACEXML validator. + + ACE_TRACE ("CIAO::Partitioning_Handler::startElement"); + ++this->element_count_; + + switch (this->state_) + { + case START: + if (ACE_OS::strcmp (qName, "homeplacement") == 0) + { + this->state_ = HOMEPLACEMENT; + const char *id = 0; + long cardinality = + this->get_id_and_cardinality (id, atts + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + + ACEXML_NEW_THROW_EX (this->home_placement_, + CIAO::Assembly_Placement::homeplacement (id, + cardinality), + ACEXML_SAXException + ("Internal error, no memory.")); + ACEXML_CHECK; + } + else if (ACE_OS::strcmp (qName, "processcollocation") == 0) + { + const char *id = 0; + long cardinality = + this->get_id_and_cardinality (id, atts + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + + ACEXML_NEW_THROW_EX (this->process_collocation_, + CIAO::Assembly_Placement::processcollocation (id, + cardinality), + ACEXML_SAXException + ("Internal error, no memory.")); + ACEXML_CHECK; + } + else if (ACE_OS::strcmp (qName, "hostcollocation") == 0) + { + const char *id = 0; + long cardinality = + this->get_id_and_cardinality (id, atts + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + + ACEXML_NEW_THROW_EX (this->host_collocation_, + CIAO::Assembly_Placement::hostcollocation (id, + cardinality), + ACEXML_SAXException + ("Internal error, no memory.")); + ACEXML_CHECK; + } + else if (ACE_OS::strcmp (qName, "executableplacement") == 0) + { + ACEXML_THROW (ACEXML_SAXException + (ACE_TEXT ("\"executableplacement\" is not yet supported."))); + } + else if (ACE_OS::strcmp (qName, "extension") == 0) + { + ACEXML_THROW (ACEXML_SAXException + (ACE_TEXT ("\"extension\" is not yet supported."))); + } + else if (ACE_OS::strcmp (qName, "partitioning") == 0) + { + // do nothing + } + else + { + ACEXML_THROW + (ACEXML_SAXException + ("Invalid tag encounter while parsing \"partitioning\"")); + } + break; + + case HOMEPLACEMENT: + if (ACE_OS::strcmp (qName, "componentfileref") == 0) + { + const char *id; + this->get_idref (id, + atts + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + + this->home_placement_->componentfileref (id); + } + else if (ACE_OS::strcmp (qName, "componentinstantiation") == 0) + { + const char *id; + this->get_id_and_cardinality (id, + atts + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + + ACEXML_NEW_THROW_EX (this->comp_instance_, + CIAO::Assembly_Placement::componentinstantiation (id), + ACEXML_SAXException + ("Internal error, no memory.")); + ACEXML_CHECK; + + } + // @@ Ignore the rest of element in home placement for now. + break; + + case COMPONENT_INSTANTIATION: + + break; + + default: + ACEXML_THROW + (ACEXML_SAXException + ("Invalid tag encounter while parsing \"partitioning\"")); + } + +} + +long +CIAO::Partitioning_Handler::get_id_and_cardinality (const char *&id, + ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + long retv = 1; + + for (size_t i = 0; i < atts->getLength (); ++i) + { + if (ACE_OS_String::strcmp (atts->getQName (i), ACE_TEXT ("id")) == 0) + { + id = atts->getValue (i); + } + else if (ACE_OS_String::strcmp (atts->getQName (i), + ACE_TEXT ("cardinality")) == 0) + { + retv = ACE_OS::atoi (atts->getValue (i)); + } + else + ACEXML_THROW_RETURN + (ACEXML_SAXException + ("Invalid tag encounter while parsing \"componentfiles\""), + -1); + } + return retv; +} + +long +CIAO::Partitioning_Handler::get_idref (const char *&id, + ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + for (size_t i = 0; i < atts->getLength (); ++i) + { + if (ACE_OS_String::strcmp (atts->getQName (i), ACE_TEXT ("idref")) == 0) + { + id = atts->getValue (i); + } + else + ACEXML_THROW_RETURN + (ACEXML_SAXException + ("Invalid tag encounter while parsing \"componentfiles\""), + -1); + } + return 0; +} + +// ================================================================= + +void +CIAO::Connections_Handler::characters (const ACEXML_Char *ch, + int start, + int length + ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + this->characters_.set (ch + start, length); +} + +void +CIAO::Connections_Handler::endElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + ACE_TRACE ("CIAO::Connections_Handler::endElement"); + + --this->element_count_; + if (this->element_count_ == 0) + { + this->parent_->pop_handler (namespaceURI, + localName, + qName + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + } + + switch (this->state_) + { + case START: + if (ACE_OS::strcmp (qName, "consumesidentifier") == 0 || + ACE_OS::strcmp (qName, "usesidentifier") == 0) + { + this->info_->name_ = this->characters_.c_str (); + } + else if (ACE_OS::strcmp (qName, "extension") == 0) + { + // @@ Not supported yet. + } + break; + + case SOURCE: + break; + + default: + ACEXML_THROW + (ACEXML_SAXException + ("Invalid state encounter while parsing \"connections\"")); + break; + } +} + +void +CIAO::Connections_Handler::startElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName, + ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + ACE_TRACE ("CIAO::Connections_Handler::startElement"); + ++this->element_count_; + + switch (this->state_) + { + case START: + if (ACE_OS::strcmp (qName, "connectinterface") == 0) + { + this->create_info (atts + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + + this->info_->type_ = CIAO::Assembly_Connection::INTERFACE; + } + else if (ACE_OS::strcmp (qName, "connectevent") == 0) + { + this->create_info (atts + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + + } + else if (ACE_OS::strcmp (qName, "connecthomes") == 0) + { + this->create_info (atts + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + + } + else if (ACE_OS::strcmp (qName, "extension") == 0) + { + // @@ Not supported yet. + } + break; + + case SOURCE: + break; + + default: + ACEXML_THROW + (ACEXML_SAXException + ("Invalid state encounter while parsing \"connections\"")); + break; + } +} + +void +CIAO::Connections_Handler::create_info (ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + ACEXML_NEW_THROW_EX (this->info_, + CIAO::Assembly_Connection::Connect_Info (), + ACEXML_SAXException + ("Internal error, no memory.")); + ACEXML_CHECK; + + for (size_t i = 0; i < atts->getLength (); ++i) + { + if (ACE_OS_String::strcmp (atts->getQName (i), ACE_TEXT ("id")) == 0) + { + this->info_->id_ = atts->getValue (i); + } + else + ACEXML_THROW + (ACEXML_SAXException + ("Invalid tag encounter while parsing \"componentfiles\"")); + } +} diff --git a/TAO/CIAO/tools/XML_Helpers/Assembly_Handlers.h b/TAO/CIAO/tools/XML_Helpers/Assembly_Handlers.h new file mode 100644 index 00000000000..4b888dd54cb --- /dev/null +++ b/TAO/CIAO/tools/XML_Helpers/Assembly_Handlers.h @@ -0,0 +1,324 @@ +// $Id$ + +//============================================================================= +/** + * @file $Name$ + * + * $Id$ + * + * @author Nanbor Wang <nanbor@cs.wustl.edu> + */ +//============================================================================= + +#ifndef CIAO_ASSEMBLY_HANDLERS_H +#define CIAO_ASSEMBLY_HANDLERS_H + +#include "Cascadable_DocHandler.h" +#include "Assembly_Spec.h" + +namespace CIAO +{ + + /** + * @class Assembly_Handler + * + * @brief Assembly_Handler parse the root componentassembly descriptors + * + */ + class Assembly_Handler : public CIAO::XMLHelpers::Cascadable_DocHandler + { + public: + enum CS_States + { + START, + COMPONENTFILES_DONE, + PLACEMENT_DONE, + CONNECTION_DONE, + DONE + }; + + /** + * Default constructor. + */ + Assembly_Handler (ACEXML_XMLReader *parser, + Assembly_Spec *spec + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) ; + + /** + * Default destructor. + */ + virtual ~Assembly_Handler (void); + + // Methods inherit from ACEXML_ContentHandler. + + /** + * Receive notification of character data. + */ + virtual void characters (const ACEXML_Char *ch, + int start, + int length ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /** + * Receive notification of the end of an element. + */ + virtual void endElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /** + * Receive notification of the beginning of an element. + */ + virtual void startElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName, + ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + protected: + Assembly_Spec *context_; + + CS_States state_; + + private: + }; + + /** + * @class Comp_File_Handler + * + * @brief This DocHandler handles the "componentfiles" tag + */ + class Comp_File_Handler : public CIAO::XMLHelpers::Cascadable_DocHandler + { + public: + // @@ CF_States is not used for now. + enum CF_States + { + START + }; + + /// Constructor. + Comp_File_Handler (Assembly_Spec *spec, + ACEXML_XMLReader *parser, + CIAO::XMLHelpers::Cascadable_DocHandler *parent, + const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName, + ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)); + + /// Destructor + virtual ~Comp_File_Handler (); + + /** + * Receive notification of the end of an element. + */ + virtual void endElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) ; + + /** + * Receive notification of the beginning of an element. + */ + virtual void startElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName, + ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) ; + + protected: + long element_count_; + + Assembly_Spec *context_; + + ACE_CString id_; + ACE_CString fileinarchive_; + + CF_States state_; + }; + + /** + * @class Partitioning_Handler + * + * @brief This DocHandler handles the "partitioning" tag + */ + class Partitioning_Handler : public CIAO::XMLHelpers::Cascadable_DocHandler + { + public: + // @@ Do we need PH_States? + enum PH_States + { + START, + HOMEPLACEMENT, + COMPONENT_INSTANTIATION + }; + + enum CHAR_States + { + IDLE, + DESTINATION + }; + + /// Constructor. + Partitioning_Handler (Assembly_Spec *spec, + ACEXML_XMLReader *parser, + CIAO::XMLHelpers::Cascadable_DocHandler *parent, + const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName, + ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)); + + /// Destructor + virtual ~Partitioning_Handler (); + + /* + * Receive notification of character data. + */ + virtual void characters (const ACEXML_Char *ch, + int start, + int length + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) ; + + /** + * Receive notification of the end of an element. + */ + virtual void endElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) ; + + /** + * Receive notification of the beginning of an element. + */ + virtual void startElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName, + ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) ; + + protected: + long get_id_and_cardinality (const char *&id, + ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) ; + + long get_idref (const char *&id, + ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) ; + + long element_count_; + + Assembly_Spec *context_; + + /// Temporary holder when building componentinstantiation spec. + Assembly_Placement::hostcollocation *host_collocation_; + + /// Temporary holder when building componentinstantiation spec. + Assembly_Placement::processcollocation *process_collocation_; + + /// Temporary holder when building homeplacement spec. + Assembly_Placement::homeplacement *home_placement_; + + /// Temporary holder when building componentinstantiation spec. + Assembly_Placement::componentinstantiation *comp_instance_; + + // State of this partitioning handler. + PH_States state_; + + ACE_CString characters_; + }; + + /** + * @class Connections_Handler + * + * @brief This DocHandler handles the "connections" tag + */ + class Connections_Handler : public CIAO::XMLHelpers::Cascadable_DocHandler + { + public: + enum CH_States + { + START, // parsing destination info + SOURCE // parsing source I/F resolution method + }; + + /// Constructor. + Connections_Handler (Assembly_Spec *spec, + ACEXML_XMLReader *parser, + CIAO::XMLHelpers::Cascadable_DocHandler *parent, + const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName, + ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)); + + /// Destructor + virtual ~Connections_Handler (); + + /* + * Receive notification of character data. + */ + virtual void characters (const ACEXML_Char *ch, + int start, + int length + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) ; + + /** + * Receive notification of the end of an element. + */ + virtual void endElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) ; + + /** + * Receive notification of the beginning of an element. + */ + virtual void startElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName, + ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) ; + + protected: + // Create a new blank Connect_Info. + void create_info (ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) ; + + long element_count_; + + Assembly_Spec *context_; + + // Connection Info currently being built. + Assembly_Connection::Connect_Info *info_; + + CH_States state_; + + ACE_CString characters_; + }; +} + +#if defined (__ACE_INLINE__) +# include "Assembly_Handlers.inl" +#endif /* __ACE_INLINE__ */ +#endif /* CIAO_ASSEMBLY_HANDLERS_H */ diff --git a/TAO/CIAO/tools/XML_Helpers/Assembly_Handlers.inl b/TAO/CIAO/tools/XML_Helpers/Assembly_Handlers.inl new file mode 100644 index 00000000000..edaa7bc2471 --- /dev/null +++ b/TAO/CIAO/tools/XML_Helpers/Assembly_Handlers.inl @@ -0,0 +1,118 @@ +// $Id$ + +ACE_INLINE +CIAO::Assembly_Handler::Assembly_Handler (ACEXML_XMLReader *reader, + Assembly_Spec *spec + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + : Cascadable_DocHandler (reader, + 0, + 0, + 0, + 0, + 0 + ACEXML_ENV_ARG_PARAMETER), + context_ (spec), + state_ (START) +{ +} + +ACE_INLINE +CIAO::Assembly_Handler::~Assembly_Handler (void) +{ +} + +// ================================================================= + +ACE_INLINE +CIAO::Comp_File_Handler::Comp_File_Handler (Assembly_Spec *spec, + ACEXML_XMLReader *parser, + CIAO::XMLHelpers::Cascadable_DocHandler *p, + const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName, + ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + : Cascadable_DocHandler (parser, + p, + namespaceURI, + localName, + qName, + atts + ACEXML_ENV_ARG_PARAMETER), + element_count_ (0), + context_ (spec), + state_ (START) +{ +} + +ACE_INLINE +CIAO::Comp_File_Handler::~Comp_File_Handler (void) +{ +} + +// ================================================================= + +ACE_INLINE +CIAO::Partitioning_Handler::Partitioning_Handler (Assembly_Spec *spec, + ACEXML_XMLReader *parser, + CIAO::XMLHelpers::Cascadable_DocHandler *p, + const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName, + ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + : Cascadable_DocHandler (parser, + p, + namespaceURI, + localName, + qName, + atts + ACEXML_ENV_ARG_PARAMETER), + element_count_ (0), + context_ (spec), + host_collocation_ (0), + process_collocation_ (0), + home_placement_ (0), + comp_instance_ (0), + state_ (START) +{ +} + +ACE_INLINE +CIAO::Partitioning_Handler::~Partitioning_Handler (void) +{ +} + +// ================================================================= + +ACE_INLINE +CIAO::Connections_Handler::Connections_Handler (Assembly_Spec *spec, + ACEXML_XMLReader *parser, + CIAO::XMLHelpers::Cascadable_DocHandler *p, + const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName, + ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + : Cascadable_DocHandler (parser, + p, + namespaceURI, + localName, + qName, + atts + ACEXML_ENV_ARG_PARAMETER), + element_count_ (0), + context_ (spec), + info_ (0), + state_ (START) +{ +} + +ACE_INLINE +CIAO::Connections_Handler::~Connections_Handler (void) +{ +} diff --git a/TAO/CIAO/tools/XML_Helpers/Assembly_Spec.cpp b/TAO/CIAO/tools/XML_Helpers/Assembly_Spec.cpp new file mode 100644 index 00000000000..82a2cc2876b --- /dev/null +++ b/TAO/CIAO/tools/XML_Helpers/Assembly_Spec.cpp @@ -0,0 +1,77 @@ +// $Id$ + +#include "Assembly_Spec.h" + +#if !defined (__ACE_INLINE__) +# include "Assembly_Spec.inl" +#endif /* __ACE_INLINE__ */ + + +// ================================================================ + +int +CIAO::Assembly_Placement::Node::accept +(CIAO::Assembly_Placement::Visitor &visitor) +{ + // This should have never gotten called. + ACE_ASSERT (0); + return -1; +} + +CIAO::Assembly_Placement::Node::~Node () +{ +} + +// ================================================================ + +int +CIAO::Assembly_Placement::componentinstantiation::accept +(CIAO::Assembly_Placement::Visitor &visitor) +{ + return visitor.visit_componentinstantiation (this); +} + +CIAO::Assembly_Placement::componentinstantiation::~componentinstantiation () +{ +} + +// ================================================================ + +int +CIAO::Assembly_Placement::homeplacement::accept +(CIAO::Assembly_Placement::Visitor &visitor) +{ + return visitor.visit_homeplacement (this); +} + +CIAO::Assembly_Placement::homeplacement::~homeplacement () +{ +} + +// ================================================================ + +int +CIAO::Assembly_Placement::hostcollocation::accept +(CIAO::Assembly_Placement::Visitor &visitor) +{ + return visitor.visit_hostcollocation (this); +} + +CIAO::Assembly_Placement::hostcollocation::~hostcollocation () +{ +} + +// ================================================================ + +int +CIAO::Assembly_Placement::processcollocation::accept +(CIAO::Assembly_Placement::Visitor &visitor) +{ + return visitor.visit_processcollocation (this); +} + +CIAO::Assembly_Placement::processcollocation::~processcollocation () +{ +} + +// ================================================================ diff --git a/TAO/CIAO/tools/XML_Helpers/Assembly_Spec.h b/TAO/CIAO/tools/XML_Helpers/Assembly_Spec.h new file mode 100644 index 00000000000..2b3fff0fdf9 --- /dev/null +++ b/TAO/CIAO/tools/XML_Helpers/Assembly_Spec.h @@ -0,0 +1,327 @@ +// $Id$ + +//============================================================================= +/** + * @file $Name$ + * + * $Id$ + * + * @author Nanbor Wang <nanbor@cs.wustl.edu> + */ +//============================================================================= + +#ifndef CIAO_ASSEMBLY_SPEC_H +#define CIAO_ASSEMBLY_SPEC_H + +#include "ace/Hash_Map_Manager_T.h" +#include "ace/Containers_T.h" +#include "ace/SString.h" + +namespace CIAO +{ + /** + * @typedef ID_IMPL_MAP + * + * A hash map type for indexing implmentation IDs to corresponding + * softpkg paths. + */ + typedef ACE_Hash_Map_Manager_Ex<ACE_CString, + ACE_CString, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> ID_IMPL_MAP; + + namespace Assembly_Placement + { + /** + * @enum Node Type + */ + typedef enum _nodetype + { + INVALID_NODE, + INVALID_CONTAINER, + HOST, + PROCESS, + HOME, + COMPONENT + } Node_Type; + + // Forward declaration. + class Visitor; + + /** + * @class Node + * + * Abstract base class for placement information + */ + class Node + { + public: + /// Default constructor. + Node (const char *id = 0); + + /// Accepting a visitor. + virtual int accept (Visitor &v); + + virtual ~Node (); + + void usagename (const char *un); + const char *usagename (void) const; + + const char *id (void) const; + + /// Double linked list required internal data + Node *prev_; + Node *next_; + + protected: + /// Node ID. + ACE_CString id_; + + /// Usage information. + ACE_CString usagename_; + + + }; + + /** + * @class Container + * + * Abstract base class for container type placement node + */ + class Container : public Node, + public ACE_Double_Linked_List<Node> + { + public: + Container (const char *id, + unsigned long cardinality); + + //@{ + /** Accesor/mutator for destination information */ + void destination (const char *des); + const char *destination (void) const; + + unsigned long cardinality (void) const; + //@} + + protected: + /// A corbaloc string pointing to a CIAO_Daemon interface. + ACE_CString destination_; + + // cardinality + unsigned long cardinality_; + }; + + /** + * @class componentinstantiation + */ + class componentinstantiation : public Node + { + public: + componentinstantiation (const char *id); + + + /// Accepting a visitor. + virtual int accept (Visitor &v); + + virtual ~componentinstantiation (); + + protected: + }; + + /** + * @class homeplacement + */ + class homeplacement : public Container + { + public: + homeplacement (const char *id, + unsigned long cardinality = 1); + /// Accepting a visitor. + virtual int accept (Visitor &v); + + virtual ~homeplacement (); + + //@{ + /** Accessor/mutator functions */ + void componentfileref (const char *file); + const char *componentfileref (void) const; + //@} + + protected: + // idref to component implementation file. + ACE_CString componentfileref_; + }; + + /** + * @class hostcollocation + */ + class hostcollocation : public Container + { + public: + hostcollocation (const char *id, + unsigned long cardinality = 1); + + /// Accepting a visitor. + virtual int accept (Visitor &v); + + virtual ~hostcollocation (); + + protected: + }; + + /** + * @class hostcollocation + */ + class processcollocation : public Container + { + public: + processcollocation (const char *id, + unsigned long cardinality = 1); + + /// Accepting a visitor. + virtual int accept (Visitor &v); + + virtual ~processcollocation (); + + protected: + }; + + /** + * @class Placement_Visitor + * + * Abstract Base class for placement node visitor. + */ + class Visitor + { + public: + Visitor (); + + virtual ~Visitor () = 0; + + virtual int visit_hostcollocation (hostcollocation *hc) = 0; + + virtual int visit_processcollocation (processcollocation *pc) = 0; + + virtual int visit_homeplacement (homeplacement *hp) = 0; + + virtual int visit_componentinstantiation (componentinstantiation *ci) = 0; + + protected: + }; + } + + namespace Assembly_Connection + { + /** + * + */ + typedef enum _if_resolution + { + PROVIDER, // Requires a component ref. (compound) + CONSUMER, // Requires a component ref. (compound) + COMP_IDREF, // Requires an idref + HOME_IDREF, // Requires an idref + NAMINGSERVICE, // Requires a name + STRINGIFIEDOBJECTREF, // Requires an IOR + HOMEFINDER, // Requries a name (similar to naming) + TRADERQUERY // Require trader query structure. No support for now. + } IF_Resolution_Method; + + typedef enum _conxion_type + { + INTERFACE, + EMITER_CONSUMER, + PUBLISHER_CONSUMER, + HOME, + INVALID_CONN + } Connection_Type; + + class IF_Resolver_Info + { + public: + IF_Resolver_Info (IF_Resolution_Method type, + const char *info, + IF_Resolver_Info *nested = 0); + + ~IF_Resolver_Info (); + + IF_Resolution_Method resolver_type (void) const; + + /// The string we use to resolve the interface. + const char *resolver_info (void) const; + + /// Return a nested resolver this resolver depends on. + IF_Resolver_Info *nested_resolver (void); + + /// Return the trader structure. (Not implemented yet. + /// therefore, we are returning void * for now.) + void *traderquery (void) const; + + protected: + /// Hints the kind of resolve info. + IF_Resolution_Method resolver_type_; + + /// Information this info contains + ACE_CString resolver_info_; + + /// Dependent resolver info. + IF_Resolver_Info *nested_resolver_; + + /// @@@ Future placeholder for trader query info. + void *traderquery_; + }; + + /** + * + */ + typedef struct _CII + { + _CII (); + + ~_CII (); + + // The kind of connection this info describes. + Connection_Type type_; + + /// The id of the connection. + ACE_CString id_; + + /// The name of the receptacle or consumer. + ACE_CString name_; + + /// The component that uses the receptacle or consumes the event. + IF_Resolver_Info *component_; + + /// The interface that is to be connected to the port. + IF_Resolver_Info *interface_; + + } Connect_Info; + } + + /** + * + */ + typedef struct _ASpec + { + _ASpec (); + + /// ID to implementation map. + ACE_Hash_Map_Manager_Ex<ACE_CString, + ACE_CString, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> componentfiles_; + + /// Partitioning data + Assembly_Placement::Container partitioning_; + + /// Connection data + ACE_Unbounded_Queue<Assembly_Connection::Connect_Info> connections_; + } Assembly_Spec; +} + +#if defined (__ACE_INLINE__) +# include "Assembly_Spec.inl" +#endif /* __ACE_INLINE__ */ +#endif /* CIAO_ASSEMBLY_SPEC_H */ diff --git a/TAO/CIAO/tools/XML_Helpers/Assembly_Spec.inl b/TAO/CIAO/tools/XML_Helpers/Assembly_Spec.inl new file mode 100644 index 00000000000..7106d7aac02 --- /dev/null +++ b/TAO/CIAO/tools/XML_Helpers/Assembly_Spec.inl @@ -0,0 +1,180 @@ +// $Id$ + +// ================================================================ + +ACE_INLINE +CIAO::Assembly_Placement::Node::Node (const char *id) + : prev_ (0), + next_ (0), + id_ (id) +{ +} + +ACE_INLINE void +CIAO::Assembly_Placement::Node::usagename (const char *un) +{ + this->usagename_ = un; +} + +ACE_INLINE const char * +CIAO::Assembly_Placement::Node::usagename () const +{ + return this->usagename_.c_str (); +} + +ACE_INLINE const char * +CIAO::Assembly_Placement::Node::id () const +{ + return this->id_.c_str (); +} + +// ================================================================ + +ACE_INLINE +CIAO::Assembly_Placement::Container::Container (const char *id, + unsigned long cardinality) + : cardinality_ (cardinality), + CIAO::Assembly_Placement::Node (id) +{ +} + +ACE_INLINE void +CIAO::Assembly_Placement::Container::destination (const char *des) +{ + this->destination_ = des; +} + +ACE_INLINE const char * +CIAO::Assembly_Placement::Container::destination (void) const +{ + return this->destination_.c_str (); +} + +ACE_INLINE unsigned long +CIAO::Assembly_Placement::Container::cardinality (void) const +{ + return this->cardinality_; +} + +// ================================================================ + +ACE_INLINE +CIAO::Assembly_Placement::componentinstantiation::componentinstantiation (const char *id) + : CIAO::Assembly_Placement::Node (id) +{ +} + +// ================================================================ + +ACE_INLINE +CIAO::Assembly_Placement::homeplacement::homeplacement (const char *id, + unsigned long cardinality) + : CIAO::Assembly_Placement::Container (id, + cardinality) +{ +} + +ACE_INLINE const char * +CIAO::Assembly_Placement::homeplacement::componentfileref (void) const +{ + return this->componentfileref_.c_str (); +} + +ACE_INLINE void +CIAO::Assembly_Placement::homeplacement::componentfileref (const char *ref) +{ + this->componentfileref_ = ref; +} + +// ================================================================ + +ACE_INLINE +CIAO::Assembly_Placement::hostcollocation::hostcollocation (const char *id, + unsigned long cardinality) + : CIAO::Assembly_Placement::Container (id, cardinality) +{ +} + +// ================================================================ + +ACE_INLINE +CIAO::Assembly_Placement::processcollocation::processcollocation (const char *id, + unsigned long cardinality) + : CIAO::Assembly_Placement::Container (id, cardinality) +{ +} + +// ================================================================ + +ACE_INLINE +CIAO::Assembly_Connection::IF_Resolver_Info::IF_Resolver_Info +(CIAO::Assembly_Connection::IF_Resolution_Method type, + const char *info, + CIAO::Assembly_Connection::IF_Resolver_Info *nested) + : resolver_type_ (type), + resolver_info_ (info), + nested_resolver_ (nested), + traderquery_ (0) +{ +} + +ACE_INLINE +CIAO::Assembly_Connection::IF_Resolver_Info::~IF_Resolver_Info (void) +{ + delete this->nested_resolver_; +} + +ACE_INLINE CIAO::Assembly_Connection::IF_Resolution_Method +CIAO::Assembly_Connection::IF_Resolver_Info::resolver_type (void) const +{ + return this->resolver_type_; +} + +ACE_INLINE const char * +CIAO::Assembly_Connection::IF_Resolver_Info::resolver_info (void) const +{ + return this->resolver_info_.c_str (); +} + +ACE_INLINE CIAO::Assembly_Connection::IF_Resolver_Info * +CIAO::Assembly_Connection::IF_Resolver_Info::nested_resolver (void) +{ + return this->nested_resolver_; +} + +ACE_INLINE void * +CIAO::Assembly_Connection::IF_Resolver_Info::traderquery (void) const +{ + return this->traderquery_; +} + +// ================================================================ + +ACE_INLINE +CIAO::Assembly_Connection::_CII::_CII (void) + : type_ (CIAO::Assembly_Connection::INVALID_CONN), + component_ (0), + interface_ (0) +{ +} + +ACE_INLINE +CIAO::Assembly_Connection::_CII::~_CII (void) +{ + // Do not manage memory here. We will try to manage the memory + // explicitly for now. +#if 0 + delete this->component_; + delete this->interface_; +#endif /* 0 */ +} + +// ================================================================ + +ACE_INLINE +CIAO::_ASpec::_ASpec (void) + : partitioning_ ("CIAO_ROOT_PARTITIONING", + 0) + +{ +} diff --git a/TAO/CIAO/tools/XML_Helpers/Helper_Test.dsp b/TAO/CIAO/tools/XML_Helpers/Helper_Test.dsp index 023a6634f2c..3d3e4c48fc7 100644 --- a/TAO/CIAO/tools/XML_Helpers/Helper_Test.dsp +++ b/TAO/CIAO/tools/XML_Helpers/Helper_Test.dsp @@ -7,19 +7,19 @@ CFG=Helper_Test - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "Helper_Test.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "Helper_Test.mak" CFG="Helper_Test - Win32 Debug"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "Helper_Test - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "Helper_Test - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
@@ -76,7 +76,7 @@ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 aced.lib ACEXMLd.lib ACEXML_Parserd.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\ace" /libpath:"..\..\..\..\ACEXML\Common" /libpath:"..\..\..\..\ACEXML\parser\parser"
-!ENDIF
+!ENDIF
# Begin Target
@@ -87,6 +87,14 @@ LINK32=link.exe # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
+SOURCE=.\Assembly_Handlers.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Assembly_Spec.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\Cascadable_DocHandler.cpp
# End Source File
# Begin Source File
@@ -107,6 +115,22 @@ SOURCE=.\XML_Utils.cpp # PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
+SOURCE=.\Assembly_Handlers.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Assembly_Handlers.inl
+# End Source File
+# Begin Source File
+
+SOURCE=.\Assembly_Spec.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Assembly_Spec.inl
+# End Source File
+# Begin Source File
+
SOURCE=.\Softpkg_Handlers.h
# End Source File
# Begin Source File
diff --git a/TAO/CIAO/tools/XML_Helpers/Softpkg_Handlers.cpp b/TAO/CIAO/tools/XML_Helpers/Softpkg_Handlers.cpp index 62e553616e3..ce5456963b7 100644 --- a/TAO/CIAO/tools/XML_Helpers/Softpkg_Handlers.cpp +++ b/TAO/CIAO/tools/XML_Helpers/Softpkg_Handlers.cpp @@ -31,30 +31,6 @@ CIAO::Softpkg_Handler::Softpkg_Info::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); } - -CIAO::Softpkg_Handler::Softpkg_Handler (ACEXML_XMLReader *parser, - CIAO::Softpkg_Handler::Softpkg_Info *info - ACEXML_ENV_ARG_DECL) - ACE_THROW_SPEC ((ACEXML_SAXException)) - : Cascadable_DocHandler (parser, - 0, - 0, - 0, - 0, - 0 - ACEXML_ENV_ARG_PARAMETER), - rec_cdata_ (false), - state_ (CIAO::Softpkg_Handler::ROOT), - softpkg_info_ (info) -{ - // no-op -} - -CIAO::Softpkg_Handler::~Softpkg_Handler (void) -{ - // no-op -} - void CIAO::Softpkg_Handler::characters (const ACEXML_Char *cdata, int start, diff --git a/TAO/CIAO/tools/XML_Helpers/Softpkg_Handlers.h b/TAO/CIAO/tools/XML_Helpers/Softpkg_Handlers.h index b2038a0a301..60f790535db 100644 --- a/TAO/CIAO/tools/XML_Helpers/Softpkg_Handlers.h +++ b/TAO/CIAO/tools/XML_Helpers/Softpkg_Handlers.h @@ -6,6 +6,9 @@ * * $Id$ * + * This file turned out to host only one handler. We'll still keep + * the name as Softpkg_Handlers, however. + * * @author Nanbor Wang <nanbor@cs.wustl.edu> */ //============================================================================= diff --git a/TAO/CIAO/tools/XML_Helpers/Softpkg_Handlers.inl b/TAO/CIAO/tools/XML_Helpers/Softpkg_Handlers.inl index 77b4466a3cb..99a8925b4ef 100644 --- a/TAO/CIAO/tools/XML_Helpers/Softpkg_Handlers.inl +++ b/TAO/CIAO/tools/XML_Helpers/Softpkg_Handlers.inl @@ -1 +1,26 @@ // -*- C++ -*- $Id$ + +ACE_INLINE +CIAO::Softpkg_Handler::Softpkg_Handler (ACEXML_XMLReader *parser, + CIAO::Softpkg_Handler::Softpkg_Info *info + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + : Cascadable_DocHandler (parser, + 0, + 0, + 0, + 0, + 0 + ACEXML_ENV_ARG_PARAMETER), + rec_cdata_ (false), + state_ (CIAO::Softpkg_Handler::ROOT), + softpkg_info_ (info) +{ + // no-op +} + +ACE_INLINE +CIAO::Softpkg_Handler::~Softpkg_Handler (void) +{ + // no-op +} diff --git a/TAO/CIAO/tools/XML_Helpers/XML_Utils.cpp b/TAO/CIAO/tools/XML_Helpers/XML_Utils.cpp index 38e43b32cd7..89ef941de7d 100644 --- a/TAO/CIAO/tools/XML_Helpers/XML_Utils.cpp +++ b/TAO/CIAO/tools/XML_Helpers/XML_Utils.cpp @@ -4,6 +4,7 @@ #include "ACEXML/common/FileCharStream.h" #include "ACEXML/common/StrCharStream.h" #include "ACEXML/parser/parser/Parser.h" +#include "Assembly_Handlers.h" #if !defined (__ACE_INLINE__) # include "XML_Utils.inl" @@ -78,3 +79,58 @@ CIAO::XML_Utils::parse_softpkg (CIAO::Softpkg_Handler::Softpkg_Info *info) ACEXML_ENDTRY; return 0; } + +int +CIAO::XML_Utils::parse_componentassembly (const char *filename, + CIAO::Assembly_Spec *spec) +{ + if (spec == 0) // no way this is going to work. :) + return -1; + + ACEXML_DefaultHandler *handler = 0; + auto_ptr<ACEXML_DefaultHandler> cleanup_handler (handler); + + ACEXML_FileCharStream *fstm = 0; + ACE_NEW_RETURN (fstm, + ACEXML_FileCharStream (), + 1); + + if (fstm->open (filename) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Fail to open XML file: %s\n"), + filename), + -1); + ACEXML_TRY_NEW_ENV + { + ACEXML_Parser parser; + + ACE_NEW_RETURN (handler, + CIAO::Assembly_Handler (&parser, + spec + ACEXML_ENV_ARG_PARAMETER), + -1); + + ACEXML_InputSource input(fstm); + + parser.setContentHandler (handler); + parser.setDTDHandler (handler); + parser.setErrorHandler (handler); + parser.setEntityResolver (handler); + + parser.parse (&input ACEXML_ENV_ARG_PARAMETER); + ACEXML_TRY_CHECK; + } + ACEXML_CATCH (ACEXML_SAXException, ex) + { + ex.print (); + return -1; + } + ACEXML_CATCHANY + { + ACE_ERROR_RETURN ((LM_ERROR, + "Caught unknown exception.\n"), + -1); + } + ACEXML_ENDTRY; + return 0; +} diff --git a/TAO/CIAO/tools/XML_Helpers/XML_Utils.h b/TAO/CIAO/tools/XML_Helpers/XML_Utils.h index b39f98c9a8d..adf470e0574 100644 --- a/TAO/CIAO/tools/XML_Helpers/XML_Utils.h +++ b/TAO/CIAO/tools/XML_Helpers/XML_Utils.h @@ -14,6 +14,7 @@ #define CIAO_XML_UTILS_H #include "Softpkg_Handlers.h" +#include "Assembly_Spec.h" namespace CIAO { @@ -44,6 +45,8 @@ namespace CIAO */ static int parse_softpkg (Softpkg_Handler::Softpkg_Info *info); + static int parse_componentassembly (const char *filename, + Assembly_Spec *spec); }; diff --git a/TAO/CIAO/tools/XML_Helpers/main.cpp b/TAO/CIAO/tools/XML_Helpers/main.cpp index 4f9cc69e3ef..06510f08231 100644 --- a/TAO/CIAO/tools/XML_Helpers/main.cpp +++ b/TAO/CIAO/tools/XML_Helpers/main.cpp @@ -7,17 +7,21 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { - ACE_TCHAR *filename = 0; + ACE_TCHAR *softpkg_filename = 0; + ACE_TCHAR *assembly_filename = 0; - ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("f:")); + ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("a:s:")); ACE_TCHAR c; while ((c = get_opt ()) != -1) { switch (c) { - case 'f': - filename = get_opt.opt_arg (); + case 's': + softpkg_filename = get_opt.opt_arg (); + break; + case 'a': + assembly_filename = get_opt.opt_arg (); break; default: ACE_ERROR_RETURN ((LM_ERROR, @@ -28,14 +32,28 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) } }; - if (filename == 0) + if (softpkg_filename == 0 && assembly_filename == 0) ACE_ERROR_RETURN ((LM_ERROR, "No filename specified\n"), -1); - CIAO::Softpkg_Handler::Softpkg_Info info; - info.csd_path_ = filename; + if (softpkg_filename != 0) + { + CIAO::Softpkg_Handler::Softpkg_Info info; + info.csd_path_ = softpkg_filename; + + if (CIAO::XML_Utils::parse_softpkg (&info) == 0) + info.dump (); + } - if (CIAO::XML_Utils::parse_softpkg (&info) == 0) - info.dump (); + if (assembly_filename != 0) + { + CIAO::Assembly_Spec assembly_spec; + + if (CIAO::XML_Utils::parse_componentassembly (assembly_filename, + &assembly_spec) == 0) + { + ACE_DEBUG ((LM_DEBUG, "ComponentAssembly Done.\n")); + } + } return 0; } |