CEC_SupplierAdmin.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   CEC_SupplierAdmin.h
00006  *
00007  *  $Id: CEC_SupplierAdmin.h 77001 2007-02-12 07:54:49Z johnnyw $
00008  *
00009  *  @author Carlos O'Ryan (coryan@cs.wustl.edu)
00010  *
00011  * More details can be found in:
00012  *
00013  * http://doc.ece.uci.edu/~coryan/EC/
00014  */
00015 //=============================================================================
00016 
00017 #ifndef TAO_CEC_SUPPLIERADMIN_H
00018 #define TAO_CEC_SUPPLIERADMIN_H
00019 
00020 #include /**/ "ace/pre.h"
00021 
00022 #include "orbsvcs/CosEventChannelAdminS.h"
00023 
00024 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00025 # pragma once
00026 #endif /* ACE_LACKS_PRAGMA_ONCE */
00027 
00028 #include "orbsvcs/ESF/ESF_Proxy_Admin.h"
00029 
00030 #include "orbsvcs/CosEvent/CEC_ProxyPushConsumer.h"
00031 #include "orbsvcs/CosEvent/CEC_ProxyPullConsumer.h"
00032 #include "orbsvcs/CosEvent/event_serv_export.h"
00033 
00034 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00035 
00036 class TAO_CEC_EventChannel;
00037 
00038 /**
00039  * @class TAO_CEC_SupplierAdmin
00040  *
00041  * @brief ProxyPushSupplier
00042  *
00043  * Implement the CosEventChannelAdmin::SupplierAdmin interface.
00044  * This class is an Abstract Factory for the
00045  * TAO_CEC_ProxyPushConsumer.
00046  * = MEMORY MANAGMENT
00047  * It does not assume ownership of the TAO_CEC_EventChannel object
00048  * = LOCKING
00049  * @@ TODO
00050  * No provisions for locking, access must be serialized
00051  * externally.
00052  * = TODO
00053  */
00054 class TAO_Event_Serv_Export TAO_CEC_SupplierAdmin
00055   : public POA_CosEventChannelAdmin::SupplierAdmin
00056 {
00057 public:
00058   /// constructor...
00059   TAO_CEC_SupplierAdmin (TAO_CEC_EventChannel* event_channel);
00060 
00061   /// destructor...
00062   virtual ~TAO_CEC_SupplierAdmin (void);
00063 
00064   /// For each elements call <worker->work()>.
00065   void for_each (TAO_ESF_Worker<TAO_CEC_ProxyPushConsumer> *worker);
00066 
00067   /// For each elements call <worker->work()>.
00068   void for_each (TAO_ESF_Worker<TAO_CEC_ProxyPullConsumer> *worker);
00069 
00070   /// Keep track of connected consumers.
00071   virtual void connected (TAO_CEC_ProxyPushConsumer*);
00072   virtual void reconnected (TAO_CEC_ProxyPushConsumer*);
00073   virtual void disconnected (TAO_CEC_ProxyPushConsumer*);
00074   virtual void connected (TAO_CEC_ProxyPullConsumer*);
00075   virtual void reconnected (TAO_CEC_ProxyPullConsumer*);
00076   virtual void disconnected (TAO_CEC_ProxyPullConsumer*);
00077 
00078   /// The event channel is shutting down, inform all the consumers of
00079   /// this
00080   virtual void shutdown (void);
00081 
00082   // = The CosEventChannelAdmin::SupplierAdmin methods...
00083   virtual CosEventChannelAdmin::ProxyPushConsumer_ptr
00084       obtain_push_consumer (void);
00085   virtual CosEventChannelAdmin::ProxyPullConsumer_ptr
00086       obtain_pull_consumer (void);
00087 
00088   // = The PortableServer::ServantBase methods
00089   virtual PortableServer::POA_ptr _default_POA (void);
00090 
00091 private:
00092   /// The Event Channel we belong to
00093   TAO_CEC_EventChannel *event_channel_;
00094 
00095   /// The push and pull aspects are implemented using these classes
00096   TAO_ESF_Proxy_Admin<TAO_CEC_EventChannel,
00097                       TAO_CEC_ProxyPushConsumer,
00098                       CosEventChannelAdmin::ProxyPushConsumer>
00099     push_admin_;
00100   TAO_ESF_Proxy_Admin<TAO_CEC_EventChannel,
00101                       TAO_CEC_ProxyPullConsumer,
00102                       CosEventChannelAdmin::ProxyPullConsumer>
00103     pull_admin_;
00104 
00105   /// Store the default POA.
00106   PortableServer::POA_var default_POA_;
00107 };
00108 
00109 TAO_END_VERSIONED_NAMESPACE_DECL
00110 
00111 #if defined (__ACE_INLINE__)
00112 #include "orbsvcs/CosEvent/CEC_SupplierAdmin.inl"
00113 #endif /* __ACE_INLINE__ */
00114 
00115 #include /**/ "ace/post.h"
00116 
00117 #endif /* TAO_CEC_SUPPLIERADMIN_H */

Generated on Tue Feb 2 17:44:51 2010 for TAO_CosEvent by  doxygen 1.4.7