~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to TAO/orbsvcs/orbsvcs/IFRService/ComponentDef_i.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- C++ -*- */
2
 
// ComponentDef_i.cpp,v 1.11 2003/08/01 03:45:55 parsons Exp
3
 
 
4
 
#include "Repository_i.h"
5
 
#include "ComponentDef_i.h"
6
 
#include "ProvidesDef_i.h"
7
 
#include "UsesDef_i.h"
8
 
#include "EmitsDef_i.h"
9
 
#include "PublishesDef_i.h"
10
 
#include "ConsumesDef_i.h"
11
 
#include "ExtAttributeDef_i.h"
12
 
#include "IFR_Service_Utils.h"
13
 
 
14
 
ACE_RCSID (IFRService,
15
 
           ComponentDef_i,
16
 
           "ComponentDef_i.cpp,v 1.11 2003/08/01 03:45:55 parsons Exp")
17
 
 
18
 
// Specialization.
19
 
template<>
20
 
void
21
 
TAO_Port_Desc_Seq_Utils<CORBA::ComponentIR::UsesDescriptionSeq>::get_is_multiple (
22
 
    CORBA::ComponentIR::UsesDescriptionSeq &desc_seq,
23
 
    ACE_Configuration *config,
24
 
    ACE_Configuration_Section_Key &key,
25
 
    CORBA::ULong index
26
 
  )
27
 
{
28
 
  CORBA::ULong is_multiple = 0;
29
 
  config->get_integer_value (key,
30
 
                             "is_multiple",
31
 
                             is_multiple);
32
 
  desc_seq[index].is_multiple =
33
 
    ACE_static_cast (CORBA::Boolean,
34
 
                     is_multiple);
35
 
}
36
 
 
37
 
// Specialization.
38
 
template<>
39
 
void
40
 
TAO_Port_Desc_Seq_Utils<CORBA::ComponentIR::EventPortDescriptionSeq>::port_base_type (
41
 
    CORBA::ComponentIR::EventPortDescriptionSeq &desc_seq,
42
 
    ACE_TString &holder,
43
 
    CORBA::ULong index
44
 
  )
45
 
{
46
 
  desc_seq[index].event = holder.fast_rep ();
47
 
}
48
 
 
49
 
/// Specialization.
50
 
template<>
51
 
void
52
 
TAO_Port_Utils<CORBA::ComponentIR::UsesDef>::set_is_multiple (
53
 
    CORBA::Boolean is_multiple,
54
 
    ACE_Configuration *config,
55
 
    ACE_Configuration_Section_Key &key
56
 
  )
57
 
{
58
 
  config->set_integer_value (key,
59
 
                             "is_multiple",
60
 
                             is_multiple);
61
 
}
62
 
 
63
 
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
64
 
 
65
 
template class TAO_Port_Desc_Seq_Utils<CORBA::ComponentIR::UsesDescriptionSeq>;
66
 
template class TAO_Port_Desc_Seq_Utils<CORBA::ComponentIR::EventPortDescriptionSeq>;
67
 
template class TAO_Port_Utils<CORBA::ComponentIR::UsesDef>;
68
 
 
69
 
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
70
 
 
71
 
#pragma instantiate TAO_Port_Desc_Seq_Utils<CORBA::ComponentIR::UsesDescriptionSeq>
72
 
#pragma instantiate TAO_Port_Desc_Seq_Utils<CORBA::ComponentIR::EventPortDescriptionSeq>
73
 
#pragma instantiate TAO_Port_Utils<CORBA::ComponentIR::UsesDef>
74
 
 
75
 
#endif /*ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION*/
76
 
 
77
 
// ==============================================================
78
 
 
79
 
TAO_ComponentDef_i::TAO_ComponentDef_i (
80
 
    TAO_Repository_i *repo
81
 
  )
82
 
  : TAO_IRObject_i (repo),
83
 
    TAO_Container_i (repo),
84
 
    TAO_Contained_i (repo),
85
 
    TAO_IDLType_i (repo),
86
 
    TAO_InterfaceDef_i (repo),
87
 
    TAO_InterfaceAttrExtension_i (repo),
88
 
    TAO_ExtInterfaceDef_i (repo)
89
 
{
90
 
}
91
 
 
92
 
