diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-04-13 14:47:50 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-04-13 14:47:50 +0000 |
commit | feb8e89d1f3932917e3068c9c23db15ce55286e4 (patch) | |
tree | 0d62c61c2e4151b7665392d162436ee7d1e6782d /TAO/CIAO/tools/Config_Handlers/PCD_Handler.cpp | |
parent | cbe8aa5d5be1d4679ae0c4e30baaea24fbae416c (diff) | |
download | ATCD-feb8e89d1f3932917e3068c9c23db15ce55286e4.tar.gz |
Thu Apr 13 13:43:19 UTC 2006 William R. Otte <wotte@dre.vanderbilt.edu>escher_x_4_9_integration_point
Diffstat (limited to 'TAO/CIAO/tools/Config_Handlers/PCD_Handler.cpp')
-rw-r--r-- | TAO/CIAO/tools/Config_Handlers/PCD_Handler.cpp | 185 |
1 files changed, 84 insertions, 101 deletions
diff --git a/TAO/CIAO/tools/Config_Handlers/PCD_Handler.cpp b/TAO/CIAO/tools/Config_Handlers/PCD_Handler.cpp index 917c056a6cb..007355c0139 100644 --- a/TAO/CIAO/tools/Config_Handlers/PCD_Handler.cpp +++ b/TAO/CIAO/tools/Config_Handlers/PCD_Handler.cpp @@ -8,6 +8,7 @@ #include "CRDD_Handler.h" #include "Basic_Deployment_Data.hpp" #include "ciao/Deployment_DataC.h" +#include "ciao/CIAO_common.h" namespace CIAO { @@ -26,9 +27,11 @@ namespace CIAO ///and maps the values from the passed in XSC ///PlanConnectionDescription to its members. void PCD_Handler::get_PlanConnectionDescription ( - Deployment::PlanConnectionDescription& toconfig, - PlanConnectionDescription& desc) + Deployment::PlanConnectionDescription& toconfig, + PlanConnectionDescription& desc) { + CIAO_TRACE("PCD_Handler::get_PlanConnectionDescription"); + toconfig.name = CORBA::string_dup (desc.name ().c_str ()); //Source is mapped to a string in the schema and a sequence @@ -43,118 +46,98 @@ namespace CIAO toconfig.source[0] = desc.source ().c_str (); } - for(PlanConnectionDescription::deployRequirement_iterator - req (desc.begin_deployRequirement()); - req != desc.end_deployRequirement(); - req++) - { -#if 0 - // @@ MAJO: - //Create the handler for the requirements. - Requirement_Handler reqhandler; - - //Increase the sequence length and delgate - //the Requirement to the Req_Handler. - toconfig.deployRequirement.length ( - toconfig.deployRequirement.length () + 1); - reqhandler.get_Requirement ( - toconfig.deployRequirement[toconfig.deployRequirement.length () - 1], - desc.deployRequirement ()); -#endif /*if 0*/ - } + toconfig.deployRequirement.length (desc.count_deployRequirement ()); + std::for_each (desc.begin_deployRequirement (), + desc.end_deployRequirement (), + Requirement_Functor (toconfig.deployRequirement)); + //Create the ComponentExternalPortEndpoint handler. - CEPE_Handler::external_port_endpoints ( - desc, - toconfig.externalEndpoint); - + CEPE_Handler::external_port_endpoints (desc, + toconfig.externalEndpoint); + //Configure the PlanSubcomponentPortEndpoint's. - PSPE_Handler::sub_component_port_endpoints ( - desc, - toconfig.internalEndpoint); + PSPE_Handler::sub_component_port_endpoints (desc, + toconfig.internalEndpoint); //Configure the ExternalReferenceEndpoint's. - ERE_Handler::external_ref_endpoints ( - desc, - toconfig.externalReference); - + ERE_Handler::external_ref_endpoints (desc, + toconfig.externalReference); + //Configure the resource value. CRDD_Handler crddhandler; CORBA::ULong pos = 0; toconfig.deployedResource.length (desc.count_deployedResource ()); for(PlanConnectionDescription::deployedResource_iterator res = - desc.begin_deployedResource(); - res != desc.end_deployedResource(); - res++) - { + desc.begin_deployedResource(); + res != desc.end_deployedResource(); + res++) + { crddhandler.get_ConnectionResourceDeploymentDescription ( - toconfig.deployedResource[pos++], - *res); - } + toconfig.deployedResource[pos++], + *res); + } + + } + + PlanConnectionDescription PCD_Handler::get_PlanConnectionDescription ( + const Deployment::PlanConnectionDescription &src) + { + CIAO_TRACE("PCD_Handler::get_PlanConnectionDescription"); + + XMLSchema::string< char > name ((src.name)); + + PlanConnectionDescription pcd(name); + + //Get the source if it exists + if(src.source.length() != 0) + { + XMLSchema::string< char > source((src.source[0])); + pcd.source(source); + } + + //Get any externalEndpoint(s) and store them + size_t total = src.externalEndpoint.length(); + for(size_t i = 0; i < total; i++) + { + pcd.add_externalEndpoint( + CEPE_Handler::external_port_endpoint(src.externalEndpoint[i])); + } + + //Get any externalReference(s) and store them + total = src.externalReference.length(); + for(size_t j = 0; j < total; j++) + { + pcd.add_externalReference( + ERE_Handler::external_ref_endpoint(src.externalReference[j])); + } + + //Get any internalEndpoint(s) and store them + total = src.internalEndpoint.length(); + for(size_t k = 0; k < total; k++) + { + pcd.add_internalEndpoint( + PSPE_Handler::sub_component_port_endpoint(src.internalEndpoint[k])); + } + + //Get any deployedResource(s) and store them + total = src.deployedResource.length(); + for(size_t l = 0; l < total; l++) + { + pcd.add_deployedResource( + CRDD_Handler::connection_resource_depl_desc(src.deployedResource[l])); + } + + //Get any deployRequirement(s) and store them + total = src.deployRequirement.length(); + for(size_t m = 0; m < total; m++) + { + pcd.add_deployRequirement( + Req_Handler::get_requirement(src.deployRequirement[m])); + } + return pcd; } - - PlanConnectionDescription PCD_Handler::get_PlanConnectionDescription ( - const Deployment::PlanConnectionDescription &src) - { - XMLSchema::string< char > name ((src.name)); - - PlanConnectionDescription pcd(name); - - //Get the source if it exists - if(src.source.length() != 0) - { - XMLSchema::string< char > source((src.source[0])); - pcd.source(source); - } - - //Get any externalEndpoint(s) and store them - size_t total = src.externalEndpoint.length(); - for(size_t i = 0; i < total; i++) - { - pcd.add_externalEndpoint( - CEPE_Handler::external_port_endpoint( - src.externalEndpoint[i])); - } - - //Get any externalReference(s) and store them - total = src.externalReference.length(); - for(size_t j = 0; j < total; j++) - { - pcd.add_externalReference( - ERE_Handler::external_ref_endpoint( - src.externalReference[j])); - } - - //Get any internalEndpoint(s) and store them - total = src.internalEndpoint.length(); - for(size_t k = 0; k < total; k++) - { - pcd.add_internalEndpoint( - PSPE_Handler::sub_component_port_endpoint( - src.internalEndpoint[k])); - } - - //Get any deployedResource(s) and store them - total = src.deployedResource.length(); - for(size_t l = 0; l < total; l++) - { - pcd.add_deployedResource( - CRDD_Handler::connection_resource_depl_desc( - src.deployedResource[l])); - } - - //Get any deployRequirement(s) and store them - total = src.deployRequirement.length(); - for(size_t m = 0; m < total; m++) - { - pcd.add_deployRequirement( - Req_Handler::get_requirement( - src.deployRequirement[m])); - } - - return pcd; - } } } |