Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / DynamicAny / DynArray_i.h
blob01cb6eb8447457b56fe340b9976db0d66179597a
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file DynArray_i.h
7 * @author Jeff Parsons <parsons@cs.wustl.edu>
8 */
9 //=============================================================================
12 #ifndef TAO_DYNARRAY_I_H
13 #define TAO_DYNARRAY_I_H
14 #include /**/ "ace/pre.h"
16 #include "tao/DynamicAny/DynamicAny.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/DynamicAny/DynCommon.h"
23 #include "tao/LocalObject.h"
24 #include "ace/Containers.h"
26 #if defined (_MSC_VER)
27 # pragma warning(push)
28 # pragma warning (disable:4250)
29 #endif /* _MSC_VER */
31 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
33 /**
34 * @class TAO_DynArray_i
36 * Implementation of Dynamic Any type for arrays
38 class TAO_DynamicAny_Export TAO_DynArray_i
39 : public virtual DynamicAny::DynArray,
40 public virtual TAO_DynCommon,
41 public virtual ::CORBA::LocalObject
43 public:
44 /// Constructor.
45 TAO_DynArray_i (CORBA::Boolean allow_truncation=true);
47 /// Destructor.
48 ~TAO_DynArray_i ();
50 /// Initialize using just a TypeCode.
51 void init (CORBA::TypeCode_ptr tc);
53 /// Initialize using an Any.
54 void init (const CORBA::Any& any);
56 // = LocalObject methods
57 static TAO_DynArray_i *_narrow (CORBA::Object_ptr obj);
59 // = Functions specific to DynArray.
61 virtual DynamicAny::AnySeq * get_elements ();
63 virtual void set_elements (const DynamicAny::AnySeq & value);
65 virtual DynamicAny::DynAnySeq * get_elements_as_dyn_any ();
67 virtual void set_elements_as_dyn_any (const DynamicAny::DynAnySeq & value);
69 // = DynAny common functions not implemented in class TAO_DynCommon.
71 virtual void from_any (const CORBA::Any & value);
73 virtual CORBA::Any * to_any ();
75 virtual CORBA::Boolean equal (DynamicAny::DynAny_ptr dyn_any);
77 virtual void destroy ();
79 virtual DynamicAny::DynAny_ptr current_component ();
81 private:
82 /// Returns the type of elements contained in the array.
83 CORBA::TypeCode_ptr get_element_type ();
85 /// Gets the length of the array from the typecode.
86 CORBA::ULong get_tc_length (CORBA::TypeCode_ptr tc);
88 /// Called by both versions of init().
89 void init_common ();
91 // Use copy() or assign() instead of these.
92 TAO_DynArray_i (const TAO_DynArray_i &src);
93 TAO_DynArray_i &operator= (const TAO_DynArray_i &src);
95 private:
96 /// Each component is also a DynAny.
97 ACE_Array_Base<DynamicAny::DynAny_var> da_members_;
100 TAO_END_VERSIONED_NAMESPACE_DECL
102 #if defined(_MSC_VER)
103 # pragma warning(pop)
104 #endif /* _MSC_VER */
106 #include /**/ "ace/post.h"
107 #endif /* TAO_DYNARRAY_I_H */