/usr/include/omniEvents/ProxyPushSupplier.h is in libomnievents-dev 1:2.6.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | // Package : omniEvents
// ProxyPushSupplier.h Created : 2003/12/04
// Author : Alex Tingle
//
// Copyright (C) 2003-2005 Alex Tingle.
//
// This file is part of the omniEvents application.
//
// omniEvents is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// omniEvents is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
#ifndef OMNIEVENTS__PROXYPUSHSUPPLIER_H
#define OMNIEVENTS__PROXYPUSHSUPPLIER_H
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef HAVE_IOSTREAM
# include <iostream>
#else
# include <iostream.h>
#endif
#include "Callback.h"
#include "EventQueue.h"
#include "ProxyManager.h"
#include "CosEventChannelAdmin.hh"
#ifdef HAVE_STD_IOSTREAM
using namespace std;
#endif
namespace OmniEvents {
class ProxyPushSupplierManager
: public ProxyManager,
public omni_thread
{
public: // CORBA interface methods
PortableServer::Servant incarnate(
const PortableServer::ObjectId& oid,
PortableServer::POA_ptr poa
);
/** Pauses the thread, and then calls the parent's implementation. */
void etherealize(
const PortableServer::ObjectId& oid,
PortableServer::POA_ptr adapter,
PortableServer::Servant serv,
CORBA::Boolean cleanup_in_progress,
CORBA::Boolean remaining_activations
);
public:
ProxyPushSupplierManager(PortableServer::POA_ptr parentPoa,EventQueue& q);
~ProxyPushSupplierManager();
CosEventChannelAdmin::ProxyPushSupplier_ptr createObject();
/** Send disconnect_push_consumer() to all connected PushConsumers. */
void disconnect();
void* run_undetached(void*);
void _add_ref();
void _remove_ref(); ///< Shutdown the thread when refCount reaches zero.
omni_mutex _lock;
omni_condition _condition;
/** Helper class that locks ProxyPushSupplier upon construction, and
* wakes it up on destruction. By contrast, just locking & unlocking the mutex
* pauses the thread, but doesn't wake it up any faster than it would have
* woken anyway. */
class PauseThenWake
{
ProxyPushSupplierManager* _p;
PauseThenWake(const PauseThenWake&); ///< Dummy, no implementation.
PauseThenWake(); ///< Dummy, no implementation.
public:
inline PauseThenWake(ProxyPushSupplierManager* p);
inline ~PauseThenWake();
};
private:
EventQueue& _queue;
int _refCount;
};
class ProxyPushSupplier_i
: public virtual POA_CosEventChannelAdmin::ProxyPushSupplier,
public Proxy,
public EventQueue::Reader,
public Callback
{
public: // CORBA interface methods
void connect_push_consumer(CosEventComm::PushConsumer_ptr pushConsumer);
void disconnect_push_supplier();
public:
ProxyPushSupplier_i(PortableServer::POA_ptr poa, EventQueue& q);
~ProxyPushSupplier_i();
OMNIEVENTS__DEBUG_REF_COUNTS__DECL
/** Sets 'busy' if some work was done.
* Sets 'waiting' if there is an outstanding request.
*/
inline void trigger(bool& busy, bool& waiting);
/** Sets _targetIsProxy, if it is. */
void callback(CORBA::Request_ptr req);
void reincarnate(const string& oid, const PersistNode& node);
void output(ostream &os);
private:
CosEventComm::PushConsumer_var _target;
bool _targetIsProxy; ///< TRUE if _target is a ProxyPushConsumer.
};
//
// Inline Implementations.
//
inline ProxyPushSupplierManager::PauseThenWake::PauseThenWake(
ProxyPushSupplierManager* p
):_p(p)
{
if(_p)
_p->_lock.lock();
}
inline ProxyPushSupplierManager::PauseThenWake::~PauseThenWake()
{
if(_p)
{
_p->_lock.unlock();
_p->_condition.signal(); // Wake up the thread if it's asleep.
}
}
}; // end namespace OmniEvents
#endif // OMNIEVENTS__PROXYPUSHSUPPLIER_H
|