blob: a61bb47f6c4d365a2a48c4cff23bbad60c93c786 (
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
|
// $Id$
#include "ESD_Handler.h"
#include "Basic_Deployment_Data.hpp"
#include "DAnCE/Deployment/Deployment_DataC.h"
#include "cdp.hpp"
namespace DAnCE
{
namespace Config_Handlers
{
void
ESD_Handler::es_deployment_descrs (
const DeploymentPlan &src,
Deployment::EventServiceDeploymentDescriptions& dest)
{
DANCE_TRACE("ESD_Handler::instance_deployment_descrs");
DeploymentPlan::es_const_iterator esd_e = src.end_instance ();
CORBA::ULong pos = 0;
dest.length (src.count_instance ());
for (DeploymentPlan::es_const_iterator esd_b =
src.begin_instance ();
esd_b != esd_e;
++esd_b)
{
ESD_Handler::instance_deployment_descr ((*esd_b),
dest[pos], pos);
pos++;
}
}
void
ESD_Handler::es_deployment_descr (
const EventServiceDeploymentDescription& src,
Deployment::EventServiceDeploymentDescription& dest,
CORBA::ULong pos)
{
DANCE_TRACE("IDD_Handler::es_deployment_descr");
try
{
dest.name = src.name ().c_str ();
dest.node = src.node ().c_str ();
dest.svc_cfg_file = src.svc_cfg_file ().c_str ());
switch (desc.type ().integral ())
{
case EventServiceType::EC_l:
dest.type = Deployment::EC;
break;
case EventServiceType::RTEC_l:
dest.type = Deployment::RTEC;
break;
case EventServiceType::NOTIFY_l:
dest.type = Deployment::NOTIFY;
break;
case EventServiceType::RTNOTIFY_l:
dest.type = Deployment::RTNOTIFY;
break;
default:
throw Config_Error (desc.requirementName (),
"Unknown EventServiceType.");
break;
}
}
catch (Config_Error &ex)
{
ex.name_ = src.name () + ":" + ex.name_;
throw ex;
}
// Done!
}
EventServiceDeploymentDescription
ESD_Handler::es_deployment_descr (
const Deployment::EventServiceDeploymentDescription& src)
{
DANCE_TRACE("ESD_Handler::es_deployment_descr - reverse");
//Get all the string
XMLSchema::string < ACE_TCHAR > name ((src.name));
XMLSchema::string < ACE_TCHAR > node ((src.node));
XMLSchema::string < ACE_TCHAR > svc_cfg_file ((src.svc_cfg_file));
// Instantiate the IDD
EventServiceDeploymentDescription esd (
name,
node,
EventServiceType::RTEC_l,
svc_cfg_file);
switch (src.EventServiceType)
{
case Deployment::EC:
esd.EventServiceType (EventServiceType::EC);
break;
case Deployment::RTEC:
esd.EventServiceType (EventServiceType::RTEC);
break;
case Deployment::NOTIFY:
esd.EventServiceType (EventServiceType::NOTIFY);
break;
case Deployment::RTNOTIFY:
esd.EventServiceType (EventServiceType::RTNOTIFY);
break;
default:
throw Config_Error (src.resourceName.in (),
"Unknown EventServiceType.");
break;
}
return esd;
}
}
}
|