summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjules <jules@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-09-29 20:27:33 +0000
committerjules <jules@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-09-29 20:27:33 +0000
commit6d856395aff120814780d4de6ad404ccfd51fc4c (patch)
tree53f6b3d0eacc18e14cd27deac3a0b1e8930659f4
parentebd55a5359a997723db514a0e41c8a2c6d3a3f39 (diff)
downloadATCD-6d856395aff120814780d4de6ad404ccfd51fc4c.tar.gz
Wed Sep 29 15:17:23 2004 Jules White <jules@dre.vanderbilt.edu>
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.cpp220
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.h41
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/CCD_Handler.cpp264
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/CCD_Handler.h51
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.cpp84
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.h77
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/ChangeLog28
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/IDD_Handler.cpp138
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/IDD_Handler.h53
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.cpp6
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.h8
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/IRDD_Handler.cpp65
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/IRDD_Handler.h68
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.cpp181
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.h48
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/Property_Handler.cpp30
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/Property_Handler.h77
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/RDD_Handler.cpp36
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/RDD_Handler.h34
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/Req_Handler.cpp42
-rw-r--r--TAO/CIAO/DAnCE/Config_Handlers/Req_Handler.h48
21 files changed, 965 insertions, 634 deletions
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.cpp
index 49e106c815d..3817dfee742 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.cpp
+++ b/TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.cpp
@@ -1,120 +1,158 @@
+
// $Id$
+
+
#include "ADD_Handler.h"
#include "Basic_Deployment_Data.hpp"
#include "ciao/Deployment_DataC.h"
#include "Property_Handler.h"
#include "Req_Handler.h"
#include "RDD_Handler.h"
-#include "Singleton_IDREF_Map.h"
-ACE_RCSID (DAnCE,
- ADD_Handler,
- "$Id$")
+
namespace CIAO
{
namespace Config_Handlers
{
- bool
- ADD_Handler::artifact_deployment_descr (
- const ArtifactDeploymentDescription &src,
- Deployment::ArtifactDeploymentDescription &dest,
- CORBA::ULong pos)
- {
- dest.name =
- CORBA::string_dup (src.name ().c_str ());
-
- dest.node =
- CORBA::string_dup (src.node ().c_str ());
- ArtifactDeploymentDescription::location_const_iterator end =
- src.end_location ();
+ ADD_Handler::ADD_Handler (void)
+ {
+ }
- for (ArtifactDeploymentDescription::location_const_iterator
- start = src.begin_location ();
- start != end;
- ++start)
- {
- CORBA::ULong l =
- dest.location.length ();
+ ADD_Handler::~ADD_Handler (void)
+ {
+ }
- dest.location.length (l + 1);
- dest.location[l] = start->c_str ();
- }
+ void
+ ADD_Handler::artifact_deployment_descr (
+ const ArtifactDeploymentDescription& desc,
+ Deployment::ArtifactDeploymentDescription& toconfig)
+ {
- ArtifactDeploymentDescription::source_const_iterator sce =
- src.end_source ();
+
+ toconfig.name=
+ CORBA::string_dup (desc.name ().c_str ());
+
+ ArtifactDeploymentDescription::source_const_iterator source_end =
+ desc.end_source ();
+ ArtifactDeploymentDescription::source_const_iterator source_beg =
+ desc.begin_source ();
+
+ CORBA::ULong source_length = toconfig.source.length ();
+ size_t source_delta = source_end - source_beg;
+ source_length += source_delta;
+
+ toconfig.source.length (source_length);
+ size_t source_count = 0;
+
for (ArtifactDeploymentDescription::source_const_iterator
- scb = src.begin_source ();
- scb != sce;
- ++scb)
- {
- CORBA::ULong l =
- dest.location.length ();
-
- dest.location.length (l + 1);
-
- dest.location[l] = scb->c_str ();
+ item (desc.begin_source ());
+ item != source_end;
+ ++item)
+ {
+ toconfig.source[source_length - (source_delta - source_count)] =
+ CORBA::string_dup (item->c_str ());
+ ++source_count;
}
-
- // @@TODO: See this loop is repeated
- ArtifactDeploymentDescription::execParameter_const_iterator adce =
- src.end_execParameter ();
-
- for (ArtifactDeploymentDescription::execParameter_const_iterator adcb =
- src.begin_execParameter ();
- adcb != adce;
- ++adcb)
- {
- CORBA::ULong len =
- dest.execParameter.length ();
-
- dest.execParameter.length (len + 1);
-
- Property_Handler::get_property ((*adcb),
- dest.execParameter[len]);
+
+ toconfig.node=
+ CORBA::string_dup (desc.node ().c_str ());
+
+ ArtifactDeploymentDescription::location_const_iterator location_end =
+ desc.end_location ();
+ ArtifactDeploymentDescription::location_const_iterator location_beg =
+ desc.begin_location ();
+
+ CORBA::ULong location_length = toconfig.location.length ();
+ size_t location_delta = location_end - location_beg;
+ location_length += location_delta;
+
+ toconfig.location.length (location_length);
+ size_t location_count = 0;
+
+ for (ArtifactDeploymentDescription::location_const_iterator
+ item (desc.begin_location ());
+ item != location_end;
+ ++item)
+ {
+ toconfig.location[location_length - (location_delta - location_count)] =
+ CORBA::string_dup (item->c_str ());
+ ++location_count;
}
-
-
- if (src.id_p ())
- {
- ACE_CString cstr (src.id ().c_str ());
-
- bool retval =
- Singleton_IDREF_Map::instance ()->bind_ref (cstr,
- pos);
- if (!retval)
- {
- // @@ MAJO: Don't know how to handle this. Throw an exception?
- }
+
+ ArtifactDeploymentDescription::execParameter_const_iterator execParameter_end =
+ desc.end_execParameter ();
+ ArtifactDeploymentDescription::execParameter_const_iterator execParameter_beg =
+ desc.begin_execParameter ();
+
+ CORBA::ULong execParameter_length = toconfig.execParameter.length ();
+ size_t execParameter_delta = execParameter_end - execParameter_beg;
+ execParameter_length += execParameter_delta;
+
+ toconfig.execParameter.length (execParameter_length);
+ size_t execParameter_count = 0;
+
+ for (ArtifactDeploymentDescription::execParameter_const_iterator
+ item (execParameter_beg);
+ item != execParameter_end;
+ ++item)
+ {
+ Property_Handler::property (
+ *item,
+ toconfig.execParameter[execParameter_length - (execParameter_delta - execParameter_count)]);
+ ++execParameter_count;
}
-
-#if 0
- // @@ MAJO: Don't know how to handle this.
- if (src.deployRequirement_p ())
- {
- Req_Handler handler;
- add.deployRequirement.length (
- add.deployRequirement.length () + 1);
- handler.get_Requirement (
- add.deployRequirement[add.deployRequirement.length () - 1],
- src.deployRequirement ());
+
+ ArtifactDeploymentDescription::deployRequirement_const_iterator deployRequirement_end =
+ desc.end_deployRequirement ();
+ ArtifactDeploymentDescription::deployRequirement_const_iterator deployRequirement_beg =
+ desc.begin_deployRequirement ();
+
+ CORBA::ULong deployRequirement_length = toconfig.deployRequirement.length ();
+ size_t deployRequirement_delta = deployRequirement_end - deployRequirement_beg;
+ deployRequirement_length += deployRequirement_delta;
+
+ toconfig.deployRequirement.length (deployRequirement_length);
+ size_t deployRequirement_count = 0;
+
+ for (ArtifactDeploymentDescription::deployRequirement_const_iterator
+ item (deployRequirement_beg);
+ item != deployRequirement_end;
+ ++item)
+ {
+ Req_Handler::requirement (
+ *item,
+ toconfig.deployRequirement[deployRequirement_length - (deployRequirement_delta - deployRequirement_count)]);
+ ++deployRequirement_count;
}
-
- if (src.deployedResource_p ())
- {
- RDD_Handler handler;
- add.deployedResource.length (
- add.deployedResource.length () + 1);
- handler.get_ResourceDeploymentDescription (
- add.deployedResource[add.deployedResource.length () - 1],
- src.deployedResource ());
+
+ ArtifactDeploymentDescription::deployedResource_const_iterator deployedResource_end =
+ desc.end_deployedResource ();
+ ArtifactDeploymentDescription::deployedResource_const_iterator deployedResource_beg =
+ desc.begin_deployedResource ();
+
+ CORBA::ULong deployedResource_length = toconfig.deployedResource.length ();
+ size_t deployedResource_delta = deployedResource_end - deployedResource_beg;
+ deployedResource_length += deployedResource_delta;
+
+ toconfig.deployedResource.length (deployedResource_length);
+ size_t deployedResource_count = 0;
+
+ for (ArtifactDeploymentDescription::deployedResource_const_iterator
+ item (deployedResource_beg);
+ item != deployedResource_end;
+ ++item)
+ {
+ RDD_Handler::resource_deployment_descr (
+ *item,
+ toconfig.deployedResource[deployedResource_length - (deployedResource_delta - deployedResource_count)]);
+ ++deployedResource_count;
}
-#endif /* if 0*/
- return true;
+
}
}
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.h
index 51d7eff4dd9..b9139bc633b 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.h
+++ b/TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.h
@@ -1,4 +1,5 @@
-//==============================================================
+
+ //==============================================================
/**
* @file ADD_Handler.h
*
@@ -13,13 +14,14 @@
#include /**/ "ace/pre.h"
#include "Config_Handlers/Config_Handlers_Export.h"
-#include "tao/Basic_Types.h"
+#include "ace/config-lite.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+
namespace Deployment
{
class ArtifactDeploymentDescription;
@@ -32,28 +34,35 @@ namespace CIAO
namespace Config_Handlers
{
- class ArtifactDeploymentDescription;
+ class ArtifactDeploymentDescription;
- /*
+
+ /*
* @class ADD_Handler
*
* @brief Handler class for <ArtifactDeploymentDescription> types.
*
- * This class defines handler methods to map values from XSC
- * ArtifactDeploymentDescription objects, parsed from the
- * // @@ Jules, why Any type?
- * descriptor files, to the corresponding CORBA IDL Any type.
+ * This class defines handler methods to map values from
+ * XSC ArtifactDeploymentDescription objects, parsed from the descriptor files, to the
+ * corresponding CORBA IDL Any type.
+ *
*/
- class Config_Handlers_Export ADD_Handler
- {
- public:
- static bool artifact_deployment_descr (
- const ArtifactDeploymentDescription& desc,
- ::Deployment::ArtifactDeploymentDescription &dest,
- CORBA::ULong l = 0);
+
+ class Config_Handlers_Export ADD_Handler {
+
+ public:
+
+ ADD_Handler (void);
+ virtual ~ADD_Handler (void);
+
+ static void artifact_deployment_descr (
+ const ArtifactDeploymentDescription& desc,
+ Deployment::ArtifactDeploymentDescription& toconfig);
+
};
}
}
-#include /**/ "ace/post.h"
+#include /**/ "ace/post.h"
#endif /* CIAO_CONFIG_HANDLERS_ADD_Handler_H */
+
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CCD_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/CCD_Handler.cpp
index 9b9bc45fddf..99adc131408 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/CCD_Handler.cpp
+++ b/TAO/CIAO/DAnCE/Config_Handlers/CCD_Handler.cpp
@@ -1,151 +1,161 @@
+
// $Id$
+
#include "CCD_Handler.h"
+#include "Basic_Deployment_Data.hpp"
+#include "ciao/Deployment_DataC.h"
+#include "ccd.hpp"
#include "Property_Handler.h"
#include "CPD_Handler.h"
#include "ComponentPropertyDescription_Handler.h"
+
namespace CIAO
{
namespace Config_Handlers
{
- bool
- CCD_Handler::component_interface_descr (
- Deployment::ComponentInterfaceDescription& toconfig,
- ComponentInterfaceDescription& desc)
+
+ CCD_Handler::CCD_Handler (void)
{
- if(desc.UUID_p ())
- {
- toconfig.UUID =
- CORBA::string_dup (desc.UUID ().c_str ());
- }
+ }
- if(desc.label_p ())
- {
- toconfig.label =
- CORBA::string_dup (desc.label ().c_str ());
- }
+ CCD_Handler::~CCD_Handler (void)
+ {
+ }
- if(desc.specificType_p ())
- {
- toconfig.specificType =
- CORBA::string_dup (desc.specificType ().c_str ());
- }
- ComponentInterfaceDescription::supportedType_iterator
- end = desc.end_supportedType ();
+ void
+ CCD_Handler::comp_interface_descr (
+ const ComponentInterfaceDescription& desc,
+ Deployment::ComponentInterfaceDescription& toconfig)
+ {
- for (ComponentInterfaceDescription::supportedType_iterator s =
- desc.begin_supportedType ();
- s != end; ++s)
- {
- // This loop is going to be very slow! :(!
- CORBA::ULong len =
- toconfig.supportedType.length ();
- toconfig.supportedType.length (len + 1);
- toconfig.supportedType[len] =
- CORBA::string_dup ((*s).c_str ());
+
+ 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 ());
+
+ ComponentInterfaceDescription::supportedType_const_iterator supportedType_end =
+ desc.end_supportedType ();
+ ComponentInterfaceDescription::supportedType_const_iterator supportedType_beg =
+ desc.begin_supportedType ();
+
+ CORBA::ULong supportedType_length = toconfig.supportedType.length ();
+ size_t supportedType_delta = supportedType_end - supportedType_beg;
+ supportedType_length += supportedType_delta;
+
+ toconfig.supportedType.length (supportedType_length);
+ size_t supportedType_count = 0;
+
+ for (ComponentInterfaceDescription::supportedType_const_iterator
+ item (desc.begin_supportedType ());
+ item != supportedType_end;
+ ++item)
+ {
+ toconfig.supportedType[supportedType_length - (supportedType_delta - supportedType_count)] =
+ CORBA::string_dup (item->c_str ());
+ ++supportedType_count;
}
-
- ComponentInterfaceDescription::idlFile_iterator
- eidl = desc.end_idlFile ();
-
- for (ComponentInterfaceDescription::idlFile_iterator sidl=
- desc.begin_idlFile ();
- sidl != eidl;
- ++sidl)
+
+ ComponentInterfaceDescription::idlFile_const_iterator idlFile_end =
+ desc.end_idlFile ();
+ ComponentInterfaceDescription::idlFile_const_iterator idlFile_beg =
+ desc.begin_idlFile ();
+
+ CORBA::ULong idlFile_length = toconfig.idlFile.length ();
+ size_t idlFile_delta = idlFile_end - idlFile_beg;
+ idlFile_length += idlFile_delta;
+
+ toconfig.idlFile.length (idlFile_length);
+ size_t idlFile_count = 0;
+
+ for (ComponentInterfaceDescription::idlFile_const_iterator
+ item (desc.begin_idlFile ());
+ item != idlFile_end;
+ ++item)
+ {
+ toconfig.idlFile[idlFile_length - (idlFile_delta - idlFile_count)] =
+ CORBA::string_dup (item->c_str ());
+ ++idlFile_count;
+ }
+
+ ComponentInterfaceDescription::configProperty_const_iterator configProperty_end =
+ desc.end_configProperty ();
+ ComponentInterfaceDescription::configProperty_const_iterator configProperty_beg =
+ desc.begin_configProperty ();
+
+ CORBA::ULong configProperty_length = toconfig.configProperty.length ();
+ size_t configProperty_delta = configProperty_end - configProperty_beg;
+ configProperty_length += configProperty_delta;
+
+ toconfig.configProperty.length (configProperty_length);
+ size_t configProperty_count = 0;
+
+ for (ComponentInterfaceDescription::configProperty_const_iterator
+ item (configProperty_beg);
+ item != configProperty_end;
+ ++item)
+ {
+ Property_Handler::property (
+ *item,
+ toconfig.configProperty[configProperty_length - (configProperty_delta - configProperty_count)]);
+ ++configProperty_count;
+ }
+
+ ComponentInterfaceDescription::port_const_iterator port_end =
+ desc.end_port ();
+ ComponentInterfaceDescription::port_const_iterator port_beg =
+ desc.begin_port ();
+
+ CORBA::ULong port_length = toconfig.port.length ();
+ size_t port_delta = port_end - port_beg;
+ port_length += port_delta;
+
+ toconfig.port.length (port_length);
+ size_t port_count = 0;
+
+ for (ComponentInterfaceDescription::port_const_iterator
+ item (port_beg);
+ item != port_end;
+ ++item)
+ {
+ CPD_Handler::comp_port_descr (
+ *item,
+ toconfig.port[port_length - (port_delta - port_count)]);
+ ++port_count;
+ }
+
+ /* if (desc.property_p ())
{
- // @@ Another n^2 algorithm
- CORBA::ULong len =
- toconfig.idlFile.length ();
-
- toconfig.idlFile.length (len + 1);
-
- toconfig.idlFile [len] =
- (*sidl).c_str ();
+ CORBA::ULong length = toconfig.property.length ();
+
+ toconfig.property.length (length + 1);
+ ComponentPropertyDescription_Handler::comp_property_descr (
+ desc.property (),
+ toconfig.property[length - 1]);
}
-
- ComponentInterfaceDescription::configProperty_iterator pend =
- desc.end_configProperty ();
-
- for (ComponentInterfaceDescription::configProperty_iterator pstart =
- desc.begin_configProperty ();
- pstart != pend;
- ++pstart)
- {
- // Need to improve this. This is clearly O(n^2).
- CORBA::ULong len =
- toconfig.configProperty.length ();
-
- toconfig.configProperty.length (len + 1);
-
- Property_Handler::get_property (*pstart,
- toconfig.configProperty [len]);
- }
-
- for (ComponentInterfaceDescription::port_iterator
- port (desc.begin_port ());
- port != desc.end_port ();
- ++port)
- {
- CORBA::ULong len =
- toconfig.port.length ();
-
- toconfig.port.length (len + 1);
-
- CPD_Handler::component_port_description (
- toconfig.port[len],
- *port);
- }
-
-#if 0
- // @@ MAJO: I don't think we need to handle this now, since they
- // are not needed for this round. IOW, we don't really understand
- // how to use this stuff ;)
- if (desc.property_p ())
- {
- //Create the ComponentPropertyDescription handler.
- ComponentPropertyDescription_Handler cprop_handler;
-
- //Increase the size of the property sequence.
- toconfig.property.length (
- toconfig.property.length () + 1);
- //Now delegate the propogation to the
- //<ComponentPropertyDescription_Handler>.
- cprop_handler.get_ComponentPropertyDescription (
- toconfig.property [toconfig.property.length () -1],
- desc.property ());
- }
-
-
-
- //The IDL for the <infoProperty> specifies
- //a sequence of <Property> structs but the schema
- //specifies <infoProperty> as a single
- //<Property>. We construct that single property
- //element and assign it to the first position in the
- //<infoProperty> sequence. We only do this if it
- //is present.
- if (desc.infoProperty_p () )
- {
- //First construct the <Deployment::Property>
- //to configure.
- Deployment::Property prop;
-
- //Now, propogate the values from the <desc> into <prop>.
- Property_Handler::get_property (desc.infoProperty (),
- prop);
-
- //Finally, add it to the sequence.
- toconfig.infoProperty.length (
- toconfig.infoProperty.length () + 1);
- toconfig.infoProperty [toconfig.infoProperty.length () - 1] = prop;
- }
-#endif /*if 0*/
-
- return 1;
+
+ if (desc.infoProperty_p ())
+ {
+ CORBA::ULong length = toconfig.infoProperty.length ();
+
+ toconfig.infoProperty.length (length + 1);
+ Property_Handler::property (
+ desc.infoProperty (),
+ toconfig.infoProperty[length - 1]);
+ }*/
+
+
}
+
}
+
}
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CCD_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CCD_Handler.h
index cbcf1dbec8c..e9cf8e30a08 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/CCD_Handler.h
+++ b/TAO/CIAO/DAnCE/Config_Handlers/CCD_Handler.h
@@ -1,55 +1,68 @@
-//================================================
+
+ //==============================================================
/**
- * @file CID_Handler.h
+ * @file CCD_Handler.h
*
* $Id$
*
* @author Jules White <jules@dre.vanderbilt.edu>
*/
-//================================================
+//================================================================
-#ifndef CIAO_CONFIG_HANDLERS_CCD_HANDLER_H
-#define CIAO_CONFIG_HANDLERS_CCD_HANDLER_H
+#ifndef CIAO_CONFIG_HANDLERS_CCD_Handler_H
+#define CIAO_CONFIG_HANDLERS_CCD_Handler_H
#include /**/ "ace/pre.h"
#include "Config_Handlers/Config_Handlers_Export.h"
+#include "ace/config-lite.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "Config_Handlers/cid.hpp"
+
namespace Deployment
{
class ComponentInterfaceDescription;
}
+
namespace CIAO
{
+
namespace Config_Handlers
{
+
+ class ComponentInterfaceDescription;
+
+
/*
* @class CCD_Handler
*
* @brief Handler class for <ComponentInterfaceDescription> types.
*
- * This class is named CCD_Handler but actually fills
- * <ComponentInterfaceDescription>. Why is this confusion? We
- * want to maintain the correlation between the XSD file and the
- * actual datatype. The file name corresponds to the XSD file but
- * the data type being filled in is of type
- * <ComponentInterfaceDescription>
+ * This class defines handler methods to map values from
+ * XSC ComponentInterfaceDescription objects, parsed from the descriptor files, to the
+ * corresponding CORBA IDL Any type.
+ *
*/
- class Config_Handlers_Export CCD_Handler
- {
+
+ class Config_Handlers_Export CCD_Handler {
+
public:
- static bool component_interface_descr (
- Deployment::ComponentInterfaceDescription& toconfig,
- ComponentInterfaceDescription& desc);
+
+ CCD_Handler (void);
+ virtual ~CCD_Handler (void);
+
+ static void comp_interface_descr (
+ const ComponentInterfaceDescription& desc,
+ Deployment::ComponentInterfaceDescription& toconfig);
+
};
}
}
-#include /**/ "ace/post.h"
-#endif /* CID_HANDLER_H */
+#include /**/ "ace/post.h"
+#endif /* CIAO_CONFIG_HANDLERS_CCD_Handler_H */
+
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.cpp
index 225e2035586..91dc9ed8715 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.cpp
+++ b/TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.cpp
@@ -1,33 +1,77 @@
+
// $Id$
+
+
#include "CPD_Handler.h"
+#include "Basic_Deployment_Data.hpp"
+#include "ciao/Deployment_DataC.h"
+
+
namespace CIAO
{
namespace Config_Handlers
{
+ CPD_Handler::CPD_Handler (void)
+ {
+ }
+
+ CPD_Handler::~CPD_Handler (void)
+ {
+ }
+
+
void
- CPD_Handler::component_port_description (
- Deployment::ComponentPortDescription& toconfig,
- ComponentPortDescription& desc)
+ CPD_Handler::comp_port_descr (
+ const ComponentPortDescription& desc,
+ Deployment::ComponentPortDescription& toconfig)
{
- toconfig.name =
- desc.name ().c_str ();
-
- toconfig.specificType =
- desc.specificType ().c_str ();
-
- if (!desc.supportedType ().empty ())
- {
- toconfig.supportedType.length (1);
- toconfig.supportedType[0] =
- desc.supportedType ().c_str ();
- }
-
- toconfig.provider = !desc.provider ().empty ();
- toconfig.exclusiveProvider = !desc.exclusiveProvider ().empty ();
- toconfig.exclusiveUser = !desc.exclusiveUser ().empty ();
- toconfig.optional = !desc.optional ().empty ();
+
+
+
+ toconfig.name=
+ CORBA::string_dup (desc.name ().c_str ());
+
+ toconfig.specificType=
+ CORBA::string_dup (desc.specificType ().c_str ());
+
+ CORBA::ULong supportedType_length = toconfig.supportedType.length ();
+ toconfig.supportedType.length (supportedType_length + 1);
+ toconfig.supportedType[supportedType_length - 1]=
+ CORBA::string_dup (desc.supportedType ().c_str ());
+
+ toconfig.provider=
+ !desc.provider ().empty ();
+
+ toconfig.exclusiveProvider=
+ !desc.exclusiveProvider ().empty ();
+
+ toconfig.exclusiveUser=
+ !desc.exclusiveUser ().empty ();
+
+ if (desc.kind () ==
+ CCMComponentPortKind::Facet)
+ toconfig.kind = Deployment::Facet;
+ if (desc.kind () ==
+ CCMComponentPortKind::SimplexReceptacle)
+ toconfig.kind = Deployment::SimplexReceptacle;
+ if (desc.kind () ==
+ CCMComponentPortKind::MultiplexReceptacle)
+ toconfig.kind = Deployment::MultiplexReceptacle;
+ if (desc.kind () ==
+ CCMComponentPortKind::EventEmitter)
+ toconfig.kind = Deployment::EventEmitter;
+ if (desc.kind () ==
+ CCMComponentPortKind::EventPublisher)
+ toconfig.kind = Deployment::EventPublisher;
+ if (desc.kind () ==
+ CCMComponentPortKind::EventConsumer)
+ toconfig.kind = Deployment::EventConsumer;
+
+
}
+
}
+
}
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.h
index d6ce8eb9044..c55ac979737 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.h
+++ b/TAO/CIAO/DAnCE/Config_Handlers/CPD_Handler.h
@@ -1,4 +1,5 @@
-//================================================
+
+ //==============================================================
/**
* @file CPD_Handler.h
*
@@ -6,52 +7,62 @@
*
* @author Jules White <jules@dre.vanderbilt.edu>
*/
-//================================================
-
-#ifndef CIAO_CONFIG_HANDLERS_CPD_HANDLER_H
-#define CIAO_CONFIG_HANDLERS_CPD_HANDLER_H
+//================================================================
+#ifndef CIAO_CONFIG_HANDLERS_CPD_Handler_H
+#define CIAO_CONFIG_HANDLERS_CPD_Handler_H
#include /**/ "ace/pre.h"
-#include "ciao/DeploymentC.h"
-#include "Basic_Deployment_Data.hpp"
-
+#include "Config_Handlers/Config_Handlers_Export.h"
+#include "ace/config-lite.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-namespace CIAO{
- namespace Config_Handlers{
+namespace Deployment
+{
+ class ComponentPortDescription;
+}
+
- /*
- * @class CPD_Handler
- *
- * @brief Handler class for <CCMComponentPortDescription> 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.
- *
- */
+namespace CIAO
+{
- class CPD_Handler
- {
+ namespace Config_Handlers
+ {
- public:
+ class ComponentPortDescription;
- /// Maps the values from the XSC object
- /// <ComponentInterfaceDescription> to the CORBA IDL type
- /// <Deployment::ComponentInterfaceDescription>.
- static void component_port_description (
- ::Deployment::ComponentPortDescription& toconfig,
- ComponentPortDescription& desc);
- };
- }
+ /*
+ * @class CPD_Handler
+ *
+ * @brief Handler class for <ComponentPortDescription> types.
+ *
+ * This class defines handler methods to map values from
+ * XSC ComponentPortDescription objects, parsed from the descriptor files, to the
+ * corresponding CORBA IDL Any type.
+ *
+ */
+
+ class Config_Handlers_Export CPD_Handler {
+
+ public:
+
+ CPD_Handler (void);
+ virtual ~CPD_Handler (void);
+
+ static void comp_port_descr (
+ const ComponentPortDescription& desc,
+ Deployment::ComponentPortDescription& toconfig);
+
+ };
+ }
}
-#include /**/ "ace/post.h"
-#endif /* CIAO_CONFIG_HANDLERS_CPD_HANDLER_H*/
+#include /**/ "ace/post.h"
+#endif /* CIAO_CONFIG_HANDLERS_CPD_Handler_H */
+
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/ChangeLog b/TAO/CIAO/DAnCE/Config_Handlers/ChangeLog
index ef70bdc0f1b..a8d98385e3e 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/ChangeLog
+++ b/TAO/CIAO/DAnCE/Config_Handlers/ChangeLog
@@ -1,9 +1,31 @@
+Wed Sep 29 15:17:23 2004 Jules White <jules@dre.vanderbilt.edu>
+
+ * DAnCE/Config_Handlers/CCD_Handler.cpp:
+ * DAnCE/Config_Handlers/CCD_Handler.h:
+ * DAnCE/Config_Handlers/ADD_Handler.cpp:
+ * DAnCE/Config_Handlers/ADD_Handler.h:
+ * DAnCE/Config_Handlers/IDD_Handler.cpp:
+ * DAnCE/Config_Handlers/IDD_Handler.h:
+ * DAnCE/Config_Handlers/IRDD_Handler.cpp:
+ * DAnCE/Config_Handlers/IRDD_Handler.h:
+ * DAnCE/Config_Handlers/RDD_Handler.cpp:
+ * DAnCE/Config_Handlers/RDD_Handler.h:
+ * DAnCE/Config_Handlers/MDD_Handler.cpp:
+ * DAnCE/Config_Handlers/MDD_Handler.h:
+ * DAnCE/Config_Handlers/Property_Handler.cpp:
+ * DAnCE/Config_Handlers/Property_Handler.h:
+ * DAnCE/Config_Handlers/Req_Handler.cpp:
+ * DAnCE/Config_Handlers/Req_Handler.h:
+
+ Re-generated the handlers to improve loop efficiency, account
+ for schema changes, and use the new IDREF handling.
+
Tue Sep 28 15:26:41 2004 Jules White <jules@dre.vanderbilt.edu>
- * DAnCE/Config_Handlers/Base_Handler.cpp:
- * DAnCE/Config_Handlers/Base_Handler.h:
+ * DAnCE/Config_Handlers/Base_Handler.cpp:
+ * DAnCE/Config_Handlers/Base_Handler.h:
- Removed Base_Handler since it is no longer used.
+ Removed Base_Handler since it is no longer used.
Tue Sep 28 18:38:41 2004 Balachandran Natarajan <bala@dre.vanderbilt.edu>
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/IDD_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/IDD_Handler.cpp
index 0d60bc4ba26..e3966725d20 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/IDD_Handler.cpp
+++ b/TAO/CIAO/DAnCE/Config_Handlers/IDD_Handler.cpp
@@ -1,10 +1,15 @@
+
// $Id$
+
#include "IDD_Handler.h"
-#include "Prop_Handler.h"
-#include "ANY_Handler.h"
#include "Basic_Deployment_Data.hpp"
#include "ciao/Deployment_DataC.h"
+#include "MDD_Handler.h"
+#include "Property_Handler.h"
+#include "IRDD_Handler.h"
+
+
namespace CIAO
{
@@ -18,104 +23,55 @@ namespace CIAO
IDD_Handler::~IDD_Handler (void)
{
}
-
- ///This method takes a <Deployment::InstanceDeploymentDescription>
- ///and maps the values from the passed in XSC
- ///InstanceDeploymentDescription to its members.
- void
- IDD_Handler::get_InstanceDeploymentDescription (
- Deployment::InstanceDeploymentDescription& toconfig,
- InstanceDeploymentDescription& desc)
+
+
+ void
+ IDD_Handler::instance_deployment_descr (
+ const InstanceDeploymentDescription& desc,
+ Deployment::InstanceDeploymentDescription& toconfig)
{
- // name, node, and source are required elements,
- // and will be present in any valid instance document.
- toconfig.name = CORBA::string_dup (desc.name ().c_str ());
- toconfig.node = CORBA::string_dup (desc.node ().c_str ());
+
+
- toconfig.source.length (toconfig.source.length () + 1);
- toconfig.source[toconfig.source.length () - 1] =
- CORBA::string_dup (desc.source ().c_str ());
+ toconfig.name=
+ CORBA::string_dup (desc.name ().c_str ());
- // @@TODO: What to do with the implementationRef?
+ toconfig.node=
+ CORBA::string_dup (desc.node ().c_str ());
- if (desc.configProperty_p ())
- {
- // Create a property handler to fill in a property struct
- Prop_Handler property_handler;
- Deployment::Property prop;
- property_handler.get_Property (prop,
- desc.configProperty ());
-
- // Make room in the sequence for the strtuct that we have
- // created.
- toconfig.configProperty.length (toconfig.configProperty.length () + 1);
- toconfig.configProperty[toconfig.configProperty.length () - 1] =
- prop;
- }
-
- if (desc.deployedResource_p ())
- {
- CORBA::ULong length = toconfig.deployedResource.length ();
- toconfig.deployedResource.length (length + 1);
-
- this->get_InstanceResourceDeploymentDescription
- (toconfig.deployedResource[length - 1],
- desc.deployedResource ());
- }
+ CORBA::ULong source_length = toconfig.source.length ();
+ toconfig.source.length (source_length + 1);
+ toconfig.source[source_length - 1]=
+ CORBA::string_dup (desc.source ().c_str ());
- if (desc.deployedSharedResource_p ())
- {
- CORBA::ULong length = toconfig.deployedSharedResource.length ();
- toconfig.deployedSharedResource.length (length + 1);
-
- this->get_InstanceResourceDeploymentDescription
- (toconfig.deployedResource[length],
- desc.deployedResource ());
- }
+ Singleton_IDREF_Map::instance ()->find_ref (
+ toconfig.implementation,
+ desc.implementation);
- // Done!
- }
-
- void
- IDD_Handler::get_InstanceResourceDeploymentDescription (
- Deployment::InstanceResourceDeploymentDescription &toconfig,
- InstanceResourceDeploymentDescription &desc)
- {
- // resourceUsage is an enumerated type
- switch (desc.resourceUsage ().integral ())
- {
- case ResourceUsageKind::None_l:
- toconfig.resourceUsage = Deployment::None;
- break;
-
- case ResourceUsageKind::InstanceUsesResource_l:
- toconfig.resourceUsage = Deployment::InstanceUsesResource;
- break;
-
- case ResourceUsageKind::ResourceUsesInstance_l:
- toconfig.resourceUsage = Deployment::ResourceUsesInstance;
- break;
-
- case ResourceUsageKind::PortUsesResource_l:
- toconfig.resourceUsage = Deployment::PortUsesResource;
- break;
-
- case ResourceUsageKind::ResourceUsesPort_l:
- toconfig.resourceUsage = Deployment::ResourceUsesPort;
- break;
- }
+ CORBA::ULong configProperty_length = toconfig.configProperty.length ();
+
+ toconfig.configProperty.length (configProperty_length + 1);
+ Property_Handler::property (
+ desc.configProperty (),
+ toconfig.configProperty[configProperty_length - 1]);
- // requirementName and resourceName are strings
- toconfig.requirementName =
- CORBA::string_dup (desc.requirementName ().c_str ());
- toconfig.resourceName =
- CORBA::string_dup (desc.resourceName ().c_str ());
+ CORBA::ULong deployedProperty_length = toconfig.deployedProperty.length ();
+
+ toconfig.deployedProperty.length (deployedProperty_length + 1);
+ IRDD_Handler::instance_resource_deployment_descr (
+ desc.deployedProperty (),
+ toconfig.deployedProperty[deployedProperty_length - 1]);
- ANY_Handler::get_Any (toconfig.resourceValue,
- desc.resourceValue ());
+ CORBA::ULong deployedSharedProperty_length = toconfig.deployedSharedProperty.length ();
+
+ toconfig.deployedSharedProperty.length (deployedSharedProperty_length + 1);
+ IRDD_Handler::instance_resource_deployment_descr (
+ desc.deployedSharedProperty (),
+ toconfig.deployedSharedProperty[deployedSharedProperty_length - 1]);
+
- // Done!
}
-
+
}
+
}
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/IDD_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/IDD_Handler.h
index 3e8e28def0f..ca2415f475a 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/IDD_Handler.h
+++ b/TAO/CIAO/DAnCE/Config_Handlers/IDD_Handler.h
@@ -1,4 +1,5 @@
-//==============================================================
+
+ //==============================================================
/**
* @file IDD_Handler.h
*
@@ -8,64 +9,60 @@
*/
//================================================================
-#ifndef CIAO_CONFIG_HANDLERS_IDD_HANDLER_H
-#define CIAO_CONFIG_HANDLERS_IDD_HANDLER_H
+#ifndef CIAO_CONFIG_HANDLERS_IDD_Handler_H
+#define CIAO_CONFIG_HANDLERS_IDD_Handler_H
#include /**/ "ace/pre.h"
-#include "Config_Handlers_export.h"
+#include "Config_Handlers/Config_Handlers_Export.h"
+#include "ace/config-lite.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
namespace Deployment
{
- struct InstanceDeploymentDescription;
- struct InstanceResourceDeploymentDescription;
+ class InstanceDeploymentDescription;
}
+
namespace CIAO
{
namespace Config_Handlers
{
-
- struct InstanceDeploymentDescription;
- struct InstanceResourceDeploymentDescription;
-
+
+ class InstanceDeploymentDescription;
+
+
/*
* @class IDD_Handler
*
* @brief Handler class for <InstanceDeploymentDescription> types.
*
* This class defines handler methods to map values from
- * XSC InstanceDeploymentDescriptionn objects, parsed from
- * the descriptor files, to the corresponding CORBA IDL type.
+ * XSC InstanceDeploymentDescription objects, parsed from the descriptor files, to the
+ * corresponding CORBA IDL Any type.
*
*/
class Config_Handlers_Export IDD_Handler {
public:
-
+
IDD_Handler (void);
virtual ~IDD_Handler (void);
-
- ///This method takes a <Deployment::InstanceDeploymentDescriptionn>
- ///and maps the values from the passed in XSC
- ///InstanceDeploymentDescriptionn to its members.
- void get_InstanceDeploymentDescription (
- Deployment::InstanceDeploymentDescription& toconfig,
- InstanceDeploymentDescription& desc);
-
- /// This method populates the Deployment::InstanceResourceDeploymentDescription
- /// Which is inly used in the IDD above.
- void get_InstanceResourceDeploymentDescription (
- Deployment::InstanceResourceDeploymentDescription &toconfig,
- InstanceResourceDeploymentDescription &desc);
+
+ static void instance_deployment_descr (
+ const InstanceDeploymentDescription& desc,
+ Deployment::InstanceDeploymentDescription& toconfig);
+
};
}
}
-#include /**/ "ace/post.h"
-#endif /* CIAO_CONFIG_HANDLERS_IDD_HANDLER_H*/
+#include /**/ "ace/post.h"
+#endif /* CIAO_CONFIG_HANDLERS_IDD_Handler_H */
+
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.cpp
index 8e09f935c03..3fb5f7fc06d 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.cpp
+++ b/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.cpp
@@ -23,9 +23,9 @@ namespace CIAO
void
- ID_Handler::get_ImplementationDependency (
- Deployment::ImplementationDependency& toconfig,
- ImplementationDependency& desc)
+ ID_Handler::implementation_dependency (
+ const ImplementationDependency& desc,
+ Deployment::ImplementationDependency& toconfig)
{
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.h
index 95e633e79e2..53da62d1de2 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.h
+++ b/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.h
@@ -13,7 +13,7 @@
#define CIAO_CONFIG_HANDLERS_ID_Handler_H
#include /**/ "ace/pre.h"
-#include "Config_Handlers_export.h"
+#include "Config_Handlers/Config_Handlers_Export.h"
#include "ace/config-lite.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
@@ -55,9 +55,9 @@ namespace CIAO
ID_Handler (void);
virtual ~ID_Handler (void);
- void get_ImplementationDependency (
- Deployment::ImplementationDependency& toconfig,
- ImplementationDependency& desc);
+ static void implementation_dependency (
+ const ImplementationDependency& desc,
+ Deployment::ImplementationDependency& toconfig);
};
}
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/IRDD_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/IRDD_Handler.cpp
new file mode 100644
index 00000000000..322f930045f
--- /dev/null
+++ b/TAO/CIAO/DAnCE/Config_Handlers/IRDD_Handler.cpp
@@ -0,0 +1,65 @@
+
+// $Id$
+
+
+#include "IRDD_Handler.h"
+#include "Basic_Deployment_Data.hpp"
+#include "ciao/Deployment_DataC.h"
+#include "Any_Handler.h"
+
+
+
+namespace CIAO
+{
+ namespace Config_Handlers
+ {
+
+ IRDD_Handler::IRDD_Handler (void)
+ {
+ }
+
+ IRDD_Handler::~IRDD_Handler (void)
+ {
+ }
+
+
+ void
+ IRDD_Handler::instance_resource_deployment_descr (
+ const InstanceResourceDeploymentDescription& desc,
+ Deployment::InstanceResourceDeploymentDescription& toconfig)
+ {
+
+
+
+ if (desc.resourceUsage () ==
+ ResourceUsageKind::None)
+ toconfig.resourceUsage = Deployment::None;
+ if (desc.resourceUsage () ==
+ ResourceUsageKind::InstanceUsesResource)
+ toconfig.resourceUsage = Deployment::InstanceUsesResource;
+ if (desc.resourceUsage () ==
+ ResourceUsageKind::ResourceUsesInstance)
+ toconfig.resourceUsage = Deployment::ResourceUsesInstance;
+ if (desc.resourceUsage () ==
+ ResourceUsageKind::PortUsesResource)
+ toconfig.resourceUsage = Deployment::PortUsesResource;
+ if (desc.resourceUsage () ==
+ ResourceUsageKind::ResourceUsesPort)
+ toconfig.resourceUsage = Deployment::ResourceUsesPort;
+
+ toconfig.requirementName=
+ CORBA::string_dup (desc.requirementName ().c_str ());
+
+ toconfig.resourceName=
+ CORBA::string_dup (desc.resourceName ().c_str ());
+
+ Any_Handler::extract_into_any (
+ desc.resourceValue (),
+ toconfig.resourceValue);
+
+
+ }
+
+ }
+
+}
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/IRDD_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/IRDD_Handler.h
new file mode 100644
index 00000000000..94ccbf104d2
--- /dev/null
+++ b/TAO/CIAO/DAnCE/Config_Handlers/IRDD_Handler.h
@@ -0,0 +1,68 @@
+
+ //==============================================================
+/**
+ * @file IRDD_Handler.h
+ *
+ * $Id$
+ *
+ * @author Jules White <jules@dre.vanderbilt.edu>
+ */
+//================================================================
+
+#ifndef CIAO_CONFIG_HANDLERS_IRDD_Handler_H
+#define CIAO_CONFIG_HANDLERS_IRDD_Handler_H
+#include /**/ "ace/pre.h"
+
+#include "Config_Handlers/Config_Handlers_Export.h"
+#include "ace/config-lite.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+
+namespace Deployment
+{
+ class InstanceResourceDeploymentDescription;
+}
+
+
+namespace CIAO
+{
+
+ namespace Config_Handlers
+ {
+
+ class InstanceResourceDeploymentDescription;
+
+
+ /*
+ * @class IRDD_Handler
+ *
+ * @brief Handler class for <InstanceResourceDeploymentDescription> types.
+ *
+ * This class defines handler methods to map values from
+ * XSC InstanceResourceDeploymentDescription objects, parsed from the descriptor files, to the
+ * corresponding CORBA IDL Any type.
+ *
+ */
+
+ class Config_Handlers_Export IRDD_Handler {
+
+ public:
+
+ IRDD_Handler (void);
+ virtual ~IRDD_Handler (void);
+
+ static void instance_resource_deployment_descr (
+ const InstanceResourceDeploymentDescription& desc,
+ Deployment::InstanceResourceDeploymentDescription& toconfig);
+
+ };
+ }
+}
+
+#include /**/ "ace/post.h"
+#endif /* CIAO_CONFIG_HANDLERS_IRDD_Handler_H */
+
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.cpp
index 9c01e471134..63bac6b6f5c 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.cpp
+++ b/TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.cpp
@@ -1,102 +1,137 @@
+
// $Id$
+
+
#include "MDD_Handler.h"
#include "Basic_Deployment_Data.hpp"
#include "ciao/Deployment_DataC.h"
+#include "Singleton_IDREF_Map.h"
#include "ADD_Handler.h"
#include "Property_Handler.h"
#include "Req_Handler.h"
-#include "Singleton_IDREF_Map.h"
+
+
namespace CIAO
{
namespace Config_Handlers
{
- bool
- MDD_Handler::mono_deployment_description (
- const MonolithicDeploymentDescription& desc,
- Deployment::MonolithicDeploymentDescription& toconfig)
+
+ MDD_Handler::MDD_Handler (void)
{
- toconfig.name =
- CORBA::string_dup (desc.name ().c_str ());
+ }
- MonolithicDeploymentDescription::source_const_iterator me =
- desc.end_source ();
+ MDD_Handler::~MDD_Handler (void)
+ {
+ }
- for (MonolithicDeploymentDescription::source_const_iterator se =
- desc.begin_source ();
- se != me;
- ++se)
- {
- CORBA::ULong len =
- toconfig.source.length ();
- toconfig.source.length (len + 1);
+ void
+ MDD_Handler::monolithic_deployment_descr (
+ const MonolithicDeploymentDescription& desc,
+ Deployment::MonolithicDeploymentDescription& toconfig)
+ {
- toconfig.source[len] =
- CORBA::string_dup ((*se).c_str ());
- }
- MonolithicDeploymentDescription::artifact_const_iterator ae =
+
+ toconfig.name=
+ CORBA::string_dup (desc.name ().c_str ());
+
+ MonolithicDeploymentDescription::source_const_iterator source_end =
+ desc.end_source ();
+ MonolithicDeploymentDescription::source_const_iterator source_beg =
+ desc.begin_source ();
+
+ CORBA::ULong source_length = toconfig.source.length ();
+ size_t source_delta = source_end - source_beg;
+ source_length += source_delta;
+
+ toconfig.source.length (source_length);
+ size_t source_count = 0;
+
+ for (MonolithicDeploymentDescription::source_const_iterator
+ item (desc.begin_source ());
+ item != source_end;
+ ++item)
+ {
+ toconfig.source[source_length - (source_delta - source_count)] =
+ CORBA::string_dup (item->c_str ());
+ ++source_count;
+ }
+
+ MonolithicDeploymentDescription::artifact_const_iterator artifact_end =
desc.end_artifact ();
-
+ MonolithicDeploymentDescription::artifact_const_iterator artifact_beg =
+ desc.begin_artifact ();
+
+ CORBA::ULong artifact_length = toconfig.artifactRef.length ();
+ size_t artifact_delta = artifact_end - artifact_beg;
+ artifact_length += artifact_delta;
+
+ toconfig.artifactRef.length (artifact_length);
+ size_t artifact_count = 0;
+ IDREF_Map* artifact_instance = Singleton_IDREF_Map::instance ();
+
+
for (MonolithicDeploymentDescription::artifact_const_iterator
- ab = desc.begin_artifact ();
- ae != ab;
- ++ab)
+ item (desc.begin_artifact ());
+ item != artifact_end;
+ ++item)
{
- CORBA::ULong tmp = 0;
-
- // @@ MAJO: What should be do
- bool r =
- Singleton_IDREF_Map::instance ()->find_ref (
- ab->id ().c_str (),
- tmp);
-
- if (!r)
- {
- // @@MAJO: What should we do if find_ref fails?
- return false;
- }
-
- CORBA::ULong len =
- toconfig.artifactRef.length ();
-
- toconfig.artifactRef.length (len + 1);
-
- toconfig.artifactRef[len] = tmp;
+ ACE_TString artifact_id (item->id ().c_str ());
+ artifact_instance->find_ref (
+ artifact_id,
+ toconfig.artifactRef[artifact_length - (artifact_delta - artifact_count)]);
+ ++artifact_count;
}
-
- MonolithicDeploymentDescription::execParameter_const_iterator epce =
+
+ MonolithicDeploymentDescription::execParameter_const_iterator execParameter_end =
desc.end_execParameter ();
-
- for (MonolithicDeploymentDescription::execParameter_const_iterator epcb =
- desc.begin_execParameter ();
- epcb != epce;
- ++epcb)
- {
- CORBA::ULong len =
- toconfig.execParameter.length ();
-
- toconfig.execParameter.length (len + 1);
-
- Property_Handler::get_property ((*epcb),
- toconfig.execParameter[len]);
+ MonolithicDeploymentDescription::execParameter_const_iterator execParameter_beg =
+ desc.begin_execParameter ();
+
+ CORBA::ULong execParameter_length = toconfig.execParameter.length ();
+ size_t execParameter_delta = execParameter_end - execParameter_beg;
+ execParameter_length += execParameter_delta;
+
+ toconfig.execParameter.length (execParameter_length);
+ size_t execParameter_count = 0;
+
+ for (MonolithicDeploymentDescription::execParameter_const_iterator
+ item (execParameter_beg);
+ item != execParameter_end;
+ ++item)
+ {
+ Property_Handler::property (
+ *item,
+ toconfig.execParameter[execParameter_length - (execParameter_delta - execParameter_count)]);
+ ++execParameter_count;
}
-
-#if 0
- // @@ MAJO: Don't know how to handle this
- if (desc.deployRequirement_p ())
- {
- Req_Handler handler;
- toconfig.deployRequirement.length (
- toconfig.deployRequirement.length () + 1);
- handler.get_Requirement (
- toconfig.deployRequirement[toconfig.deployRequirement.length () - 1],
- desc.deployRequirement ());
+
+ MonolithicDeploymentDescription::deployRequirement_const_iterator deployRequirement_end =
+ desc.end_deployRequirement ();
+ MonolithicDeploymentDescription::deployRequirement_const_iterator deployRequirement_beg =
+ desc.begin_deployRequirement ();
+
+ CORBA::ULong deployRequirement_length = toconfig.deployRequirement.length ();
+ size_t deployRequirement_delta = deployRequirement_end - deployRequirement_beg;
+ deployRequirement_length += deployRequirement_delta;
+
+ toconfig.deployRequirement.length (deployRequirement_length);
+ size_t deployRequirement_count = 0;
+
+ for (MonolithicDeploymentDescription::deployRequirement_const_iterator
+ item (deployRequirement_beg);
+ item != deployRequirement_end;
+ ++item)
+ {
+ Req_Handler::requirement (
+ *item,
+ toconfig.deployRequirement[deployRequirement_length - (deployRequirement_delta - deployRequirement_count)]);
+ ++deployRequirement_count;
}
-#endif /*if 0*/
- return true;
+
}
}
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.h
index 1ec98904b4f..a631a54ee3a 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.h
+++ b/TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.h
@@ -13,13 +13,15 @@
#define CIAO_CONFIG_HANDLERS_MDD_Handler_H
#include /**/ "ace/pre.h"
-#include "Config_Handlers_Export.h"
+#include "Config_Handlers/Config_Handlers_Export.h"
+#include "ace/config-lite.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+
namespace Deployment
{
class MonolithicDeploymentDescription;
@@ -31,28 +33,36 @@ namespace CIAO
namespace Config_Handlers
{
+
class MonolithicDeploymentDescription;
- /*
- * @class MDD_Handler
- *
- * @brief Handler class for <MonolithicDeploymentDescription> types.
- *
- * This class defines handler methods to map values from XSC
- * MonolithicDeploymentDescription objects, parsed from the
- * descriptor files, to the corresponding CORBA IDL types.
- *
- */
-
- class Config_Handlers_Export MDD_Handler
- {
- public:
- static bool mono_deployment_description (
- const MonolithicDeploymentDescription& desc,
- Deployment::MonolithicDeploymentDescription& toconfig);
+
+ /*
+ * @class MDD_Handler
+ *
+ * @brief Handler class for <MonolithicDeploymentDescription> types.
+ *
+ * This class defines handler methods to map values from
+ * XSC MonolithicDeploymentDescription objects, parsed from the descriptor files, to the
+ * corresponding CORBA IDL Any type.
+ *
+ */
+
+ class Config_Handlers_Export MDD_Handler {
+
+ public:
+
+ MDD_Handler (void);
+ virtual ~MDD_Handler (void);
+
+ static void monolithic_deployment_descr (
+ const MonolithicDeploymentDescription& desc,
+ Deployment::MonolithicDeploymentDescription& toconfig);
+
};
}
}
-#include /**/ "ace/post.h"
+#include /**/ "ace/post.h"
#endif /* CIAO_CONFIG_HANDLERS_MDD_Handler_H */
+
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Property_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/Property_Handler.cpp
index 60dacce16ed..9666b7b81c5 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/Property_Handler.cpp
+++ b/TAO/CIAO/DAnCE/Config_Handlers/Property_Handler.cpp
@@ -1,9 +1,13 @@
-//$Id$
+
+// $Id$
+
#include "Property_Handler.h"
-#include "Any_Handler.h"
#include "Basic_Deployment_Data.hpp"
#include "ciao/Deployment_DataC.h"
+#include "Any_Handler.h"
+
+
namespace CIAO
{
@@ -18,17 +22,25 @@ namespace CIAO
{
}
+
void
- Property_Handler::get_property (
- const Property& desc,
- Deployment::Property& toconfig)
+ Property_Handler::property (
+ const Property& desc,
+ Deployment::Property& toconfig)
{
- toconfig.name =
- CORBA::string_dup (desc.name ().c_str ());
- Any_Handler::extract_into_any (desc.value (),
- toconfig.value);
+
+ toconfig.name=
+ CORBA::string_dup (desc.name ().c_str ());
+
+ Any_Handler::extract_into_any (
+ desc.value (),
+ toconfig.value);
+
+
}
+
}
+
}
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Property_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/Property_Handler.h
index 253f62b6cbd..af5684085da 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/Property_Handler.h
+++ b/TAO/CIAO/DAnCE/Config_Handlers/Property_Handler.h
@@ -1,61 +1,68 @@
-//================================================
+
+ //==============================================================
/**
- * @file Prop_Handler.h
+ * @file Property_Handler.h
*
* $Id$
*
* @author Jules White <jules@dre.vanderbilt.edu>
*/
-//================================================
-
-#ifndef CIAO_CONFIG_HANDLERS_PROPERTY_HANDLER_H
-#define CIAO_CONFIG_HANDLERS_PROPERTY_HANDLER_H
+//================================================================
+#ifndef CIAO_CONFIG_HANDLERS_Property_Handler_H
+#define CIAO_CONFIG_HANDLERS_Property_Handler_H
#include /**/ "ace/pre.h"
#include "Config_Handlers/Config_Handlers_Export.h"
+#include "ace/config-lite.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
namespace Deployment
{
class Property;
}
+
namespace CIAO
{
+
namespace Config_Handlers
{
- class Property;
-
- /*
- * @class Property_Handler
- *
- * @brief Handler class for <CCMComponentPortDescription> 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 Config_Handlers_Export Property_Handler
- {
- public:
- Property_Handler (void);
- virtual ~Property_Handler (void);
-
- /// This method maps the values from the XSC object
- /// <CIAO::Config_Handlers::Property> to the CORBA IDL type
- /// <Deployment::Property>.
- static void get_property (const Property& desc,
- ::Deployment::Property& toconfig);
- };
-
- }
+
+ class Property;
+
+
+ /*
+ * @class Property_Handler
+ *
+ * @brief Handler class for <Property> types.
+ *
+ * This class defines handler methods to map values from
+ * XSC Property objects, parsed from the descriptor files, to the
+ * corresponding CORBA IDL Any type.
+ *
+ */
+
+ class Config_Handlers_Export Property_Handler {
+
+ public:
+
+ Property_Handler (void);
+ virtual ~Property_Handler (void);
+
+ static void property (
+ const Property& desc,
+ Deployment::Property& toconfig);
+
+ };
+ }
}
-#include /**/ "ace/post.h"
-#endif /* CIAO_CONFIG_HANDLERS_PROPERTY_HANDLER_H*/
+#include /**/ "ace/post.h"
+#endif /* CIAO_CONFIG_HANDLERS_Property_Handler_H */
+
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/RDD_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/RDD_Handler.cpp
index e6b2b03b596..a8dbfc766a3 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/RDD_Handler.cpp
+++ b/TAO/CIAO/DAnCE/Config_Handlers/RDD_Handler.cpp
@@ -1,27 +1,47 @@
+
// $Id$
+
+
#include "RDD_Handler.h"
#include "Basic_Deployment_Data.hpp"
#include "ciao/Deployment_DataC.h"
#include "Any_Handler.h"
+
+
namespace CIAO
{
namespace Config_Handlers
{
+
+ RDD_Handler::RDD_Handler (void)
+ {
+ }
+
+ RDD_Handler::~RDD_Handler (void)
+ {
+ }
+
+
void
RDD_Handler::resource_deployment_descr (
- const ResourceDeploymentDescription &src,
- ::Deployment::ResourceDeploymentDescription &dest)
+ const ResourceDeploymentDescription& desc,
+ Deployment::ResourceDeploymentDescription& toconfig)
{
- dest.requirementName =
- src.requirementName ().c_str ();
- dest.resourceName=
- src.resourceName ().c_str ();
- Any_Handler::extract_into_any (src.resourceValue (),
- dest.resourceValue);
+
+ toconfig.requirementName=
+ CORBA::string_dup (desc.requirementName ().c_str ());
+
+ toconfig.resourceName=
+ CORBA::string_dup (desc.resourceName ().c_str ());
+
+ Any_Handler::extract_into_any (
+ desc.resourceValue (),
+ toconfig.resourceValue);
+
}
}
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/RDD_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/RDD_Handler.h
index c87056371da..ef4af0ab322 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/RDD_Handler.h
+++ b/TAO/CIAO/DAnCE/Config_Handlers/RDD_Handler.h
@@ -13,7 +13,8 @@
#define CIAO_CONFIG_HANDLERS_RDD_Handler_H
#include /**/ "ace/pre.h"
-#include "Config_Handlers_export.h"
+#include "Config_Handlers/Config_Handlers_Export.h"
+#include "ace/config-lite.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -32,29 +33,36 @@ namespace CIAO
namespace Config_Handlers
{
- class ResourceDeploymentDescription;
- /*
+ class ResourceDeploymentDescription;
+
+
+ /*
* @class RDD_Handler
*
* @brief Handler class for <ResourceDeploymentDescription> types.
*
- * This class defines handler methods to map values from XSC
- * ResourceDeploymentDescription objects, parsed from the
- * descriptor files, to the corresponding CORBA IDL Any type.
+ * This class defines handler methods to map values from
+ * XSC ResourceDeploymentDescription objects, parsed from the descriptor files, to the
+ * corresponding CORBA IDL Any type.
*
*/
-
- class Config_Handlers_Export RDD_Handler
- {
+
+ class Config_Handlers_Export RDD_Handler {
+
public:
- static void resource_deployment_descr (
- const ResourceDeploymentDescription& desc,
- ::Deployment::ResourceDeploymentDescription& toconfig);
+
+ RDD_Handler (void);
+ virtual ~RDD_Handler (void);
+
+ static void resource_deployment_descr (
+ const ResourceDeploymentDescription& desc,
+ Deployment::ResourceDeploymentDescription& toconfig);
};
}
}
-#include /**/ "ace/post.h"
+#include /**/ "ace/post.h"
#endif /* CIAO_CONFIG_HANDLERS_RDD_Handler_H */
+
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Req_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/Req_Handler.cpp
index 56dbb7e1eab..23a427649c8 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/Req_Handler.cpp
+++ b/TAO/CIAO/DAnCE/Config_Handlers/Req_Handler.cpp
@@ -1,8 +1,12 @@
+
// $Id$
+
#include "Req_Handler.h"
-#include "Property_Handler.h"
-#include "ciao/DeploymentC.h"
+#include "Basic_Deployment_Data.hpp"
+#include "ciao/Deployment_DataC.h"
+
+
namespace CIAO
{
@@ -17,28 +21,24 @@ namespace CIAO
{
}
+
void
- Req_Handler::get_Requirement (
- Deployment::Requirement& toconfig,
- Requirement& desc)
+ Req_Handler::requirement (
+ const Requirement& desc,
+ Deployment::Requirement& toconfig)
{
- //Map the basic string types to their Deployment::Req
- //counterparts.
- toconfig.name = CORBA::string_dup (desc.name ().c_str ());
- toconfig.resourceType =
- CORBA::string_dup (desc.resourceType ().c_str ());
-
- //Map the XSC Req's property into the next
- //position in the IDL Req's sequence.
-#if 0
- /// @@ MAJO:
- Property_Handler prophandler;
- toconfig.property.length (toconfig.property.length () + 1);
- Property_Handler::get_property (
- toconfig.property[toconfig.property.length () - 1],
- desc.property ());
-#endif /*if 0*/
+
+
+
+ toconfig.name=
+ CORBA::string_dup (desc.name ().c_str ());
+
+ toconfig.resourceType=
+ CORBA::string_dup (desc.resourceType ().c_str ());
+
+
}
}
+
}
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Req_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/Req_Handler.h
index c3a22cc6dc7..3322344147c 100644
--- a/TAO/CIAO/DAnCE/Config_Handlers/Req_Handler.h
+++ b/TAO/CIAO/DAnCE/Config_Handlers/Req_Handler.h
@@ -1,6 +1,7 @@
-//==============================================================
+
+ //==============================================================
/**
- * @file REQ_Handler.h
+ * @file Req_Handler.h
*
* $Id$
*
@@ -8,55 +9,60 @@
*/
//================================================================
-#ifndef CIAO_CONFIG_HANDLERS_REQ_HANDLER_H
-#define CIAO_CONFIG_HANDLERS_REQ_HANDLER_H
+#ifndef CIAO_CONFIG_HANDLERS_Req_Handler_H
+#define CIAO_CONFIG_HANDLERS_Req_Handler_H
#include /**/ "ace/pre.h"
-#include "Basic_Deployment_Data.hpp"
-#include "Config_Handlers_export.h"
+#include "Config_Handlers/Config_Handlers_Export.h"
+#include "ace/config-lite.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
namespace Deployment
{
- struct Requirement;
+ class Requirement;
}
+
namespace CIAO
{
namespace Config_Handlers
{
+
+ class Requirement;
+
+
/*
- * @class REQ_Handler
+ * @class Req_Handler
*
* @brief Handler class for <Requirement> types.
*
* This class defines handler methods to map values from
- * XSC Requirement objects, parsed from
- * the descriptor files, to the corresponding CORBA IDL type.
+ * XSC Requirement objects, parsed from the descriptor files, to the
+ * corresponding CORBA IDL Any type.
*
*/
- class Config_Handlers_Export Req_Handler{
+ class Config_Handlers_Export Req_Handler {
public:
-
+
Req_Handler (void);
virtual ~Req_Handler (void);
-
- ///This method takes a <Deployment::Requirement>
- ///and maps the values from the passed in XSC
- ///Requirement to its members.
- void get_Requirement (
- Deployment::Requirement& toconfig,
- Requirement& desc);
+
+ static void requirement (
+ const Requirement& desc,
+ Deployment::Requirement& toconfig);
};
}
}
-#include /**/ "ace/post.h"
-#endif /* CIAO_CONFIG_HANDLERS_REQ_HANDLER_H*/
+#include /**/ "ace/post.h"
+#endif /* CIAO_CONFIG_HANDLERS_Req_Handler_H */
+