DynStruct_i.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // $Id: DynStruct_i.h 77779 2007-03-23 11:48:02Z johnnyw $
00004 
00005 //=============================================================================
00006 /**
00007  *  @file    DynStruct_i.h
00008  *
00009  *  $Id: DynStruct_i.h 77779 2007-03-23 11:48:02Z johnnyw $
00010  *
00011  *  @author Jeff Parsons <parsons@cs.wustl.edu>
00012  */
00013 //=============================================================================
00014 
00015 
00016 #ifndef TAO_DYNSTRUCT_I_H
00017 #define TAO_DYNSTRUCT_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_DynStruct_i
00039  *
00040  * Implementation of Dynamic Any type for Structs
00041  */
00042 class TAO_DynamicAny_Export TAO_DynStruct_i
00043   : public virtual DynamicAny::DynStruct,
00044     public virtual TAO_DynCommon,
00045     public virtual TAO_Local_RefCounted_Object
00046 {
00047 public:
00048   /// Constructor.
00049   TAO_DynStruct_i (void);
00050 
00051   /// Destructor.
00052   ~TAO_DynStruct_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_DynStruct_i *_narrow (CORBA::Object_ptr obj);
00062 
00063   // = Functions specific to DynStruct.
00064 
00065   virtual DynamicAny::FieldName current_member_name (void);
00066 
00067   virtual CORBA::TCKind current_member_kind (void);
00068 
00069   virtual DynamicAny::NameValuePairSeq *get_members (void);
00070 
00071   virtual void set_members (const DynamicAny::NameValuePairSeq& value);
00072 
00073   virtual DynamicAny::NameDynAnyPairSeq * get_members_as_dyn_any (void);
00074 
00075   virtual void set_members_as_dyn_any (
00076       const DynamicAny::NameDynAnyPairSeq & value);
00077 
00078   // = DynAny common functions not implemented in class TAO_DynCommon.
00079 
00080   virtual void from_any (const CORBA::Any & value);
00081 
00082   virtual CORBA::Any * to_any (void);
00083 
00084   virtual CORBA::Boolean equal (DynamicAny::DynAny_ptr dyn_any);
00085 
00086   virtual void destroy (void);
00087 
00088   virtual DynamicAny::DynAny_ptr current_component (void);
00089 
00090 private:
00091   /// Check if the typecode is acceptable.
00092   void check_typecode (CORBA::TypeCode_ptr tc);
00093 
00094   /// Code common to the constructor from an Any arg and the member
00095   /// function from_any().
00096   void set_from_any (const CORBA::Any &any);
00097 
00098   /// Called by both versions of init().
00099   void init_common (void);
00100 
00101   // = Use copy() or assign() instead of these.
00102   TAO_DynStruct_i (const TAO_DynStruct_i &src);
00103   TAO_DynStruct_i &operator= (const TAO_DynStruct_i &src);
00104 
00105 private:
00106   /// Each component is also a DynAny.
00107   ACE_Array_Base<DynamicAny::DynAny_var> da_members_;
00108 };
00109 
00110 TAO_END_VERSIONED_NAMESPACE_DECL
00111 
00112 #if defined(_MSC_VER)
00113 # pragma warning(pop)
00114 #endif /* _MSC_VER */
00115 
00116 #include /**/ "ace/post.h"
00117 #endif /* TAO_DYNSTRUCT_I_H */

Generated on Sun Jan 27 13:36:29 2008 for TAO_DynamicAny by doxygen 1.3.6