TAO_ComponentDef_i::~TAO_ComponentDef_i (void)
93
 
{
94
 
}
95
 
 
96
 
CORBA::DefinitionKind
97
 
TAO_ComponentDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
98
 
  ACE_THROW_SPEC ((CORBA::SystemException))
99
 
{
100
 
  return CORBA::dk_Component;
101
 
}
102
 
 
103
 
void
104
 
TAO_ComponentDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
105
 
  ACE_THROW_SPEC ((CORBA::SystemException))
106
 
{
107
 
  TAO_IFR_WRITE_GUARD;
108
 
 
109
 
  this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
110
 
  ACE_CHECK;
111
 
 
112
 
  this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
113
 
}
114
 
 
115
 
void
116
 
TAO_ComponentDef_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL)
117
 
  ACE_THROW_SPEC ((CORBA::SystemException))
118
 
{
119
 
  // Destroy our special subsections first, then call destroy_i
120
 
  // on our base class.
121
 
 
122
 
  TAO_IFR_Generic_Utils<TAO_ProvidesDef_i>::destroy_special (
123
 
      "provides",
124
 
      this->repo_,
125
 
      this->section_key_
126
 
      ACE_ENV_ARG_PARAMETER
127
 
    );
128
 
  ACE_CHECK;
129
 
 
130
 
  TAO_IFR_Generic_Utils<TAO_UsesDef_i>::destroy_special (
131
 
      "uses",
132
 
      this->repo_,
133
 
      this->section_key_
134
 
      ACE_ENV_ARG_PARAMETER
135
 
    );
136
 
  ACE_CHECK;
137
 
 
138
 
  TAO_IFR_Generic_Utils<TAO_EmitsDef_i>::destroy_special (
139
 
      "emits",
140
 
      this->repo_,
141
 
      this->section_key_
142
 
      ACE_ENV_ARG_PARAMETER
143
 
    );
144
 
  ACE_CHECK;
145
 
 
146
 
  TAO_IFR_Generic_Utils<TAO_PublishesDef_i>::destroy_special (
147
 
      "publishes",
148
 
      this->repo_,
149
 
      this->section_key_
150
 
      ACE_ENV_ARG_PARAMETER
151
 
    );
152
 
  ACE_CHECK;
153
 
 
154
 
  TAO_IFR_Generic_Utils<TAO_ConsumesDef_i>::destroy_special (
155
 
      "consumes",
156
 
      this->repo_,
157
 
      this->section_key_
158
 
      ACE_ENV_ARG_PARAMETER
159
 
    );
160
 
  ACE_CHECK;
161
 
 
162
 
  this->TAO_ExtInterfaceDef_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
163
 
}
164
 
 
165
 
CORBA::Contained::Description *
166
 
TAO_ComponentDef_i::describe (ACE_ENV_SINGLE_ARG_DECL)
167
 
  ACE_THROW_SPEC ((CORBA::SystemException))
168
 
{
169
 
  TAO_IFR_READ_GUARD_RETURN (0);
170
 
 
171
 
  this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
172
 
  ACE_CHECK_RETURN (0);
173
 
 
174
 
  return this->describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
175
 
}
176
 
 
177
 
CORBA::Contained::Description *
178
 
TAO_ComponentDef_i::describe_i (ACE_ENV_SINGLE_ARG_DECL)
179
 
  ACE_THROW_SPEC ((CORBA::SystemException))
180
 
