diff options
Diffstat (limited to 'TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.cpp')
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.cpp | 122 |
1 files changed, 64 insertions, 58 deletions
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.cpp index 49ce5c7ac6f..b1a56970789 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.cpp +++ b/TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.cpp @@ -6,49 +6,55 @@ typedef ::std::vector< ::CIAO::Config_Handlers::ComponentPortDescription >::iterator port_iterator; -CIAO::Config_Handlers::CID_Handler::CID_Handler() -{} -CIAO::Config_Handlers::CID_Handler::~CID_Handler() -{} - -Deployment::ComponentInterfaceDescription& -CIAO::Config_Handlers::CID_Handler::get_ComponentInterfaceDescription -(Deployment::ComponentInterfaceDescription& toconfig, - ComponentInterfaceDescription& desc) +namespace CIAO { - - //We first set up some of the basic - //properties such as UUID. We check - //to make sure each one is actually - //present before assigning it to - //the corresponding field in <toconfig>. - if( desc.UUID_p() ) + namespace Config_Handlers + { + CID_Handler::CID_Handler (void) { - toconfig.UUID = - CORBA::string_dup (desc.UUID().c_str()); } - if( desc.label_p() ){ - toconfig.label = - CORBA::string_dup (desc.label().c_str()); - } - if( desc.specificType_p() ){ - toconfig.specificType = - CORBA::string_dup (desc.specificType().c_str()); + + CID_Handler::~CID_Handler (void) + { } - - - if(desc.supportedType_p()){ - //Copy the values of the sequence types idlFile and - //supportedType to the + + bool + CID_Handler::get_component_interface_descr ( + Deployment::ComponentInterfaceDescription& toconfig, + ComponentInterfaceDescription& desc) + { + + // We first set up some of the basic properties such as UUID. We + // check to make sure each one is actually present before + // assigning it to the corresponding field in <toconfig>. + if(desc.UUID_p ()) + { + toconfig.UUID = + CORBA::string_dup (desc.UUID ().c_str ()); + } + else if(desc.label_p ()) + { + toconfig.label = + CORBA::string_dup (desc.label ().c_str ()); + } + else if(desc.specificType_p ()) + { + toconfig.specificType = + CORBA::string_dup (desc.specificType ().c_str ()); + } + else if (desc.supportedType_p ()) + { + //Copy the values of the sequence types idlFile and + //supportedType to the //<Deployment::ComponentInterfaceDescription>. if(!desc.supportedType().empty()) { toconfig.supportedType.length (1); - toconfig.supportedType[0] = + toconfig.supportedType[0] = CORBA::string_dup (desc.supportedType().c_str()); } } - + //Make sure the <idlFile> property //is actually present before attempting //any operations on it. @@ -56,17 +62,17 @@ CIAO::Config_Handlers::CID_Handler::get_ComponentInterfaceDescription if(!desc.idlFile().empty()) { toconfig.idlFile.length (1); - toconfig.idlFile[0] = + toconfig.idlFile[0] = CORBA::string_dup (desc.idlFile().c_str()); } } - - + + Prop_Handler propertyhandler; - + //The IDL for the <configProperty> specifies //a sequence of <Property> structs but the schema - //specifies <configProperty> as a single + //specifies <configProperty> as a single //<Property>. We construct that single property //element and assign it to the first position in the //<configProperty> sequence. We only do this if it @@ -76,19 +82,19 @@ CIAO::Config_Handlers::CID_Handler::get_ComponentInterfaceDescription //First construct the <Deployment::Property> //to configure. Deployment::Property prop; - + //Now, propogate the values from the <desc> into <prop>. propertyhandler.get_Property (prop,desc.configProperty()); - + //Finally, add it to the sequence. toconfig.configProperty.length (1); toconfig.configProperty[0] = prop; } - + //Create the handler for the //<ComponentPortDescriptions>. - CPD_Handler cpd_handler; - + CPD_Handler cpd_handler; + //Iterate through each of the XSC Component //Port Descriptions and use the CPD_Handler //to propogate their values into the <port> @@ -101,23 +107,23 @@ CIAO::Config_Handlers::CID_Handler::get_ComponentInterfaceDescription toconfig.port.length (toconfig.port.length () + 1); cpd_handler.get_ComponentPortDescription( toconfig.port[toconfig.port.length () - 1], - *port); + *port); } - + /*ComponentPropertyDescription stuff - * - * - * - * - * + * + * + * + * + * */ - - - - - - - - - return toconfig; + + + + + + + + + return toconfig; } |