2 //=============================================================================
6 * @author Jeff Parsons <parsons@cs.wustl.edu>
8 //=============================================================================
11 #ifndef TAO_DYNUNION_I_H
12 #define TAO_DYNUNION_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"
24 #if defined (_MSC_VER)
25 # pragma warning(push)
26 # pragma warning (disable:4250)
29 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
32 * @class TAO_DynUnion_i
34 * Implementation of Dynamic Any type for Unions.
36 class TAO_DynamicAny_Export TAO_DynUnion_i
37 : public virtual DynamicAny::DynUnion
,
38 public virtual TAO_DynCommon
,
39 public virtual ::CORBA::LocalObject
43 TAO_DynUnion_i (CORBA::Boolean allow_truncation
=true);
48 /// Constructor taking an Any argument.
49 void init (const CORBA::Any
& any
);
51 /// Constructor taking a typecode argument.
52 void init (CORBA::TypeCode_ptr tc
);
54 // = LocalObject methods.
55 static TAO_DynUnion_i
*_narrow (CORBA::Object_ptr obj
);
57 // = Functions specific to DynUnion.
59 virtual DynamicAny::DynAny_ptr
get_discriminator ();
61 virtual void set_discriminator (DynamicAny::DynAny_ptr d
);
63 virtual void set_to_default_member ();
65 virtual void set_to_no_active_member ();
67 virtual CORBA::Boolean
has_no_active_member ();
69 virtual CORBA::TCKind
discriminator_kind ();
71 virtual DynamicAny::DynAny_ptr
member ();
73 virtual char * member_name ();
75 virtual CORBA::TCKind
member_kind ();
77 // = DynAny common functions not implemented in class TAO_DynCommon.
79 virtual void from_any (const CORBA::Any
& value
);
81 virtual CORBA::Any
* to_any ();
83 virtual CORBA::Boolean
equal (DynamicAny::DynAny_ptr dyn_any
);
85 virtual void destroy ();
87 virtual DynamicAny::DynAny_ptr
current_component ();
90 /// Code common to the constructor from an Any arg and the member
91 /// function from_any().
92 void set_from_any (const CORBA::Any
&any
);
94 /// Called by both versions of init().
97 /// Iterative check for label value match.
98 CORBA::Boolean
label_match (const CORBA::Any
&my_any
,
99 const CORBA::Any
&other_any
);
101 /// Use copy() or assign() instead of these.
102 TAO_DynUnion_i (const TAO_DynUnion_i
&src
);
103 TAO_DynUnion_i
&operator= (const TAO_DynUnion_i
&src
);
106 /// Just two components.
107 DynamicAny::DynAny_var member_
;
108 DynamicAny::DynAny_var discriminator_
;
110 /// The active member's slot in the union type code.
111 CORBA::ULong member_slot_
;
114 TAO_END_VERSIONED_NAMESPACE_DECL
116 #if defined(_MSC_VER)
117 # pragma warning(pop)
118 #endif /* _MSC_VER */
120 #include /**/ "ace/post.h"
121 #endif /* TAO_DYNUNION_I_H */