{
181
 
  CORBA::ComponentIR::ComponentDescription cd;
182
 
  TAO_IFR_Desc_Utils<CORBA::ComponentIR::ComponentDescription,
183
 
                     TAO_ComponentDef_i>::fill_desc_begin (
184
 
                                              cd,
185
 
                                              this->repo_,
186
 
                                              this->section_key_
187
 
                                              ACE_ENV_ARG_PARAMETER
188
 
                                            );
189
 
  ACE_CHECK_RETURN (0);
190
 
 
191
 
  ACE_TString holder;
192
 
  this->repo_->config ()->get_string_value (this->section_key_,
193
 
                                            "base_component",
194
 
                                            holder);
195
 
  cd.base_component = holder.fast_rep ();
196
 
 
197
 
  CORBA::ULong count = 0;
198
 
  ACE_Configuration_Section_Key supports_key;
199
 
  int status = this->repo_->config ()->open_section (this->section_key_,
200
 
                                                     "supported",
201
 
                                                     0,
202
 
                                                     supports_key);
203
 
 
204
 
  if (status == 0)
205
 
    {
206
 
      this->repo_->config ()->get_integer_value (supports_key,
207
 
                                                 "count",
208
 
                                                 count);
209
 
    }
210
 
 
211
 
  cd.supported_interfaces.length (count);
212
 
  char *stringified = 0;
213
 
  CORBA::ULong i = 0;
214
 
 
215
 
  for (i = 0; i < count; ++i)
216
 
    {
217
 
      stringified = TAO_IFR_Service_Utils::int_to_string (i);
218
 
      this->repo_->config ()->get_string_value (supports_key,
219
 
                                                stringified,
220
 
                                                holder);
221
 
 
222
 
      cd.supported_interfaces[i] = holder.c_str ();
223
 
    }
224
 
 
225
 
  TAO_Port_Desc_Seq_Utils<
226
 
      CORBA::ComponentIR::ProvidesDescriptionSeq
227
 
    >::port_descriptions (cd.provided_interfaces,
228
 
       this->repo_->config (),
229
 
       this->section_key_,
230
 
       "provides");
231
 
 
232
 
  TAO_Port_Desc_Seq_Utils<
233
 
      CORBA::ComponentIR::UsesDescriptionSeq
234
 
    >::port_descriptions (cd.used_interfaces,
235
 
       this->repo_->config (),
236
 
       this->section_key_,
237
 
       "uses");
238
 
 
239
 
  TAO_Port_Desc_Seq_Utils<
240
 
      CORBA::ComponentIR::EventPortDescriptionSeq
241
 
    >::port_descriptions (cd.emits_events,
242
 
      this->repo_->config (),
243
 
      this->section_key_,
244
 
      "emits");
245
 
 
246
 
  TAO_Port_Desc_Seq_Utils<
247
 
      CORBA::ComponentIR::EventPortDescriptionSeq
248
 
    >::port_descriptions (cd.publishes_events,
249
 
      this->repo_->config (),
250
 
      this->section_key_,
251
 
      "publishes");
252
 
 
253
 
  TAO_Port_Desc_Seq_Utils<
254
 
      CORBA::ComponentIR::EventPortDescriptionSeq
255
 
    >::port_descriptions (cd.consumes_events,
256
 
      this->repo_->config (),
257
 
      this->section_key_,
258
 
      "consumes");
259
 
 
260
 
  count = 0;
261
 
  ACE_Configuration_Section_Key attrs_key;
262
 
  status =
263
 
    this->repo_->config ()->open_section (this->section_key_,
264
 
                                          "attrs",
265
 
                                          0,
266
 
                                          attrs_key);
267
 
  if (status == 0)
268
 
    {
269
 
      this->repo_->config ()->get_integer_value (attrs_key,
270
 
                                                 "count",
271
 
                                                 count);
272
 
    }
273
 
 
274
 
  cd.attributes.length (count);
275
 
  ACE_Configuration_Section_Key attr_key;
276
 
 
277
 
  for (i = 0; i < count; ++i)
278
 
    {
279
 
      stringified = TAO_IFR_Service_Utils::int_to_string (i);
280
 
      this->repo_->config ()->get_string_value (attrs_key,
281
 
                                                stringified,
282
 
                                                holder);
283
 
      this->repo_->config ()->expand_path (this->repo_->root_key (),
284
 
                                           holder,
285
 
                                           attr_key,
286
 
                                           0);
287
 
      TAO_ExtAttributeDef_i impl (this->repo_);
288
 
      impl.section_key (attr_key);
289
 
      impl.fill_description (cd.attributes[i]
290
 
                             ACE_ENV_ARG_PARAMETER);
291
 
      ACE_CHECK_RETURN (0);
292
 
    }
293
 
 
294
 
  cd.type = this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
295
 
  ACE_CHECK_RETURN (0);
296
 
 
297
 
  CORBA::Contained::Description *cont_desc_ptr = 0;
298
 
  ACE_NEW_THROW_EX (cont_desc_ptr,
299
 
                    CORBA::Contained::Description,
300
 
                    CORBA::NO_MEMORY ());
301
 
  ACE_CHECK_RETURN (0);
302
 
  CORBA::Contained::Description_var retval = cont_desc_ptr;
303
 
 
304
 
  cont_desc_ptr->kind = CORBA::dk_Component;
305
 
 
306
 
  cont_desc_ptr->value <<= cd;
307
 
  return retval._retn ();
308
 
}
309
 
 
310
 
