Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

RMCast_Reliable_Factory.cpp

Go to the documentation of this file.
00001 // $Id: RMCast_Reliable_Factory.cpp,v 1.1.1.1 2001/12/04 14:33:17 chad Exp $
00002 
00003 #include "RMCast_Reliable_Factory.h"
00004 #include "RMCast_Receiver_Module.h"
00005 #include "RMCast_Reassembly.h"
00006 #include "RMCast_Reordering.h"
00007 
00008 #if !defined (__ACE_INLINE__)
00009 # include "RMCast_Reliable_Factory.i"
00010 #endif /* ! __ACE_INLINE__ */
00011 
00012 ACE_RCSID(ace, RMCast_Reliable_Factory, "$Id: RMCast_Reliable_Factory.cpp,v 1.1.1.1 2001/12/04 14:33:17 chad Exp $")
00013 
00014 ACE_RMCast_Reliable_Factory::~ACE_RMCast_Reliable_Factory (void)
00015 {
00016 }
00017 
00018 ACE_RMCast_Module*
00019 ACE_RMCast_Reliable_Factory::create (void)
00020 {
00021   ACE_RMCast_Module *receiver;
00022   ACE_NEW_RETURN (receiver, ACE_RMCast_Receiver_Module, 0);
00023 
00024   ACE_RMCast_Module *reassembly;
00025   ACE_NEW_RETURN (reassembly, ACE_RMCast_Reassembly, 0);
00026 
00027   ACE_RMCast_Module *reordering;
00028   ACE_NEW_RETURN (reordering, ACE_RMCast_Reordering, 0);
00029 
00030   ACE_RMCast_Module *user = this->factory_->create ();
00031   if (user == 0)
00032     {
00033       delete receiver;
00034       delete reordering;
00035       delete reassembly;
00036       return 0;
00037     }
00038   receiver->next (reassembly);
00039   reassembly->next (reordering);
00040   reordering->next (user);
00041   return receiver;
00042 }
00043 
00044 void
00045 ACE_RMCast_Reliable_Factory::destroy (ACE_RMCast_Module *receiver)
00046 {
00047   ACE_RMCast_Module *reassembly = receiver->next ();
00048   ACE_RMCast_Module *reordering = reassembly->next ();
00049   ACE_RMCast_Module *user = reordering->next ();
00050   this->factory_->destroy (user);
00051   delete reordering;
00052   delete reassembly;
00053   delete receiver;
00054 }

Generated on Mon Jun 16 13:12:37 2003 for ACE_RMCast by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002