OmniEvents
ProxyPullConsumer.h
Go to the documentation of this file.
1 // Package : omniEvents
2 // ProxyPullCOnsumer.h Created : 2003/12/04
3 // Author : Alex Tingle
4 //
5 // Copyright (C) 2003-2005 Alex Tingle.
6 //
7 // This file is part of the omniEvents application.
8 //
9 // omniEvents is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // omniEvents is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 //
23 
24 #ifndef OMNIEVENTS__PROXYPULLCONSUMER_H
25 #define OMNIEVENTS__PROXYPULLCONSUMER_H
26 
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30 
31 #include <list>
32 
33 #ifdef HAVE_IOSTREAM
34 # include <iostream>
35 #else
36 # include <iostream.h>
37 #endif
38 
39 #include "ProxyManager.h"
40 
41 #include "CosEventChannelAdmin.hh"
42 
43 #ifdef HAVE_STD_IOSTREAM
44 using namespace std;
45 #endif
46 
47 namespace OmniEvents {
48 
50 : public ProxyManager,
51  public PortableServer::RefCountServantBase
52 {
53 public: // CORBA interface methods
54  PortableServer::Servant incarnate(
55  const PortableServer::ObjectId& oid,
56  PortableServer::POA_ptr poa
57  );
58 public:
60  PortableServer::POA_ptr parentPoa,
61  list<CORBA::Any*>& q
62  );
65  CosEventChannelAdmin::ProxyPullConsumer_ptr createObject();
66 
77  void collect();
78 
83  void triggerRequest();
84 
86  void disconnect();
87 
88 private:
89  list<CORBA::Any*>& _queue;
90 };
91 
92 
101 : public virtual POA_CosEventChannelAdmin::ProxyPullConsumer,
102  public Proxy
103 {
104 public: // CORBA interface methods
105  void connect_pull_supplier(CosEventComm::PullSupplier_ptr pullSupplier);
106  void disconnect_pull_consumer();
107 public:
108  ProxyPullConsumer_i(PortableServer::POA_ptr poa, list<CORBA::Any*>& q);
110 
112  void collect();
114  void triggerRequest();
115 
116  void reincarnate(const string& oid, const PersistNode& node);
117  void output(ostream& os);
118 private:
119  CosEventComm::PullSupplier_var _target;
120  list<CORBA::Any*>& _queue;
121 
123  enum Mode { Pull=0, TryPull=1 };
125 
130 };
131 
132 }; // end namespace OmniEvents
133 
134 #endif // OMNIEVENTS__PROXYPULLCONSUMER_H
#define OMNIEVENTS__DEBUG_REF_COUNTS__DECL
Declares debug versions of _add/remove_ref().
Definition: Servant.h:68
Base class for ServantActivator classes that manage Proxy servants.
Definition: ProxyManager.h:60
Base class for three of the four Proxy servants.
Definition: ProxyManager.h:107
Implementation of the ProxyPullConsumer interface.
Mode
This proxy can call out in either pull() or try_pull() mode.
CosEventComm::PullSupplier_var _target
int _exceptionCount
Only when two consecutive exceptions have been received from each mode, do we consider the connection...