00001 // -*- C++ -*- 00002 // 00003 // ExceptionList.h,v 1.20 2006/06/19 14:51:11 parsons Exp 00004 00005 // ============================================================================ 00006 // 00007 // = LIBRARY 00008 // DynamicInterface 00009 // 00010 // = FILENAME 00011 // ExceptionList.h 00012 // 00013 // = DESCRIPTION 00014 // This file defines the ExceptionList datatype used in 00015 // dynamic invocations. 00016 // 00017 // = AUTHOR 00018 // Copyright 1994-1995 by Sun Microsystems Inc. 00019 // 00020 // ============================================================================ 00021 00022 #ifndef TAO_CORBA_EXCEPTIONLIST_H 00023 #define TAO_CORBA_EXCEPTIONLIST_H 00024 00025 #include /**/ "ace/pre.h" 00026 00027 #include "tao/DynamicInterface/dynamicinterface_export.h" 00028 00029 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00030 # pragma once 00031 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00032 00033 #include "tao/DynamicInterface/DII_CORBA_methods.h" 00034 #include "tao/AnyTypeCode/AnyTypeCode_methods.h" 00035 #include "tao/orbconf.h" 00036 #include "tao/Basic_Types.h" 00037 #include "tao/default_environment.h" 00038 #include "tao/Pseudo_VarOut_T.h" 00039 00040 #include "ace/Unbounded_Queue.h" 00041 #include "ace/Atomic_Op.h" 00042 #include "ace/CORBA_macros.h" 00043 #include "ace/Synch_Traits.h" 00044 00045 #if defined (TAO_EXPORT_MACRO) 00046 #undef TAO_EXPORT_MACRO 00047 #endif 00048 #define TAO_EXPORT_MACRO TAO_DynamicInterface_Export 00049 00050 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00051 00052 namespace CORBA 00053 { 00054 typedef TAO_Pseudo_Var_T<ExceptionList> ExceptionList_var; 00055 typedef TAO_Pseudo_Out_T<ExceptionList> ExceptionList_out; 00056 00057 /** 00058 * @class ExceptionList 00059 * 00060 * @brief ExceptionList definition taken from CORBA v2.2 Feb 1998. 00061 * 00062 * Maintains a list of TypeCodes for Exceptions. 00063 */ 00064 class TAO_DynamicInterface_Export ExceptionList 00065 { 00066 public: 00067 // = Intialization and termination methods. 00068 00069 /// Constructor. 00070 ExceptionList (void); 00071 00072 /// Constructor - initialize given a length and an array of 00073 /// TypeCodes. 00074 ExceptionList (CORBA::ULong len, 00075 CORBA::TypeCode_ptr *tc_list); 00076 00077 /// Destructor. 00078 ~ExceptionList (void); 00079 00080 /// Return the number of elements. 00081 CORBA::ULong count (void); 00082 00083 /// Increase the reference count. 00084 ExceptionList_ptr _duplicate (void); 00085 00086 /// Increase the reference count in the spec defined manner. 00087 static ExceptionList_ptr _duplicate (ExceptionList *); 00088 00089 void _destroy (void); 00090 00091 static ExceptionList_ptr _nil (void); 00092 00093 /// Add a TypeCode to the list. 00094 void add (CORBA::TypeCode_ptr tc); 00095 00096 /// Add and consume a TypeCode to the list. 00097 void add_consume (CORBA::TypeCode_ptr tc); 00098 00099 /// Return the typecode at slot i. Raises the "Bounds" exception. 00100 CORBA::TypeCode_ptr item (CORBA::ULong slot 00101 ACE_ENV_ARG_DECL_WITH_DEFAULTS); 00102 00103 /// Remove the typecode at slot i. Raises the "Bounds" exception. 00104 void remove (CORBA::ULong slot 00105 ACE_ENV_ARG_DECL_WITH_DEFAULTS); 00106 00107 /// Increment and decrement ref counts. 00108 void _incr_refcnt (void); 00109 void _decr_refcnt (void); 00110 00111 /// Useful for template programming. 00112 typedef CORBA::ExceptionList_ptr _ptr_type; 00113 typedef CORBA::ExceptionList_var _var_type; 00114 typedef CORBA::ExceptionList_out _out_type; 00115 00116 private: 00117 // = Not allowed. 00118 ExceptionList (const ExceptionList &); 00119 ExceptionList &operator= (const ExceptionList &); 00120 00121 /// Reference counter. 00122 ACE_Atomic_Op<TAO_SYNCH_MUTEX, CORBA::ULong> ref_count_; 00123 00124 /// Internal list of typecodes. 00125 ACE_Unbounded_Queue<CORBA::TypeCode_ptr> tc_list_; 00126 }; 00127 } // End CORBA namespace 00128 00129 TAO_END_VERSIONED_NAMESPACE_DECL 00130 00131 #if defined (__ACE_INLINE__) 00132 # include "tao/DynamicInterface/ExceptionList.inl" 00133 #endif /* __ACE_INLINE__ */ 00134 00135 #include /**/ "ace/post.h" 00136 00137 #endif /* TAO_CORBA_EXCEPTIONLIST_H */