sources:


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