summaryrefslogtreecommitdiff
path: root/TAO/CIAO/tools/Config_Handlers/Req_Handler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/CIAO/tools/Config_Handlers/Req_Handler.cpp')
-rw-r--r--TAO/CIAO/tools/Config_Handlers/Req_Handler.cpp67
1 files changed, 32 insertions, 35 deletions
diff --git a/TAO/CIAO/tools/Config_Handlers/Req_Handler.cpp b/TAO/CIAO/tools/Config_Handlers/Req_Handler.cpp
index 4a52efb9967..37fd441ac92 100644
--- a/TAO/CIAO/tools/Config_Handlers/Req_Handler.cpp
+++ b/TAO/CIAO/tools/Config_Handlers/Req_Handler.cpp
@@ -3,7 +3,7 @@
#include "Req_Handler.h"
#include "Property_Handler.h"
#include "ciao/DeploymentC.h"
-
+#include "ciao/CIAO_common.h"
namespace CIAO
{
namespace Config_Handlers
@@ -18,43 +18,40 @@ namespace CIAO
}
void
- Req_Handler::get_Requirement (
- Deployment::Requirement& toconfig,
- Requirement& desc)
+ Req_Handler::get_requirement (const Requirement& desc,
+ Deployment::Requirement& toconfig)
{
+ CIAO_TRACE("Req_Handler::get_Requirement");
+
//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.
- /// @@ MAJO:
- Property_Handler prophandler;
- toconfig.property.length (toconfig.property.length () + 1);
- Property_Handler::get_property (
- desc.property (),
- toconfig.property[toconfig.property.length () - 1]);
+ toconfig.name = desc.name ().c_str ();
+ toconfig.resourceType = desc.resourceType ().c_str ();
+
+ toconfig.property.length (desc.count_property ());
+ std::for_each (desc.begin_property (),
+ desc.end_property (),
+ Property_Functor (toconfig.property));
+ }
+
+ Requirement
+ Req_Handler::get_requirement (const Deployment::Requirement& src)
+ {
+ CIAO_TRACE("Req_Handler::get_requirement - reverse");
+
+ //Get the values for name and res
+ XMLSchema::string< char > name ((src.name));
+ XMLSchema::string< char > res ((src.resourceType));
+
+ //Instantiate the Requirement
+ Requirement req (name,res);
+
+ for (CORBA::ULong i = 0; i < src.property.length (); ++i)
+ {
+ req.add_property (Property_Handler::get_property (src.property[i]));
+ }
+
+ return req;
}
-
- Requirement
- Req_Handler::get_requirement (
- const Deployment::Requirement& src)
- {
- //Get the values for name and res
- XMLSchema::string< char > name ((src.name));
- XMLSchema::string< char > res ((src.resourceType));
-
- //Get the Property
- Property prop (
- Property_Handler::get_property (
- src.property[0]));
-
- //Instantiate the Requirement
- Requirement req (name,res,prop);
-
- return req;
- }
}
}