From f038c2cc16f5c0c04b146e4bd3fa48a26916e2e0 Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 30 Aug 2004 17:25:26 +0000 Subject: *** empty log message *** --- TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.cpp | 39 +++++++++++++++ TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.h | 56 +++++++++++++++++++++ TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.cpp | 47 ++++++++++++++++++ TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.h | 67 ++++++++++++++++++++++++++ TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.cpp | 51 ++++++++++++++++++++ TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.h | 61 +++++++++++++++++++++++ 6 files changed, 321 insertions(+) create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.cpp create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.h create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.cpp create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.h create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.cpp create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.h diff --git a/TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.cpp new file mode 100644 index 00000000000..8faa9c487a4 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.cpp @@ -0,0 +1,39 @@ +// $Id$ + +#include "ANY_Handler.h" + +CIAO::Config_Handlers::ANY_Handler::ANY_Handler() +{} +CIAO::Config_Handlers::ANY_Handler::~ANY_Handler() +{} + + + +using CIAO::Config_Handlers; + +CORBA::Any& +CIAO::Config_Handlers::ANY_Handler::get_Any( + CORBA::Any& toconfig, Any& desc) +{ + + //Get the value that should be assigned to the Any. + DataValue value = desc.value(); + + //Here, we check each type to see if + //it is present. If a type is listed as + //present, we can assume that it is the + //intended value for the Any. This relieves + //us from the burden of having to check the + //type field on . + if(value.short_p()){ + //what we want to do here is create + //a utility class that handles converting + //the XMLSchema::short_, etc.. classes to the + //equivalent Corba class. + } + if(value.long_p()){ + + } + + return toconfig; +} diff --git a/TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.h new file mode 100644 index 00000000000..0503fa55e25 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.h @@ -0,0 +1,56 @@ +//================================================ +/** + * @file ANY_Handler.h + * + * $Id$ + * + * @author Jules White + */ +//================================================ + +#ifndef ANY_HANDLER_H +#define ANY_HANDLER_H + +#include /**/ "ace/pre.h" + +#include "ciao/DeploymentC.h" +#include "Basic_Deployment_Data.hpp" + + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + +namespace CIAO{ + + namespace Config_Handlers{ + + + /* + * @class ANY_Handler + * + * @brief Handler class for types. + * + * This class defines handler methods to map values from + * XSC Any objects, parsed from the descriptor files, to the + * corresponding CORBA IDL Any type. + * + */ + + class ANY_Handler{ + + public: + + ANY_Handler(); + virtual ~ANY_Handler(); + + static CORBA::Any& get_Any(CORBA::Any& toconfig, Any& desc); + + }; + + } + +} +#include /**/ "ace/post.h" +#endif /* ANY_HANDLER_H */ diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.cpp new file mode 100644 index 00000000000..20440307168 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.cpp @@ -0,0 +1,47 @@ +// $Id$ + +#include "CID_Handler.h" + +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) +{ + + toconfig.UUID = + CORBA::string_dup (desc.UUID().c_str()); + toconfig.label = + CORBA::string_dup (desc.label().c_str()); + toconfig.specificType = + CORBA::string_dup (desc.specificType().c_str()); + + //Copy the values of the sequence types idlFile and + //supporteType to the + //. + if(!desc.supportedType().empty()) + { + toconfig.supportedType.length(1); + toconfig.supportedType[0] = + CORBA::string_dup(desc.supportedType().c_str()); + } + + if(!desc.idlFile().empty()) + { + toconfig.idlFile.length(1); + toconfig.idlFile[0] = + CORBA::string_dup(desc.idlFile().c_str()); + } + + //Create the handler for the + //. + //CPDHandler cpd_handler(); + + + + return toconfig; +} diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.h new file mode 100644 index 00000000000..b272c218429 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.h @@ -0,0 +1,67 @@ +//================================================ +/** + * @file CID_Handler.h + * + * $Id$ + * + * @author Jules White + */ +//================================================ + +#ifndef CID_HANDLER_H +#define CID_HANDLER_H + +#include /**/ "ace/pre.h" + +#include "ciao/DeploymentC.h" +#include "ccd.hpp" +#include "Basic_Deployment_Data.hpp" + + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + +namespace CIAO{ + + namespace Config_Handlers{ + + + /* + * @class CID_Handler + * + * @brief Handler class for types. + * + * This class defines handler methods to map values from + * XSC objects, parsed from the descriptor files, to the + * corresponding CORBA IDL type for the schema element. + * + */ + + class CID_Handler{ + + public: + + CID_Handler(); + virtual ~CID_Handler(); + + ///This method maps the values from the + ///XSC object to + ///the CORBA IDL type . + ///It handles the creation of the Deployment::ComponentPort's, + ///Deployment::ComponentPortDescriptions's, and + ///Deployment::Properties and delegates mapping the values + ///from their corresponding XSC objects to their handlers. + Deployment::ComponentInterfaceDescription& + get_ComponentInterfaceDescription( + Deployment::ComponentInterfaceDescription& toconfig, + ComponentInterfaceDescription& desc); + + }; + + } + +} +#include /**/ "ace/post.h" +#endif /* CID_HANDLER_H */ diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.cpp new file mode 100644 index 00000000000..e028d5e3be1 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.cpp @@ -0,0 +1,51 @@ +// $Id$ + + +#include "CPD_Handler.h" + + +using CIAO::Config_Handlers; + +CIAO::Config_Handlers::CPD_Handler::CPD_Handler() +{} +CIAO::Config_Handlers::CPD_Handler::~CPD_Handler() +{} + +using CIAO::Config_Handlers; + +///This method maps the values from the +///XSC object to +///the CORBA IDL type . +Deployment::ComponentPortDescription & +CIAO::Config_Handlers::CPD_Handler::get_ComponentPortDescription( + Deployment::ComponentPortDescription& toconfig, + ComponentPortDescription& desc) +{ + //We make sure that a value exists for supportedType + //before increasing the size of the sequence. + if(!desc.supportedType().empty()){ + toconfig.supportedType.length(1); + toconfig.supportedType[0] = + CORBA::string_dup(desc.supportedType().c_str()); + } + + + toconfig.name = CORBA::string_dup(desc.name().c_str()); + + + toconfig.specificType = + CORBA::string_dup(desc.specificType().c_str()); + + //The DnC spec maps these CORBA IDL booleans to + //strings. Therefore, we set them to true if a + //value was provided (they aren't an empty string) + //and false otherwise. + toconfig.provider = !desc.provider().empty(); + toconfig.exclusiveProvider = !desc.exclusiveProvider().empty(); + toconfig.exclusiveUser = !desc.exclusiveUser().empty(); + toconfig.optional = !desc.optional().empty(); + + //Return the Deployment::ComponentPortDescription + return toconfig; + +} diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.h new file mode 100644 index 00000000000..26aea0f81a9 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.h @@ -0,0 +1,61 @@ +//================================================ +/** + * @file CPD_Handler.h + * + * $Id$ + * + * @author Jules White + */ +//================================================ + +#ifndef CPD_HANDLER_H +#define CPD_HANDLER_H + +#include /**/ "ace/pre.h" + +#include "ciao/DeploymentC.h" +#include "Basic_Deployment_Data.hpp" + + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + +namespace CIAO{ + + namespace Config_Handlers{ + + /* + * @class CPD_Handler + * + * @brief Handler class for types. + * + * This class defines handler methods to map values from + * XSC objects, parsed from the descriptor files, to the + * corresponding CORBA IDL type for the schema element. + * + */ + + class CPD_Handler{ + + public: + + CPD_Handler(); + virtual ~CPD_Handler(); + + ///This method maps the values from the + ///XSC object to + ///the CORBA IDL type . + Deployment::ComponentPortDescription& + get_ComponentPortDescription( + Deployment::ComponentPortDescription& toconfig, + ComponentPortDescription& desc + ); + }; + + } +} + +#include /**/ "ace/post.h" +#endif /* CPD_HANDLER_H */ -- cgit v1.2.1