summaryrefslogtreecommitdiff
path: root/TAO/CIAO/tools/Config_Handlers/Req_Handler.cpp
blob: 4a52efb99670b148fd99afe5bd8d82d4d4083b8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// $Id$

#include "Req_Handler.h"
#include "Property_Handler.h"
#include "ciao/DeploymentC.h"

namespace CIAO
{
  namespace Config_Handlers
  {

    Req_Handler::Req_Handler (void)
    {
    }

    Req_Handler::~Req_Handler (void)
    {
    }

    void
    Req_Handler::get_Requirement (
                         Deployment::Requirement& toconfig,
                         Requirement& desc)
    {
      //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]);
    }
    
      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;
      }
  }
}