summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2004-09-02 17:58:17 +0000
committerbala <balanatarajan@users.noreply.github.com>2004-09-02 17:58:17 +0000
commitb1d2d17ed16cba14d80e42d4bc9ff47f79850b26 (patch)
tree79174aae5ad8affbf3ccfb6f68f642908d7bd5f2
parent060b2a5f8136026a46d3fe21ce4398a4061131fa (diff)
downloadATCD-b1d2d17ed16cba14d80e42d4bc9ff47f79850b26.tar.gz
*** empty log message ***
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.cpp149
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.h62
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.cpp122
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.h70
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc2
5 files changed, 215 insertions, 190 deletions
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.cpp
index c0b6d0db7af..3203b0ad7a4 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.cpp
+++ b/TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.cpp
@@ -1,77 +1,96 @@
// $Id$
#include "ANY_Handler.h"
+#include "tao/Any.h"
-CIAO::Config_Handlers::ANY_Handler::ANY_Handler()
-{}
-CIAO::Config_Handlers::ANY_Handler::~ANY_Handler()
-{}
+namespace CIAO
+{
+ namespace Config_Handlers
+ {
+ ANY_Handler::ANY_Handler (void)
+ {
+ }
+ ANY_Handler::~ANY_Handler (void)
+ {
+ }
-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 <desc>.
- if(value.short_p()){
- toconfig <<= ACE_static_cast (CORBA::Short,
- CORBA::Short(value.short_()));
- }
- if(value.ushort_p()){
- toconfig <<= ACE_static_cast (CORBA::UShort,
- CORBA::UShort(value.ushort()));
- }
- if(value.long_p()){
- toconfig <<= ACE_static_cast (CORBA::Long,
- CORBA::Long(value.long_()));
- }
- if(value.ulong_p()){
- toconfig <<= ACE_static_cast (CORBA::ULong,
- CORBA::ULong(value.ulong()));
- }
- if(value.boolean_p()){
- toconfig <<= ACE_static_cast (CORBA::Boolean,
- CORBA::Boolean(value.boolean()));
- }
- if(value.double_p()){
- toconfig <<= ACE_static_cast (CORBA::Double,
- CORBA::Double(value.double_()));
- }
- if(value.float_p()){
- toconfig <<= ACE_static_cast (CORBA::Float,
- CORBA::Float(value.float_()));
- }
- if(value.string_p()){
- toconfig <<= CORBA::string_dup (value.string().c_str());
- }
- if(value.octet_p()){
- toconfig <<= CORBA::Any::from_octet (
- CORBA::Octet(value.octet()));
- }
- if(value.longlong_p()){
- toconfig <<= ACE_static_cast (CORBA::LongLong,
- CORBA::LongLong(value.longlong()));
- }
- if(value.ulonglong_p()){
- toconfig <<= ACE_static_cast (CORBA::ULongLong,
- CORBA::ULongLong(value.ulonglong()));
- }
+ void
+ ANY_Handler::get_any (CORBA::Any& toconfig,
+ Any& desc)
+ {
+
+ // Get the value that should be assigned to the Any.
+ DataValue value =
+ desc.value ();
+
+ // @@ Jules, you may want to align your coding standards to ACE
+ // coding standards. Else, Dr. Schmidt is going to come down on
+ // you heavily in CS291 :-)
+ if (value.short_p ())
+ {
+ // @@ Jules, please try using regular C++ casts
+ toconfig <<=
+ static_cast <CORBA::Short> (value.short ());
+ }
+ else if (value.ushort_p ())
+ {
+ toconfig <<=
+ static_cast <CORBA::UShort> (value.ushort ());
+ }
+ else if (value.long_p ())
+ {
+ toconfig <<=
+ static_cast <CORBA::UShort> (value.long ());
+ }
+ else if (value.ulong_p ())
+ {
+ toconfig <<=
+ static_cast <CORBA::UShort> (value.ulong ());
+ }
+ else if (value.boolean_p ())
+ {
+ toconfig <<=
+ static_cast <CORBA::Boolean> (value.boolean ());
+ }
+ else if (value.double_p ())
+ {
+ toconfig <<=
+ static_cast <CORBA::Double> (value.double ());
+ }
+ else if (value.float_p ())
+ {
+ toconfig <<=
+ static_cast <CORBA::Float> (value.float_ ());
+ }
+ else if (value.string_p ())
+ {
+ toconfig <<=
+ value.string ().c_str ();
+ }
+ else if (value.octet_p ())
+ {
+ toconfig <<=
+ CORBA::Any::from_octet (static_cast<CORBA::Octet> (value.octet ()));
+ }
+ else if (value.longlong_p ())
+ {
+ toconfig <<=
+ static_cast <CORBA::LongLong> (value.longlong ());
+ }
+ else if (value.ulonglong_p ())
+ {
+ toconfig <<=
+ static_cast <CORBA::ULongLong> (value.ulonglong ());
+ }
//if(value.longdouble_p()){
- // toconfig <<= ACE_static_cast (CORBA::LongDouble,
+ // toconfig <<= ACE_static_cast (CORBA::LongDouble,
// CORBA::LongDouble(value.longdouble()));
// }
-
- return toconfig;
+
+ return toconfig;
+ }
+ }
}
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.h
index 0503fa55e25..989cb071f3a 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.h
+++ b/TAO/CIAO/DAnCE/Config_Handlers/ANY_Handler.h
@@ -1,4 +1,4 @@
-//================================================
+//==============================================================
/**
* @file ANY_Handler.h
*
@@ -6,51 +6,55 @@
*
* @author Jules White <jules@dre.vanderbilt.edu>
*/
-//================================================
-
-#ifndef ANY_HANDLER_H
-#define ANY_HANDLER_H
+//================================================================
+#ifndef CIAO_CONFIG_HANDLERS_ANY_HANDLER_H
+#define CIAO_CONFIG_HANDLERS_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 CORBA
+{
+ class Any;
+}
-namespace CIAO{
-
- namespace Config_Handlers{
-
+namespace CIAO
+{
+ namespace Config_Handlers
+ {
/*
* @class ANY_Handler
- *
+ *
* @brief Handler class for <ComponentInterfaceDescription> types.
- *
- * This class defines handler methods to map values from
+ *
+ * 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);
-
+
+ class ANY_Handler
+ {
+ public:
+
+ ANY_Handler (void);
+
+ virtual ~ANY_Handler (void);
+
+ static void get_any(CORBA::Any& toconfig,
+ Any& desc);
+
};
}
-
}
+
#include /**/ "ace/post.h"
-#endif /* ANY_HANDLER_H */
+#endif /* CIAO_CONFIG_HANDLERS_ANY_HANDLER_H*/
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;
}
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.h
index b272c218429..0413a4a8fce 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.h
+++ b/TAO/CIAO/DAnCE/Config_Handlers/CID_Handler.h
@@ -8,60 +8,58 @@
*/
//================================================
-#ifndef CID_HANDLER_H
-#define CID_HANDLER_H
+#ifndef CIAO_CONFIG_HANDLERS_CID_HANDLER_H
+#define CIAO_CONFIG_HANDLERS_CID_HANDLER_H
#include /**/ "ace/pre.h"
-
-#include "ciao/DeploymentC.h"
-#include "ccd.hpp"
-#include "Basic_Deployment_Data.hpp"
-
-
+
+#include "cid.hpp"
+
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+namespace Deployment
+{
+ namespace ComponentInterfaceDescription;
+}
-namespace CIAO{
-
- namespace Config_Handlers{
-
-
+namespace CIAO
+{
+ namespace Config_Handlers
+ {
/*
* @class CID_Handler
- *
+ *
* @brief Handler class for <ComponentInterfaceDescription> types.
- *
- * This class defines handler methods to map values from
+ *
+ * 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{
-
+ class CID_Handler
+ {
public:
-
- CID_Handler();
- virtual ~CID_Handler();
-
- ///This method maps the values from the
- ///XSC object <ComponentPortDescription> to
- ///the CORBA IDL type <Deployment::ComponentPortDescription>.
- ///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,
+
+ CID_Handler (void);
+ virtual ~CID_Handler(void);
+
+ /// This method maps the values from the XSC object
+ /// <ComponentPortDescription> to the CORBA IDL type
+ /// <Deployment::ComponentPortDescription>. 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.
+ bool get_component_interface_descr (
+ Deployment::ComponentInterfaceDescription& toconfig,
ComponentInterfaceDescription& desc);
-
};
}
-
+
}
+
#include /**/ "ace/post.h"
#endif /* CID_HANDLER_H */
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc b/TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc
index 12ab9879d79..392ed5ee247 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc
+++ b/TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc
@@ -50,8 +50,6 @@ project (Config_Handlers) : ciao_deployment_stub {
project (XSC_Config_Handlers) : ciao_deployment_stub {
- requires += dummy_label
-
sharedname = XSC_Config_Handlers
dynamicflags = CONFIG_HANDLER_BUILD_DLL
macros += XML_USE_PTHREADS