/usr/include/omniORB4/omniServant.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 | // -*- Mode: C++; -*-
// Package : omniORB2
// omniServant.h Created on: 22/2/99
// Author : David Riddoch (djr)
//
// Copyright (C) 2005 Apasphere Ltd
// Copyright (C) 1996-1999 AT&T Research 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:
// Base class for object implementations (servants).
//
#ifndef __OMNISERVANT_H__
#define __OMNISERVANT_H__
#include <omniORB4/omniutilities.h>
class omniObjRef;
class omniCallHandle;
class omniObjTableEntry;
//: Base class for all Servants.
class omniServant {
protected:
inline omniServant() {}
inline omniServant(const omniServant&) {}
inline omniServant& operator = (const omniServant&) { return *this; }
public:
virtual ~omniServant();
virtual void* _ptrToInterface(const char* repoId);
// The most derived class which overrides this virtual function will be
// called to return a pointer to the base class object identified by
// the repository id <repoId>. Thus for IDL interface foo, this method
// should return a (_impl_foo*). If this object does not support the
// given interface, then it should return 0. For the CORBA::Object
// repoId this method should return non-zero, but the value will not be
// used (it need not be a valid pointer).
// This default version returns non zero only for CORBA::Object, so
// is suitable for DSI servants.
// <repoId> must not be null.
// This function must not throw any exceptions.
// This function must be thread-safe.
virtual void* _downcast();
// This is a hook which more derived servant types may use to obtain
// a pointer to the more derived type. The default version returns
// zero.
// This is intended to be used by servant base classes
// (eg PortableServer::ServantBase and omniOrbBoaServant), not by
// skeletons.
virtual const char* _mostDerivedRepoId();
// The most derived skeleton type should return the repo id of
// this servant. This cannot be done for DSI servants, since
// the _primary_interface() method can only be called in the
// context of serving a CORBA request. Thus this default
// version returns "", indicating that it is not known.
// This function must not throw any exceptions.
// This function must be thread-safe.
virtual _CORBA_Boolean _is_a(const char* logical_type_id);
// May be overridden by more derived servants. This default
// version calls the _ptrToInterface() method and returns
// true if this method returns nonzero.
virtual _CORBA_Boolean _non_existent();
// May be overridden by more derived servants. This default
// version returns 0.
virtual omniObjRef* _do_get_interface() = 0;
// Must be overridden by more derived servants to implement the
// GIOP _get_interface operation. The returned reference really
// ought to be of type CORBA::InterfaceDef_ptr.
virtual _CORBA_Boolean _dispatch(omniCallHandle&);
// This is the point at which the ORB makes an upcall into the object
// implementation when making method invocations from the wire. This
// function is called by the dispatcher of GIOP_S. It should return
// false if the operation is not implemented by this servant, true
// otherwise. The implementation of this function may throw system
// exceptions, which will be passed back to the client side.
// For static servants this function is overriden by a dispatch function
// in the skeleton implementation stub. The version here implements the
// standard CORBA::Object functions -- and is called if the most derived
// version returns false.
// This function is thread-safe. Overriding methods should also be
// thread-safe if this servant is to be activated in a multi-threaded
// object adapter.
void _addActivation(omniObjTableEntry*);
// Add an activation to this servant's list.
// Must hold <omni::internalLock>.
void _removeActivation(omniObjTableEntry*);
// Remove an activation from this servant's list.
// Must hold <omni::internalLock>.
inline const omnivector<omniObjTableEntry*>& _activations() const {
ASSERT_OMNI_TRACEDMUTEX_HELD(*omni::internalLock, 1);
return pd_activations;
}
// Must hold <omni::internalLock>.
virtual void _add_ref();
virtual void _remove_ref();
// Base omniServant versions do nothing; overridden in
// PortableServer::ServantBase to perform reference counting.
private:
omnivector<omniObjTableEntry*> pd_activations;
// A list of the object identities that this servant is incarnating.
// If it is not incarnating any objects, this will be empty. Note
// that when an object is deactivated the identity will be removed
// from this list. However, the identity may still hold a reference
// to this servant until it is destroyed.
};
#endif // __OMNISERVANT_H__
|