summaryrefslogtreecommitdiff
path: root/TAO/tao/DynamicInterface/ExceptionList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/DynamicInterface/ExceptionList.cpp')
-rw-r--r--TAO/tao/DynamicInterface/ExceptionList.cpp108
1 files changed, 108 insertions, 0 deletions
diff --git a/TAO/tao/DynamicInterface/ExceptionList.cpp b/TAO/tao/DynamicInterface/ExceptionList.cpp
new file mode 100644
index 00000000000..18de9aee9d0
--- /dev/null
+++ b/TAO/tao/DynamicInterface/ExceptionList.cpp
@@ -0,0 +1,108 @@
+#include "tao/DynamicInterface/ExceptionList.h"
+
+ACE_RCSID (DynamicInterface,
+ ExceptionList,
+ "$Id$")
+
+#include "tao/AnyTypeCode/TypeCode.h"
+#include "tao/Environment.h"
+#include "tao/SystemException.h"
+
+#if !defined (__ACE_INLINE__)
+# include "tao/DynamicInterface/ExceptionList.inl"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+CORBA::ExceptionList::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::~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
+ ACE_ENV_ARG_DECL)
+{
+ 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
+ ACE_ENV_ARG_DECL)
+{
+ 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)
+{
+ CORBA::ULong refcount = --this->ref_count_;
+
+ if (refcount == 0)
+ {
+ delete this;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL