00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef OMNIEVENTS__PROXYPULLCONSUMER_H
00025 #define OMNIEVENTS__PROXYPULLCONSUMER_H
00026
00027 #ifdef HAVE_CONFIG_H
00028 # include "config.h"
00029 #endif
00030
00031 #include <list>
00032
00033 #ifdef HAVE_IOSTREAM
00034 # include <iostream>
00035 #else
00036 # include <iostream.h>
00037 #endif
00038
00039 #include "ProxyManager.h"
00040
00041 #include "CosEventChannelAdmin.hh"
00042
00043 #ifdef HAVE_STD_IOSTREAM
00044 using namespace std;
00045 #endif
00046
00047 namespace OmniEvents {
00048
00049 class ProxyPullConsumerManager
00050 : public ProxyManager,
00051 public PortableServer::RefCountServantBase
00052 {
00053 public:
00054 PortableServer::Servant incarnate(
00055 const PortableServer::ObjectId& oid,
00056 PortableServer::POA_ptr poa
00057 );
00058 public:
00059 ProxyPullConsumerManager(
00060 PortableServer::POA_ptr parentPoa,
00061 list<CORBA::Any*>& q
00062 );
00063 ~ProxyPullConsumerManager();
00064 CosEventChannelAdmin::ProxyPullConsumer_ptr createObject();
00065
00078 void trigger();
00079
00081 void disconnect();
00082
00083 private:
00084 list<CORBA::Any*>& _queue;
00085 };
00086
00087
00095 class ProxyPullConsumer_i
00096 : public virtual POA_CosEventChannelAdmin::ProxyPullConsumer,
00097 public Proxy
00098 {
00099 public:
00100 void connect_pull_supplier(CosEventComm::PullSupplier_ptr pullSupplier);
00101 void disconnect_pull_consumer();
00102 public:
00103 ProxyPullConsumer_i(PortableServer::POA_ptr poa, list<CORBA::Any*>& q);
00104 ~ProxyPullConsumer_i();
00105 void trigger();
00106 void reincarnate(const string& oid, const PersistNode& node);
00107 void output(ostream& os);
00108 private:
00109 CosEventComm::PullSupplier_var _target;
00110 list<CORBA::Any*>& _queue;
00111
00113 enum Mode { Pull=0, TryPull=1 };
00114
00118 int _exceptionCount[2];
00119 };
00120
00121 };
00122
00123 #endif // OMNIEVENTS__PROXYPULLCONSUMER_H