summaryrefslogtreecommitdiff
path: root/TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.cpp
blob: 2d7d23639d9fc026fdcf04ba03ff9206b51a06cc (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97

// $Id$


#include "ADD_Handler.h"
#include "Basic_Deployment_Data.hpp"
#include "ciao/Deployment_DataC.h"
#include "Prop_Handler.h"
#include "Req_Handler.h"
#include "RDD_Handler.h"



namespace CIAO
{
  namespace Config_Handlers
  {

    ADD_Handler::ADD_Handler (void)
    {
    }

    ADD_Handler::~ADD_Handler (void)
    {
    }


    void
    ADD_Handler::get_ArtifactDeploymentDescription (
                    Deployment::ArtifactDeploymentDescription& toconfig, 
                    ArtifactDeploymentDescription& desc)
    {


      
      toconfig.name=
           CORBA::string_dup (desc.name ().c_str ());
      
      toconfig.source.length (
           toconfig.source.length () + 1);
         toconfig.source[toconfig.source.length () - 1]=
           CORBA::string_dup (desc.source ().c_str ());
      
      if (desc.node_p ())
       {
         
         toconfig.node=
           CORBA::string_dup (desc.node ().c_str ());
       }
      
      for (ArtifactDeploymentDescription::location_iterator
           item (desc.begin_location ());
           item != desc.end_location ();
           ++item)
        {	 
           toconfig.location.length (
             toconfig.location.length () + 1);
           toconfig.location[toconfig.location.length () - 1] =
             CORBA::string_dup (item->c_str ());
        }
      
      if (desc.execParameter_p ())
        {
	 			  Prop_Handler handler;
          toconfig.execParameter.length (
            toconfig.execParameter.length () + 1);
          handler.get_Property (
            toconfig.execParameter[toconfig.execParameter.length () - 1],
            desc.execParameter ());
        }
      
      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 ());
        }
      
      if (desc.deployedResource_p ())
        {
	 			  RDD_Handler handler;
          toconfig.deployedResource.length (
            toconfig.deployedResource.length () + 1);
          handler.get_ResourceDeploymentDescription (
            toconfig.deployedResource[toconfig.deployedResource.length () - 1],
            desc.deployedResource ());
        }

      
    }

  }

}