summaryrefslogtreecommitdiff
path: root/modules/CIAO/DAnCE/Utils/Plan_Handler.h
blob: ce04462695e29e410b739e0c9d1322e68fae05dd (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
//$Id$
/*========================================================
 *
 * @file   Plan_Handler.h
 *
 * @Brief  This file contains the implementation of
 *         the Plan_Handler class.
 *
 * @author Gan Deng <gan.deng@vanderbilt.edu>
 *========================================================*/

#ifndef CIAO_DANCE_UTILS_H
#define CIAO_DANCE_UTILS_H

#include "DAnCE_Utils_Export.h"
#include "Deployment/Deployment_DeploymentPlanC.h"

namespace DAnCE
{
  class ImplementationNotFound {};
  class InstanceNotFound {};
  class ConnectionNotFound {};

  /**
   * @class Plan_Handler
   *
   * This class takes an existing deployment plan as input, and
   * can modify the deployment plan internals.
   *
   * The main methods on this class are:
   *  
   *  - Add a instance to the deployment plan;
   *  - Add a connection to the deployment plan;
   *  - Remove a connection from the deployment plan;
   *  - Remove a instance (and, consequently all its connection) from the
   *    deployment plan;
   *  - Show all instances in the deployment plan;
   *  - Show all connections in the deployment plan;
   */

  class DAnCE_Utils_Export DAnCE_Utils
  {
  public:
    static void add_instance (
        ::Deployment::DeploymentPlan &deployment_plan, 
        const char *instance_name, 
        const char *node_name, 
        const char *impl_name, 
        const char *ns_name = 0);

    static void add_connection (
        ::Deployment::DeploymentPlan &deployment_plan, 
        const char *connection_name, 
        const char *port_name, 
        const char *facet_instance, 
        const char *receptacle_instance);

    static void remove_instance (
        ::Deployment::DeploymentPlan &deployment_plan, 
        const char *instance_name);

    static void remove_connection (
        ::Deployment::DeploymentPlan &deployment_plan, 
        const char *connection_name);

    static void print_instances (
      const ::Deployment::DeploymentPlan &deployment_plan);

    static void print_connections (
      const ::Deployment::DeploymentPlan &deployment_plan);
  };
}

#endif /* CIAO_DANCE_UTILS_H */