CORBA::TypeCode_ptr
311
 
TAO_ComponentDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
312
 
  ACE_THROW_SPEC ((CORBA::SystemException))
313
 
{
314
 
  TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
315
 
 
316
 
  this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
317
 
  ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
318
 
 
319
 
  return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
320
 
}
321
 
 
322
 
CORBA::TypeCode_ptr
323
 
TAO_ComponentDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
324
 
  ACE_THROW_SPEC ((CORBA::SystemException))
325
 
{
326
 
  ACE_TString id;
327
 
  this->repo_->config ()->get_string_value (this->section_key_,
328
 
                                            "id",
329
 
                                            id);
330
 
 
331
 
  ACE_TString name;
332
 
  this->repo_->config ()->get_string_value (this->section_key_,
333
 
                                            "name",
334
 
                                            name);
335
 
 
336
 
  return this->repo_->tc_factory ()->create_component_tc (
337
 
                                         id.c_str (),
338
 
                                         name.c_str ()
339
 
                                         ACE_ENV_ARG_PARAMETER
340
 
                                       );
341
 
}
342
 
 
343
 
CORBA::InterfaceDefSeq *
344
 
TAO_ComponentDef_i::supported_interfaces (ACE_ENV_SINGLE_ARG_DECL)
345
 
  ACE_THROW_SPEC ((CORBA::SystemException))
346
 
{
347
 
  TAO_IFR_READ_GUARD_RETURN (0);
348
 
 
349
 
  this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
350
 
  ACE_CHECK_RETURN (0);
351
 
 
352
 
  return this->supported_interfaces_i (ACE_ENV_SINGLE_ARG_PARAMETER);
353
 
}
354
 
 
355
 
CORBA::InterfaceDefSeq *
356
 
TAO_ComponentDef_i::supported_interfaces_i (ACE_ENV_SINGLE_ARG_DECL)
357
 
  ACE_THROW_SPEC ((CORBA::SystemException))
358
 
{
359
 
  CORBA::InterfaceDefSeq *seq = 0;
360
 
  ACE_NEW_RETURN (seq,
361
 
                  CORBA::InterfaceDefSeq (0),
362
 
                  0);
363
 
  CORBA::InterfaceDefSeq_var retval = seq;
364
 
  retval->length (0);
365
 
 
366
 
  CORBA::ULong count = 0;
367
 
  ACE_Configuration_Section_Key supported_key;
368
 
  int status =
369
 
    this->repo_->config ()->open_section (this->section_key_,
370
 
                                          "supported",
371
 
                                          0,
372
 
                                          supported_key);
373
 
 
374
 
  if (status == 0)
375
 
    {
376
 
      this->repo_->config ()->get_integer_value (supported_key,
377
 
                                                 "count",
378
 
                                                 count);
379
 
      retval->length (count);
380
 
      char *stringified = 0;
381
 
      ACE_TString path;
382
 
      CORBA::Object_var tmp;
383
 
 
384
 
      for (CORBA::ULong i = 0; i < count; ++i)
385
 
        {
386
 
          stringified = TAO_IFR_Service_Utils::int_to_string (i);
387
 
          this->repo_->config ()->get_string_value (supported_key,
388
 
                                                    stringified,
389
 
                                                    path);
390
 
          tmp =
391
 
            TAO_IFR_Service_Utils::path_to_ir_object (path,
392
 
                                                      this->repo_
393
 
                                                      ACE_ENV_ARG_PARAMETER);
394
 
          ACE_CHECK_RETURN (0);
395
 
 
396
 
          retval[i] = CORBA::InterfaceDef::_narrow (tmp.in ()
397
 
                                                    ACE_ENV_ARG_PARAMETER);
398
 
          ACE_CHECK_RETURN (0);
399
 
        }
400
 
    }
401
 
 
402
 
  return retval._retn ();
403
 
}
404
 
 
405
 
void
406
 
