/usr/include/omniORB4/internal/giopRope.h is in libomniorb4-dev 4.2.2-0.8.
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 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | // -*- Mode: C++; -*-
// Package : omniORB
// giopRope.h Created on: 05/01/2001
// Author : Sai Lai Lo (sll)
//
// Copyright (C) 2003-2013 Apasphere Ltd
// Copyright (C) 2001 AT&T Laboratories Cambridge
//
// This file is part of the omniORB library
//
// The omniORB library 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.
//
// This library 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, see http://www.gnu.org/licenses/
//
//
// Description:
// *** PROPRIETARY INTERFACE ***
//
#ifndef __GIOPROPE_H__
#define __GIOPROPE_H__
#include <omniORB4/omniTransport.h>
#ifdef _core_attr
# error "A local CPP macro _core_attr has already been defined."
#endif
#if defined(_OMNIORB_LIBRARY)
# define _core_attr
#else
# define _core_attr _OMNIORB_NTDLL_IMPORT
#endif
class omniIOR;
OMNI_NAMESPACE_BEGIN(omni)
class giopStream;
class giopStrand;
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
class giopRope : public Rope, public RopeLink {
public:
static int selectRope(const giopAddressList& addrlist,
omniIOR::IORInfo* info,
Rope*& rope,
CORBA::Boolean& is_local);
// Given an address list, return a rope that can be used to talk to
// remote objects in that address space. If the address list is in fact
// pointing to ourselves, set <is_local> to true.
// Returns true if either the addresses are local or the rope is found.
// Returns false if no suitable rope is found.
// If a rope is returned, the reference count on the rope is already
// incremented by 1.
//
// This is normally the entry function that causes a rope to be created
// in the first place.
//
// Thread Safety preconditions:
// Caller must not hold omniTransportLock, it is used internally for
// synchronisation.
giopRope(const giopAddressList& addrlist, omniIOR::IORInfo* info);
// <addrlist> is copied.
// Reference count is initialised to 0.
// No thread safety precondition
giopRope(giopAddress* addr);
// Construct with a single address. Used for server-side bidir.
// <addr> is consumed by this instance.
// No thread safety precondition
virtual ~giopRope();
// No thread safety precondition
virtual IOP_C* acquireClient(const omniIOR* ior,
const CORBA::Octet* key,
CORBA::ULong keysize,
omniCallDescriptor* cd);
// Acquire a GIOP_C from this rope.
//
// Thread Safety preconditions:
// Caller must not hold omniTransportLock, it is used internally for
// synchronisation.
void releaseClient(IOP_C*);
// Release the GIOP_C back to this rope. The GIOP_C must have been acquired
// previously through acquireClient from this rope. Passing in a GIOP_C
// from a different rope would result in undefined behaviour.
//
// Thread Safety preconditions:
// Caller must not hold omniTransportLock, it is used internally for
// synchronisation.
void incrRefCount();
// Increment the reference count by 1.
//
// Thread Safety preconditions:
// Caller must not hold omniTransportLock, it is used internally for
// synchronisation.
virtual void decrRefCount();
// Decrement the reference count by 1. If the reference count becomes
// 0, the rope will be deleted at the earliest convenient time.
//
// Thread Safety preconditions:
// Caller must not hold omniTransportLock, it is used internally for
// synchronisation.
void disconnect();
// Forcibly disconnect all strands.
//
// Thread Safety preconditions:
// Caller must not hold omniTransportLock, it is used internally for
// synchronisation.
CORBA::Boolean hasAddress(const giopAddress*);
// Returns true if the address is in this rope's address list; false
// otherwise.
//
// Thread Safety preconditions:
// None: the list of addresses is constant once set.
virtual const giopAddress* notifyCommFailure(const giopAddress*,
CORBA::Boolean heldlock);
// Caller detects an error in sending or receiving data with this address.
// It calls this function to indicate to the rope that the address is bad.
// If the rope has other alternative addresses, it should select another
// address next time acquireClient is called.
//
// Returns the next address the rope will try. In the case when there is
// only 1 address, the return value will be the same as the argument.
// When there are more than 1 addresses and the caller decides to retry
// an invocation on all of these addresses, the caller can use the return
// value to decide when all the addresses have been tried. This
// is done by comparing the return value with the address in use when
// the first call is made.
//
// Thread Safety preconditions:
// Internally, omniTransportLock is used for synchronisation, if
// <heldlock> is true, the caller already holds the lock.
// Access functions to change the rope parameters. Notice that these
// functions does not perform any mutual exclusion internally. It is
// however safe to change the parameters while the rope is in use. The
// new parameter value will take effect as soon as appropriate. For
// instance, decrease the max. number of strand will not have any effect
// on these strands that have already been created.
CORBA::Boolean oneCallPerConnection() {
// No thread safety precondition, use with extreme care
// return True(1) if only one call can be in progress at any time on
// each strand.
// return False(0) if the same strand can be used to carry multiple
// concurrent calls.
// The default is True.
return pd_oneCallPerConnection;
}
void oneCallPerConnection(CORBA::Boolean yes) {
// No thread safety precondition, use with extreme care
pd_oneCallPerConnection = yes;
}
CORBA::ULong maxStrands() {
// No thread safety precondition, use with extreme care
// Return the maximum no. of strands that can be opened.
// The default is omniORB::maxTcpConnectionPerServer.
return pd_maxStrands;
}
void maxStrands(CORBA::ULong max) {
// No thread safety precondition, use with extreme care
if (max == 0) max = 1;
pd_maxStrands = max;
}
friend class giopStream;
friend class giopStrand;
friend class omni_giopRope_initialiser;
friend class omni_giopbidir_initialiser;
protected:
int pd_refcount;
giopAddressList pd_addresses; // Addresses of the remote server
size_t pd_ior_addr_size; // Number of addresses in IOR
omnivector<CORBA::ULong> pd_addresses_order;
size_t pd_address_in_use;
CORBA::ULong pd_maxStrands;
CORBA::Boolean pd_oneCallPerConnection;
int pd_nwaiting;
omni_tracedcondition pd_cond;
CORBA::ULong pd_flags; // Selected flags in use
CORBA::ULong pd_ior_flags; // Flags requested in IOR
CORBA::Boolean pd_offerBiDir; // State of orbParameters::
// offerBiDir... at time of creation.
CORBA::Boolean pd_addrs_filtered;
CORBA::Boolean pd_filtering;
static _core_attr RopeLink ropes;
// All ropes created by selectRope are linked together by this list.
virtual void realIncrRefCount();
// Really increment the reference count.
//
// Thread Safety preconditions:
// Caller must hold omniTransportLock.
virtual CORBA::Boolean match(const giopAddressList&,
omniIOR::IORInfo* info) const;
// Return true if the address list matches EXACTLY those of this
// rope, and the IORInfo policies match.
// No thread safety precondition
virtual void filterAndSortAddressList();
// Use the clientTransportRules to filter and sort the address list
// in pd_addresses, storing the resulting order in
// pd_addresses_order, and set pd_flags appropriately. Any names in
// pd_addresses are resolved and the resulting addresses are added
// to pd_addresses.
//
// Called with no locks held, but serialised for a particular rope.
private:
giopRope();
giopRope(const giopRope&);
giopRope& operator=(const giopRope&);
};
OMNI_NAMESPACE_END(omni)
#undef _core_attr
#endif // __GIOPROPE_H__
|