diff options
Diffstat (limited to 'TAO/CIAO')
-rw-r--r-- | TAO/CIAO/examples/UAV/CAOC/CAOC_exec.cpp | 4 | ||||
-rw-r--r-- | TAO/CIAO/examples/UAV/CAOC/CAOC_svnt.cpp | 24 | ||||
-rw-r--r-- | TAO/CIAO/examples/UAV/Engagement/Engagement_svnt.cpp | 12 | ||||
-rw-r--r-- | TAO/CIAO/examples/UAV/Ground/UAV_GS_svnt.cpp | 13 | ||||
-rw-r--r-- | TAO/CIAO/examples/UAV/Satellite/Satellite.idl | 7 | ||||
-rw-r--r-- | TAO/CIAO/examples/UAV/Satellite/Satellite.mpc | 11 | ||||
-rw-r--r-- | TAO/CIAO/examples/UAV/Satellite/Satellite_exec.cpp | 15 | ||||
-rw-r--r-- | TAO/CIAO/examples/UAV/Satellite/Satellite_exec.h | 5 | ||||
-rw-r--r-- | TAO/CIAO/examples/UAV/Satellite/Satellite_svnt.cpp | 22 | ||||
-rw-r--r-- | TAO/CIAO/examples/UAV/Satellite/Satellite_svnt.h | 7 | ||||
-rw-r--r-- | TAO/CIAO/examples/UAV/Satellite/controller.cpp | 89 | ||||
-rw-r--r-- | TAO/CIAO/examples/UAV/UCAV_GS/UCAV_GS_svnt.cpp | 13 | ||||
-rw-r--r-- | TAO/CIAO/examples/UAV/descriptors/BBN_UAV.cad | 241 |
13 files changed, 459 insertions, 4 deletions
diff --git a/TAO/CIAO/examples/UAV/CAOC/CAOC_exec.cpp b/TAO/CIAO/examples/UAV/CAOC/CAOC_exec.cpp index 843390daea7..0ccfca2e69e 100644 --- a/TAO/CIAO/examples/UAV/CAOC/CAOC_exec.cpp +++ b/TAO/CIAO/examples/UAV/CAOC/CAOC_exec.cpp @@ -23,12 +23,12 @@ MyImpl::CAOC_exec_i::push_target_located (BBN_UAV::TargetLocated *ev ACE_THROW_SPEC ((CORBA::SystemException)) { // Notify others - BBN_UAV::PrepareEngage_var event = new OBV_BBN_UAV::PrepareEngage; + BBN_UAV::PrepareCapture_var event = new OBV_BBN_UAV::PrepareCapture; ACE_DEBUG ((LM_DEBUG, "CAOC, received a TargetLocated from Satellite \n")); - this->context_->push_prepare_engage (event + this->context_->push_prepare_capture (event ACE_ENV_ARG_PARAMETER); } diff --git a/TAO/CIAO/examples/UAV/CAOC/CAOC_svnt.cpp b/TAO/CIAO/examples/UAV/CAOC/CAOC_svnt.cpp index a87c44ad98f..729d120d16a 100644 --- a/TAO/CIAO/examples/UAV/CAOC/CAOC_svnt.cpp +++ b/TAO/CIAO/examples/UAV/CAOC/CAOC_svnt.cpp @@ -144,6 +144,17 @@ namespace CAOC_Impl ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + + ACE_CString my_uuid = this->servant_->component_UUID (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + my_uuid += "_prepare_capture_publisher"; + + this->container_->push_event (ev, + my_uuid.c_str () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + /* ACE_Active_Map_Manager< ::BBN_UAV::PrepareCaptureConsumer_var>::iterator end = this->ciao_publishes_prepare_capture_map_.end (); @@ -168,6 +179,7 @@ namespace CAOC_Impl ACE_ENV_ARG_PARAMETER); ACE_CHECK; } + */ } ::Components::Cookie * @@ -229,6 +241,17 @@ namespace CAOC_Impl ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + + ACE_CString my_uuid = this->servant_->component_UUID (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + my_uuid += "_prepare_engage_publisher"; + + this->container_->push_event (ev, + my_uuid.c_str () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + /* ACE_Active_Map_Manager< ::BBN_UAV::PrepareEngageConsumer_var>::iterator end = this->ciao_publishes_prepare_engage_map_.end (); @@ -253,6 +276,7 @@ namespace CAOC_Impl ACE_ENV_ARG_PARAMETER); ACE_CHECK; } + */ } ::Components::Cookie * diff --git a/TAO/CIAO/examples/UAV/Engagement/Engagement_svnt.cpp b/TAO/CIAO/examples/UAV/Engagement/Engagement_svnt.cpp index 92f43bcd3cd..49cd839d5c3 100644 --- a/TAO/CIAO/examples/UAV/Engagement/Engagement_svnt.cpp +++ b/TAO/CIAO/examples/UAV/Engagement/Engagement_svnt.cpp @@ -144,6 +144,17 @@ namespace Engagement_Impl ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + + ACE_CString my_uuid = this->servant_->component_UUID (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + my_uuid += "_start_engage_publisher"; + + this->container_->push_event (ev, + my_uuid.c_str () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + /* ACE_Active_Map_Manager< ::BBN_UAV::StartEngageConsumer_var>::iterator end = this->ciao_publishes_start_engage_map_.end (); @@ -168,6 +179,7 @@ namespace Engagement_Impl ACE_ENV_ARG_PARAMETER); ACE_CHECK; } + */ } ::Components::Cookie * diff --git a/TAO/CIAO/examples/UAV/Ground/UAV_GS_svnt.cpp b/TAO/CIAO/examples/UAV/Ground/UAV_GS_svnt.cpp index 0fd4180665d..fb7118e9356 100644 --- a/TAO/CIAO/examples/UAV/Ground/UAV_GS_svnt.cpp +++ b/TAO/CIAO/examples/UAV/Ground/UAV_GS_svnt.cpp @@ -144,6 +144,18 @@ namespace UAV_GS_Impl ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + + + ACE_CString my_uuid = this->servant_->component_UUID (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + my_uuid += "_start_capture_publisher"; + + this->container_->push_event (ev, + my_uuid.c_str () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + /* ACE_Active_Map_Manager< ::BBN_UAV::StartCaptureConsumer_var>::iterator end = this->ciao_publishes_start_capture_map_.end (); @@ -168,6 +180,7 @@ namespace UAV_GS_Impl ACE_ENV_ARG_PARAMETER); ACE_CHECK; } + */ } ::Components::Cookie * diff --git a/TAO/CIAO/examples/UAV/Satellite/Satellite.idl b/TAO/CIAO/examples/UAV/Satellite/Satellite.idl index da8ad4d9dcf..0a5fd98f53e 100644 --- a/TAO/CIAO/examples/UAV/Satellite/Satellite.idl +++ b/TAO/CIAO/examples/UAV/Satellite/Satellite.idl @@ -15,7 +15,12 @@ module BBN_UAV { - component Satellite + interface trigger + { + void alert (); + }; + + component Satellite supports trigger { publishes TargetLocated target_located; }; diff --git a/TAO/CIAO/examples/UAV/Satellite/Satellite.mpc b/TAO/CIAO/examples/UAV/Satellite/Satellite.mpc index cd9744d99d6..ef0e403f308 100644 --- a/TAO/CIAO/examples/UAV/Satellite/Satellite.mpc +++ b/TAO/CIAO/examples/UAV/Satellite/Satellite.mpc @@ -61,5 +61,16 @@ project(Satellite_exec) : ciao_component { } } +project (Satellite_controller) : ciao_client, valuetype { + exename = controller + after += Satellite_stub + libs += Satellite_stub BBN_UAV_stub + IDL_Files { + } + + Source_Files { + controller.cpp + } +} diff --git a/TAO/CIAO/examples/UAV/Satellite/Satellite_exec.cpp b/TAO/CIAO/examples/UAV/Satellite/Satellite_exec.cpp index ca0453af87f..4fe47fdcb58 100644 --- a/TAO/CIAO/examples/UAV/Satellite/Satellite_exec.cpp +++ b/TAO/CIAO/examples/UAV/Satellite/Satellite_exec.cpp @@ -17,6 +17,21 @@ MyImpl::Satellite_exec_i::~Satellite_exec_i () { } +// Operations from supported interface(s) + +void +MyImpl::Satellite_exec_i::alert (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Satellite, pushing TargetLocated!\n"))); + + BBN_UAV::TargetLocated_var ev = new OBV_BBN_UAV::TargetLocated (); + + this->context_->push_target_located (ev.in () + ACE_ENV_ARG_PARAMETER); +} + // Operations from Components::SessionComponent void MyImpl::Satellite_exec_i::set_session_context (Components::SessionContext_ptr ctx diff --git a/TAO/CIAO/examples/UAV/Satellite/Satellite_exec.h b/TAO/CIAO/examples/UAV/Satellite/Satellite_exec.h index baa9b51804c..8908f4b705b 100644 --- a/TAO/CIAO/examples/UAV/Satellite/Satellite_exec.h +++ b/TAO/CIAO/examples/UAV/Satellite/Satellite_exec.h @@ -38,6 +38,11 @@ namespace MyImpl /// Default destructor. ~Satellite_exec_i (void); + // Operations from supported interface(s) + + virtual void alert (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + // Operations from Components::SessionComponent virtual void diff --git a/TAO/CIAO/examples/UAV/Satellite/Satellite_svnt.cpp b/TAO/CIAO/examples/UAV/Satellite/Satellite_svnt.cpp index 670b255d33e..0c71dcea062 100644 --- a/TAO/CIAO/examples/UAV/Satellite/Satellite_svnt.cpp +++ b/TAO/CIAO/examples/UAV/Satellite/Satellite_svnt.cpp @@ -144,6 +144,18 @@ namespace Satellite_Impl ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + + + ACE_CString my_uuid = this->servant_->component_UUID (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + my_uuid += "_target_located_publisher"; + + this->container_->push_event (ev, + my_uuid.c_str () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + /* ACE_Active_Map_Manager< ::BBN_UAV::TargetLocatedConsumer_var>::iterator end = this->ciao_publishes_target_located_map_.end (); @@ -168,6 +180,7 @@ namespace Satellite_Impl ACE_ENV_ARG_PARAMETER); ACE_CHECK; } + */ } ::Components::Cookie * @@ -812,6 +825,15 @@ namespace Satellite_Impl // Supported operations. + void + Satellite_Servant::alert ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + this->executor_->alert ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + // Component attribute operations. } diff --git a/TAO/CIAO/examples/UAV/Satellite/Satellite_svnt.h b/TAO/CIAO/examples/UAV/Satellite/Satellite_svnt.h index 81306b5fc41..ef1857ebeb2 100644 --- a/TAO/CIAO/examples/UAV/Satellite/Satellite_svnt.h +++ b/TAO/CIAO/examples/UAV/Satellite/Satellite_svnt.h @@ -172,6 +172,11 @@ namespace Satellite_Impl // Supported operations. + virtual void + alert ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + // Public port operations. virtual ::Components::Cookie * @@ -434,7 +439,7 @@ namespace Satellite_Impl ::CIAO::Session_Container * container_; - + ACE_CString component_UUID_; }; } diff --git a/TAO/CIAO/examples/UAV/Satellite/controller.cpp b/TAO/CIAO/examples/UAV/Satellite/controller.cpp new file mode 100644 index 00000000000..dd78b69d2e1 --- /dev/null +++ b/TAO/CIAO/examples/UAV/Satellite/controller.cpp @@ -0,0 +1,89 @@ +// $Id$ +/** + * @file controller.cpp + * + * This program initiates a satellite alert. + */ + + +#include "SatelliteC.h" +#include "ace/Get_Opt.h" +#include "ace/Streams.h" + +char *satellite_ior_ = 0; + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "k:r:of"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + + case 'k': + satellite_ior_ = get_opts.opt_arg (); + break; + + break; + + case '?': // display help for use of the server. + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s\n" + "-k <Satellite IOR> (default is file://sat.ior)\n" + "\n", + argv [0]), + -1); + } + + if (satellite_ior_ == 0) + satellite_ior_ = "file://sat.ior"; + + return 0; +} + +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); + + if (parse_args (argc, argv) != 0) + return -1; + + CORBA::Object_var obj + = orb->string_to_object (satellite_ior_ + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + BBN_UAV::Satellite_var sat + = BBN_UAV::Satellite::_narrow (obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (CORBA::is_nil (sat.in ())) + ACE_ERROR_RETURN ((LM_ERROR, "Unable to acquire 'Satellite' objref\n"), -1); + + ACE_DEBUG ((LM_DEBUG, "Send a satellite alert\n")); + + sat->alert (ACE_ENV_SINGLE_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/UAV/UCAV_GS/UCAV_GS_svnt.cpp b/TAO/CIAO/examples/UAV/UCAV_GS/UCAV_GS_svnt.cpp index 4c0f7893ed4..3d43bf83c96 100644 --- a/TAO/CIAO/examples/UAV/UCAV_GS/UCAV_GS_svnt.cpp +++ b/TAO/CIAO/examples/UAV/UCAV_GS/UCAV_GS_svnt.cpp @@ -144,6 +144,18 @@ namespace UCAV_GS_Impl ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + + + ACE_CString my_uuid = this->servant_->component_UUID (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + my_uuid += "_start_move_publisher"; + + this->container_->push_event (ev, + my_uuid.c_str () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + /* ACE_Active_Map_Manager< ::BBN_UAV::StartMoveConsumer_var>::iterator end = this->ciao_publishes_start_move_map_.end (); @@ -168,6 +180,7 @@ namespace UCAV_GS_Impl ACE_ENV_ARG_PARAMETER); ACE_CHECK; } + */ } ::Components::Cookie * diff --git a/TAO/CIAO/examples/UAV/descriptors/BBN_UAV.cad b/TAO/CIAO/examples/UAV/descriptors/BBN_UAV.cad new file mode 100644 index 00000000000..bcecdf98390 --- /dev/null +++ b/TAO/CIAO/examples/UAV/descriptors/BBN_UAV.cad @@ -0,0 +1,241 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- If this file is moved to a different directory, make sure to change the + path to the DTD below. Otherwise the examples won't work. --> +<!DOCTYPE componentassembly SYSTEM "http://www.dre.vanderbilt.edu/CIAO/DTD/componentassembly.dtd"> + +<componentassembly id="Collocated component test"> + <componentfiles> + <componentfile id="com-Satellite"> + <fileinarchive name="Satellite.csd"/> + </componentfile> + <componentfile id="com-CAOC"> + <fileinarchive name="CAOC.csd"/> + </componentfile> + <componentfile id="com-UAV_GS"> + <fileinarchive name="UAV_GS.csd"/> + </componentfile> + <componentfile id="com-UAV"> + <fileinarchive name="UAV.csd"/> + </componentfile> + <componentfile id="com-Engagement"> + <fileinarchive name="Engagement.csd"/> + </componentfile> + <componentfile id="com-Battle"> + <fileinarchive name="Battle.csd"/> + </componentfile> + <componentfile id="com-UCAV_GS"> + <fileinarchive name="UCAV_GS.csd"/> + </componentfile> + <componentfile id="com-UCAV"> + <fileinarchive name="UCAV.csd"/> + </componentfile> + </componentfiles> + + <partitioning> + + <homeplacement id="a_SatelliteHome"> + <componentfileref idref="com-Satellite"/> + <componentinstantiation id="a_Satellite"> + <registercomponent> + <!-- writeiortofile is a non-standard CIAO extension. --> + <writeiortofile name="sat.ior"/> + </registercomponent> + </componentinstantiation> + </homeplacement> + + <homeplacement id="a_CAOCHome"> + <componentfileref idref="com-CAOC"/> + <componentinstantiation id="a_CAOC"> + </componentinstantiation> + </homeplacement> + + <homeplacement id="a_UAV_GSHome"> + <componentfileref idref="com-UAV_GS"/> + <componentinstantiation id="a_UAV_GS"> + </componentinstantiation> + </homeplacement> + + <homeplacement id="a_UAVHome"> + <componentfileref idref="com-UAV"/> + <componentinstantiation id="a_UAV"> + </componentinstantiation> + </homeplacement> + + <homeplacement id="b_UAVHome"> + <componentfileref idref="com-UAV"/> + <componentinstantiation id="b_UAV"> + </componentinstantiation> + </homeplacement> + + <homeplacement id="c_UAVHome"> + <componentfileref idref="com-UAV"/> + <componentinstantiation id="c_UAV"> + </componentinstantiation> + </homeplacement> + + <homeplacement id="a_EngagementHome"> + <componentfileref idref="com-Engagement"/> + <componentinstantiation id="a_Engagement"> + </componentinstantiation> + </homeplacement> + + <homeplacement id="a_Battle"> + <componentfileref idref="com-Battle"/> + <componentinstantiation id="a_Battle"> + </componentinstantiation> + </homeplacement> + + <homeplacement id="a_UCAV_GSHome"> + <componentfileref idref="com-UCAV_GS"/> + <componentinstantiation id="a_UCAV_GS"> + </componentinstantiation> + </homeplacement> + + <homeplacement id="a_UCAVHome"> + <componentfileref idref="com-UCAV"/> + <componentinstantiation id="a_UCAV"> + </componentinstantiation> + </homeplacement> + + <homeplacement id="b_UCAVHome"> + <componentfileref idref="com-UCAV"/> + <componentinstantiation id="b_UCAV"> + </componentinstantiation> + </homeplacement> + + <homeplacement id="c_UCAVHome"> + <componentfileref idref="com-UCAV"/> + <componentinstantiation id="c_UCAV"> + </componentinstantiation> + </homeplacement> + <!-- A plain vanilla partition. We don't even need the processcollocation tag here. --> + + </partitioning> + + <connections> + + <connectevent> + <consumesport> + <consumesidentifier>target_located</consumesidentifier> + <componentinstantiationref idref="a_CAOC"/> + </consumesport> + <publishesport> + <publishesidentifier>target_located</publishesidentifier> + <componentinstantiationref idref="a_Satellite"/> + </publishesport> + </connectevent> + + <connectevent> + <consumesport> + <consumesidentifier>prepare_capture</consumesidentifier> + <componentinstantiationref idref="a_UAV_GS"/> + </consumesport> + <publishesport> + <publishesidentifier>prepare_capture</publishesidentifier> + <componentinstantiationref idref="a_CAOC"/> + </publishesport> + </connectevent> + + <connectevent> + <consumesport> + <consumesidentifier>prepare_engage</consumesidentifier> + <componentinstantiationref idref="a_Engagement"/> + </consumesport> + <publishesport> + <publishesidentifier>prepare_engage</publishesidentifier> + <componentinstantiationref idref="a_CAOC"/> + </publishesport> + </connectevent> + + <connectevent> + <consumesport> + <consumesidentifier>start_capture</consumesidentifier> + <componentinstantiationref idref="a_UAV"/> + </consumesport> + <publishesport> + <publishesidentifier>start_capture</publishesidentifier> + <componentinstantiationref idref="a_UAV_GS"/> + </publishesport> + </connectevent> + + <connectevent> + <consumesport> + <consumesidentifier>start_capture</consumesidentifier> + <componentinstantiationref idref="b_UAV"/> + </consumesport> + <publishesport> + <publishesidentifier>start_capture</publishesidentifier> + <componentinstantiationref idref="a_UAV_GS"/> + </publishesport> + </connectevent> + + <connectevent> + <consumesport> + <consumesidentifier>start_capture</consumesidentifier> + <componentinstantiationref idref="c_UAV"/> + </consumesport> + <publishesport> + <publishesidentifier>start_capture</publishesidentifier> + <componentinstantiationref idref="a_UAV_GS"/> + </publishesport> + </connectevent> + + <connectevent> + <consumesport> + <consumesidentifier>start_engage</consumesidentifier> + <componentinstantiationref idref="a_Battle"/> + </consumesport> + <publishesport> + <publishesidentifier>start_engage</publishesidentifier> + <componentinstantiationref idref="a_Engagement"/> + </publishesport> + </connectevent> + + <connectevent> + <consumesport> + <consumesidentifier>prepare_move</consumesidentifier> + <componentinstantiationref idref="a_UCAV_GS"/> + </consumesport> + <publishesport> + <publishesidentifier>prepare_move</publishesidentifier> + <componentinstantiationref idref="a_Engagement"/> + </publishesport> + </connectevent> + + <connectevent> + <consumesport> + <consumesidentifier>start_move</consumesidentifier> + <componentinstantiationref idref="a_UCAV"/> + </consumesport> + <publishesport> + <publishesidentifier>start_move</publishesidentifier> + <componentinstantiationref idref="a_UCAV_GS"/> + </publishesport> + </connectevent> + + <connectevent> + <consumesport> + <consumesidentifier>start_move</consumesidentifier> + <componentinstantiationref idref="b_UCAV"/> + </consumesport> + <publishesport> + <publishesidentifier>start_move</publishesidentifier> + <componentinstantiationref idref="a_UCAV_GS"/> + </publishesport> + </connectevent> + + <connectevent> + <consumesport> + <consumesidentifier>start_move</consumesidentifier> + <componentinstantiationref idref="c_UCAV"/> + </consumesport> + <publishesport> + <publishesidentifier>start_move</publishesidentifier> + <componentinstantiationref idref="a_UCAV_GS"/> + </publishesport> + </connectevent> + + </connections> + +</componentassembly> |