TAO_ComponentDef_i::supported_interfaces (
407
 
    const CORBA::InterfaceDefSeq &supported_interfaces
408
 
    ACE_ENV_ARG_DECL
409
 
  )
410
 
  ACE_THROW_SPEC ((CORBA::SystemException))
411
 
{
412
 
  TAO_IFR_WRITE_GUARD;
413
 
 
414
 
  this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
415
 
  ACE_CHECK;
416
 
 
417
 
  this->supported_interfaces_i (supported_interfaces
418
 
                                ACE_ENV_ARG_PARAMETER);
419
 
}
420
 
 
421
 
void
422
 
TAO_ComponentDef_i::supported_interfaces_i (
423
 
    const CORBA::InterfaceDefSeq &supported_interfaces
424
 
    ACE_ENV_ARG_DECL
425
 
  )
426
 
  ACE_THROW_SPEC ((CORBA::SystemException))
427
 
{
428
 
  // Remove the old supported interfaces.
429
 
  this->repo_->config ()->remove_section (this->section_key_,
430
 
                                          "supported",
431
 
                                          0);
432
 
 
433
 
  CORBA::ULong length = supported_interfaces.length ();
434
 
  ACE_Configuration_Section_Key inherited_key;
435
 
  this->repo_->config ()->open_section (this->section_key_,
436
 
                                        "supported",
437
 
                                        1,
438
 
                                        inherited_key);
439
 
 
440
 
  CORBA::String_var name;
441
 
  char *supported_path = 0;
442
 
  ACE_Configuration_Section_Key supported_key;
443
 
 
444
 
  for (CORBA::ULong i = 0; i < length; ++i)
445
 
    {
446
 
      supported_path =
447
 
        TAO_IFR_Service_Utils::reference_to_path (
448
 
            supported_interfaces[i].in ()
449
 
          );
450
 
 
451
 
      // Get the servant's key into the temporary key holder, because
452
 
      // the name clash checker for base interfaces is static, and has
453
 
      // no other way to know about a specific key.
454
 
      this->repo_->config ()->expand_path (this->repo_->root_key (),
455
 
                                            supported_path,
456
 
                                            TAO_IFR_Service_Utils::tmp_key_,
457
 
                                            0);
458
 
      TAO_IFR_Service_Utils::name_exists (&TAO_InterfaceDef_i::name_clash,
459
 
                                          this->section_key_,
460
 
                                          this->repo_,
461
 
                                          this->def_kind ()
462
 
                                          ACE_ENV_ARG_PARAMETER);
463
 
      ACE_CHECK;
464
 
 
465
 
      char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
466
 
      this->repo_->config ()->set_string_value (supported_key,
467
 
                                                stringified,
468
 
                                                supported_path);
469
 
    }
470
 
}
471
 
 
472
 
CORBA::ComponentIR::ComponentDef_ptr
473
 
TAO_ComponentDef_i::base_component (ACE_ENV_SINGLE_ARG_DECL)
474
 
   ACE_THROW_SPEC ((CORBA::SystemException))
475
 
{
476
 
  TAO_IFR_READ_GUARD_RETURN (CORBA::ComponentIR::ComponentDef::_nil ());
477
 
 
478
 
  this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
479
 
  ACE_CHECK_RETURN (CORBA::ComponentIR::ComponentDef::_nil ());
480
 
 
481
 
  return this->base_component_i (ACE_ENV_SINGLE_ARG_PARAMETER);
482
 
}
483
 
 
484
 
CORBA::ComponentIR::ComponentDef_ptr
485
 
TAO_ComponentDef_i::base_component_i (ACE_ENV_SINGLE_ARG_DECL)
486
 
  ACE_THROW_SPEC ((CORBA::SystemException))
487
 
{
488
 
  ACE_TString base_id;
489
 
  int status =
490
 
    this->repo_->config ()->get_string_value (this->section_key_,
491
 
                                              "base_component",
492
 
                                              base_id);
493
 
 
494
 
  if (status != 0)
495
 
    {
496
 
      return CORBA::ComponentIR::ComponentDef::_nil ();
497
 
    }
498
 
 
499
 
  CORBA::Contained_var obj = this->repo_->lookup_id (base_id.fast_rep ()
500
 
                                                     ACE_ENV_ARG_PARAMETER);
501
 
  ACE_CHECK_RETURN (CORBA::ComponentIR::ComponentDef::_nil ());
502
 
 
503
 
  return CORBA::ComponentIR::ComponentDef::_narrow (obj.in ()
504
 
                                                    ACE_ENV_ARG_PARAMETER);
505
 
}
506
 
 
507
 
