DynUnion_i.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // $Id: DynUnion_i.h 81429 2008-04-24 18:49:54Z johnnyw $
00004 
00005 //=============================================================================
00006 /**
00007  *  @file    DynUnion_i.h
00008  *
00009  *  $Id: DynUnion_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_DYNUNION_I_H
00017 #define TAO_DYNUNION_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 
00029 #if defined (_MSC_VER)
00030 # pragma warning(push)
00031 # pragma warning (disable:4250)
00032 #endif /* _MSC_VER */
00033 
00034 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00035 
00036 /**
00037  * @class TAO_DynUnion_i
00038  *
00039  * Implementation of Dynamic Any type for Unions.
00040  */
00041 class TAO_DynamicAny_Export TAO_DynUnion_i
00042   : public virtual DynamicAny::DynUnion,
00043     public virtual TAO_DynCommon,
00044     public virtual ::CORBA::LocalObject
00045 {
00046 public:
00047   /// Constructor.
00048   TAO_DynUnion_i (void);
00049 
00050   /// Destructor.
00051   ~TAO_DynUnion_i (void);
00052 
00053   /// Constructor taking an Any argument.
00054   void init (const CORBA::Any& any);
00055 
00056   /// Constructor taking a typecode argument.
00057   void init (CORBA::TypeCode_ptr tc);
00058 
00059   // = LocalObject methods.
00060   static TAO_DynUnion_i *_narrow (CORBA::Object_ptr obj);
00061 
00062   // = Functions specific to DynUnion.
00063 
00064   virtual DynamicAny::DynAny_ptr get_discriminator (void);
00065 
00066   virtual void set_discriminator (DynamicAny::DynAny_ptr d);
00067 
00068   virtual void set_to_default_member (void);
00069 
00070   virtual void set_to_no_active_member (void);
00071 
00072   virtual CORBA::Boolean has_no_active_member (void);
00073 
00074   virtual CORBA::TCKind discriminator_kind (void);
00075 
00076   virtual DynamicAny::DynAny_ptr member (void);
00077 
00078   virtual char * member_name (void);
00079 
00080   virtual CORBA::TCKind member_kind (void);
00081 
00082   // = DynAny common functions not implemented in class TAO_DynCommon.
00083 
00084   virtual void from_any (const CORBA::Any & value);
00085 
00086   virtual CORBA::Any * to_any (void);
00087 
00088   virtual CORBA::Boolean equal (DynamicAny::DynAny_ptr dyn_any);
00089 
00090   virtual void destroy (void);
00091 
00092   virtual DynamicAny::DynAny_ptr current_component (void);
00093 
00094 private:
00095   /// Code common to the constructor from an Any arg and the member
00096   /// function from_any().
00097   void set_from_any (const CORBA::Any &any);
00098 
00099   /// Called by both versions of init().
00100   void init_common (void);
00101 
00102   /// Iterative check for label value match.
00103   CORBA::Boolean label_match (const CORBA::Any &my_any,
00104                               const CORBA::Any &other_any);
00105 
00106   /// Use copy() or assign() instead of these.
00107   TAO_DynUnion_i (const TAO_DynUnion_i &src);
00108   TAO_DynUnion_i &operator= (const TAO_DynUnion_i &src);
00109 
00110 private:
00111   /// Just two components.
00112   DynamicAny::DynAny_var member_;
00113   DynamicAny::DynAny_var discriminator_;
00114 
00115   /// The active member's slot in the union type code.
00116   CORBA::ULong member_slot_;
00117 };
00118 
00119 TAO_END_VERSIONED_NAMESPACE_DECL
00120 
00121 #if defined(_MSC_VER)
00122 # pragma warning(pop)
00123 #endif /* _MSC_VER */
00124 
00125 #include /**/ "ace/post.h"
00126 #endif /* TAO_DYNUNION_I_H */

Generated on Tue Feb 2 17:43:11 2010 for TAO_DynamicAny by  doxygen 1.4.7