diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2005-05-25 15:53:37 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2005-05-25 15:53:37 +0000 |
commit | 80cf149d84db6e6edac4875135d36a33fed2d608 (patch) | |
tree | 1afabfe40fcd014b68bcf2643c24dffb2033fb6a | |
parent | d1746aa6110385b878335758dde4be7cbf55e754 (diff) | |
download | ATCD-80cf149d84db6e6edac4875135d36a33fed2d608.tar.gz |
Wed May 25 10:52:43 CDT 2005 Will Otte <wotte@dre.vanderbilt.edu>
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/ChangeLog | 7 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.cpp | 90 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.h | 32 |
3 files changed, 95 insertions, 34 deletions
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/ChangeLog b/TAO/CIAO/DAnCE/Config_Handlers/ChangeLog index 95b2e617700..7361f9a4b36 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/ChangeLog +++ b/TAO/CIAO/DAnCE/Config_Handlers/ChangeLog @@ -1,3 +1,10 @@ +Wed May 25 10:52:43 CDT 2005 Will Otte <wotte@dre.vanderbilt.edu> + + * DP_Handler.cpp + * DP_Handler.h + + Minor refactoring to add support for recerse mapping. + Tue May 24 09:34:28 CDT 2005 Will Otte <wotte@dre.vanderbilt.edu> Created xsc_reverse_handlers branch to develop IDL->XSC mapping. diff --git a/TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.cpp index 70030dbc971..2eaffd21af0 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.cpp +++ b/TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.cpp @@ -19,24 +19,53 @@ namespace CIAO namespace Config_Handlers { DP_Handler::DP_Handler (DeploymentPlan &dp) - : idl_dp_ (0) - , dp_ (dp) - , retval_ (false) + : xsc_dp_ (0) + , idl_dp_ (0) + , retval_ (false) { - if (!this->resolve_plan ()) + if (!this->resolve_plan (dp)) throw; } - + + DP_Handler::DP_Handler (const ::Deployment::DeploymentPlan &plan) + : xsc_dp_ (0), + idl_dp_ (0), + retval_ (0) + { + if (!this->build_xsc (plan)) + throw; + } + DP_Handler::~DP_Handler (void) throw () { } - + + DeploymentPlan const * + DP_Handler::xsc (void) const + throw (DP_Handler::NoPlan) + { + if (this->retval_ && this->xsc_dp_.get () != 0) + return this->xsc_dp_.get (); + + throw NoPlan (); + } + + DeploymentPlan * + DP_Handler::xsc (void) + throw (DP_Handler::NoPlan) + { + if (this->retval_ && this->xsc_dp_.get () != 0) + return this->xsc_dp_.release (); + + throw NoPlan (); + } + ::Deployment::DeploymentPlan const * DP_Handler::plan (void) const throw (DP_Handler::NoPlan) { - if (this->retval_) + if (this->retval_ && this->idl_dp_.get () != 0) return this->idl_dp_.get (); throw NoPlan (); @@ -46,14 +75,14 @@ namespace CIAO DP_Handler::plan (void) throw (DP_Handler::NoPlan) { - if (this->retval_) + if (this->retval_ && this->idl_dp_.get () != 0) return this->idl_dp_.release (); throw NoPlan (); } bool - DP_Handler::resolve_plan (void) + DP_Handler::resolve_plan (DeploymentPlan &xsc_dp) { ::Deployment::DeploymentPlan *tmp = new Deployment::DeploymentPlan; @@ -61,23 +90,23 @@ namespace CIAO this->idl_dp_.reset (tmp); // Read in the label, if present, since minoccurs = 0 - if (this->dp_.label_p ()) + if (xsc_dp.label_p ()) { this->idl_dp_->label = - CORBA::string_dup (this->dp_.label ().c_str ()); + CORBA::string_dup (xsc_dp.label ().c_str ()); } // Read in the UUID, if present - if (this->dp_.UUID_p ()) + if (xsc_dp.UUID_p ()) { this->idl_dp_->UUID = - CORBA::string_dup (this->dp_.UUID ().c_str ()); + CORBA::string_dup (xsc_dp.UUID ().c_str ()); } // Similar thing for dependsOn - for (DeploymentPlan::dependsOn_const_iterator dstart = this->dp_.begin_dependsOn (); - dstart != this->dp_.end_dependsOn (); + for (DeploymentPlan::dependsOn_const_iterator dstart = xsc_dp.begin_dependsOn (); + dstart != xsc_dp.end_dependsOn (); ++dstart) { CORBA::ULong len = @@ -94,8 +123,8 @@ namespace CIAO /* @@ Not needed at this time... // ... An the property stuff - for (DeploymentPlan::infoProperty_const_iterator pstart = this->dp_.begin_infoProperty (); - pstart != this->dp_.end_infoProperty (); + for (DeploymentPlan::infoProperty_const_iterator pstart = xsc_dp.begin_infoProperty (); + pstart != xsc_dp.end_infoProperty (); ++pstart) { CORBA::ULong len = @@ -110,18 +139,18 @@ namespace CIAO */ // Read in the realizes, if present - if (this->dp_.realizes_p ()) + if (xsc_dp.realizes_p ()) { this->retval_ = CCD_Handler::component_interface_descr ( - this->dp_.realizes (), + xsc_dp.realizes (), this->idl_dp_->realizes); if (!this->retval_) { ACE_DEBUG ((LM_ERROR, "(%P|%t) DP_Handler: " - "Error parting Component Interface Descriptor.")); + "Error parsing Component Interface Descriptor.")); return false; } } @@ -129,47 +158,54 @@ namespace CIAO this->retval_ = ADD_Handler::artifact_deployment_descrs ( - this->dp_, + xsc_dp, this->idl_dp_->artifact); if (!this->retval_) { ACE_DEBUG ((LM_ERROR, "(%P|%t) DP_Handler: " - "Error parting Artifact Deployment Descriptior.")); + "Error parsing Artifact Deployment Descriptior.")); return false; } this->retval_ = MDD_Handler::mono_deployment_descriptions ( - this->dp_, + xsc_dp, this->idl_dp_->implementation); if (!this->retval_) { ACE_DEBUG ((LM_ERROR, "(%P|%t) DP_Handler: " - "Error parting Monolithic Deployment Decriptions.")); + "Error parsing Monolithic Deployment Decriptions.")); return false; } this->retval_ = IDD_Handler::instance_deployment_descrs ( - this->dp_, + xsc_dp, this->idl_dp_->instance); if (!this->retval_) { ACE_DEBUG ((LM_ERROR, "(%P|%t) DP_Handler: " - "Error parting Instance Deployment Decriptions.")); + "Error parsing Instance Deployment Decriptions.")); return false; } - DP_PCD_Handler::plan_connection_descrs (this->dp_, this->idl_dp_->connection); + DP_PCD_Handler::plan_connection_descrs (xsc_dp, this->idl_dp_->connection); return this->retval_; } + + bool + DP_Handler::build_xsc (const ::Deployment::DeploymentPlan &plan) + { + // @@Lucas: Fill in the implementation here. + } + } } diff --git a/TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.h index 08da1a611c2..b98f697e84b 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.h @@ -41,11 +41,28 @@ namespace CIAO public: class NoPlan {}; + /// Use this constructor if you want to use + /// the XSC->IDL mapping DP_Handler (DeploymentPlan &dp); - + + /// Use this constructor if you want to use + /// the IDL->XSC mapping + DP_Handler (const ::Deployment::DeploymentPlan &plan); + ~DP_Handler (void) throw (); - + + /// Generates the IDL->XSC mapping. returns + /// null if the method fails or if the class was + /// constructed with the wrong source. + DeploymentPlan const *xsc (void) const + throw (NoPlan); + + DeploymentPlan *xsc (void) + throw (NoPlan); + + /// Generates the XSC->IDL mapping. returns null + /// if the method fails or the class was constructed ::Deployment::DeploymentPlan const *plan (void) const throw (NoPlan); @@ -54,14 +71,15 @@ namespace CIAO private: - bool resolve_plan (void); - + bool resolve_plan (DeploymentPlan &dp); + + bool build_xsc (const ::Deployment::DeploymentPlan &plan); + private: - + auto_ptr< DeploymentPlan > xsc_dp_; + auto_ptr< ::Deployment::DeploymentPlan> idl_dp_; - DeploymentPlan &dp_; - bool retval_; }; } |