00001 // -*- C++ -*- 00002 00003 // $Id: DynArray_i.h 81429 2008-04-24 18:49:54Z johnnyw $ 00004 00005 //============================================================================= 00006 /** 00007 * @file DynArray_i.h 00008 * 00009 * $Id: DynArray_i.h 81429 2008-04-24 18:49:54Z johnnyw $ 00010 * 00011 * @author Jeff Parsons <parsons@cs.wustl.edu> 00012 */ 00013 //============================================================================= 00014 00015 00016 #ifndef TAO_DYNARRAY_I_H 00017 #define TAO_DYNARRAY_I_H 00018 #include /**/ "ace/pre.h" 00019 00020 #include "tao/DynamicAny/DynamicAny.h" 00021 00022 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00023 # pragma once 00024 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00025 00026 #include "tao/DynamicAny/DynCommon.h" 00027 #include "tao/LocalObject.h" 00028 #include "ace/Containers.h" 00029 00030 #if defined (_MSC_VER) 00031 # pragma warning(push) 00032 # pragma warning (disable:4250) 00033 #endif /* _MSC_VER */ 00034 00035 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00036 00037 /** 00038 * @class TAO_DynArray_i 00039 * 00040 * Implementation of Dynamic Any type for arrays 00041 */ 00042 class TAO_DynamicAny_Export TAO_DynArray_i 00043 : public virtual DynamicAny::DynArray, 00044 public virtual TAO_DynCommon, 00045 public virtual ::CORBA::LocalObject 00046 { 00047 public: 00048 /// Constructor. 00049 TAO_DynArray_i (void); 00050 00051 /// Destructor. 00052 ~TAO_DynArray_i (void); 00053 00054 /// Initialize using just a TypeCode. 00055 void init (CORBA::TypeCode_ptr tc); 00056 00057 /// Initialize using an Any. 00058 void init (const CORBA::Any& any); 00059 00060 // = LocalObject methods 00061 static TAO_DynArray_i *_narrow (CORBA::Object_ptr obj); 00062 00063 // = Functions specific to DynArray. 00064 00065 virtual DynamicAny::AnySeq * get_elements (void); 00066 00067 virtual void set_elements (const DynamicAny::AnySeq & value); 00068 00069 virtual DynamicAny::DynAnySeq * get_elements_as_dyn_any (void); 00070 00071 virtual void set_elements_as_dyn_any (const DynamicAny::DynAnySeq & value); 00072 00073 // = DynAny common functions not implemented in class TAO_DynCommon. 00074 00075 virtual void from_any (const CORBA::Any & value); 00076 00077 virtual CORBA::Any * to_any (void); 00078 00079 virtual CORBA::Boolean equal (DynamicAny::DynAny_ptr dyn_any); 00080 00081 virtual void destroy (void); 00082 00083 virtual DynamicAny::DynAny_ptr current_component (void); 00084 00085 private: 00086 /// Returns the type of elements contained in the array. 00087 CORBA::TypeCode_ptr get_element_type (void); 00088 00089 /// Gets the length of the array from the typecode. 00090 CORBA::ULong get_tc_length (CORBA::TypeCode_ptr tc); 00091 00092 /// Called by both versions of init(). 00093 void init_common (void); 00094 00095 // Use copy() or assign() instead of these. 00096 TAO_DynArray_i (const TAO_DynArray_i &src); 00097 TAO_DynArray_i &operator= (const TAO_DynArray_i &src); 00098 00099 private: 00100 /// Each component is also a DynAny. 00101 ACE_Array_Base<DynamicAny::DynAny_var> da_members_; 00102 }; 00103 00104 TAO_END_VERSIONED_NAMESPACE_DECL 00105 00106 #if defined(_MSC_VER) 00107 # pragma warning(pop) 00108 #endif /* _MSC_VER */ 00109 00110 #include /**/ "ace/post.h" 00111 #endif /* TAO_DYNARRAY_I_H */