diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-10-31 18:14:53 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-10-31 18:14:53 +0000 |
commit | b60b85d8455663b44af5a8ab90e01b28211e2aa4 (patch) | |
tree | 459333aaeffce07d580e66cfefcbc6a9b550b942 /TAO/tao/DynamicInterface/ExceptionList.cpp | |
parent | 6441a72082acd62852c9f7ccdd90aec8665821d2 (diff) | |
download | ATCD-b60b85d8455663b44af5a8ab90e01b28211e2aa4.tar.gz |
ChangeLogTag: Tue Oct 31 12:01:10 2000 Jeff Parsons <parsons@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/DynamicInterface/ExceptionList.cpp')
-rw-r--r-- | TAO/tao/DynamicInterface/ExceptionList.cpp | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/TAO/tao/DynamicInterface/ExceptionList.cpp b/TAO/tao/DynamicInterface/ExceptionList.cpp new file mode 100644 index 00000000000..dfe4bace7a4 --- /dev/null +++ b/TAO/tao/DynamicInterface/ExceptionList.cpp @@ -0,0 +1,119 @@ +// $Id$ + +#include "ExceptionList.h" +#include "tao/Typecode.h" +#include "tao/Environment.h" + +#if !defined (__ACE_INLINE__) +# include "ExceptionList.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(DynamicInterface, ExceptionList, "$Id$") + +CORBA_ExceptionList::CORBA_ExceptionList (CORBA::ULong len, + CORBA::TypeCode_ptr *tc_list) + : ref_count_ (1) +{ + for (CORBA::ULong i = 0; i < len; ++i) + { + this->add (tc_list [i]); + } +} + +CORBA_ExceptionList::~CORBA_ExceptionList (void) +{ + for (CORBA::ULong i = 0; i < this->count (); ++i) + { + CORBA::TypeCode_ptr *tc = 0; + + if (this->tc_list_.get (tc, i) == -1) + { + return; + } + + CORBA::release (*tc); + } +} + +void +CORBA_ExceptionList::add (CORBA::TypeCode_ptr tc) +{ + this->tc_list_.enqueue_tail (CORBA::TypeCode::_duplicate (tc)); +} + +void +CORBA_ExceptionList::add_consume (CORBA::TypeCode_ptr tc) +{ + this->tc_list_.enqueue_tail (tc); +} + +CORBA::TypeCode_ptr +CORBA_ExceptionList::item (CORBA::ULong slot, + CORBA::Environment &ACE_TRY_ENV) +{ + CORBA::TypeCode_ptr *tc = 0; + + if (this->tc_list_.get (tc, slot) == -1) + { + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), + CORBA::TypeCode::_nil ()); + } + else + { + return CORBA::TypeCode::_duplicate (*tc); + } +} + +void +CORBA_ExceptionList::remove (CORBA::ULong, + CORBA::Environment &ACE_TRY_ENV) +{ + ACE_THROW (CORBA::NO_IMPLEMENT ()); +} + +CORBA_ExceptionList_ptr +CORBA_ExceptionList::_duplicate (void) +{ + this->_incr_refcnt (); + return this; +} + +void +CORBA_ExceptionList::_destroy (void) +{ + this->_decr_refcnt (); +} + +void +CORBA_ExceptionList::_incr_refcnt (void) +{ + this->ref_count_++; +} + +void +CORBA_ExceptionList::_decr_refcnt (void) +{ + this->ref_count_--; + + if (this->ref_count_ == 0) + { + delete this; + } +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + +template class ACE_Node<CORBA::TypeCode_ptr>; +template class ACE_Unbounded_Queue<CORBA::TypeCode_ptr>; +template class ACE_Unbounded_Queue_Iterator<CORBA::TypeCode_ptr>; +template class ACE_Atomic_Op<ACE_SYNCH_MUTEX, CORBA::ULong>; + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +#pragma instantiate ACE_Node<CORBA::TypeCode_ptr> +#pragma instantiate ACE_Unbounded_Queue<CORBA::TypeCode_ptr> +#pragma instantiate ACE_Unbounded_Queue_Iterator<CORBA::TypeCode_ptr> +#pragma instantiate ACE_Atomic_Op<ACE_SYNCH_MUTEX, CORBA::ULong> + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + |