summaryrefslogtreecommitdiff
path: root/TAO/CIAO/DAnCE/Config_Handlers/Req_Handler.cpp
blob: 6fa0928b63713f6a6826e656e1ac0cf359803af0 (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
// $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)
    {
      XMLSchema::string< char > name ((src.name));
      XMLSchema::string< char > res ((src.resourceType));
      Property prop (
          Property_Handler::get_property (src.property[0]));
      Requirement req (name,res,prop);

      return req;
    }
  }
}