2 //=============================================================================
6 * @author Jeff Parsons <parsons@cs.wustl.edu>
8 //=============================================================================
11 #ifndef TAO_DYNSTRUCT_I_H
12 #define TAO_DYNSTRUCT_I_H
13 #include /**/ "ace/pre.h"
15 #include "tao/DynamicAny/DynamicAny.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "tao/DynamicAny/DynCommon.h"
22 #include "tao/LocalObject.h"
23 #include "ace/Containers.h"
25 #if defined (_MSC_VER)
26 # pragma warning(push)
27 # pragma warning (disable:4250)
30 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
33 * @class TAO_DynStruct_i
35 * Implementation of Dynamic Any type for Structs
37 class TAO_DynamicAny_Export TAO_DynStruct_i
38 : public virtual DynamicAny::DynStruct
,
39 public virtual TAO_DynCommon
,
40 public virtual ::CORBA::LocalObject
44 TAO_DynStruct_i (CORBA::Boolean allow_truncation
=true);
49 /// Initialize using just a TypeCode.
50 void init (CORBA::TypeCode_ptr tc
);
52 /// Initialize using an Any.
53 void init (const CORBA::Any
& any
);
55 // = LocalObject methods.
56 static TAO_DynStruct_i
*_narrow (CORBA::Object_ptr obj
);
58 // = Functions specific to DynStruct.
60 virtual DynamicAny::FieldName
current_member_name ();
62 virtual CORBA::TCKind
current_member_kind ();
64 virtual DynamicAny::NameValuePairSeq
*get_members ();
66 virtual void set_members (const DynamicAny::NameValuePairSeq
& value
);
68 virtual DynamicAny::NameDynAnyPairSeq
* get_members_as_dyn_any ();
70 virtual void set_members_as_dyn_any (
71 const DynamicAny::NameDynAnyPairSeq
& value
);
73 // = DynAny common functions not implemented in class TAO_DynCommon.
75 virtual void from_any (const CORBA::Any
& value
);
77 virtual CORBA::Any
* to_any ();
79 virtual CORBA::Boolean
equal (DynamicAny::DynAny_ptr dyn_any
);
81 virtual void destroy ();
83 virtual DynamicAny::DynAny_ptr
current_component ();
86 /// Check if the typecode is acceptable.
87 void check_typecode (CORBA::TypeCode_ptr tc
);
89 /// Code common to the constructor from an Any arg and the member
90 /// function from_any().
91 void set_from_any (const CORBA::Any
&any
);
93 /// Called by both versions of init().
96 // = Use copy() or assign() instead of these.
97 TAO_DynStruct_i (const TAO_DynStruct_i
&src
);
98 TAO_DynStruct_i
&operator= (const TAO_DynStruct_i
&src
);
101 /// Each component is also a DynAny.
102 ACE_Array_Base
<DynamicAny::DynAny_var
> da_members_
;
105 TAO_END_VERSIONED_NAMESPACE_DECL
107 #if defined(_MSC_VER)
108 # pragma warning(pop)
109 #endif /* _MSC_VER */
111 #include /**/ "ace/post.h"
112 #endif /* TAO_DYNSTRUCT_I_H */