void
508
 
TAO_ComponentDef_i::base_component (
509
 
    CORBA::ComponentIR::ComponentDef_ptr base_component
510
 
    ACE_ENV_ARG_DECL
511
 
  )
512
 
  ACE_THROW_SPEC ((CORBA::SystemException))
513
 
{
514
 
  TAO_IFR_WRITE_GUARD;
515
 
 
516
 
  this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
517
 
  ACE_CHECK;
518
 
 
519
 
  this->base_component_i (base_component
520
 
                          ACE_ENV_ARG_PARAMETER);
521
 
}
522
 
 
523
 
void
524
 
TAO_ComponentDef_i::base_component_i (
525
 
    CORBA::ComponentIR::ComponentDef_ptr base_component
526
 
    ACE_ENV_ARG_DECL
527
 
  )
528
 
  ACE_THROW_SPEC ((CORBA::SystemException))
529
 
{
530
 
  if (CORBA::is_nil (base_component))
531
 
    {
532
 
      this->repo_->config ()->remove_value (this->section_key_,
533
 
                                            "base_component");
534
 
      return;
535
 
    }
536
 
 
537
 
  const char *base_path =
538
 
    TAO_IFR_Service_Utils::reference_to_path (base_component);
539
 
 
540
 
  // Get the servant's key into the temporary key holder, because
541
 
  // the name clash checker for base valuetypes is static, and has
542
 
  // no other way to know about a specific key.
543
 
  this->repo_->config ()->expand_path (
544
 
                              this->repo_->root_key (),
545
 
                              base_path,
546
 
                              TAO_IFR_Service_Utils::tmp_key_,
547
 
                              0
548
 
                            );
549
 
  TAO_IFR_Service_Utils::name_exists (&TAO_ComponentDef_i::name_clash,
550
 
                                      this->section_key_,
551
 
                                      this->repo_,
552
 
                                      CORBA::dk_Component
553
 
                                      ACE_ENV_ARG_PARAMETER);
554
 
  ACE_CHECK;
555
 
 
556
 
  this->repo_->config ()->set_string_value (
557
 
                              this->section_key_,
558
 
                              "base_component",
559
 
                              base_component->_interface_repository_id ()
560
 
                            );
561
 
}
562
 
 
563
 
CORBA::ComponentIR::ProvidesDef_ptr
564
 
TAO_ComponentDef_i::create_provides (
565
 
    const char *id,
566
 
    const char *name,
567
 
    const char *version,
568
 
    CORBA::InterfaceDef_ptr interface_type
569
 
    ACE_ENV_ARG_DECL
570
 
  )
571
 
  ACE_THROW_SPEC ((CORBA::SystemException))
572
 
{
573
 
  TAO_IFR_WRITE_GUARD_RETURN (CORBA::ComponentIR::ProvidesDef::_nil ());
574
 
 
575
 
  this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
576
 
  ACE_CHECK_RETURN (CORBA::ComponentIR::ProvidesDef::_nil ());
577
 
 
578
 
  return this->create_provides_i (id,
579
 
                                  name,
580
 
                                  version,
581
 
                                  interface_type
582
 
                                  ACE_ENV_ARG_PARAMETER);
583
 
}
584
 
 
585
 
CORBA::ComponentIR::ProvidesDef_ptr
586
 
TAO_ComponentDef_i::create_provides_i (
587
 
    const char *id,
588
 
    const char *name,
589
 
    const char *version,
590
 
    CORBA::InterfaceDef_ptr interface_type
591
 
    ACE_ENV_ARG_DECL
592
 
  )
593
 
  ACE_THROW_SPEC ((CORBA::SystemException))
594
 
{
595
 
  return
596
 
    TAO_Port_Utils<
597
 
        CORBA::ComponentIR::ProvidesDef
598
 
      >::create_entry (id,
599
 
                       name,
600
 
                       version,
601
 
                       "provides",
602
 
                       interface_type,
603
 
                       0,
604
 
                       this->repo_,
605
 
                       CORBA::dk_Provides,
606
 
                       this->section_key_
607
 
                       ACE_ENV_ARG_PARAMETER);
608
 
}
609
 
 
610
 
