summaryrefslogtreecommitdiff
path: root/TAO/CIAO/tools/Config_Handlers/CPD_Handler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/CIAO/tools/Config_Handlers/CPD_Handler.cpp')
-rw-r--r--TAO/CIAO/tools/Config_Handlers/CPD_Handler.cpp129
1 files changed, 64 insertions, 65 deletions
diff --git a/TAO/CIAO/tools/Config_Handlers/CPD_Handler.cpp b/TAO/CIAO/tools/Config_Handlers/CPD_Handler.cpp
index ccf604c5465..25d1af78e9d 100644
--- a/TAO/CIAO/tools/Config_Handlers/CPD_Handler.cpp
+++ b/TAO/CIAO/tools/Config_Handlers/CPD_Handler.cpp
@@ -2,149 +2,148 @@
#include "CPD_Handler.h"
#include "Basic_Deployment_Data.hpp"
#include "ciao/Deployment_DataC.h"
+#include "ciao/CIAO_common.h"
+
namespace CIAO
{
namespace Config_Handlers
{
void
CPD_Handler::component_port_description (
- const ComponentPortDescription& desc,
- Deployment::ComponentPortDescription& toconfig)
+ const ComponentPortDescription& desc,
+ Deployment::ComponentPortDescription& toconfig)
{
+ CIAO_TRACE("CPD_Handler::component_port_description");
toconfig.name =
desc.name ().c_str ();
- toconfig.specificType =
- desc.specificType ().c_str ();
+ if (desc.specificType_p ())
+ toconfig.specificType =
+ desc.specificType ().c_str ();
+
+ toconfig.supportedType.length (desc.count_supportedType ());
+ std::for_each (desc.begin_supportedType (),
+ desc.end_supportedType (),
+ String_Seq_Functor (toconfig.supportedType));
- if (!desc.supportedType ().empty ())
- {
- toconfig.supportedType.length (1);
- toconfig.supportedType[0] =
- desc.supportedType ().c_str ();
- }
-
switch (desc.kind ().integral ())
{
case CCMComponentPortKind::Facet_l:
toconfig.kind = Deployment::Facet;
break;
-
+
case CCMComponentPortKind::SimplexReceptacle_l:
toconfig.kind = Deployment::SimplexReceptacle;
break;
-
+
case CCMComponentPortKind::MultiplexReceptacle_l:
toconfig.kind = Deployment::MultiplexReceptacle;
break;
-
+
case CCMComponentPortKind::EventEmitter_l:
toconfig.kind = Deployment::EventEmitter;
break;
-
+
case CCMComponentPortKind::EventPublisher_l:
toconfig.kind = Deployment::EventPublisher;
break;
-
+
case CCMComponentPortKind::EventConsumer_l:
- toconfig.kind = Deployment::EventConsumer;
+ toconfig.kind = Deployment::EventConsumer;
break;
-
+
default:
ACE_ERROR ((LM_ERROR, "Invalid port type in connection %s\n",
desc.name ().c_str ()));
throw 1;
}
-
+
/* @@BUG: We need to consider how to handle booleans. */
- toconfig.provider = desc.provider () == "true";
- toconfig.exclusiveProvider = desc.exclusiveProvider () == "true";
- toconfig.exclusiveUser = desc.exclusiveUser () == "true";
- toconfig.optional = desc.optional () == "true";
+ toconfig.provider = desc.provider ();
+ toconfig.exclusiveProvider = desc.exclusiveProvider ();
+ toconfig.exclusiveUser = desc.exclusiveUser ();
+ toconfig.optional = desc.optional ();
}
-
+
ComponentPortDescription
CPD_Handler::component_port_description (
- const Deployment::ComponentPortDescription& src)
+ const Deployment::ComponentPortDescription& src)
{
+ CIAO_TRACE("CPD_Handler::component_port_description - reverse");
::XMLSchema::string< char > name ((src.name));
::XMLSchema::string< char > stype ((src.specificType));
-
- ::XMLSchema::string< char > tval ("true");
- ::XMLSchema::string< char > fval ("false");
- ::XMLSchema::string< char > provider ("");
- ::XMLSchema::string< char > exclusiveProvider ("");
- ::XMLSchema::string< char > exclusiveUser ("");
- ::XMLSchema::string< char > optional ("");
-
+
+ ::XMLSchema::string< char > tval ("true");
+ ::XMLSchema::string< char > fval ("false");
+ XMLSchema::boolean provider;
+ XMLSchema::boolean exclusiveProvider;
+ XMLSchema::boolean exclusiveUser;
+ XMLSchema::boolean optional;
+
if (src.provider)
- provider = tval;
+ provider = true;
else
- provider = fval;
-
+ provider = false;
+
if (src.exclusiveUser)
- exclusiveUser = tval;
+ exclusiveUser = true;
else
- provider = fval;
-
+ provider = false;
+
if (src.exclusiveProvider)
- exclusiveProvider = tval;
+ exclusiveProvider = true;
else
- provider = fval;
-
+ provider = false;
+
if (src.optional)
- optional = tval;
+ optional = true;
else
- provider = fval;
-
- ComponentPortDescription cpd (
- name,
- stype,
- tval,
- provider,
- exclusiveProvider,
- exclusiveUser,
- optional,
- CCMComponentPortKind::Facet);
+ provider = false;
+
+ ComponentPortDescription cpd (name,
+ provider,
+ exclusiveProvider,
+ exclusiveUser,
+ optional,
+ CCMComponentPortKind::Facet);
switch (src.kind)
{
case ::Deployment::Facet:
cpd.kind (CCMComponentPortKind::Facet);
break;
-
+
case ::Deployment::SimplexReceptacle:
cpd.kind (CCMComponentPortKind::SimplexReceptacle);
break;
-
+
case ::Deployment::MultiplexReceptacle:
cpd.kind (CCMComponentPortKind::MultiplexReceptacle);
break;
-
+
case ::Deployment::EventEmitter:
cpd.kind (CCMComponentPortKind::EventEmitter);
break;
-
+
case ::Deployment::EventPublisher:
cpd.kind (CCMComponentPortKind::EventPublisher);
break;
-
+
case ::Deployment::EventConsumer:
cpd.kind (CCMComponentPortKind::EventConsumer);
break;
-
+
default:
ACE_ERROR ((LM_ERROR, "Invalid port kind in connection %s\n",
name.c_str ()));
}
-
- if (src.supportedType.length () > 0)
- cpd.supportedType (
- XMLSchema::string< char > ((src.supportedType[0])));
+
+ for (CORBA::ULong i = 0; i < src.supportedType.length (); ++i)
+ cpd.add_supportedType (XMLSchema::string< char > ((src.supportedType[i])));
return cpd;
}
-
+
}
}