OmniEvents
SupplierAdmin.h
Go to the documentation of this file.
1 // Package : omniEvents
2 // SupplierAdmin.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__SUPPLIERADMIN_H
25 #define OMNIEVENTS__SUPPLIERADMIN_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 "Servant.h"
40 #include "CosEventChannelAdmin.hh"
41 
42 #ifdef HAVE_STD_IOSTREAM
43 using namespace std;
44 #endif
45 
46 namespace OmniEvents {
47 
48 class EventChannel_i;
49 class ProxyPushConsumer_i;
50 class ProxyPullConsumerManager;
51 class PersistNode;
52 
54 : public virtual POA_CosEventChannelAdmin::SupplierAdmin,
55  public PortableServer::RefCountServantBase,
56  public Servant
57 {
58 public: // CORBA interface methods
59  CosEventChannelAdmin::ProxyPushConsumer_ptr obtain_push_consumer();
60  CosEventChannelAdmin::ProxyPullConsumer_ptr obtain_pull_consumer();
61 
62 public:
63  SupplierAdmin_i(const EventChannel_i& channel, PortableServer::POA_ptr poa);
64  virtual ~SupplierAdmin_i();
66 
68  void collect(list<CORBA::Any*>& events);
69 
71  void disconnect();
72 
74  void reincarnate(const PersistNode& node);
75 
77  void output(ostream& os);
78 
79 private:
83  list<CORBA::Any*> _queue;
84 
87  pair<unsigned long,unsigned long> _nextPull;
88 };
89 
90 }; // end namespace OmniEvents
91 
92 #endif // OMNIEVENTS__SUPPLIERADMIN_H
#define OMNIEVENTS__DEBUG_REF_COUNTS__DECL
Declares debug versions of _add/remove_ref().
Definition: Servant.h:68
Servant for CosEventChannelAdmin::EventChannel objects, also inherits from omni_thread.
Definition: EventChannel.h:115
Default servant for ProxyPushConsumer objects.
Base class for servants.
Definition: Servant.h:114
list< CORBA::Any * > _queue
Incoming queue for the PushConsumer.
Definition: SupplierAdmin.h:83
pair< unsigned long, unsigned long > _nextPull
Next time to retry pull (sec,nsec).
Definition: SupplierAdmin.h:87
const EventChannel_i & _channel
Definition: SupplierAdmin.h:80
ProxyPushConsumer_i * _pushConsumer
Definition: SupplierAdmin.h:81
ProxyPullConsumerManager * _pullConsumer
Definition: SupplierAdmin.h:82