sources:
FilterHome_impl.cpp (1.7k)
FilterHome_impl.h (945 bytes)
ProduktFilter_impl.cpp (1.5k)
ProduktFilter_impl.h (1.1k)
auktion.cpp (217.6k)
auktion.h (105.7k)
auktion.idl (1.8k)
auktion_ccm.cpp (69.8k)
auktion_ccm.h (23.4k)
session.cpp (1.6k)
session.h (1.9k)
session.idl (209 bytes)


website:
more info here
studies/corba/Corba-Code4/Filter/auktion_ccm.cpp
download file

  1 /* * MICO --- a free CORBA implementation * * MicoCCM written by Frank Pilhofer, sponsored by Alcatel * * This file was automatically generated. DO NOT EDIT! */
  2
  3 #include <coss/CosNaming.h>
  4 #ifdef HAVE_ANSI_CPLUSPLUS_HEADERS
  5 #include <iostream>
  6 #include <fstream>
  7 #else // HAVE_ANSI_CPLUSPLUS_HEADERS
  8 #include <iostream.h>
  9 #include <fstream.h>
 10 #endif // HAVE_ANSI_CPLUSPLUS_HEADERS
 11 #include "auktion_ccm.h"
 12
 13
 14 using namespace std;
 15
 16 /* * Glue class for component Auktion::Bieter */
 17
 18 MICO_CCM_impls::
 19 Auktion_Bieter_impl::Auktion_Bieter_impl (Auktion::CCM_Bieter * i, MICO::CCM::SessionContainer * c)
 20   : _instance (i), _container (c)
 21 {
 22   _context = new Auktion_Bieter_Context_impl (this, c);
 23   _cookie_for_versteigerungen = 0;
 24 }
 25
 26 MICO_CCM_impls::
 27 Auktion_Bieter_impl::~Auktion_Bieter_impl ()
 28 {
 29   delete _instance;
 30   delete _context;
 31 }
 32
 33 /* * Component Attributes */
 34
 35 /* * Supported Interfaces */
 36
 37 // ::Auktion::Kaeufer
 38
 39 void
 40 MICO_CCM_impls::
 41 Auktion_Bieter_impl::zuschlag (Auktion::Versteigerung_ptr gegenstand, Auktion::Verkaeufer_ptr v)
 42 {
 43   _instance->zuschlag (gegenstand, v);
 44 }
 45
 46 /* * Equivalent IDL methods */
 47
 48 // no facets
 49
 50 // receptacles
 51
 52 Components::Cookie *
 53 MICO_CCM_impls::
 54 Auktion_Bieter_impl::connect_versteigerungen (Auktion::Versteigerung_ptr _value)
 55 {
 56   Components::Cookie_var _ck = new MICO::CCM::Cookie_impl;
 57   _ck->CookieValue().replace (sizeof (CORBA::ULong), sizeof (CORBA::ULong), (CORBA::Octet *) &_cookie_for_versteigerungen);
 58   _cookie_for_versteigerungen++;
 59   CORBA::ULong _idx = _for_recep_versteigerungen.length ();
 60   _for_recep_versteigerungen.length (_idx + 1);
 61   _for_recep_versteigerungen[_idx].ck = _ck;
 62   _for_recep_versteigerungen[_idx].objref = Auktion::Versteigerung::_duplicate (_value);
 63   return _ck._retn();
 64 }
 65
 66 Auktion::Versteigerung_ptr
 67 MICO_CCM_impls::
 68 Auktion_Bieter_impl::disconnect_versteigerungen (Components::Cookie * _value)
 69 {
 70   CORBA::ULong _idx, _ck1, _ck2;
 71   if (!_value || _value->CookieValue().length() != sizeof (CORBA::ULong)) {
 72     throw Components::InvalidConnection();
 73   }
 74
 75   _ck1 = * ((CORBA::ULong *) _value->CookieValue().get_buffer());
 76
 77   for (_idx=0; _idx<_for_recep_versteigerungen.length(); _idx++) {
 78     _ck2 = * ((CORBA::ULong *) _for_recep_versteigerungen[_idx].ck->CookieValue().get_buffer());
 79     if (_ck1 == _ck2) break;
 80   }
 81
 82   if (_idx == _for_recep_versteigerungen.length()) {
 83     throw Components::InvalidConnection();
 84   }
 85
 86   Auktion::Versteigerung_var _res = Auktion::Versteigerung::_duplicate (_for_recep_versteigerungen[_idx].objref);
 87
 88   for (;_idx<_for_recep_versteigerungen.length()-1; _idx++) {
 89     _for_recep_versteigerungen[_idx] = _for_recep_versteigerungen[_idx+1];
 90   }
 91
 92   _for_recep_versteigerungen.length (_idx);
 93   return _res._retn();
 94 }
 95
 96 Auktion::Bieter::versteigerungenConnections *
 97 MICO_CCM_impls::
 98 Auktion_Bieter_impl::get_connections_versteigerungen ()
 99 {
100   return new Auktion::Bieter::versteigerungenConnections (_for_recep_versteigerungen);
101 }
102
103 // no publishers
104
105 // no emitters
106
107 // consumers
108
109 ::Auktion::GebotConsumer_ptr
110 MICO_CCM_impls::
111 Auktion_Bieter_impl::get_consumer_gebote ()
112 {
113   if (CORBA::is_nil (_for_consumer_gebote)) {
114     PortableServer::ServantBase_var _consumer_servant =
115       new Auktion_Bieter_gebote_impl (this);
116     CORBA::Object_var _ref =
117       _container->activate_facet (this, "gebote",
118                                   CORBA::LocalObject::_nil(),
119                                   _consumer_servant)
;
120     _for_consumer_gebote =
121       ::Auktion::GebotConsumer::_narrow (_ref);
122   }
123
124   return ::Auktion::GebotConsumer::_duplicate (_for_consumer_gebote);
125 }
126
127 /* * Inherited Navigation interface */
128
129 CORBA::Object_ptr
130 MICO_CCM_impls::
131 Auktion_Bieter_impl::provide_facet (const char * _name)
132 {
133   throw Components::InvalidName();
134   return CORBA::Object::_nil ();
135 }
136
137 Components::FacetDescriptions *
138 MICO_CCM_impls::
139 Auktion_Bieter_impl::get_all_facets ()
140 {
141   Components::NameList _allnames;
142   _allnames.length (0);
143   return get_named_facets (_allnames);
144 }
145
146 Components::FacetDescriptions *
147 MICO_CCM_impls::
148 Auktion_Bieter_impl::get_named_facets (const Components::NameList & _names)
149 {
150   Components::FacetDescriptions_var _res = new Components::FacetDescriptions;
151   _res->length (_names.length());
152
153   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
154     throw Components::InvalidName();
155   }
156
157   return _res._retn();
158 }
159
160 CORBA::Boolean
161 MICO_CCM_impls::
162 Auktion_Bieter_impl::same_component (CORBA::Object_ptr _ref)
163 {
164   return 0;
165 }
166
167 /* * Inherited Receptacles interface */
168
169 Components::Cookie *
170 MICO_CCM_impls::
171 Auktion_Bieter_impl::connect (const char * _name, CORBA::Object_ptr _ref)
172 {
173   if (strcmp (_name, "versteigerungen") == 0) {
174     ::Auktion::Versteigerung_var _tref = ::Auktion::Versteigerung::_narrow (_ref);
175     if (CORBA::is_nil (_tref) && !CORBA::is_nil (_ref)) {
176       throw Components::InvalidConnection();
177     }
178     return connect_versteigerungen (_tref);
179   }
180
181   throw Components::InvalidName();
182   return new MICO::CCM::Cookie_impl;
183 }
184
185 void
186 MICO_CCM_impls::
187 Auktion_Bieter_impl::disconnect (const char * _name, Components::Cookie * _ck)
188 {
189   if (strcmp (_name, "versteigerungen") == 0) {
190     ::Auktion::Versteigerung_var _dummy;
191     _dummy = disconnect_versteigerungen (_ck);
192     return;
193   }
194
195   throw Components::InvalidName();
196 }
197
198 Components::ConnectionDescriptions *
199 MICO_CCM_impls::
200 Auktion_Bieter_impl::get_connections (const char * _name)
201 {
202   Components::NameList _thename (1);
203   _thename[0] = _name;
204   Components::ReceptacleDescriptions_var _rdv = get_named_receptacles (_thename);
205   return new Components::ConnectionDescriptions (_rdv[(CORBA::ULong)0]->connections());
206 }
207 Components::ReceptacleDescriptions *
208 MICO_CCM_impls::
209 Auktion_Bieter_impl::get_all_receptacles ()
210 {
211   Components::NameList _allnames;
212   _allnames.length (1);
213   _allnames[0] = CORBA::string_dup ("versteigerungen");
214   return get_named_receptacles (_allnames);
215 }
216
217 Components::ReceptacleDescriptions *
218 MICO_CCM_impls::
219 Auktion_Bieter_impl::get_named_receptacles (const Components::NameList & _names)
220 {
221   Components::ReceptacleDescriptions_var _res = new Components::ReceptacleDescriptions;
222   _res->length (_names.length());
223
224   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
225     if (strcmp (_names[_idx].in(), "versteigerungen") == 0) {
226       _res[_idx] = new MICO::CCM::ReceptacleDescription_impl;
227       _res[_idx]->name ((const char *) "versteigerungen");
228       _res[_idx]->type_id ((const char *) "IDL:r4/Auktion/Versteigerung:1.0");
229       _res[_idx]->is_multiplex (1);
230       _res[_idx]->connections().length (_for_recep_versteigerungen.length());
231       for (CORBA::ULong _idx2=0; _idx2<_for_recep_versteigerungen.length(); _idx2++) {
232         _res[_idx]->connections()[_idx2] =
233           new MICO::CCM::ConnectionDescription_impl;
234         _res[_idx]->connections()[_idx2]->ck (_for_recep_versteigerungen[_idx2].ck);
235         _res[_idx]->connections()[_idx2]->objref (_for_recep_versteigerungen[_idx2].objref);
236       }
237       continue;
238     }
239
240     throw Components::InvalidName();
241   }
242
243   return _res._retn();
244 }
245
246 /* * Inherited Events interface */
247
248 Components::EventConsumerBase_ptr
249 MICO_CCM_impls::
250 Auktion_Bieter_impl::get_consumer (const char * _name)
251 {
252   if (strcmp (_name, "gebote") == 0) {
253     return get_consumer_gebote ();
254   }
255   throw Components::InvalidName();
256   return Components::EventConsumerBase::_nil ();
257 }
258
259 Components::ConsumerDescriptions *
260 MICO_CCM_impls::
261 Auktion_Bieter_impl::get_all_consumers ()
262 {
263   Components::NameList _allnames;
264   _allnames.length (1);
265   _allnames[0] = CORBA::string_dup ("gebote");
266   return get_named_consumers (_allnames);
267 }
268
269 Components::ConsumerDescriptions *
270 MICO_CCM_impls::
271 Auktion_Bieter_impl::get_named_consumers (const Components::NameList & _names)
272 {
273   Components::ConsumerDescriptions_var _res = new Components::ConsumerDescriptions;
274   _res->length (_names.length());
275
276   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
277     if (strcmp (_names[_idx].in(), "gebote") == 0) {
278       _res[_idx] = new MICO::CCM::ConsumerDescription_impl;
279       _res[_idx]->name ((const char *) "gebote");
280       _res[_idx]->type_id ((const char *) "IDL:r4/Auktion/Gebot:1.0");
281       Components::EventConsumerBase_var _tmp =
282         get_consumer ("gebote");
283       _res[_idx]->consumer (_tmp);
284       continue;
285     }
286
287     throw Components::InvalidName();
288   }
289
290   return _res._retn();
291 }
292
293 Components::Cookie *
294 MICO_CCM_impls::
295 Auktion_Bieter_impl::subscribe (const char * _name, Components::EventConsumerBase_ptr _ref)
296 {
297   throw Components::InvalidName();
298   return new MICO::CCM::Cookie_impl;
299 }
300
301 void
302 MICO_CCM_impls::
303 Auktion_Bieter_impl::unsubscribe (const char * _name, Components::Cookie * _ck)
304 {
305   throw Components::InvalidName();
306 }
307
308 Components::PublisherDescriptions *
309 MICO_CCM_impls::
310 Auktion_Bieter_impl::get_all_publishers ()
311 {
312   Components::NameList _allnames;
313   _allnames.length (0);
314   return get_named_publishers (_allnames);
315 }
316
317 Components::PublisherDescriptions *
318 MICO_CCM_impls::
319 Auktion_Bieter_impl::get_named_publishers (const Components::NameList & _names)
320 {
321   Components::PublisherDescriptions_var _res = new Components::PublisherDescriptions;
322   _res->length (_names.length());
323
324   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
325     throw Components::InvalidName();
326   }
327
328   return _res._retn();
329 }
330
331 void
332 MICO_CCM_impls::
333 Auktion_Bieter_impl::connect_consumer (const char * _name, Components::EventConsumerBase_ptr _ref)
334 {
335   throw Components::InvalidName();
336 }
337
338 Components::EventConsumerBase_ptr
339 MICO_CCM_impls::
340 Auktion_Bieter_impl::disconnect_consumer (const char * _name)
341 {
342   throw Components::InvalidName();
343 }
344
345 Components::EmitterDescriptions *
346 MICO_CCM_impls::
347 Auktion_Bieter_impl::get_all_emitters ()
348 {
349   Components::NameList _allnames;
350   _allnames.length (0);
351   return get_named_emitters (_allnames);
352 }
353
354 Components::EmitterDescriptions *
355 MICO_CCM_impls::
356 Auktion_Bieter_impl::get_named_emitters (const Components::NameList & _names)
357 {
358   Components::EmitterDescriptions_var _res = new Components::EmitterDescriptions;
359   _res->length (_names.length());
360
361   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
362     throw Components::InvalidName();
363   }
364
365   return _res._retn();
366 }
367
368 /* * Inherited CCMObject interface */
369
370 CORBA::Object_ptr
371 MICO_CCM_impls::
372 Auktion_Bieter_impl::get_component_def ()
373 {
374   return CORBA::Object::_nil ();
375 }
376
377 Components::CCMHome_ptr
378 MICO_CCM_impls::
379 Auktion_Bieter_impl::get_ccm_home ()
380 {
381   return _container->get_reference_for_home ();
382 }
383
384 void
385 MICO_CCM_impls::
386 Auktion_Bieter_impl::configuration_complete ()
387 {
388   _container->configuration_complete (this);
389   Components::SessionComponent_ptr _sc =
390     Components::SessionComponent::_narrow (_instance);
391   if (!CORBA::is_nil (_sc)) {
392     _sc->set_session_context (_context);
393     _sc->ccm_activate ();
394   }
395 }
396
397 Components::ComponentPortDescription *
398 MICO_CCM_impls::
399 Auktion_Bieter_impl::get_all_ports ()
400 {
401   Components::FacetDescriptions_var _fds = get_all_facets ();
402   Components::ReceptacleDescriptions_var _rds = get_all_receptacles ();
403   Components::ConsumerDescriptions_var _cds = get_all_consumers ();
404   Components::EmitterDescriptions_var _eds = get_all_emitters ();
405   Components::PublisherDescriptions_var _pds = get_all_publishers ();
406
407   Components::ComponentPortDescription_var _cpd =
408     new MICO::CCM::ComponentPortDescription_impl;
409
410   _cpd->facets (_fds.in());
411   _cpd->receptacles (_rds.in());
412   _cpd->consumers (_cds.in());
413   _cpd->emitters (_eds.in());
414   _cpd->publishers (_pds.in());
415
416   return _cpd._retn();
417 }
418
419 void
420 MICO_CCM_impls::
421 Auktion_Bieter_impl::remove ()
422 {
423   Components::CCMHome_var myhome = get_ccm_home ();
424   Components::CCMObject_var myself = _container->get_reference_for_component (this);
425   myhome->remove_component (myself);
426 }
427
428 /* * Overload default implementation */
429
430 CORBA::Object_ptr
431 MICO_CCM_impls::
432 Auktion_Bieter_impl::_get_component ()
433 {
434   return _container->get_reference_for_component (this);
435 }
436
437 /* * Glue class for consumer gebote of component Auktion::Bieter * type Auktion::Gebot */
438
439 MICO_CCM_impls::
440 Auktion_Bieter_gebote_impl::Auktion_Bieter_gebote_impl (Auktion_Bieter_impl * _g)
441 {
442   _glue = _g;
443 }
444
445 MICO_CCM_impls::
446 Auktion_Bieter_gebote_impl::~Auktion_Bieter_gebote_impl ()
447 {
448 }
449
450 void
451 MICO_CCM_impls::
452 Auktion_Bieter_gebote_impl::push_event (Components::EventBase * ev)
453 {
454   Auktion::Gebot * tev = Auktion::Gebot::_downcast (ev);
455   if (tev == 0 && ev != 0) {
456     throw Components::BadEventType ((const char *) "Auktion::Gebot");
457   }
458   push_Gebot (tev);
459 }
460
461 void
462 MICO_CCM_impls::
463 Auktion_Bieter_gebote_impl::push_Gebot (Auktion::Gebot * tev)
464 {
465   _glue->_instance->push_gebote (tev);
466 }
467
468 /* * Context class for component Auktion::Bieter */
469
470 MICO_CCM_impls::
471 Auktion_Bieter_Context_impl::Auktion_Bieter_Context_impl (Auktion_Bieter_impl * _g, MICO::CCM::SessionContainer * _c)
472 {
473   _glue = _g;
474   _container = _c;
475 }
476
477 MICO_CCM_impls::
478 Auktion_Bieter_Context_impl::~Auktion_Bieter_Context_impl ()
479 {
480 }
481
482 Auktion::Bieter::versteigerungenConnections *
483 MICO_CCM_impls::
484 Auktion_Bieter_Context_impl::get_connections_versteigerungen ()
485 {
486   return _glue->get_connections_versteigerungen ();
487 }
488
489 Components::CCMHome_ptr
490 MICO_CCM_impls::
491 Auktion_Bieter_Context_impl::get_CCM_home ()
492 {
493   return _container->get_CCM_home ();
494 }
495
496 CORBA::Object_ptr
497 MICO_CCM_impls::
498 Auktion_Bieter_Context_impl::get_CCM_object ()
499 {
500   return _container->get_CCM_object (_glue->_instance);
501 }
502
503 /* * Glue class for component Auktion::Verkaeufer */
504
505 MICO_CCM_impls::
506 Auktion_Verkaeufer_impl::Auktion_Verkaeufer_impl (Auktion::CCM_Verkaeufer * i, MICO::CCM::SessionContainer * c)
507   : _instance (i), _container (c)
508 {
509   _context = new Auktion_Verkaeufer_Context_impl (this, c);
510 }
511
512 MICO_CCM_impls::
513 Auktion_Verkaeufer_impl::~Auktion_Verkaeufer_impl ()
514 {
515   delete _instance;
516   delete _context;
517 }
518
519 /* * Component Attributes */
520
521 /* * Supported Interfaces */
522
523 /* * Equivalent IDL methods */
524
525 // no facets
526
527 // receptacles
528
529 void
530 MICO_CCM_impls::
531 Auktion_Verkaeufer_impl::connect_handelsplatz (Auktion::VersteigerungsFabrik_ptr _value)
532 {
533   _for_recep_handelsplatz = Auktion::VersteigerungsFabrik::_duplicate (_value);
534 }
535
536 Auktion::VersteigerungsFabrik_ptr
537 MICO_CCM_impls::
538 Auktion_Verkaeufer_impl::disconnect_handelsplatz ()
539 {
540   Auktion::VersteigerungsFabrik_var _res = Auktion::VersteigerungsFabrik::_duplicate (_for_recep_handelsplatz);
541   _for_recep_handelsplatz = Auktion::VersteigerungsFabrik::_nil ();
542   return _res._retn ();
543 }
544
545 Auktion::VersteigerungsFabrik_ptr
546 MICO_CCM_impls::
547 Auktion_Verkaeufer_impl::get_connection_handelsplatz ()
548 {
549   return Auktion::VersteigerungsFabrik::_duplicate (_for_recep_handelsplatz);
550 }
551
552 // no publishers
553
554 // no emitters
555
556 // consumers
557
558 ::Auktion::KaufConsumer_ptr
559 MICO_CCM_impls::
560 Auktion_Verkaeufer_impl::get_consumer_zuschlag ()
561 {
562   if (CORBA::is_nil (_for_consumer_zuschlag)) {
563     PortableServer::ServantBase_var _consumer_servant =
564       new Auktion_Verkaeufer_zuschlag_impl (this);
565     CORBA::Object_var _ref =
566       _container->activate_facet (this, "zuschlag",
567                                   CORBA::LocalObject::_nil(),
568                                   _consumer_servant)
;
569     _for_consumer_zuschlag =
570       ::Auktion::KaufConsumer::_narrow (_ref);
571   }
572
573   return ::Auktion::KaufConsumer::_duplicate (_for_consumer_zuschlag);
574 }
575
576 /* * Inherited Navigation interface */
577
578 CORBA::Object_ptr
579 MICO_CCM_impls::
580 Auktion_Verkaeufer_impl::provide_facet (const char * _name)
581 {
582   throw Components::InvalidName();
583   return CORBA::Object::_nil ();
584 }
585
586 Components::FacetDescriptions *
587 MICO_CCM_impls::
588 Auktion_Verkaeufer_impl::get_all_facets ()
589 {
590   Components::NameList _allnames;
591   _allnames.length (0);
592   return get_named_facets (_allnames);
593 }
594
595 Components::FacetDescriptions *
596 MICO_CCM_impls::
597 Auktion_Verkaeufer_impl::get_named_facets (const Components::NameList & _names)
598 {
599   Components::FacetDescriptions_var _res = new Components::FacetDescriptions;
600   _res->length (_names.length());
601
602   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
603     throw Components::InvalidName();
604   }
605
606   return _res._retn();
607 }
608
609 CORBA::Boolean
610 MICO_CCM_impls::
611 Auktion_Verkaeufer_impl::same_component (CORBA::Object_ptr _ref)
612 {
613   return 0;
614 }
615
616 /* * Inherited Receptacles interface */
617
618 Components::Cookie *
619 MICO_CCM_impls::
620 Auktion_Verkaeufer_impl::connect (const char * _name, CORBA::Object_ptr _ref)
621 {
622   if (strcmp (_name, "handelsplatz") == 0) {
623     ::Auktion::VersteigerungsFabrik_var _tref = ::Auktion::VersteigerungsFabrik::_narrow (_ref);
624     if (CORBA::is_nil (_tref) && !CORBA::is_nil (_ref)) {
625       throw Components::InvalidConnection();
626     }
627     connect_handelsplatz (_tref);
628     return 0;
629   }
630
631   throw Components::InvalidName();
632   return new MICO::CCM::Cookie_impl;
633 }
634
635 void
636 MICO_CCM_impls::
637 Auktion_Verkaeufer_impl::disconnect (const char * _name, Components::Cookie * _ck)
638 {
639   if (strcmp (_name, "handelsplatz") == 0) {
640     ::Auktion::VersteigerungsFabrik_var _dummy;
641     _dummy = disconnect_handelsplatz ();
642     return;
643   }
644
645   throw Components::InvalidName();
646 }
647
648 Components::ConnectionDescriptions *
649 MICO_CCM_impls::
650 Auktion_Verkaeufer_impl::get_connections (const char * _name)
651 {
652   Components::NameList _thename (1);
653   _thename[0] = _name;
654   Components::ReceptacleDescriptions_var _rdv = get_named_receptacles (_thename);
655   return new Components::ConnectionDescriptions (_rdv[(CORBA::ULong)0]->connections());
656 }
657 Components::ReceptacleDescriptions *
658 MICO_CCM_impls::
659 Auktion_Verkaeufer_impl::get_all_receptacles ()
660 {
661   Components::NameList _allnames;
662   _allnames.length (1);
663   _allnames[0] = CORBA::string_dup ("handelsplatz");
664   return get_named_receptacles (_allnames);
665 }
666
667 Components::ReceptacleDescriptions *
668 MICO_CCM_impls::
669 Auktion_Verkaeufer_impl::get_named_receptacles (const Components::NameList & _names)
670 {
671   Components::ReceptacleDescriptions_var _res = new Components::ReceptacleDescriptions;
672   _res->length (_names.length());
673
674   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
675     if (strcmp (_names[_idx].in(), "handelsplatz") == 0) {
676       _res[_idx] = new MICO::CCM::ReceptacleDescription_impl;
677       _res[_idx]->name ((const char *) "handelsplatz");
678       _res[_idx]->type_id ((const char *) "IDL:r4/Auktion/VersteigerungsFabrik:1.0");
679       _res[_idx]->is_multiplex (0);
680       if (!CORBA::is_nil (_for_recep_handelsplatz)) {
681         _res[_idx]->connections().length(1);
682         _res[_idx]->connections()[0] =
683           new MICO::CCM::ConnectionDescription_impl;
684         _res[_idx]->connections()[0]->ck (0);
685         _res[_idx]->connections()[0]->objref (_for_recep_handelsplatz);
686       }
687       continue;
688     }
689
690     throw Components::InvalidName();
691   }
692
693   return _res._retn();
694 }
695
696 /* * Inherited Events interface */
697
698 Components::EventConsumerBase_ptr
699 MICO_CCM_impls::
700 Auktion_Verkaeufer_impl::get_consumer (const char * _name)
701 {
702   if (strcmp (_name, "zuschlag") == 0) {
703     return get_consumer_zuschlag ();
704   }
705   throw Components::InvalidName();
706   return Components::EventConsumerBase::_nil ();
707 }
708
709 Components::ConsumerDescriptions *
710 MICO_CCM_impls::
711 Auktion_Verkaeufer_impl::get_all_consumers ()
712 {
713   Components::NameList _allnames;
714   _allnames.length (1);
715   _allnames[0] = CORBA::string_dup ("zuschlag");
716   return get_named_consumers (_allnames);
717 }
718
719 Components::ConsumerDescriptions *
720 MICO_CCM_impls::
721 Auktion_Verkaeufer_impl::get_named_consumers (const Components::NameList & _names)
722 {
723   Components::ConsumerDescriptions_var _res = new Components::ConsumerDescriptions;
724   _res->length (_names.length());
725
726   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
727     if (strcmp (_names[_idx].in(), "zuschlag") == 0) {
728       _res[_idx] = new MICO::CCM::ConsumerDescription_impl;
729       _res[_idx]->name ((const char *) "zuschlag");
730       _res[_idx]->type_id ((const char *) "IDL:r4/Auktion/Kauf:1.0");
731       Components::EventConsumerBase_var _tmp =
732         get_consumer ("zuschlag");
733       _res[_idx]->consumer (_tmp);
734       continue;
735     }
736
737     throw Components::InvalidName();
738   }
739
740   return _res._retn();
741 }
742
743 Components::Cookie *
744 MICO_CCM_impls::
745 Auktion_Verkaeufer_impl::subscribe (const char * _name, Components::EventConsumerBase_ptr _ref)
746 {
747   throw Components::InvalidName();
748   return new MICO::CCM::Cookie_impl;
749 }
750
751 void
752 MICO_CCM_impls::
753 Auktion_Verkaeufer_impl::unsubscribe (const char * _name, Components::Cookie * _ck)
754 {
755   throw Components::InvalidName();
756 }
757
758 Components::PublisherDescriptions *
759 MICO_CCM_impls::
760 Auktion_Verkaeufer_impl::get_all_publishers ()
761 {
762   Components::NameList _allnames;
763   _allnames.length (0);
764   return get_named_publishers (_allnames);
765 }
766
767 Components::PublisherDescriptions *
768 MICO_CCM_impls::
769 Auktion_Verkaeufer_impl::get_named_publishers (const Components::NameList & _names)
770 {
771   Components::PublisherDescriptions_var _res = new Components::PublisherDescriptions;
772   _res->length (_names.length());
773
774   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
775     throw Components::InvalidName();
776   }
777
778   return _res._retn();
779 }
780
781 void
782 MICO_CCM_impls::
783 Auktion_Verkaeufer_impl::connect_consumer (const char * _name, Components::EventConsumerBase_ptr _ref)
784 {
785   throw Components::InvalidName();
786 }
787
788 Components::EventConsumerBase_ptr
789 MICO_CCM_impls::
790 Auktion_Verkaeufer_impl::disconnect_consumer (const char * _name)
791 {
792   throw Components::InvalidName();
793 }
794
795 Components::EmitterDescriptions *
796 MICO_CCM_impls::
797 Auktion_Verkaeufer_impl::get_all_emitters ()
798 {
799   Components::NameList _allnames;
800   _allnames.length (0);
801   return get_named_emitters (_allnames);
802 }
803
804 Components::EmitterDescriptions *
805 MICO_CCM_impls::
806 Auktion_Verkaeufer_impl::get_named_emitters (const Components::NameList & _names)
807 {
808   Components::EmitterDescriptions_var _res = new Components::EmitterDescriptions;
809   _res->length (_names.length());
810
811   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
812     throw Components::InvalidName();
813   }
814
815   return _res._retn();
816 }
817
818 /* * Inherited CCMObject interface */
819
820 CORBA::Object_ptr
821 MICO_CCM_impls::
822 Auktion_Verkaeufer_impl::get_component_def ()
823 {
824   return CORBA::Object::_nil ();
825 }
826
827 Components::CCMHome_ptr
828 MICO_CCM_impls::
829 Auktion_Verkaeufer_impl::get_ccm_home ()
830 {
831   return _container->get_reference_for_home ();
832 }
833
834 void
835 MICO_CCM_impls::
836 Auktion_Verkaeufer_impl::configuration_complete ()
837 {
838   _container->configuration_complete (this);
839   Components::SessionComponent_ptr _sc =
840     Components::SessionComponent::_narrow (_instance);
841   if (!CORBA::is_nil (_sc)) {
842     _sc->set_session_context (_context);
843     _sc->ccm_activate ();
844   }
845 }
846
847 Components::ComponentPortDescription *
848 MICO_CCM_impls::
849 Auktion_Verkaeufer_impl::get_all_ports ()
850 {
851   Components::FacetDescriptions_var _fds = get_all_facets ();
852   Components::ReceptacleDescriptions_var _rds = get_all_receptacles ();
853   Components::ConsumerDescriptions_var _cds = get_all_consumers ();
854   Components::EmitterDescriptions_var _eds = get_all_emitters ();
855   Components::PublisherDescriptions_var _pds = get_all_publishers ();
856
857   Components::ComponentPortDescription_var _cpd =
858     new MICO::CCM::ComponentPortDescription_impl;
859
860   _cpd->facets (_fds.in());
861   _cpd->receptacles (_rds.in());
862   _cpd->consumers (_cds.in());
863   _cpd->emitters (_eds.in());
864   _cpd->publishers (_pds.in());
865
866   return _cpd._retn();
867 }
868
869 void
870 MICO_CCM_impls::
871 Auktion_Verkaeufer_impl::remove ()
872 {
873   Components::CCMHome_var myhome = get_ccm_home ();
874   Components::CCMObject_var myself = _container->get_reference_for_component (this);
875   myhome->remove_component (myself);
876 }
877
878 /* * Overload default implementation */
879
880 CORBA::Object_ptr
881 MICO_CCM_impls::
882 Auktion_Verkaeufer_impl::_get_component ()
883 {
884   return _container->get_reference_for_component (this);
885 }
886
887 /* * Glue class for consumer zuschlag of component Auktion::Verkaeufer * type Auktion::Kauf */
888
889 MICO_CCM_impls::
890 Auktion_Verkaeufer_zuschlag_impl::Auktion_Verkaeufer_zuschlag_impl (Auktion_Verkaeufer_impl * _g)
891 {
892   _glue = _g;
893 }
894
895 MICO_CCM_impls::
896 Auktion_Verkaeufer_zuschlag_impl::~Auktion_Verkaeufer_zuschlag_impl ()
897 {
898 }
899
900 void
901 MICO_CCM_impls::
902 Auktion_Verkaeufer_zuschlag_impl::push_event (Components::EventBase * ev)
903 {
904   Auktion::Kauf * tev = Auktion::Kauf::_downcast (ev);
905   if (tev == 0 && ev != 0) {
906     throw Components::BadEventType ((const char *) "Auktion::Kauf");
907   }
908   push_Kauf (tev);
909 }
910
911 void
912 MICO_CCM_impls::
913 Auktion_Verkaeufer_zuschlag_impl::push_Kauf (Auktion::Kauf * tev)
914 {
915   _glue->_instance->push_zuschlag (tev);
916 }
917
918 /* * Context class for component Auktion::Verkaeufer */
919
920 MICO_CCM_impls::
921 Auktion_Verkaeufer_Context_impl::Auktion_Verkaeufer_Context_impl (Auktion_Verkaeufer_impl * _g, MICO::CCM::SessionContainer * _c)
922 {
923   _glue = _g;
924   _container = _c;
925 }
926
927 MICO_CCM_impls::
928 Auktion_Verkaeufer_Context_impl::~Auktion_Verkaeufer_Context_impl ()
929 {
930 }
931
932 Auktion::VersteigerungsFabrik_ptr
933 MICO_CCM_impls::
934 Auktion_Verkaeufer_Context_impl::get_connection_handelsplatz ()
935 {
936   return _glue->get_connection_handelsplatz ();
937 }
938
939 Components::CCMHome_ptr
940 MICO_CCM_impls::
941 Auktion_Verkaeufer_Context_impl::get_CCM_home ()
942 {
943   return _container->get_CCM_home ();
944 }
945
946 CORBA::Object_ptr
947 MICO_CCM_impls::
948 Auktion_Verkaeufer_Context_impl::get_CCM_object ()
949 {
950   return _container->get_CCM_object (_glue->_instance);
951 }
952
953 /* * Glue class for component Auktion::Auktionshaus */
954
955 MICO_CCM_impls::
956 Auktion_Auktionshaus_impl::Auktion_Auktionshaus_impl (Auktion::CCM_Auktionshaus * i, MICO::CCM::SessionContainer * c)
957   : _instance (i), _container (c)
958 {
959   _context = new Auktion_Auktionshaus_Context_impl (this, c);
960   _glue_for_facet_auktionen = 0;
961   _instance_for_facet_auktionen = Auktion::CCM_VersteigerungsFabrik::_nil ();
962   _cookie_for_gebote = 0;
963 }
964
965 MICO_CCM_impls::
966 Auktion_Auktionshaus_impl::~Auktion_Auktionshaus_impl ()
967 {
968   delete _instance;
969   delete _context;
970 }
971
972 /* * Component Attributes */
973
974 /* * Supported Interfaces */
975
976 /* * Equivalent IDL methods */
977
978 // facets
979
980 Auktion::VersteigerungsFabrik_ptr
981 MICO_CCM_impls::
982 Auktion_Auktionshaus_impl::provide_auktionen ()
983 {
984   if (CORBA::is_nil (_instance_for_facet_auktionen)) {
985     _instance_for_facet_auktionen = _instance->get_auktionen ();
986   }
987   if (_glue_for_facet_auktionen.in() == 0) {
988     _glue_for_facet_auktionen =
989       new Auktion_Auktionshaus_auktionen_impl (this);
990     CORBA::Object_var _facet_ref =
991       _container->activate_facet (this, "auktionen",
992                                   _instance_for_facet_auktionen,
993                                   _glue_for_facet_auktionen)
;
994     _reference_for_facet_auktionen =
995       Auktion::VersteigerungsFabrik::_narrow (_facet_ref);
996   }
997   return Auktion::VersteigerungsFabrik::_duplicate (_reference_for_facet_auktionen);
998 }
999
1000 // no receptacles
1001
1002 // publishers
1003
1004 Components::Cookie *
1005 MICO_CCM_impls::
1006 Auktion_Auktionshaus_impl::subscribe_gebote (::Auktion::GebotConsumer_ptr consumer)
1007 {
1008   Components::Cookie_var _ck = new MICO::CCM::Cookie_impl;
1009   _ck->CookieValue().replace (sizeof (CORBA::ULong), sizeof (CORBA::ULong), (CORBA::Octet *) &_cookie_for_gebote);
1010   _cookie_for_gebote++;
1011   CORBA::ULong _idx = _for_publisher_gebote.length ();
1012   _for_publisher_gebote.length (_idx + 1);
1013   _for_publisher_gebote[_idx] = new MICO::CCM::SubscriberDescription_impl;
1014   _for_publisher_gebote[_idx]->ck (_ck);
1015   _for_publisher_gebote[_idx]->consumer (consumer);
1016   return _ck._retn();
1017 }
1018
1019 ::Auktion::GebotConsumer_ptr
1020 MICO_CCM_impls::
1021 Auktion_Auktionshaus_impl::unsubscribe_gebote (Components::Cookie * _value)
1022 {
1023   CORBA::ULong _idx, _ck1, _ck2;
1024   if (!_value || _value->CookieValue().length() != sizeof (CORBA::ULong)) {
1025     throw Components::InvalidConnection();
1026   }
1027
1028   _ck1 = * ((CORBA::ULong *) _value->CookieValue().get_buffer());
1029
1030   for (_idx=0; _idx<_for_publisher_gebote.length(); _idx++) {
1031     _ck2 = * ((CORBA::ULong *) _for_publisher_gebote[_idx]->ck()->CookieValue().get_buffer());
1032     if (_ck1 == _ck2) break;
1033   }
1034
1035   if (_idx == _for_publisher_gebote.length()) {
1036     throw Components::InvalidConnection();
1037   }
1038
1039   ::Auktion::GebotConsumer_var _res = ::Auktion::GebotConsumer::_narrow (_for_publisher_gebote[_idx]->consumer());
1040
1041   for (;_idx<_for_publisher_gebote.length()-1; _idx++) {
1042     _for_publisher_gebote[_idx] = _for_publisher_gebote[_idx+1];
1043   }
1044
1045   _for_publisher_gebote.length (_idx);
1046   return _res._retn();
1047 }
1048
1049 // no emitters
1050
1051 // no consumers
1052
1053 /* * Inherited Navigation interface */
1054
1055 CORBA::Object_ptr
1056 MICO_CCM_impls::
1057 Auktion_Auktionshaus_impl::provide_facet (const char * _name)
1058 {
1059   if (strcmp (_name, "auktionen") == 0) {
1060     return provide_auktionen ();
1061   }
1062   throw Components::InvalidName();
1063   return CORBA::Object::_nil ();
1064 }
1065
1066 Components::FacetDescriptions *
1067 MICO_CCM_impls::
1068 Auktion_Auktionshaus_impl::get_all_facets ()
1069 {
1070   Components::NameList _allnames;
1071   _allnames.length (1);
1072   _allnames[0] = CORBA::string_dup ("auktionen");
1073   return get_named_facets (_allnames);
1074 }
1075
1076 Components::FacetDescriptions *
1077 MICO_CCM_impls::
1078 Auktion_Auktionshaus_impl::get_named_facets (const Components::NameList & _names)
1079 {
1080   Components::FacetDescriptions_var _res = new Components::FacetDescriptions;
1081   _res->length (_names.length());
1082
1083   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
1084     if (strcmp (_names[_idx].in(), "auktionen") == 0) {
1085       _res[_idx] = new MICO::CCM::FacetDescription_impl;
1086       _res[_idx]->name ((const char *) "auktionen");
1087       _res[_idx]->type_id ((const char *) "IDL:r4/Auktion/VersteigerungsFabrik:1.0");
1088       _res[_idx]->facet_ref (provide_facet ("auktionen"));
1089       continue;
1090     }
1091
1092     throw Components::InvalidName();
1093   }
1094
1095   return _res._retn();
1096 }
1097
1098 CORBA::Boolean
1099 MICO_CCM_impls::
1100 Auktion_Auktionshaus_impl::same_component (CORBA::Object_ptr _ref)
1101 {
1102   return 0;
1103 }
1104
1105 /* * Inherited Receptacles interface */
1106
1107 Components::Cookie *
1108 MICO_CCM_impls::
1109 Auktion_Auktionshaus_impl::connect (const char * _name, CORBA::Object_ptr _ref)
1110 {
1111   throw Components::InvalidName();
1112   return new MICO::CCM::Cookie_impl;
1113 }
1114
1115 void
1116 MICO_CCM_impls::
1117 Auktion_Auktionshaus_impl::disconnect (const char * _name, Components::Cookie * _ck)
1118 {
1119   throw Components::InvalidName();
1120 }
1121
1122 Components::ConnectionDescriptions *
1123 MICO_CCM_impls::
1124 Auktion_Auktionshaus_impl::get_connections (const char * _name)
1125 {
1126   Components::NameList _thename (1);
1127   _thename[0] = _name;
1128   Components::ReceptacleDescriptions_var _rdv = get_named_receptacles (_thename);
1129   return new Components::ConnectionDescriptions (_rdv[(CORBA::ULong)0]->connections());
1130 }
1131 Components::ReceptacleDescriptions *
1132 MICO_CCM_impls::
1133 Auktion_Auktionshaus_impl::get_all_receptacles ()
1134 {
1135   Components::NameList _allnames;
1136   _allnames.length (0);
1137   return get_named_receptacles (_allnames);
1138 }
1139
1140 Components::ReceptacleDescriptions *
1141 MICO_CCM_impls::
1142 Auktion_Auktionshaus_impl::get_named_receptacles (const Components::NameList & _names)
1143 {
1144   Components::ReceptacleDescriptions_var _res = new Components::ReceptacleDescriptions;
1145   _res->length (_names.length());
1146
1147   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
1148     throw Components::InvalidName();
1149   }
1150
1151   return _res._retn();
1152 }
1153
1154 /* * Inherited Events interface */
1155
1156 Components::EventConsumerBase_ptr
1157 MICO_CCM_impls::
1158 Auktion_Auktionshaus_impl::get_consumer (const char * _name)
1159 {
1160   throw Components::InvalidName();
1161   return Components::EventConsumerBase::_nil ();
1162 }
1163
1164 Components::ConsumerDescriptions *
1165 MICO_CCM_impls::
1166 Auktion_Auktionshaus_impl::get_all_consumers ()
1167 {
1168   Components::NameList _allnames;
1169   _allnames.length (0);
1170   return get_named_consumers (_allnames);
1171 }
1172
1173 Components::ConsumerDescriptions *
1174 MICO_CCM_impls::
1175 Auktion_Auktionshaus_impl::get_named_consumers (const Components::NameList & _names)
1176 {
1177   Components::ConsumerDescriptions_var _res = new Components::ConsumerDescriptions;
1178   _res->length (_names.length());
1179
1180   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
1181     throw Components::InvalidName();
1182   }
1183
1184   return _res._retn();
1185 }
1186
1187 Components::Cookie *
1188 MICO_CCM_impls::
1189 Auktion_Auktionshaus_impl::subscribe (const char * _name, Components::EventConsumerBase_ptr _ref)
1190 {
1191   if (strcmp (_name, "gebote") == 0) {
1192     ::Auktion::GebotConsumer_var _tref =
1193       ::Auktion::GebotConsumer::_narrow (_ref);
1194     if (CORBA::is_nil (_tref) && !CORBA::is_nil (_ref)) {
1195       throw Components::InvalidConnection();
1196     }
1197     return subscribe_gebote (_tref);
1198   }
1199
1200   throw Components::InvalidName();
1201   return new MICO::CCM::Cookie_impl;
1202 }
1203
1204 void
1205 MICO_CCM_impls::
1206 Auktion_Auktionshaus_impl::unsubscribe (const char * _name, Components::Cookie * _ck)
1207 {
1208   if (strcmp (_name, "gebote") == 0) {
1209     Components::EventConsumerBase_var _dummy;
1210     _dummy = unsubscribe_gebote (_ck);
1211     return;
1212   }
1213
1214   throw Components::InvalidName();
1215 }
1216
1217 Components::PublisherDescriptions *
1218 MICO_CCM_impls::
1219 Auktion_Auktionshaus_impl::get_all_publishers ()
1220 {
1221   Components::NameList _allnames;
1222   _allnames.length (1);
1223   _allnames[0] = CORBA::string_dup ("gebote");
1224   return get_named_publishers (_allnames);
1225 }
1226
1227 Components::PublisherDescriptions *
1228 MICO_CCM_impls::
1229 Auktion_Auktionshaus_impl::get_named_publishers (const Components::NameList & _names)
1230 {
1231   Components::PublisherDescriptions_var _res = new Components::PublisherDescriptions;
1232   _res->length (_names.length());
1233
1234   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
1235     if (strcmp (_names[_idx].in(), "gebote") == 0) {
1236       _res[_idx] = new MICO::CCM::PublisherDescription_impl;
1237       _res[_idx]->name ((const char *) "gebote");
1238       _res[_idx]->type_id ((const char *) "IDL:r4/Auktion/Gebot:1.0");
1239       _res[_idx]->consumers (_for_publisher_gebote);
1240       continue;
1241     }
1242
1243     throw Components::InvalidName();
1244   }
1245
1246   return _res._retn();
1247 }
1248
1249 void
1250 MICO_CCM_impls::
1251 Auktion_Auktionshaus_impl::connect_consumer (const char * _name, Components::EventConsumerBase_ptr _ref)
1252 {
1253   throw Components::InvalidName();
1254 }
1255
1256 Components::EventConsumerBase_ptr
1257 MICO_CCM_impls::
1258 Auktion_Auktionshaus_impl::disconnect_consumer (const char * _name)
1259 {
1260   throw Components::InvalidName();
1261 }
1262
1263 Components::EmitterDescriptions *
1264 MICO_CCM_impls::
1265 Auktion_Auktionshaus_impl::get_all_emitters ()
1266 {
1267   Components::NameList _allnames;
1268   _allnames.length (0);
1269   return get_named_emitters (_allnames);
1270 }
1271
1272 Components::EmitterDescriptions *
1273 MICO_CCM_impls::
1274 Auktion_Auktionshaus_impl::get_named_emitters (const Components::NameList & _names)
1275 {
1276   Components::EmitterDescriptions_var _res = new Components::EmitterDescriptions;
1277   _res->length (_names.length());
1278
1279   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
1280     throw Components::InvalidName();
1281   }
1282
1283   return _res._retn();
1284 }
1285
1286 /* * Inherited CCMObject interface */
1287
1288 CORBA::Object_ptr
1289 MICO_CCM_impls::
1290 Auktion_Auktionshaus_impl::get_component_def ()
1291 {
1292   return CORBA::Object::_nil ();
1293 }
1294
1295 Components::CCMHome_ptr
1296 MICO_CCM_impls::
1297 Auktion_Auktionshaus_impl::get_ccm_home ()
1298 {
1299   return _container->get_reference_for_home ();
1300 }
1301
1302 void
1303 MICO_CCM_impls::
1304 Auktion_Auktionshaus_impl::configuration_complete ()
1305 {
1306   _container->configuration_complete (this);
1307   Components::SessionComponent_ptr _sc =
1308     Components::SessionComponent::_narrow (_instance);
1309   if (!CORBA::is_nil (_sc)) {
1310     _sc->set_session_context (_context);
1311     _sc->ccm_activate ();
1312   }
1313 }
1314
1315 Components::ComponentPortDescription *
1316 MICO_CCM_impls::
1317 Auktion_Auktionshaus_impl::get_all_ports ()
1318 {
1319   Components::FacetDescriptions_var _fds = get_all_facets ();
1320   Components::ReceptacleDescriptions_var _rds = get_all_receptacles ();
1321   Components::ConsumerDescriptions_var _cds = get_all_consumers ();
1322   Components::EmitterDescriptions_var _eds = get_all_emitters ();
1323   Components::PublisherDescriptions_var _pds = get_all_publishers ();
1324
1325   Components::ComponentPortDescription_var _cpd =
1326     new MICO::CCM::ComponentPortDescription_impl;
1327
1328   _cpd->facets (_fds.in());
1329   _cpd->receptacles (_rds.in());
1330   _cpd->consumers (_cds.in());
1331   _cpd->emitters (_eds.in());
1332   _cpd->publishers (_pds.in());
1333
1334   return _cpd._retn();
1335 }
1336
1337 void
1338 MICO_CCM_impls::
1339 Auktion_Auktionshaus_impl::remove ()
1340 {
1341   Components::CCMHome_var myhome = get_ccm_home ();
1342   Components::CCMObject_var myself = _container->get_reference_for_component (this);
1343   myhome->remove_component (myself);
1344 }
1345
1346 /* * Overload default implementation */
1347
1348 CORBA::Object_ptr
1349 MICO_CCM_impls::
1350 Auktion_Auktionshaus_impl::_get_component ()
1351 {
1352   return _container->get_reference_for_component (this);
1353 }
1354
1355 /* * Glue class for facet auktionen of component Auktion::Auktionshaus * type Auktion::VersteigerungsFabrik */
1356
1357 MICO_CCM_impls::
1358 Auktion_Auktionshaus_auktionen_impl::Auktion_Auktionshaus_auktionen_impl (Auktion_Auktionshaus_impl * _g)
1359 {
1360   _glue = _g;
1361 }
1362
1363 MICO_CCM_impls::
1364 Auktion_Auktionshaus_auktionen_impl::~Auktion_Auktionshaus_auktionen_impl ()
1365 {
1366 }
1367
1368 /* * Attributes */
1369
1370 /* * Operations */
1371
1372 Auktion::Versteigerung_ptr
1373 MICO_CCM_impls::
1374 Auktion_Auktionshaus_auktionen_impl::neue_auktion (const char* name, CORBA::Long minimalgebot, Auktion::Verkaeufer_ptr besitzer)
1375 {
1376   return _glue->_instance_for_facet_auktionen->neue_auktion (name, minimalgebot, besitzer);
1377 }
1378
1379 /* * Overload default implementation */
1380
1381 CORBA::Object_ptr
1382 MICO_CCM_impls::
1383 Auktion_Auktionshaus_auktionen_impl::_get_component ()
1384 {
1385   return _glue->_container->get_reference_for_component (_glue);
1386 }
1387
1388 /* * Context class for component Auktion::Auktionshaus */
1389
1390 MICO_CCM_impls::
1391 Auktion_Auktionshaus_Context_impl::Auktion_Auktionshaus_Context_impl (Auktion_Auktionshaus_impl * _g, MICO::CCM::SessionContainer * _c)
1392 {
1393   _glue = _g;
1394   _container = _c;
1395 }
1396
1397 MICO_CCM_impls::
1398 Auktion_Auktionshaus_Context_impl::~Auktion_Auktionshaus_Context_impl ()
1399 {
1400 }
1401
1402 void
1403 MICO_CCM_impls::
1404 Auktion_Auktionshaus_Context_impl::push_gebote (::Auktion::Gebot * ev)
1405 {
1406   for (CORBA::ULong idx=0; idx<_glue->_for_publisher_gebote.length(); idx++) {
1407     try {
1408       _glue->_for_publisher_gebote[idx]->consumer()->push_event (ev);
1409     }
1410      catch (...) {
1411     }
1412   }
1413 }
1414
1415 Components::CCMHome_ptr
1416 MICO_CCM_impls::
1417 Auktion_Auktionshaus_Context_impl::get_CCM_home ()
1418 {
1419   return _container->get_CCM_home ();
1420 }
1421
1422 CORBA::Object_ptr
1423 MICO_CCM_impls::
1424 Auktion_Auktionshaus_Context_impl::get_CCM_object ()
1425 {
1426   return _container->get_CCM_object (_glue->_instance);
1427 }
1428
1429 /* * Glue class for home Auktion::Welt */
1430
1431 MICO_CCM_impls::
1432 Auktion_Welt_impl::Auktion_Welt_impl (Auktion::CCM_Welt * i, MICO::CCM::SessionContainer * c)
1433   : _instance (i), _container (c)
1434 {
1435 }
1436
1437 MICO_CCM_impls::
1438 Auktion_Welt_impl::~Auktion_Welt_impl ()
1439 {
1440   delete _instance;
1441 }
1442
1443 /* * Implicit operations */
1444
1445 Auktion::Auktionshaus_ptr
1446 MICO_CCM_impls::
1447 Auktion_Welt_impl::create ()
1448 {
1449   Components::EnterpriseComponent_var _ci = _instance->create ();
1450   Auktion::CCM_Auktionshaus_ptr _ti =
1451     Auktion::CCM_Auktionshaus::_narrow (_ci);
1452   PortableServer::ServantBase_var _cs =
1453     new Auktion_Auktionshaus_impl (_ti, _container);
1454   Components::CCMObject_var _co =
1455     _container->activate_component (_ti, _cs.in());
1456   return Auktion::Auktionshaus::_narrow (_co);
1457 }
1458
1459 /* * Explicit operations */
1460
1461 // no factories
1462
1463 // no finders
1464
1465 // no attributes
1466
1467 // no operations
1468
1469 /* * Inherited CCMHome interface */
1470
1471 CORBA::Object_ptr
1472 MICO_CCM_impls::
1473 Auktion_Welt_impl::get_component_def ()
1474 {
1475   return CORBA::Object::_nil ();
1476 }
1477
1478 CORBA::Object_ptr
1479 MICO_CCM_impls::
1480 Auktion_Welt_impl::get_home_def ()
1481 {
1482   return CORBA::Object::_nil ();
1483 }
1484
1485 void
1486 MICO_CCM_impls::
1487 Auktion_Welt_impl::remove_component (Components::CCMObject_ptr _co)
1488 {
1489   PortableServer::ServantBase_var _cs =
1490     _container->get_skeleton_for_reference (_co);
1491   CORBA::LocalObject_var _ci =
1492     _container->get_instance_for_component (_cs.in());
1493   Auktion::CCM_Auktionshaus_var _cti =
1494     Auktion::CCM_Auktionshaus::_narrow (_ci.in());
1495
1496   Components::SessionComponent_var _sc =
1497     Components::SessionComponent::_narrow (_ci);
1498   if (!CORBA::is_nil (_sc)) {
1499     _sc->ccm_passivate ();
1500     _sc->ccm_remove ();
1501   }
1502   _container->deactivate_component (_cs);
1503 }
1504
1505 /* * Inherited KeylessCCMHome interface */
1506
1507 Components::CCMObject_ptr
1508 MICO_CCM_impls::
1509 Auktion_Welt_impl::create_component ()
1510 {
1511   return create ();
1512 }
1513
1514 /* * Glue class for component Auktion::ProduktFilter */
1515
1516 MICO_CCM_impls::
1517 Auktion_ProduktFilter_impl::Auktion_ProduktFilter_impl (Auktion::CCM_ProduktFilter * i, MICO::CCM::SessionContainer * c)
1518   : _instance (i), _container (c)
1519 {
1520   _context = new Auktion_ProduktFilter_Context_impl (this, c);
1521   _cookie_for_interessante_gebote = 0;
1522 }
1523
1524 MICO_CCM_impls::
1525 Auktion_ProduktFilter_impl::~Auktion_ProduktFilter_impl ()
1526 {
1527   delete _instance;
1528   delete _context;
1529 }
1530
1531 /* * Component Attributes */
1532
1533 char*
1534 MICO_CCM_impls::
1535 Auktion_ProduktFilter_impl::interessanter_gegenstand ()
1536 {
1537   return _instance->interessanter_gegenstand ();
1538 }
1539
1540 void
1541 MICO_CCM_impls::
1542 Auktion_ProduktFilter_impl::interessanter_gegenstand (const char* _value)
1543 {
1544   _instance->interessanter_gegenstand (_value);
1545 }
1546
1547 /* * Supported Interfaces */
1548
1549 /* * Equivalent IDL methods */
1550
1551 // no facets
1552
1553 // no receptacles
1554
1555 // publishers
1556
1557 Components::Cookie *
1558 MICO_CCM_impls::
1559 Auktion_ProduktFilter_impl::subscribe_interessante_gebote (::Auktion::GebotConsumer_ptr consumer)
1560 {
1561   Components::Cookie_var _ck = new MICO::CCM::Cookie_impl;
1562   _ck->CookieValue().replace (sizeof (CORBA::ULong), sizeof (CORBA::ULong), (CORBA::Octet *) &_cookie_for_interessante_gebote);
1563   _cookie_for_interessante_gebote++;
1564   CORBA::ULong _idx = _for_publisher_interessante_gebote.length ();
1565   _for_publisher_interessante_gebote.length (_idx + 1);
1566   _for_publisher_interessante_gebote[_idx] = new MICO::CCM::SubscriberDescription_impl;
1567   _for_publisher_interessante_gebote[_idx]->ck (_ck);
1568   _for_publisher_interessante_gebote[_idx]->consumer (consumer);
1569   return _ck._retn();
1570 }
1571
1572 ::Auktion::GebotConsumer_ptr
1573 MICO_CCM_impls::
1574 Auktion_ProduktFilter_impl::unsubscribe_interessante_gebote (Components::Cookie * _value)
1575 {
1576   CORBA::ULong _idx, _ck1, _ck2;
1577   if (!_value || _value->CookieValue().length() != sizeof (CORBA::ULong)) {
1578     throw Components::InvalidConnection();
1579   }
1580
1581   _ck1 = * ((CORBA::ULong *) _value->CookieValue().get_buffer());
1582
1583   for (_idx=0; _idx<_for_publisher_interessante_gebote.length(); _idx++) {
1584     _ck2 = * ((CORBA::ULong *) _for_publisher_interessante_gebote[_idx]->ck()->CookieValue().get_buffer());
1585     if (_ck1 == _ck2) break;
1586   }
1587
1588   if (_idx == _for_publisher_interessante_gebote.length()) {
1589     throw Components::InvalidConnection();
1590   }
1591
1592   ::Auktion::GebotConsumer_var _res = ::Auktion::GebotConsumer::_narrow (_for_publisher_interessante_gebote[_idx]->consumer());
1593
1594   for (;_idx<_for_publisher_interessante_gebote.length()-1; _idx++) {
1595     _for_publisher_interessante_gebote[_idx] = _for_publisher_interessante_gebote[_idx+1];
1596   }
1597
1598   _for_publisher_interessante_gebote.length (_idx);
1599   return _res._retn();
1600 }
1601
1602 // no emitters
1603
1604 // consumers
1605
1606 ::Auktion::GebotConsumer_ptr
1607 MICO_CCM_impls::
1608 Auktion_ProduktFilter_impl::get_consumer_eingehende_gebote ()
1609 {
1610   if (CORBA::is_nil (_for_consumer_eingehende_gebote)) {
1611     PortableServer::ServantBase_var _consumer_servant =
1612       new Auktion_ProduktFilter_eingehende_gebote_impl (this);
1613     CORBA::Object_var _ref =
1614       _container->activate_facet (this, "eingehende_gebote",
1615                                   CORBA::LocalObject::_nil(),
1616                                   _consumer_servant)
;
1617     _for_consumer_eingehende_gebote =
1618       ::Auktion::GebotConsumer::_narrow (_ref);
1619   }
1620
1621   return ::Auktion::GebotConsumer::_duplicate (_for_consumer_eingehende_gebote);
1622 }
1623
1624 /* * Inherited Navigation interface */
1625
1626 CORBA::Object_ptr
1627 MICO_CCM_impls::
1628 Auktion_ProduktFilter_impl::provide_facet (const char * _name)
1629 {
1630   throw Components::InvalidName();
1631   return CORBA::Object::_nil ();
1632 }
1633
1634 Components::FacetDescriptions *
1635 MICO_CCM_impls::
1636 Auktion_ProduktFilter_impl::get_all_facets ()
1637 {
1638   Components::NameList _allnames;
1639   _allnames.length (0);
1640   return get_named_facets (_allnames);
1641 }
1642
1643 Components::FacetDescriptions *
1644 MICO_CCM_impls::
1645 Auktion_ProduktFilter_impl::get_named_facets (const Components::NameList & _names)
1646 {
1647   Components::FacetDescriptions_var _res = new Components::FacetDescriptions;
1648   _res->length (_names.length());
1649
1650   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
1651     throw Components::InvalidName();
1652   }
1653
1654   return _res._retn();
1655 }
1656
1657 CORBA::Boolean
1658 MICO_CCM_impls::
1659 Auktion_ProduktFilter_impl::same_component (CORBA::Object_ptr _ref)
1660 {
1661   return 0;
1662 }
1663
1664 /* * Inherited Receptacles interface */
1665
1666 Components::Cookie *
1667 MICO_CCM_impls::
1668 Auktion_ProduktFilter_impl::connect (const char * _name, CORBA::Object_ptr _ref)
1669 {
1670   throw Components::InvalidName();
1671   return new MICO::CCM::Cookie_impl;
1672 }
1673
1674 void
1675 MICO_CCM_impls::
1676 Auktion_ProduktFilter_impl::disconnect (const char * _name, Components::Cookie * _ck)
1677 {
1678   throw Components::InvalidName();
1679 }
1680
1681 Components::ConnectionDescriptions *
1682 MICO_CCM_impls::
1683 Auktion_ProduktFilter_impl::get_connections (const char * _name)
1684 {
1685   Components::NameList _thename (1);
1686   _thename[0] = _name;
1687   Components::ReceptacleDescriptions_var _rdv = get_named_receptacles (_thename);
1688   return new Components::ConnectionDescriptions (_rdv[(CORBA::ULong)0]->connections());
1689 }
1690 Components::ReceptacleDescriptions *
1691 MICO_CCM_impls::
1692 Auktion_ProduktFilter_impl::get_all_receptacles ()
1693 {
1694   Components::NameList _allnames;
1695   _allnames.length (0);
1696   return get_named_receptacles (_allnames);
1697 }
1698
1699 Components::ReceptacleDescriptions *
1700 MICO_CCM_impls::
1701 Auktion_ProduktFilter_impl::get_named_receptacles (const Components::NameList & _names)
1702 {
1703   Components::ReceptacleDescriptions_var _res = new Components::ReceptacleDescriptions;
1704   _res->length (_names.length());
1705
1706   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
1707     throw Components::InvalidName();
1708   }
1709
1710   return _res._retn();
1711 }
1712
1713 /* * Inherited Events interface */
1714
1715 Components::EventConsumerBase_ptr
1716 MICO_CCM_impls::
1717 Auktion_ProduktFilter_impl::get_consumer (const char * _name)
1718 {
1719   if (strcmp (_name, "eingehende_gebote") == 0) {
1720     return get_consumer_eingehende_gebote ();
1721   }
1722   throw Components::InvalidName();
1723   return Components::EventConsumerBase::_nil ();
1724 }
1725
1726 Components::ConsumerDescriptions *
1727 MICO_CCM_impls::
1728 Auktion_ProduktFilter_impl::get_all_consumers ()
1729 {
1730   Components::NameList _allnames;
1731   _allnames.length (1);
1732   _allnames[0] = CORBA::string_dup ("eingehende_gebote");
1733   return get_named_consumers (_allnames);
1734 }
1735
1736 Components::ConsumerDescriptions *
1737 MICO_CCM_impls::
1738 Auktion_ProduktFilter_impl::get_named_consumers (const Components::NameList & _names)
1739 {
1740   Components::ConsumerDescriptions_var _res = new Components::ConsumerDescriptions;
1741   _res->length (_names.length());
1742
1743   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
1744     if (strcmp (_names[_idx].in(), "eingehende_gebote") == 0) {
1745       _res[_idx] = new MICO::CCM::ConsumerDescription_impl;
1746       _res[_idx]->name ((const char *) "eingehende_gebote");
1747       _res[_idx]->type_id ((const char *) "IDL:r4/Auktion/Gebot:1.0");
1748       Components::EventConsumerBase_var _tmp =
1749         get_consumer ("eingehende_gebote");
1750       _res[_idx]->consumer (_tmp);
1751       continue;
1752     }
1753
1754     throw Components::InvalidName();
1755   }
1756
1757   return _res._retn();
1758 }
1759
1760 Components::Cookie *
1761 MICO_CCM_impls::
1762 Auktion_ProduktFilter_impl::subscribe (const char * _name, Components::EventConsumerBase_ptr _ref)
1763 {
1764   if (strcmp (_name, "interessante_gebote") == 0) {
1765     ::Auktion::GebotConsumer_var _tref =
1766       ::Auktion::GebotConsumer::_narrow (_ref);
1767     if (CORBA::is_nil (_tref) && !CORBA::is_nil (_ref)) {
1768       throw Components::InvalidConnection();
1769     }
1770     return subscribe_interessante_gebote (_tref);
1771   }
1772
1773   throw Components::InvalidName();
1774   return new MICO::CCM::Cookie_impl;
1775 }
1776
1777 void
1778 MICO_CCM_impls::
1779 Auktion_ProduktFilter_impl::unsubscribe (const char * _name, Components::Cookie * _ck)
1780 {
1781   if (strcmp (_name, "interessante_gebote") == 0) {
1782     Components::EventConsumerBase_var _dummy;
1783     _dummy = unsubscribe_interessante_gebote (_ck);
1784     return;
1785   }
1786
1787   throw Components::InvalidName();
1788 }
1789
1790 Components::PublisherDescriptions *
1791 MICO_CCM_impls::
1792 Auktion_ProduktFilter_impl::get_all_publishers ()
1793 {
1794   Components::NameList _allnames;
1795   _allnames.length (1);
1796   _allnames[0] = CORBA::string_dup ("interessante_gebote");
1797   return get_named_publishers (_allnames);
1798 }
1799
1800 Components::PublisherDescriptions *
1801 MICO_CCM_impls::
1802 Auktion_ProduktFilter_impl::get_named_publishers (const Components::NameList & _names)
1803 {
1804   Components::PublisherDescriptions_var _res = new Components::PublisherDescriptions;
1805   _res->length (_names.length());
1806
1807   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
1808     if (strcmp (_names[_idx].in(), "interessante_gebote") == 0) {
1809       _res[_idx] = new MICO::CCM::PublisherDescription_impl;
1810       _res[_idx]->name ((const char *) "interessante_gebote");
1811       _res[_idx]->type_id ((const char *) "IDL:r4/Auktion/Gebot:1.0");
1812       _res[_idx]->consumers (_for_publisher_interessante_gebote);
1813       continue;
1814     }
1815
1816     throw Components::InvalidName();
1817   }
1818
1819   return _res._retn();
1820 }
1821
1822 void
1823 MICO_CCM_impls::
1824 Auktion_ProduktFilter_impl::connect_consumer (const char * _name, Components::EventConsumerBase_ptr _ref)
1825 {
1826   throw Components::InvalidName();
1827 }
1828
1829 Components::EventConsumerBase_ptr
1830 MICO_CCM_impls::
1831 Auktion_ProduktFilter_impl::disconnect_consumer (const char * _name)
1832 {
1833   throw Components::InvalidName();
1834 }
1835
1836 Components::EmitterDescriptions *
1837 MICO_CCM_impls::
1838 Auktion_ProduktFilter_impl::get_all_emitters ()
1839 {
1840   Components::NameList _allnames;
1841   _allnames.length (0);
1842   return get_named_emitters (_allnames);
1843 }
1844
1845 Components::EmitterDescriptions *
1846 MICO_CCM_impls::
1847 Auktion_ProduktFilter_impl::get_named_emitters (const Components::NameList & _names)
1848 {
1849   Components::EmitterDescriptions_var _res = new Components::EmitterDescriptions;
1850   _res->length (_names.length());
1851
1852   for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
1853     throw Components::InvalidName();
1854   }
1855
1856   return _res._retn();
1857 }
1858
1859 /* * Inherited CCMObject interface */
1860
1861 CORBA::Object_ptr
1862 MICO_CCM_impls::
1863 Auktion_ProduktFilter_impl::get_component_def ()
1864 {
1865   return CORBA::Object::_nil ();
1866 }
1867
1868 Components::CCMHome_ptr
1869 MICO_CCM_impls::
1870 Auktion_ProduktFilter_impl::get_ccm_home ()
1871 {
1872   return _container->get_reference_for_home ();
1873 }
1874
1875 void
1876 MICO_CCM_impls::
1877 Auktion_ProduktFilter_impl::configuration_complete ()
1878 {
1879   _container->configuration_complete (this);
1880   Components::SessionComponent_ptr _sc =
1881     Components::SessionComponent::_narrow (_instance);
1882   if (!CORBA::is_nil (_sc)) {
1883     _sc->set_session_context (_context);
1884     _sc->ccm_activate ();
1885   }
1886 }
1887
1888 Components::ComponentPortDescription *
1889 MICO_CCM_impls::
1890 Auktion_ProduktFilter_impl::get_all_ports ()
1891 {
1892   Components::FacetDescriptions_var _fds = get_all_facets ();
1893   Components::ReceptacleDescriptions_var _rds = get_all_receptacles ();
1894   Components::ConsumerDescriptions_var _cds = get_all_consumers ();
1895   Components::EmitterDescriptions_var _eds = get_all_emitters ();
1896   Components::PublisherDescriptions_var _pds = get_all_publishers ();
1897
1898   Components::ComponentPortDescription_var _cpd =
1899     new MICO::CCM::ComponentPortDescription_impl;
1900
1901   _cpd->facets (_fds.in());
1902   _cpd->receptacles (_rds.in());
1903   _cpd->consumers (_cds.in());
1904   _cpd->emitters (_eds.in());
1905   _cpd->publishers (_pds.in());
1906
1907   return _cpd._retn();
1908 }
1909
1910 void
1911 MICO_CCM_impls::
1912 Auktion_ProduktFilter_impl::remove ()
1913 {
1914   Components::CCMHome_var myhome = get_ccm_home ();
1915   Components::CCMObject_var myself = _container->get_reference_for_component (this);
1916   myhome->remove_component (myself);
1917 }
1918
1919 /* * Overload default implementation */
1920
1921 CORBA::Object_ptr
1922 MICO_CCM_impls::
1923 Auktion_ProduktFilter_impl::_get_component ()
1924 {
1925   return _container->get_reference_for_component (this);
1926 }
1927
1928 /* * Glue class for consumer eingehende_gebote of component Auktion::ProduktFilter * type Auktion::Gebot */
1929
1930 MICO_CCM_impls::
1931 Auktion_ProduktFilter_eingehende_gebote_impl::Auktion_ProduktFilter_eingehende_gebote_impl (Auktion_ProduktFilter_impl * _g)
1932 {
1933   _glue = _g;
1934 }
1935
1936 MICO_CCM_impls::
1937 Auktion_ProduktFilter_eingehende_gebote_impl::~Auktion_ProduktFilter_eingehende_gebote_impl ()
1938 {
1939 }
1940
1941 void
1942 MICO_CCM_impls::
1943 Auktion_ProduktFilter_eingehende_gebote_impl::push_event (Components::EventBase * ev)
1944 {
1945   Auktion::Gebot * tev = Auktion::Gebot::_downcast (ev);
1946   if (tev == 0 && ev != 0) {
1947     throw Components::BadEventType ((const char *) "Auktion::Gebot");
1948   }
1949   push_Gebot (tev);
1950 }
1951
1952 void
1953 MICO_CCM_impls::
1954 Auktion_ProduktFilter_eingehende_gebote_impl::push_Gebot (Auktion::Gebot * tev)
1955 {
1956   _glue->_instance->push_eingehende_gebote (tev);
1957 }
1958
1959 /* * Context class for component Auktion::ProduktFilter */
1960
1961 MICO_CCM_impls::
1962 Auktion_ProduktFilter_Context_impl::Auktion_ProduktFilter_Context_impl (Auktion_ProduktFilter_impl * _g, MICO::CCM::SessionContainer * _c)
1963 {
1964   _glue = _g;
1965   _container = _c;
1966 }
1967
1968 MICO_CCM_impls::
1969 Auktion_ProduktFilter_Context_impl::~Auktion_ProduktFilter_Context_impl ()
1970 {
1971 }
1972
1973 void
1974 MICO_CCM_impls::
1975 Auktion_ProduktFilter_Context_impl::push_interessante_gebote (::Auktion::Gebot * ev)
1976 {
1977   for (CORBA::ULong idx=0; idx<_glue->_for_publisher_interessante_gebote.length(); idx++) {
1978     try {
1979       _glue->_for_publisher_interessante_gebote[idx]->consumer()->push_event (ev);
1980     }
1981      catch (...) {
1982     }
1983   }
1984 }
1985
1986 Components::CCMHome_ptr
1987 MICO_CCM_impls::
1988 Auktion_ProduktFilter_Context_impl::get_CCM_home ()
1989 {
1990   return _container->get_CCM_home ();
1991 }
1992
1993 CORBA::Object_ptr
1994 MICO_CCM_impls::
1995 Auktion_ProduktFilter_Context_impl::get_CCM_object ()
1996 {
1997   return _container->get_CCM_object (_glue->_instance);
1998 }
1999
2000 /* * Glue class for home Auktion::FilterHome */
2001
2002 MICO_CCM_impls::
2003 Auktion_FilterHome_impl::Auktion_FilterHome_impl (Auktion::CCM_FilterHome * i, MICO::CCM::SessionContainer * c)
2004   : _instance (i), _container (c)
2005 {
2006 }
2007
2008 MICO_CCM_impls::
2009 Auktion_FilterHome_impl::~Auktion_FilterHome_impl ()
2010 {
2011   delete _instance;
2012 }
2013
2014 /* * Implicit operations */
2015
2016 Auktion::ProduktFilter_ptr
2017 MICO_CCM_impls::
2018 Auktion_FilterHome_impl::create ()
2019 {
2020   Components::EnterpriseComponent_var _ci = _instance->create ();
2021   Auktion::CCM_ProduktFilter_ptr _ti =
2022     Auktion::CCM_ProduktFilter::_narrow (_ci);
2023   PortableServer::ServantBase_var _cs =
2024     new Auktion_ProduktFilter_impl (_ti, _container);
2025   Components::CCMObject_var _co =
2026     _container->activate_component (_ti, _cs.in());
2027   return Auktion::ProduktFilter::_narrow (_co);
2028 }
2029
2030 /* * Explicit operations */
2031
2032 // factories
2033
2034 Auktion::ProduktFilter_ptr
2035 MICO_CCM_impls::
2036 Auktion_FilterHome_impl::new_filter (const char* gegenstand)
2037 {
2038   Components::EnterpriseComponent_ptr _ci =
2039     _instance->new_filter (gegenstand);
2040   Auktion::CCM_ProduktFilter_var _ti =
2041     Auktion::CCM_ProduktFilter::_narrow (_ci);
2042   PortableServer::ServantBase_var _cs = new Auktion_ProduktFilter_impl (_ti, _container);
2043   Components::CCMObject_var _co =
2044     _container->activate_component (_ti, _cs.in());
2045   return Auktion::ProduktFilter::_narrow (_co);
2046 }
2047
2048 // no finders
2049
2050 // no attributes
2051
2052 // no operations
2053
2054 /* * Inherited CCMHome interface */
2055
2056 CORBA::Object_ptr
2057 MICO_CCM_impls::
2058 Auktion_FilterHome_impl::get_component_def ()
2059 {
2060   return CORBA::Object::_nil ();
2061 }
2062
2063 CORBA::Object_ptr
2064 MICO_CCM_impls::
2065 Auktion_FilterHome_impl::get_home_def ()
2066 {
2067   return CORBA::Object::_nil ();
2068 }
2069
2070 void
2071 MICO_CCM_impls::
2072 Auktion_FilterHome_impl::remove_component (Components::CCMObject_ptr _co)
2073 {
2074   PortableServer::ServantBase_var _cs =
2075     _container->get_skeleton_for_reference (_co);
2076   CORBA::LocalObject_var _ci =
2077     _container->get_instance_for_component (_cs.in());
2078   Auktion::CCM_ProduktFilter_var _cti =
2079     Auktion::CCM_ProduktFilter::_narrow (_ci.in());
2080
2081   Components::SessionComponent_var _sc =
2082     Components::SessionComponent::_narrow (_ci);
2083   if (!CORBA::is_nil (_sc)) {
2084     _sc->ccm_passivate ();
2085     _sc->ccm_remove ();
2086   }
2087   _container->deactivate_component (_cs);
2088 }
2089
2090 /* * Inherited KeylessCCMHome interface */
2091
2092 Components::CCMObject_ptr
2093 MICO_CCM_impls::
2094 Auktion_FilterHome_impl::create_component ()
2095 {
2096   return create ();
2097 }
2098
2099 /* * Glue class for home Auktion::BieterHome */
2100
2101 MICO_CCM_impls::
2102 Auktion_BieterHome_impl::Auktion_BieterHome_impl (Auktion::CCM_BieterHome * i, MICO::CCM::SessionContainer * c)
2103   : _instance (i), _container (c)
2104 {
2105 }
2106
2107 MICO_CCM_impls::
2108 Auktion_BieterHome_impl::~Auktion_BieterHome_impl ()
2109 {
2110   delete _instance;
2111 }
2112
2113 /* * Implicit operations */
2114
2115 Auktion::Bieter_ptr
2116 MICO_CCM_impls::
2117 Auktion_BieterHome_impl::create ()
2118 {
2119   Components::EnterpriseComponent_var _ci = _instance->create ();
2120   Auktion::CCM_Bieter_ptr _ti =
2121     Auktion::CCM_Bieter::_narrow (_ci);
2122   PortableServer::ServantBase_var _cs =
2123     new Auktion_Bieter_impl (_ti, _container);
2124   Components::CCMObject_var _co =
2125     _container->activate_component (_ti, _cs.in());
2126   return Auktion::Bieter::_narrow (_co);
2127 }
2128
2129 /* * Explicit operations */
2130
2131 // no factories
2132
2133 // no finders
2134
2135 // no attributes
2136
2137 // no operations
2138
2139 /* * Inherited CCMHome interface */
2140
2141 CORBA::Object_ptr
2142 MICO_CCM_impls::
2143 Auktion_BieterHome_impl::get_component_def ()
2144 {
2145   return CORBA::Object::_nil ();
2146 }
2147
2148 CORBA::Object_ptr
2149 MICO_CCM_impls::
2150 Auktion_BieterHome_impl::get_home_def ()
2151 {
2152   return CORBA::Object::_nil ();
2153 }
2154
2155 void
2156 MICO_CCM_impls::
2157 Auktion_BieterHome_impl::remove_component (Components::CCMObject_ptr _co)
2158 {
2159   PortableServer::ServantBase_var _cs =
2160     _container->get_skeleton_for_reference (_co);
2161   CORBA::LocalObject_var _ci =
2162     _container->get_instance_for_component (_cs.in());
2163   Auktion::CCM_Bieter_var _cti =
2164     Auktion::CCM_Bieter::_narrow (_ci.in());
2165
2166   Components::SessionComponent_var _sc =
2167     Components::SessionComponent::_narrow (_ci);
2168   if (!CORBA::is_nil (_sc)) {
2169     _sc->ccm_passivate ();
2170     _sc->ccm_remove ();
2171   }
2172   _container->deactivate_component (_cs);
2173 }
2174
2175 /* * Inherited KeylessCCMHome interface */
2176
2177 Components::CCMObject_ptr
2178 MICO_CCM_impls::
2179 Auktion_BieterHome_impl::create_component ()
2180 {
2181   return create ();
2182 }
2183
2184 /* * Glue class for home Auktion::VerkaeuferHome */
2185
2186 MICO_CCM_impls::
2187 Auktion_VerkaeuferHome_impl::Auktion_VerkaeuferHome_impl (Auktion::CCM_VerkaeuferHome * i, MICO::CCM::SessionContainer * c)
2188   : _instance (i), _container (c)
2189 {
2190 }
2191
2192 MICO_CCM_impls::
2193 Auktion_VerkaeuferHome_impl::~Auktion_VerkaeuferHome_impl ()
2194 {
2195   delete _instance;
2196 }
2197
2198 /* * Implicit operations */
2199
2200 Auktion::Verkaeufer_ptr
2201 MICO_CCM_impls::
2202 Auktion_VerkaeuferHome_impl::create ()
2203 {
2204   Components::EnterpriseComponent_var _ci = _instance->create ();
2205   Auktion::CCM_Verkaeufer_ptr _ti =
2206     Auktion::CCM_Verkaeufer::_narrow (_ci);
2207   PortableServer::ServantBase_var _cs =
2208     new Auktion_Verkaeufer_impl (_ti, _container);
2209   Components::CCMObject_var _co =
2210     _container->activate_component (_ti, _cs.in());
2211   return Auktion::Verkaeufer::_narrow (_co);
2212 }
2213
2214 /* * Explicit operations */
2215
2216 // no factories
2217
2218 // no finders
2219
2220 // no attributes
2221
2222 // no operations
2223
2224 /* * Inherited CCMHome interface */
2225
2226 CORBA::Object_ptr
2227 MICO_CCM_impls::
2228 Auktion_VerkaeuferHome_impl::get_component_def ()
2229 {
2230   return CORBA::Object::_nil ();
2231 }
2232
2233 CORBA::Object_ptr
2234 MICO_CCM_impls::
2235 Auktion_VerkaeuferHome_impl::get_home_def ()
2236 {
2237   return CORBA::Object::_nil ();
2238 }
2239
2240 void
2241 MICO_CCM_impls::
2242 Auktion_VerkaeuferHome_impl::remove_component (Components::CCMObject_ptr _co)
2243 {
2244   PortableServer::ServantBase_var _cs =
2245     _container->get_skeleton_for_reference (_co);
2246   CORBA::LocalObject_var _ci =
2247     _container->get_instance_for_component (_cs.in());
2248   Auktion::CCM_Verkaeufer_var _cti =
2249     Auktion::CCM_Verkaeufer::_narrow (_ci.in());
2250
2251   Components::SessionComponent_var _sc =
2252     Components::SessionComponent::_narrow (_ci);
2253   if (!CORBA::is_nil (_sc)) {
2254     _sc->ccm_passivate ();
2255     _sc->ccm_remove ();
2256   }
2257   _container->deactivate_component (_cs);
2258 }
2259
2260 /* * Inherited KeylessCCMHome interface */
2261
2262 Components::CCMObject_ptr
2263 MICO_CCM_impls::
2264 Auktion_VerkaeuferHome_impl::create_component ()
2265 {
2266   return create ();
2267 }
2268
2269
2270 /* * Glue entry points for the container */
2271
2272 extern "C" {
2273   MICO::CCM::ContainerBase *
2274   deploy_Auktion_Welt (CORBA::ORB_ptr _orb, Components::HomeExecutorBase_ptr _he)
2275   {
2276     MICO::CCM::SessionContainer * _container =
2277       new MICO::CCM::SessionContainer (_orb);
2278
2279     MICO::CCM::SessionContainer::ComponentInfo info;
2280
2281     info.home_short_name = "Welt";
2282     info.home_absolute_name = "::Auktion::Welt";
2283     info.home_id = "IDL:r4/Auktion/Welt:1.0";
2284     info.component_short_name = "Auktionshaus";
2285     info.component_absolute_name = "::Auktion::Auktionshaus";
2286     info.component_id = "IDL:r4/Auktion/Auktionshaus:1.0";
2287
2288     Auktion::CCM_Welt_ptr _hi = Auktion::CCM_Welt::_narrow (_he);
2289     info.home_instance = CORBA::LocalObject::_duplicate (_hi);
2290     info.home_glue = new MICO_CCM_impls::Auktion_Welt_impl (_hi, _container);
2291
2292     _container->load (info);
2293     return _container;
2294   }
2295 }
2296
2297 extern "C" {
2298   MICO::CCM::ContainerBase *
2299   deploy_Auktion_FilterHome (CORBA::ORB_ptr _orb, Components::HomeExecutorBase_ptr _he)
2300   {
2301     MICO::CCM::SessionContainer * _container =
2302       new MICO::CCM::SessionContainer (_orb);
2303
2304     MICO::CCM::SessionContainer::ComponentInfo info;
2305
2306     info.home_short_name = "FilterHome";
2307     info.home_absolute_name = "::Auktion::FilterHome";
2308     info.home_id = "IDL:r4/Auktion/FilterHome:1.0";
2309     info.component_short_name = "ProduktFilter";
2310     info.component_absolute_name = "::Auktion::ProduktFilter";
2311     info.component_id = "IDL:r4/Auktion/ProduktFilter:1.0";
2312
2313     Auktion::CCM_FilterHome_ptr _hi = Auktion::CCM_FilterHome::_narrow (_he);
2314     info.home_instance = CORBA::LocalObject::_duplicate (_hi);
2315     info.home_glue = new MICO_CCM_impls::Auktion_FilterHome_impl (_hi, _container);
2316
2317     _container->load (info);
2318     return _container;
2319   }
2320 }
2321
2322 extern "C" {
2323   MICO::CCM::ContainerBase *
2324   deploy_Auktion_BieterHome (CORBA::ORB_ptr _orb, Components::HomeExecutorBase_ptr _he)
2325   {
2326     MICO::CCM::SessionContainer * _container =
2327       new MICO::CCM::SessionContainer (_orb);
2328
2329     MICO::CCM::SessionContainer::ComponentInfo info;
2330
2331     info.home_short_name = "BieterHome";
2332     info.home_absolute_name = "::Auktion::BieterHome";
2333     info.home_id = "IDL:r4/Auktion/BieterHome:1.0";
2334     info.component_short_name = "Bieter";
2335     info.component_absolute_name = "::Auktion::Bieter";
2336     info.component_id = "IDL:r4/Auktion/Bieter:1.0";
2337
2338     Auktion::CCM_BieterHome_ptr _hi = Auktion::CCM_BieterHome::_narrow (_he);
2339     info.home_instance = CORBA::LocalObject::_duplicate (_hi);
2340     info.home_glue = new MICO_CCM_impls::Auktion_BieterHome_impl (_hi, _container);
2341
2342     _container->load (info);
2343     return _container;
2344   }
2345 }
2346
2347 extern "C" {
2348   MICO::CCM::ContainerBase *
2349   deploy_Auktion_VerkaeuferHome (CORBA::ORB_ptr _orb, Components::HomeExecutorBase_ptr _he)
2350   {
2351     MICO::CCM::SessionContainer * _container =
2352       new MICO::CCM::SessionContainer (_orb);
2353
2354     MICO::CCM::SessionContainer::ComponentInfo info;
2355
2356     info.home_short_name = "VerkaeuferHome";
2357     info.home_absolute_name = "::Auktion::VerkaeuferHome";
2358     info.home_id = "IDL:r4/Auktion/VerkaeuferHome:1.0";
2359     info.component_short_name = "Verkaeufer";
2360     info.component_absolute_name = "::Auktion::Verkaeufer";
2361     info.component_id = "IDL:r4/Auktion/Verkaeufer:1.0";
2362
2363     Auktion::CCM_VerkaeuferHome_ptr _hi = Auktion::CCM_VerkaeuferHome::_narrow (_he);
2364     info.home_instance = CORBA::LocalObject::_duplicate (_hi);
2365     info.home_glue = new MICO_CCM_impls::Auktion_VerkaeuferHome_impl (_hi, _container);
2366
2367     _container->load (info);
2368     return _container;
2369   }
2370 }
2371
2372
2373 /* * Default main for standalone program */
2374
2375 extern "C" {
2376   Components::HomeExecutorBase_ptr create_Auktion_Welt (CORBA::ORB_ptr);
2377   Components::HomeExecutorBase_ptr create_Auktion_FilterHome (CORBA::ORB_ptr);
2378   Components::HomeExecutorBase_ptr create_Auktion_BieterHome (CORBA::ORB_ptr);
2379   Components::HomeExecutorBase_ptr create_Auktion_VerkaeuferHome (CORBA::ORB_ptr);
2380 }
2381
2382 int
2383 main (int argc, char * argv[])
2384 {
2385   CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
2386   MICO::CCM::register_all_factories (orb);
2387   string ior;
2388   string nsname;
2389   bool all = true;
2390   string homename;
2391   int arg;
2392
2393   for (arg=1; arg<argc; arg++) {
2394     if (*argv[arg] != '-') {
2395       break;
2396     }
2397     else if (strcmp (argv[arg], "--ior") == 0 && arg+1<argc) {
2398       ior = argv[++arg];
2399     }
2400     else if (strcmp (argv[arg], "--ns") == 0 && arg+1<argc) {
2401       nsname = argv[++arg];
2402     }
2403     else if (strcmp (argv[arg], "--") == 0) {
2404       arg++;
2405       break;
2406     }
2407     else {
2408       if (strcmp (argv[arg], "--help") != 0) {
2409         cerr << "error: unknown option: \"" << argv[arg] << "\"" << endl;
2410       }
2411       cerr << "usage: " << argv[arg] << " <options> [name]" << endl;
2412       cerr << "possible <options> are:" << endl;
2413       cerr << " --ior <filename>" << endl;
2414       cerr << " --ns <ns name>" << endl;
2415       cerr << " --help" << endl;
2416       cerr << "possible names are:" << endl;
2417       cerr << " Welt ::Auktion::Welt IDL:r4/Auktion/Welt:1.0" << endl;
2418       cerr << " FilterHome ::Auktion::FilterHome IDL:r4/Auktion/FilterHome:1.0" << endl;
2419       cerr << " BieterHome ::Auktion::BieterHome IDL:r4/Auktion/BieterHome:1.0" << endl;
2420       cerr << " VerkaeuferHome ::Auktion::VerkaeuferHome IDL:r4/Auktion/VerkaeuferHome:1.0" << endl;
2421       exit (1);
2422     }
2423   }
2424
2425   if (arg < argc) {
2426     homename = argv[arg];
2427     all = false;
2428   }
2429
2430   CosNaming::NamingContextExt_var ns;
2431   CORBA::Object_var nsobj;
2432   try {
2433     nsobj = orb->resolve_initial_references ("NameService");
2434     ns = CosNaming::NamingContextExt::_narrow (nsobj);
2435   }
2436   catch (...) {
2437     ns = CosNaming::NamingContextExt::_nil ();
2438   }
2439
2440   if (CORBA::is_nil (ns) && (all || nsname.length() > 0)) {
2441     cerr << "Oops, I need a Naming Service." << endl;
2442     exit (1);
2443   }
2444
2445   Components::HomeExecutorBase_var he;
2446   MICO::CCM::ContainerBase * c;
2447   Components::CCMHome_var hp;
2448   CosNaming::Name_var n;
2449
2450   /* * Deploy ::Auktion::Welt */
2451
2452   if (all ||
2453       strcmp (homename.c_str(), "Welt") == 0 ||
2454       strcmp (homename.c_str(), "::Auktion::Welt") == 0 ||
2455       strcmp (homename.c_str(), "IDL:r4/Auktion/Welt:1.0") == 0)
{
2456     he = create_Auktion_Welt (orb);
2457     c  = deploy_Auktion_Welt (orb, he);
2458     hp = c->get_CCM_home ();
2459
2460     if (nsname.length() > 0) {
2461       n = ns->to_name (nsname.c_str());
2462       ns->rebind (n.in(), hp.in());
2463     }
2464     else if (all) {
2465       n  = ns->to_name ("Welt");
2466       ns->rebind (n.in(), hp.in());
2467     }
2468
2469     if (ior.length() > 0) {
2470       CORBA::String_var iorstr = orb->object_to_string (hp.in());
2471       if (strcmp (ior.c_str(), "-") == 0) {
2472         cout << iorstr << endl;
2473       }
2474       else {
2475         ofstream out (ior.c_str());
2476         out << iorstr << endl;
2477       }
2478     }
2479
2480     c->activate ();
2481   }
2482
2483   /* * Deploy ::Auktion::FilterHome */
2484
2485   if (all ||
2486       strcmp (homename.c_str(), "FilterHome") == 0 ||
2487       strcmp (homename.c_str(), "::Auktion::FilterHome") == 0 ||
2488       strcmp (homename.c_str(), "IDL:r4/Auktion/FilterHome:1.0") == 0)
{
2489     he = create_Auktion_FilterHome (orb);
2490     c  = deploy_Auktion_FilterHome (orb, he);
2491     hp = c->get_CCM_home ();
2492
2493     if (nsname.length() > 0) {
2494       n = ns->to_name (nsname.c_str());
2495       ns->rebind (n.in(), hp.in());
2496     }
2497     else if (all) {
2498       n  = ns->to_name ("FilterHome");
2499       ns->rebind (n.in(), hp.in());
2500     }
2501
2502     if (ior.length() > 0) {
2503       CORBA::String_var iorstr = orb->object_to_string (hp.in());
2504       if (strcmp (ior.c_str(), "-") == 0) {
2505         cout << iorstr << endl;
2506       }
2507       else {
2508         ofstream out (ior.c_str());
2509         out << iorstr << endl;
2510       }
2511     }
2512
2513     c->activate ();
2514   }
2515
2516   /* * Deploy ::Auktion::BieterHome */
2517
2518   if (all ||
2519       strcmp (homename.c_str(), "BieterHome") == 0 ||
2520       strcmp (homename.c_str(), "::Auktion::BieterHome") == 0 ||
2521       strcmp (homename.c_str(), "IDL:r4/Auktion/BieterHome:1.0") == 0)
{
2522     he = create_Auktion_BieterHome (orb);
2523     c  = deploy_Auktion_BieterHome (orb, he);
2524     hp = c->get_CCM_home ();
2525
2526     if (nsname.length() > 0) {
2527       n = ns->to_name (nsname.c_str());
2528       ns->rebind (n.in(), hp.in());
2529     }
2530     else if (all) {
2531       n  = ns->to_name ("BieterHome");
2532       ns->rebind (n.in(), hp.in());
2533     }
2534
2535     if (ior.length() > 0) {
2536       CORBA::String_var iorstr = orb->object_to_string (hp.in());
2537       if (strcmp (ior.c_str(), "-") == 0) {
2538         cout << iorstr << endl;
2539       }
2540       else {
2541         ofstream out (ior.c_str());
2542         out << iorstr << endl;
2543       }
2544     }
2545
2546     c->activate ();
2547   }
2548
2549   /* * Deploy ::Auktion::VerkaeuferHome */
2550
2551   if (all ||
2552       strcmp (homename.c_str(), "VerkaeuferHome") == 0 ||
2553       strcmp (homename.c_str(), "::Auktion::VerkaeuferHome") == 0 ||
2554       strcmp (homename.c_str(), "IDL:r4/Auktion/VerkaeuferHome:1.0") == 0)
{
2555     he = create_Auktion_VerkaeuferHome (orb);
2556     c  = deploy_Auktion_VerkaeuferHome (orb, he);
2557     hp = c->get_CCM_home ();
2558
2559     if (nsname.length() > 0) {
2560       n = ns->to_name (nsname.c_str());
2561       ns->rebind (n.in(), hp.in());
2562     }
2563     else if (all) {
2564       n  = ns->to_name ("VerkaeuferHome");
2565       ns->rebind (n.in(), hp.in());
2566     }
2567
2568     if (ior.length() > 0) {
2569       CORBA::String_var iorstr = orb->object_to_string (hp.in());
2570       if (strcmp (ior.c_str(), "-") == 0) {
2571         cout << iorstr << endl;
2572       }
2573       else {
2574         ofstream out (ior.c_str());
2575         out << iorstr << endl;
2576       }
2577     }
2578
2579     c->activate ();
2580   }
2581
2582
2583   orb->run ();
2584   return 0;
2585 }
2586
2587