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__PROXYPUSHCONSUMER_H
00025 #define OMNIEVENTS__PROXYPUSHCONSUMER_H
00026
00027 #ifdef HAVE_CONFIG_H
00028 # include "config.h"
00029 #endif
00030
00031 #include <string>
00032 #include <map>
00033 #include <list>
00034
00035 #ifdef HAVE_IOSTREAM
00036 # include <iostream>
00037 #else
00038 # include <iostream.h>
00039 #endif
00040
00041 #include "Servant.h"
00042
00043 #include "CosEventChannelAdmin.hh"
00044
00045 #ifdef HAVE_STD_IOSTREAM
00046 using namespace std;
00047 #endif
00048
00049 namespace OmniEvents {
00050
00056 class ProxyPushConsumer_i
00057 : public virtual POA_CosEventChannelAdmin::ProxyPushConsumer,
00058 public Servant
00059 {
00060 public:
00064 void connect_push_supplier(CosEventComm::PushSupplier_ptr pushSupplier);
00065
00069 void disconnect_push_consumer();
00070
00072 void push(const CORBA::Any& event);
00073
00074 public:
00075 ProxyPushConsumer_i(PortableServer::POA_ptr parentPoa, list<CORBA::Any*>& q);
00076 virtual ~ProxyPushConsumer_i();
00077
00084 CosEventChannelAdmin::ProxyPushConsumer_ptr createObject();
00085
00087 void reincarnate(const char* thisOid, const char* supplierIOR =NULL);
00089 void output(ostream& os) const;
00090
00091 private:
00092 struct ObjectId
00093 {
00094 PortableServer::ObjectId_var _oid;
00095 string _str;
00096
00097 ObjectId(){}
00098 ObjectId(const char* str);
00099 inline bool operator<(const ObjectId& right) const
00100 {
00101 return _str<right._str;
00102 }
00103 };
00104 ObjectId currentObjectId() const;
00105
00106 typedef map<ObjectId,CosEventComm::PushSupplier_var> Connections_t;
00107 Connections_t _connections;
00108 list<CORBA::Any*>& _queue;
00109 };
00110
00111 };
00112
00113 #endif // OMNIEVENTS__PROXYPUSHCONSUMER_H