/usr/include/omniORB4/ami.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 | // -*- Mode: C++; -*-
// Package : omniORB
// ami.h Created on: 2012-02-06
// Author : Duncan Grisby (dgrisby)
//
// Copyright (C) 2012 Apasphere Ltd
//
// 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:
//
// AMI support
#ifndef _OMNIORB_AMI_H_
#define _OMNIORB_AMI_H_
#include <omniORB4/messaging.hh>
#include <omniORB4/callDescriptor.h>
#ifdef _dyn_attr
# error "A local CPP macro _dyn_attr has already been defined."
#endif
#if defined(_OMNIORB_DYNAMIC_LIBRARY)
# define _dyn_attr
#else
# define _dyn_attr _OMNIORB_NTDLL_IMPORT
#endif
_CORBA_MODULE omniAMI
_CORBA_MODULE_BEG
//
// Implementation of standard Messaging::ExceptionHolder valuetype
class ExceptionHolder
: public virtual ::Messaging::ExceptionHolder,
public virtual ::CORBA::DefaultValueRefCountBase
{
public:
inline ExceptionHolder(omniAsyncCallDescriptor* cd)
: pd_cd(cd)
{}
virtual ~ExceptionHolder();
virtual void raise_exception();
private:
omniAsyncCallDescriptor* pd_cd;
// Not implemented
ExceptionHolder(const ExceptionHolder&);
ExceptionHolder& operator=(const ExceptionHolder&);
};
//
// Mixin class implementing base Messaging::Poller methods
class PollerImpl
: public virtual ::Messaging::Poller,
public virtual ::CORBA::DefaultValueRefCountBase
{
public:
PollerImpl(omniAsyncCallDescriptor* _cd)
: _pd_cd(_cd), _pd_is_from_poller(0), _pd_retrieved(0)
{}
~PollerImpl();
// Standard interface
::CORBA::Boolean is_ready(::CORBA::ULong timeout);
::CORBA::PollableSet_ptr create_pollable_set();
::CORBA::Object_ptr operation_target();
char* operation_name();
::Messaging::ReplyHandler_ptr associated_handler();
void associated_handler(::Messaging::ReplyHandler_ptr v);
::CORBA::Boolean is_from_poller();
// omniORB internal
inline omniAsyncCallDescriptor* _PR_cd() { return _pd_cd; }
inline ::CORBA::Boolean _PR_retrieved() { return _pd_retrieved; }
static _dyn_attr const char* _PD_repoId;
protected:
void _wrongOperation();
void _checkResult(const char* op, ::CORBA::ULong timeout);
omniAsyncCallDescriptor* _pd_cd;
::CORBA::Boolean _pd_is_from_poller;
::CORBA::Boolean _pd_retrieved;
};
//
// DIIPollable implementation
class DIIPollableImpl
: public virtual ::CORBA::DIIPollable
{
public:
DIIPollableImpl()
: pd_cond(&omniAsyncCallDescriptor::sd_lock, "DIIPollableImpl::pd_cond"),
pd_set_cond(0),
pd_ready(0)
{}
~DIIPollableImpl();
void _add_ref();
void _remove_ref();
::CORBA::ULong _refcount_value();
// Standard interface
::CORBA::Boolean is_ready(::CORBA::ULong timeout);
::CORBA::PollableSet_ptr create_pollable_set();
inline ::CORBA::Boolean _addToSet(omni_tracedcondition* set_cond)
{
ASSERT_OMNI_TRACEDMUTEX_HELD(omniAsyncCallDescriptor::sd_lock, 1);
if (pd_set_cond)
return 0;
pd_set_cond = set_cond;
return 1;
}
inline ::CORBA::Boolean _remFromSet(omni_tracedcondition* set_cond)
{
ASSERT_OMNI_TRACEDMUTEX_HELD(omniAsyncCallDescriptor::sd_lock, 1);
if (pd_set_cond)
return 0;
pd_set_cond = set_cond;
return 1;
}
inline void _replyReady()
{
omni_tracedmutex_lock l(omniAsyncCallDescriptor::sd_lock);
++pd_ready;
pd_cond.broadcast();
if (pd_set_cond)
pd_set_cond->signal();
}
inline void _replyCollected()
{
omni_tracedmutex_lock l(omniAsyncCallDescriptor::sd_lock);
--pd_ready;
}
inline ::CORBA::Boolean _lockedIsReady()
{
ASSERT_OMNI_TRACEDMUTEX_HELD(omniAsyncCallDescriptor::sd_lock, 1);
return pd_ready ? 1 : 0;
}
static _dyn_attr DIIPollableImpl _PD_instance;
private:
omni_tracedcondition pd_cond;
omni_tracedcondition* pd_set_cond;
CORBA::ULong pd_ready;
};
//
// PollableSet implementation
typedef _CORBA_Value_Element<
PollerImpl, ::Messaging::Poller_Helper> PollerImplElmt;
typedef _CORBA_Unbounded_Sequence_Value<
PollerImpl, PollerImplElmt, ::Messaging::Poller_Helper> PollerImplSeq;
class PollableSetImpl
: public virtual ::CORBA::PollableSet
{
public:
PollableSetImpl(PollerImpl* poller);
PollableSetImpl(DIIPollableImpl* dii_pollable);
~PollableSetImpl();
// Standard interface
::CORBA::DIIPollable* create_dii_pollable();
void add_pollable(::CORBA::Pollable* potential);
::CORBA::Pollable* get_ready_pollable(::CORBA::ULong timeout);
void remove(::CORBA::Pollable* potential);
::CORBA::UShort number_left();
void _add_ref();
void _remove_ref();
private:
omni_tracedcondition pd_cond;
PollerImplSeq pd_ami_pollers;
DIIPollableImpl* pd_dii_pollable;
omni_refcount pd_ref_count;
::CORBA::Pollable* getAndRemoveReadyPollable();
// Not implemented
PollableSetImpl(const PollableSetImpl&);
PollableSetImpl& operator=(const PollableSetImpl&);
};
_CORBA_MODULE_END // omniAMI
#endif // _OMNIORB_AMI_H_
|