summaryrefslogtreecommitdiff
path: root/CIAO/RACE/Input_Adapters/LocationUpdater/PlanUpdater.h
blob: 298b1b92fbb0f6d4284e840c13f889812cb09d1f (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/* -*- C++ -*- */

//========================================================================
/**
 *  file  PlanUpdater.h
 *
 * $Id$
 *
 *  This file contains a Visitor classes which are used to traverse a
 *  PackageConfiguration and update the location fields in a corresponding
 *  DeploymentPlan.
 *
 *  author Stoyan Paunov <spaunov@isis.vanderbilt.edu>
 */
//========================================================================

#ifndef PLAN_UPDATER_H
#define PLAN_UPDATER_H

#include /**/ "ace/pre.h"
#include "ace/SString.h"             //for the ACE_CString

#include "PCVisitorBase.h"           //for the base visitor
//#include "Node_T.h"                  //Node
#include "ace/Containers_T.h"        //for ACE_Double_Linked_List



#include "ciao/DeploymentC.h"
#include "ciao/Deployment_BaseC.h"
#include "ciao/Deployment_DataC.h"
#include "ciao/Packaging_DataC.h"

//namespace {
////Definition of various Node elements parametrized by
////Deployment specific types
//  typedef Node<Deployment::Node> NNode;
//  typedef Node<Deployment::MonolithicImplementationDescription> MNode;
//
////Definition of various stacks used to store information
////about the elements being parsed at various levels
//  typedef ACE_Bounded_Stack<int> INDEX_STACK;
//
////definition of a Node which takes an ACE_CString
//  typedef Node<ACE_CString> SNode;
//}

//===========================================================================
/**
 *  class PlanUpdater
 *
 *  This class takes in a Deployment Plan and a PackageConfiguration and
 *  attempts to update the location fields in the deployment plan to reflect
 *  the locations available via HTTP as outlined in the passed Package-
 *  Configuration. It derives from PCVisitorBase and overloads the functions
 *  which deal with single elements. Sequences are handled in the base class.
 */
//===========================================================================


class  PlanUpdater : public PCVisitorBase
{
public:

  //constructor
  PlanUpdater (Deployment::DeploymentPlan &plan,
               Deployment::PackageConfiguration &pc);

  ///Entry point to protected Visitor functions
  bool Visit ();

protected:
  /// A whole slew of overloaded routines for different IDL
  /// data types part of the PackageConfiguration.

  virtual
  void Visit (Deployment::PackageConfiguration &pc);

  //!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!

  //ComponentPackageDescription descendents
  virtual
  void Visit (Deployment::ComponentPackageDescription &cpd);

  virtual
  void Visit (Deployment::ComponentInterfaceDescription &cid);

  virtual
  void Visit (Deployment::PackagedComponentImplementation &pci);

  virtual
  void Visit (Deployment::ComponentImplementationDescription &cid);

  virtual
  void Visit (Deployment::ComponentAssemblyDescription &cad);

  virtual
  void Visit (Deployment::SubcomponentInstantiationDescription &sid);

  virtual
  void Visit (Deployment::MonolithicImplementationDescription &mid);

  virtual
  void Visit (Deployment::NamedImplementationArtifact &nia);

  virtual
  void Visit (Deployment::ImplementationArtifactDescription &iad);

  //!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!

  //ComponentPackageReference descendents
  virtual
  void Visit (Deployment::ComponentPackageReference &cpr);

  //!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!

  //properties
  virtual
  void Visit (Deployment::AssemblyPropertyMapping &apm);

  virtual
  void Visit (Deployment::Property &property);


  //requirements & capabilities
  virtual
  void Visit (Deployment::Requirement &requirement);

  virtual
  void Visit (Deployment::Capability &capability);

  virtual
  void Visit (Deployment::ImplementationRequirement &ir);

  virtual
  void Visit (Deployment::ImplementationDependency &id);

  //ports and connections
  virtual
  void Visit (Deployment::AssemblyConnectionDescription &acd);

  virtual
  void Visit (Deployment::SubcomponentPortEndpoint &spe);

  virtual
  void Visit (Deployment::ComponentExternalPortEndpoint &cepe);


private:

  Deployment::DeploymentPlan& plan_;
  Deployment::PackageConfiguration& pc_;
  bool status_;
};

#include /**/ "ace/post.h"

#endif /* PLAN_UPDATER_H */