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

ProxyPushConsumer.h

Go to the documentation of this file.
00001 //                            Package   : omniEvents
00002 // ProxyPushConsumer.h        Created   : 2003/12/04
00003 //                            Author    : Alex Tingle
00004 //
00005 //    Copyright (C) 2003 Alex Tingle.
00006 //
00007 //    This file is part of the omniEvents application.
00008 //
00009 //    omniEvents is free software; you can redistribute it and/or
00010 //    modify it under the terms of the GNU Lesser General Public
00011 //    License as published by the Free Software Foundation; either
00012 //    version 2.1 of the License, or (at your option) any later version.
00013 //
00014 //    omniEvents is distributed in the hope that it will be useful,
00015 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 //    Lesser General Public License for more details.
00018 //
00019 //    You should have received a copy of the GNU Lesser General Public
00020 //    License along with this library; if not, write to the Free Software
00021 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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: // CORBA interface methods
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 }; // end namespace OmniEvents
00112 
00113 #endif // OMNIEVENTS__PROXYPUSHCONSUMER_H

Generated on Fri Dec 12 10:53:03 2003 for OmniEvents by doxygen1.2.15