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
|
// -*- Mode: C++; -*-
// Package : omniORB
// userexception.h Created on: 1999
// Author : David Riddoch (djr)
//
// Copyright (C) 1996-1999 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 Library General Public
// License as published by the Free Software Foundation; either
// version 2 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
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library 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
//
//
// Description:
//
/*
$Log: userexception.h,v $
Revision 1.1.2.7 2000/01/27 10:55:44 djr
Mods needed for powerpc_aix. New macro OMNIORB_BASE_CTOR to provide
fqname for base class constructor for some compilers.
Revision 1.1.2.6 1999/10/21 11:29:46 djr
Added _core_attr to declaration of _PD_repoId in exceptions & interfaces.
Revision 1.1.2.5 1999/10/18 17:28:19 djr
Fixes for building MSVC dlls.
Revision 1.1.2.4 1999/10/18 11:27:37 djr
Centralised list of system exceptions.
Revision 1.1.2.3 1999/10/04 17:08:30 djr
Some more fixes/MSVC work-arounds.
Revision 1.1.2.2 1999/10/04 15:51:51 djr
Various fixes/MSVC work-arounds.
Revision 1.1.2.1 1999/09/24 09:51:58 djr
Moved from omniORB2 + some new files.
*/
#ifndef __OMNIORB_USEREXCEPTION_H__
#define __OMNIORB_USEREXCEPTION_H__
#define OMNIORB_DECLARE_USER_EXCEPTION(name, attr) \
\
class name : public CORBA::UserException { \
public: \
inline name() { \
pd_insertToAnyFn = insertToAnyFn; \
pd_insertToAnyFnNCP = insertToAnyFnNCP; \
} \
inline name(const name& _ex) : \
OMNIORB_BASE_CTOR(CORBA::)UserException(_ex) {} \
inline name& operator=(const name& _ex) { \
* (CORBA::UserException*) this = _ex; return *this; \
} \
virtual ~name(); \
virtual void _raise(); \
static name* _downcast(CORBA::Exception*); \
static const name* _downcast(const CORBA::Exception*); \
static inline name* _narrow(CORBA::Exception* _ex) { \
return _downcast(_ex); \
} \
\
inline size_t _NP_alignedSize(size_t os) const { return os; } \
inline void operator>>=(NetBufferedStream&) const {} \
inline void operator>>=(MemBufferedStream&) const {} \
inline void operator<<=(NetBufferedStream&) {} \
inline void operator<<=(MemBufferedStream&) {} \
\
static attr insertExceptionToAny insertToAnyFn; \
static attr insertExceptionToAnyNCP insertToAnyFnNCP; \
\
static attr const char* _PD_repoId; \
\
private: \
virtual CORBA::Exception* _NP_duplicate() const; \
virtual const char* _NP_typeId() const; \
virtual const char* _NP_repoId(int* size) const; \
virtual void _NP_marshal(NetBufferedStream&) const; \
virtual void _NP_marshal(MemBufferedStream&) const; \
};
#define OMNIORB_DECLARE_USER_EXCEPTION_IN_CORBA(name, attr) \
\
class name : public UserException { \
public: \
inline name() { \
pd_insertToAnyFn = insertToAnyFn; \
pd_insertToAnyFnNCP = insertToAnyFnNCP; \
} \
inline name(const name& _ex) : UserException(_ex) {} \
inline name& operator=(const name& _ex) { \
* (UserException*) this = _ex; return *this; \
} \
virtual ~name(); \
virtual void _raise(); \
static name* _downcast(Exception*); \
static const name* _downcast(const Exception*); \
static inline name* _narrow(Exception* _ex) { \
return _downcast(_ex); \
} \
\
inline size_t _NP_alignedSize(size_t os) const { return os; } \
inline void operator>>=(NetBufferedStream&) const {} \
inline void operator>>=(MemBufferedStream&) const {} \
inline void operator<<=(NetBufferedStream&) {} \
inline void operator<<=(MemBufferedStream&) {} \
\
static attr insertExceptionToAny insertToAnyFn; \
static attr insertExceptionToAnyNCP insertToAnyFnNCP; \
\
static attr const char* _PD_repoId; \
\
private: \
virtual Exception* _NP_duplicate() const; \
virtual const char* _NP_typeId() const; \
virtual const char* _NP_repoId(int* size) const; \
virtual void _NP_marshal(NetBufferedStream&) const; \
virtual void _NP_marshal(MemBufferedStream&) const; \
};
// This macro applies it's argument to the name of each
// of the system exceptions. It is expected that the
// argument <doit> will be another macro.
#define OMNIORB_FOR_EACH_SYS_EXCEPTION(doit) \
\
doit (UNKNOWN) \
doit (BAD_PARAM) \
doit (NO_MEMORY) \
doit (IMP_LIMIT) \
doit (COMM_FAILURE) \
doit (INV_OBJREF) \
doit (OBJECT_NOT_EXIST) \
doit (NO_PERMISSION) \
doit (INTERNAL) \
doit (MARSHAL) \
doit (INITIALIZE) \
doit (NO_IMPLEMENT) \
doit (BAD_TYPECODE) \
doit (BAD_OPERATION) \
doit (NO_RESOURCES) \
doit (NO_RESPONSE) \
doit (PERSIST_STORE) \
doit (BAD_INV_ORDER) \
doit (TRANSIENT) \
doit (FREE_MEM) \
doit (INV_IDENT) \
doit (INV_FLAG) \
doit (INTF_REPOS) \
doit (BAD_CONTEXT) \
doit (OBJ_ADAPTER) \
doit (DATA_CONVERSION) \
doit (TRANSACTION_REQUIRED) \
doit (TRANSACTION_ROLLEDBACK) \
doit (INVALID_TRANSACTION) \
doit (WRONG_TRANSACTION) \
#endif // __OMNIORB_USEREXCEPTION_H__
|