summaryrefslogtreecommitdiff
path: root/TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.cpp
blob: e68a6389299854c5e0c1f28fedaf9f7632a384a4 (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
#include "DP_Handler.h"
#include "ciao/Deployment_DataC.h"
#include "ace/Auto_Ptr.h"
#include "CCD_Handler.h"
#include "ADD_Handler.h"
#include "MDD_Handler.h"
#include "IDD_Handler.h"
#include "cdp.hpp"

ACE_RCSID (Config_Handlers,
           DP_Handler,
           "$Id$")

namespace CIAO
{
  namespace Config_Handlers
  {
    DP_Handler::DP_Handler (DeploymentPlan &dp)
      : idl_dp_ (0)
      , dp_ (dp)
    {
      if (!this->resolve_plan ())
        throw;
    }

    DP_Handler::~DP_Handler (void)
    {
      delete this->idl_dp_;
    }

    bool
    DP_Handler::resolve_plan (void)
    {
      ::Deployment::DeploymentPlan *tmp =
          new Deployment::DeploymentPlan;

      auto_ptr< ::Deployment::DeploymentPlan>
        auto_idl_dp (tmp);

      bool retval =
        CCD_Handler::component_interface_descr (
          this->dp_.realizes (),
          (*auto_idl_dp).realizes);

      if (!retval)
        return retval;

      retval =
        ADD_Handler::artifact_deployment_descrs (
          this->dp_,
          (*auto_idl_dp).artifact);

      if (!retval)
        return retval;

      retval =
        MDD_Handler::mono_deployment_descriptions (
          this->dp_.implementation (),
          (*auto_idl_dp).implementation);

      if (!retval)
        return retval;

      retval =
        IDD_Handler::instance_deployment_descrs (
          this->dp_,
          (*auto_idl_dp).instance);

      if (!retval)
        return retval;

      this->idl_dp_ =
        auto_idl_dp.release ();

      return true;
    }

  }
}