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

ACE_RMCast_Reliable_Factory Class Reference

Implement an ACE_RMCast_Module_Factory that "creates" a single object. More...

#include <RMCast_Reliable_Factory.h>

Inheritance diagram for ACE_RMCast_Reliable_Factory:

Inheritance graph
Collaboration diagram for ACE_RMCast_Reliable_Factory:

Collaboration graph
List of all members.

Public Methods

 ACE_RMCast_Reliable_Factory (ACE_RMCast_Module_Factory *factory)
 Constructor. More...

virtual ~ACE_RMCast_Reliable_Factory (void)
 Destructor. More...

virtual ACE_RMCast_Modulecreate (void)
virtual void destroy (ACE_RMCast_Module *)
 Destroy a proxy. More...

Private Attributes

 Delegate on another factory to create the user module. More...

Detailed Description

Implement an ACE_RMCast_Module_Factory that "creates" a single object.

Many applications (and even some internal components), will use a single ACE_RMCast_Module to process all the events, for example, a receiver may decide to use the same ACE_RMCast_Module to process all incoming events, instead of using one per remote sender.

Definition at line 35 of file RMCast_Reliable_Factory.h.

Constructor & Destructor Documentation

ACE_INLINE ACE_RMCast_Reliable_Factory::ACE_RMCast_Reliable_Factory ACE_RMCast_Module_Factory   factory


Definition at line 5 of file RMCast_Reliable_Factory.i.

00006       : factory_ (factory)
00007 {
00008 }

ACE_RMCast_Reliable_Factory::~ACE_RMCast_Reliable_Factory void    [virtual]


Definition at line 14 of file RMCast_Reliable_Factory.cpp.

00015 {
00016 }

Member Function Documentation

ACE_RMCast_Module * ACE_RMCast_Reliable_Factory::create void    [virtual]

The create() method will return always reliable.

Implements ACE_RMCast_Module_Factory.

Definition at line 19 of file RMCast_Reliable_Factory.cpp.

References ACE_NEW_RETURN, ACE_RMCast_Module_Factory::create, factory_, and ACE_RMCast_Module::next.

00020 {
00021   ACE_RMCast_Module *receiver;
00022   ACE_NEW_RETURN (receiver, ACE_RMCast_Receiver_Module, 0);
00024   ACE_RMCast_Module *reassembly;
00025   ACE_NEW_RETURN (reassembly, ACE_RMCast_Reassembly, 0);
00027   ACE_RMCast_Module *reordering;
00028   ACE_NEW_RETURN (reordering, ACE_RMCast_Reordering, 0);
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 }

void ACE_RMCast_Reliable_Factory::destroy ACE_RMCast_Module   [virtual]

Destroy a proxy.

Some factories may allocate modules from a pool, or return the same module for all proxies. Consequently, only the factory knows how to destroy them.

Implements ACE_RMCast_Module_Factory.

Definition at line 45 of file RMCast_Reliable_Factory.cpp.

References ACE_RMCast_Module_Factory::destroy, factory_, and ACE_RMCast_Module::next.

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 }

Member Data Documentation

ACE_RMCast_Module_Factory* ACE_RMCast_Reliable_Factory::factory_ [private]

Delegate on another factory to create the user module.

Definition at line 52 of file RMCast_Reliable_Factory.h.

Referenced by create, and destroy.

The documentation for this class was generated from the following files:
Generated on Mon Jun 16 13:14:12 2003 for ACE_RMCast by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002