diff options
Diffstat (limited to 'TAO/CIAO/tools/Config_Handlers/DD_Handler.cpp')
-rw-r--r-- | TAO/CIAO/tools/Config_Handlers/DD_Handler.cpp | 97 |
1 files changed, 56 insertions, 41 deletions
diff --git a/TAO/CIAO/tools/Config_Handlers/DD_Handler.cpp b/TAO/CIAO/tools/Config_Handlers/DD_Handler.cpp index 939b2437f4c..f9c71d19ac6 100644 --- a/TAO/CIAO/tools/Config_Handlers/DD_Handler.cpp +++ b/TAO/CIAO/tools/Config_Handlers/DD_Handler.cpp @@ -1,5 +1,6 @@ // $Id$ #include "Utils/XML_Helper.h" +#include "SatisfierProperty_Handler.h" #include "DD_Handler.h" #include "Any_Handler.h" #include "Deployment.hpp" @@ -17,21 +18,22 @@ namespace CIAO domain_ (0), retval_ (false) { + CIAO_TRACE("DP_PCD_Handler::constructor"); XML_Helper helper; if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG , "inside DD_Handler")); - } + { + ACE_DEBUG ((LM_DEBUG , "inside DD_Handler")); + } XERCES_CPP_NAMESPACE::DOMDocument *dom = helper.create_dom (file); if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG , "after create dom")); - } + { + ACE_DEBUG ((LM_DEBUG , "after create dom")); + } if (!dom) throw DD_Handler::NoDomain (); @@ -39,20 +41,20 @@ namespace CIAO Domain *dm = new Domain (domain (dom)); -// Domain d = domain (dom); + // Domain d = domain (dom); if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG , "dom")); - } + { + ACE_DEBUG ((LM_DEBUG , "dom")); + } this->domain_.reset (dm); if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG , "after reset")); - } + { + ACE_DEBUG ((LM_DEBUG , "after reset")); + } if (!this->build_domain ()) throw NoDomain (); @@ -63,6 +65,7 @@ namespace CIAO domain_(dmn), retval_(false) { + CIAO_TRACE("DP_PCD_Handler::constructor - Domain"); if(!this->build_domain ()) throw NoDomain (); } @@ -83,35 +86,41 @@ namespace CIAO bool DD_Handler::build_domain () { + CIAO_TRACE("DP_PCD_Handler::build_domain"); this->idl_domain_.reset ( new ::Deployment::Domain ); // Read in the name - this->idl_domain_->label = - CORBA::string_dup (domain_->label ().c_str ()); + // Check if the label is there or not + if (domain_->label_p ()) + this->idl_domain_->label = + CORBA::string_dup (domain_->label ().c_str ()); - this->idl_domain_->UUID = - CORBA::string_dup (domain_->UUID ().c_str ()); + if (domain_->UUID_p ()) + this->idl_domain_->UUID = + CORBA::string_dup (domain_->UUID ().c_str ()); CORBA::ULong len = domain_->count_node (); this->idl_domain_->node.length (len); if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG , "The node length is [%d]\n",len)); - } + { + ACE_DEBUG ((LM_DEBUG , "The node length is [%d]\n",len)); + } //Resource _resource; int i =0; for (Domain::node_const_iterator iter = domain_->begin_node (); iter != domain_->end_node (); ++iter,++i - ) + ) { // Node* thisNode = (Node*)iter; this->idl_domain_->node[i].name = CORBA::string_dup (iter->name ().c_str ()); - this->idl_domain_->node[i].label = - CORBA::string_dup (iter->label ().c_str ()); + + if (iter->label_p ()) + this->idl_domain_->node[i].label = + CORBA::string_dup (iter->label ().c_str ()); // length is hard-coded for now ... // here iterate over the resources ... @@ -146,27 +155,33 @@ namespace CIAO CORBA::ULong property_len = res_iter->count_property (); this->idl_domain_->node[i].resource[res_id].property.length (property_len); - int property_id =0; + // int property_id =0; + std::for_each (res_iter->begin_property (), + res_iter->end_property (), + SatisfierProperty_Functor (this->idl_domain_->node[i].resource[res_id].property)); + + /* //FOR EACH PROPERTY for (Resource::property_const_iterator property_iter = - res_iter->begin_property (); - property_iter != res_iter->end_property (); - property_iter++, property_id++) - { - this->idl_domain_->node[i].resource[res_id].property[property_id ].name = - CORBA::string_dup (property_iter->name ().c_str ()); - - - this->idl_domain_->node[i].resource[res_id].property[property_id].kind = - ::Deployment::Quantity; - - Any the_any = property_iter->value (); - CORBA::Any a_corba_any; - Any_Handler::extract_into_any (the_any , a_corba_any); - this->idl_domain_->node[i].resource[res_id].property[property_id].value - = a_corba_any; - } + res_iter->begin_property (); + property_iter != res_iter->end_property (); + property_iter++, property_id++) + { + this->idl_domain_->node[i].resource[res_id].property[property_id ].name = + CORBA::string_dup (property_iter->name ().c_str ()); + + + this->idl_domain_->node[i].resource[res_id].property[property_id].kind = + ::Deployment::Quantity; + + Any the_any = property_iter->value (); + CORBA::Any a_corba_any; + Any_Handler::extract_into_any (the_any , a_corba_any); + this->idl_domain_->node[i].resource[res_id].property[property_id].value + = a_corba_any; + } + */ } } |