diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-08-28 00:15:38 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-08-28 00:15:38 +0000 |
commit | 6421e2759868ce5d7c064bd34e6fc5bb5fe9cdda (patch) | |
tree | 46f556b7d3c01ff38a6e0483bbe3ef40cb7934c6 /TAO/tao/DynamicAny/DynSequence_i.h | |
parent | b5e068afb139dc7c6b9cf90c53571a4333105c95 (diff) | |
download | ATCD-6421e2759868ce5d7c064bd34e6fc5bb5fe9cdda.tar.gz |
ChangeLogTag:Sun Aug 27 16:02:47 2000 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'TAO/tao/DynamicAny/DynSequence_i.h')
-rw-r--r-- | TAO/tao/DynamicAny/DynSequence_i.h | 675 |
1 files changed, 675 insertions, 0 deletions
diff --git a/TAO/tao/DynamicAny/DynSequence_i.h b/TAO/tao/DynamicAny/DynSequence_i.h new file mode 100644 index 00000000000..918f2a96104 --- /dev/null +++ b/TAO/tao/DynamicAny/DynSequence_i.h @@ -0,0 +1,675 @@ +/* -*- C++ -*- */ +// $Id$ + +// =================================================================== +// +// = LIBRARY +// TAO +// +// = FILENAME +// DynSequence_i.h +// +// = AUTHOR +// Jeff Parsons <parsons@cs.wustl.edu> +// +// =================================================================== + +#ifndef TAO_DYNSEQUENCE_I_H +#define TAO_DYNSEQUENCE_I_H +#include "ace/pre.h" + +#include "tao/orbconf.h" + +#include "DynamicAny.h" + +#include "ace/Containers.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class TAO_DynamicAny_Export TAO_DynSequence_i : public virtual DynamicAny::DynSequence, public virtual TAO_Local_RefCounted_Object +{ + // = TITLE + // TAO_DynSequence_i + // + // = DESCRIPTION + // Implementation of Dynamic Any type for Sequences + // +public: + TAO_DynSequence_i (void); + // Constructor + + ~TAO_DynSequence_i (void); + // destructor + + void init (CORBA_TypeCode_ptr tc, + CORBA::Environment &ACE_TRY_ENV); + // Initialize using just a TypeCode + + void init (const CORBA_Any& any, + CORBA::Environment &ACE_TRY_ENV); + // Initialize using an Any + + // = LocalObject methods + static TAO_DynSequence_i *_narrow ( + CORBA::Object_ptr obj, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ); + virtual void *_tao_QueryInterface (ptr_arith_t type); + + // = Functions specific to DynSequence + virtual CORBA::ULong get_length ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + virtual void set_length ( + CORBA::ULong len, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::InvalidValue + )); + + virtual DynamicAny::AnySeq * get_elements ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + virtual void set_elements ( + const DynamicAny::AnySeq & value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual DynamicAny::DynAnySeq * get_elements_as_dyn_any ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + virtual void set_elements_as_dyn_any ( + const DynamicAny::DynAnySeq & value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + + // = Functions common to all Dynamic Any types + + virtual CORBA::TypeCode_ptr type ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + virtual void assign ( + DynamicAny::DynAny_ptr dyn_any, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch + )); + + virtual void from_any ( + const CORBA::Any & value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual CORBA::Any * to_any ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + virtual CORBA::Boolean equal ( + DynamicAny::DynAny_ptr dyn_any, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + virtual void destroy ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + virtual DynamicAny::DynAny_ptr copy ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + virtual void insert_boolean ( + CORBA::Boolean value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_octet ( + CORBA::Octet value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_char ( + CORBA::Char value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_short ( + CORBA::Short value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_ushort ( + CORBA::UShort value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_long ( + CORBA::Long value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_ulong ( + CORBA::ULong value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_float ( + CORBA::Float value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_double ( + CORBA::Double value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_string ( + const char * value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_reference ( + CORBA::Object_ptr value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_typecode ( + CORBA::TypeCode_ptr value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_longlong ( + CORBA::LongLong value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_ulonglong ( + CORBA::ULongLong value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_longdouble ( + CORBA::LongDouble value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_wchar ( + CORBA::WChar value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_wstring ( + const CORBA::WChar * value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_any ( + const CORBA::Any & value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual void insert_dyn_any ( + DynamicAny::DynAny_ptr value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + +#ifdef TAO_HAS_VALUETYPE + virtual void insert_val ( + CORBA::ValueBase_ptr value, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); +#endif /* TAO_HAS_VALUETYPE */ + + virtual CORBA::Boolean get_boolean ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual CORBA::Octet get_octet ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual CORBA::Char get_char ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual CORBA::Short get_short ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual CORBA::UShort get_ushort ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual CORBA::Long get_long ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual CORBA::ULong get_ulong ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual CORBA::Float get_float ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual CORBA::Double get_double ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual char * get_string ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual CORBA::Object_ptr get_reference ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual CORBA::TypeCode_ptr get_typecode ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual CORBA::LongLong get_longlong ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual CORBA::ULongLong get_ulonglong ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual CORBA::LongDouble get_longdouble ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual CORBA::WChar get_wchar ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual CORBA::WChar * get_wstring ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual CORBA::Any * get_any ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + + virtual DynamicAny::DynAny_ptr get_dyn_any ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); + +#ifdef TAO_HAS_VALUETYPE + virtual CORBA::ValueBase_ptr get_val ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch, + DynamicAny::DynAny::InvalidValue + )); +#endif /* TAO_HAS_VALUETYPE */ + + virtual CORBA::Boolean seek ( + CORBA::Long index, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + virtual void rewind ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + virtual CORBA::Boolean next ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + virtual CORBA::ULong component_count ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + virtual DynamicAny::DynAny_ptr current_component ( + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment () + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + DynamicAny::DynAny::TypeMismatch + )); + +private: + void check_typecode (CORBA::TypeCode_ptr tc, + CORBA::Environment &ACE_TRY_ENV); + // Check if the typecode is acceptable + + CORBA::TypeCode_ptr get_element_type (CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment ()); + // Utility, turns the type of elements contained in the sequence. + + // = Use copy() or assign() instead of these + TAO_DynSequence_i (const TAO_DynSequence_i &src); + TAO_DynSequence_i &operator= (const TAO_DynSequence_i &src); + +private: + CORBA::TypeCode_var type_; + // Holds the typecode of the Sequence + + CORBA::Long current_index_; + // Index of the current component + + ACE_Array_Base<DynamicAny::DynAny_var> da_members_; + // Each component is also a DynAny +}; + +#include "ace/post.h" +#endif /* TAO_DYNSEQUENCE_I_H */ |