CORBA::ComponentIR::UsesDef_ptr
611
 
TAO_ComponentDef_i::create_uses (const char *id,
612
 
                                 const char *name,
613
 
                                 const char *version,
614
 
                                 CORBA::InterfaceDef_ptr interface_type,
615
 
                                 CORBA::Boolean is_multiple
616
 
                                 ACE_ENV_ARG_DECL)
617
 
  ACE_THROW_SPEC ((CORBA::SystemException))
618
 
{
619
 
  TAO_IFR_WRITE_GUARD_RETURN (CORBA::ComponentIR::UsesDef::_nil ());
620
 
 
621
 
  this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
622
 
  ACE_CHECK_RETURN (CORBA::ComponentIR::UsesDef::_nil ());
623
 
 
624
 
  return this->create_uses_i (id,
625
 
                              name,
626
 
                              version,
627
 
                              interface_type,
628
 
                              is_multiple
629
 
                              ACE_ENV_ARG_PARAMETER);
630
 
}
631
 
 
632
 
CORBA::ComponentIR::UsesDef_ptr
633
 
TAO_ComponentDef_i::create_uses_i (const char *id,
634
 
                                   const char *name,
635
 
                                   const char *version,
636
 
                                   CORBA::InterfaceDef_ptr interface_type,
637
 
                                   CORBA::Boolean is_multiple
638
 
                                   ACE_ENV_ARG_DECL)
639
 
  ACE_THROW_SPEC ((CORBA::SystemException))
640
 
{
641
 
  return
642
 
    TAO_Port_Utils<
643
 
        CORBA::ComponentIR::UsesDef
644
 
      >::create_entry (id,
645
 
                       name,
646
 
                       version,
647
 
                       "uses",
648
 
                       interface_type,
649
 
                       is_multiple,
650
 
                       this->repo_,
651
 
                       CORBA::dk_Uses,
652
 
                       this->section_key_
653
 
                       ACE_ENV_ARG_PARAMETER);
654
 
}
655
 
 
656
 
CORBA::ComponentIR::EmitsDef_ptr
657
 
TAO_ComponentDef_i::create_emits (const char *id,
658
 
                                  const char *name,
659
 
                                  const char *version,
660
 
                                  CORBA::ValueDef_ptr value
661
 
                                  ACE_ENV_ARG_DECL)
662
 
  ACE_THROW_SPEC ((CORBA::SystemException))
663
 
{
664
 
  TAO_IFR_WRITE_GUARD_RETURN (CORBA::ComponentIR::EmitsDef::_nil ());
665
 
 
666
 
  this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
667
 
  ACE_CHECK_RETURN (CORBA::ComponentIR::EmitsDef::_nil ());
668
 
 
669
 
  return this->create_emits_i (id,
670
 
                               name,
671
 
                               version,
672
 
                               value
673
 
                               ACE_ENV_ARG_PARAMETER);
674
 
}
675
 
 
676
 
CORBA::ComponentIR::EmitsDef_ptr
677
 
TAO_ComponentDef_i::create_emits_i (const char *id,
678
 
                                    const char *name,
679
 
                                    const char *version,
680
 
                                    CORBA::ValueDef_ptr value
681
 
                                    ACE_ENV_ARG_DECL)
682
 
  ACE_THROW_SPEC ((CORBA::SystemException))
683
 
{
684
 
  return
685
 
    TAO_Port_Utils<
686
 
        CORBA::ComponentIR::EmitsDef
687
 
      >::create_entry (id,
688
 
                       name,
689
 
                       version,
690
 
                       "emits",
691
 
                       value,
692
 
                       0,
693
 
                       this->repo_,
694
 
                       CORBA::dk_Emits,
695
 
                       this->section_key_
696
 
                       ACE_ENV_ARG_PARAMETER);
697
 
}
698
 
 
699
 
CORBA::ComponentIR::PublishesDef_ptr
700
 
TAO_ComponentDef_i::create_publishes (const char *id,
701
 
                                      const char *name,
702
 
                                      const char *version,
703
 
                                      CORBA::ValueDef_ptr value
704
 
                                      ACE_ENV_ARG_DECL)
705
 
  ACE_THROW_SPEC ((CORBA::SystemException))
706
 
{
707
 
  TAO_IFR_WRITE_GUARD_RETURN (CORBA::ComponentIR::PublishesDef::_nil ());
708
 
 
709
 
  this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
710
 
  ACE_CHECK_RETURN (CORBA::ComponentIR::PublishesDef::_nil ());
711
 
 
712
 
  return this->create_publishes_i (id,
713
 
                                   name,
714
 
                                   version,
715
 
                                   value
716
 
                                   ACE_ENV_ARG_PARAMETER);
717
 
}
718
 
 
719
 
CORBA::ComponentIR::PublishesDef_ptr
720
 
TAO_ComponentDef_i::create_publishes_i (const char *id,
721
 
                                        const char *name,
722
 
                                        const char *version,
723
 
                                        CORBA::ValueDef_ptr value
724
 
                                        ACE_ENV_ARG_DECL)
725
 
  ACE_THROW_SPEC ((CORBA::SystemException))
726
 
{
727
 
  return
728
 
    TAO_Port_Utils<
729
 
        CORBA::ComponentIR::PublishesDef
730
 
      >::create_entry (id,
731
 
                       name,
732
 
                       version,
733
 
                       "publishes",
734
 
                       value,
735
 
                       0,
736
 
                       this->repo_,
737
 
                       CORBA::dk_Publishes,
738
 
                       this->section_key_
739
 
                       ACE_ENV_ARG_PARAMETER);
740
 
}
741
 
 
742
 
CORBA::ComponentIR::ConsumesDef_ptr
743
 
TAO_ComponentDef_i::create_consumes (const char *id,
744
 
                                     const char *name,
745
 
                                     const char *version,
746
 
                                     CORBA::ValueDef_ptr value
747
 
                                     ACE_ENV_ARG_DECL)
748
 
  ACE_THROW_SPEC ((CORBA::SystemException))
749
 
{
750
 
  TAO_IFR_WRITE_GUARD_RETURN (CORBA::ComponentIR::ConsumesDef::_nil ());
751
 
 
752
 
  this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
753
 
  ACE_CHECK_RETURN (CORBA::ComponentIR::ConsumesDef::_nil ());
754
 
 
755
 
  return this->create_consumes_i (id,
756
 
                                  name,
757
 
                                  version,
758
 
                                  value
759
 
                                  ACE_ENV_ARG_PARAMETER);
760
 
}
761
 
 
762
 
CORBA::ComponentIR::ConsumesDef_ptr
763
 
TAO_ComponentDef_i::create_consumes_i (const char *id,
764
 
                                       const char *name,
765
 
                                       const char *version,
766
 
                                       CORBA::ValueDef_ptr value
767
 
                                       ACE_ENV_ARG_DECL)
768
 
  ACE_THROW_SPEC ((CORBA::SystemException))
769
 
{
770
 
  return
771
 
    TAO_Port_Utils<
772
 
        CORBA::ComponentIR::ConsumesDef
773
 
      >::create_entry (id,
774
 
                       name,
775
 
                       version,
776
 
                       "consumes",
777
 
                       value,
778
 
                       0,
779
 
                       this->repo_,
780
 
                       CORBA::dk_Consumes,
781
 
                       this->section_key_
782
 
                       ACE_ENV_ARG_PARAMETER);
783
 
}
784
 
 
785
 
int
786
 
TAO_ComponentDef_i::name_clash (const char *name)
787
 
{
788
 
  ACE_TRY_NEW_ENV
789
 
    {
790
 
      TAO_Container_i::tmp_name_holder_ = name;
791
 
      TAO_IFR_Service_Utils::name_exists (&TAO_Container_i::same_as_tmp_name,
792
 
                                          TAO_IFR_Service_Utils::tmp_key_,
793
 
                                          TAO_IFR_Service_Utils::repo_,
794
 
                                          CORBA::dk_Component
795
 
                                          ACE_ENV_ARG_PARAMETER);
796
 
      ACE_TRY_CHECK;
797
 
    }
798
 
  ACE_CATCHANY
799
 
    {
800
 
      return 1;
801
 
    }
802
 
  ACE_ENDTRY;
803
 
 
804
 
  return 0;
805
 
}