DynEnum_i.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 // $Id: DynEnum_i.h 77779 2007-03-23 11:48:02Z johnnyw $
00004 
00005 //=============================================================================
00006 /**
00007  *  @file    DynEnum_i.h
00008  *
00009  *  $Id: DynEnum_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_DYNENUM_I_H
00017 #define TAO_DYNENUM_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_DynEnum_i
00039  *
00040  * Implementation of Dynamic Any type for enums
00041  */
00042 class TAO_DynamicAny_Export TAO_DynEnum_i
00043   : public virtual DynamicAny::DynEnum,
00044     public virtual TAO_DynCommon,
00045     public virtual TAO_Local_RefCounted_Object
00046 {
00047 public:
00048   /// Constructor.
00049   TAO_DynEnum_i (void);
00050 
00051   /// Destructor.
00052   ~TAO_DynEnum_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_DynEnum_i *_narrow (CORBA::Object_ptr obj);
00062 
00063   // = Functions specific to DynEnum.
00064 
00065   virtual char * get_as_string (void);
00066 
00067   virtual void set_as_string (const char * value);
00068 
00069   virtual CORBA::ULong get_as_ulong (void);
00070 
00071   virtual void set_as_ulong (CORBA::ULong value);
00072 
00073   // = DynAny common functions not implemented in class TAO_DynCommon.
00074 
00075   virtual void from_any (const CORBA::Any & value);
00076 
00077   virtual CORBA::Any * to_any (void);
00078 
00079   virtual CORBA::Boolean equal (DynamicAny::DynAny_ptr dyn_any);
00080 
00081   virtual void destroy (void);
00082 
00083   virtual DynamicAny::DynAny_ptr current_component (void);
00084 
00085 private:
00086   // Called by both versions of init().
00087   void init_common (void);
00088 
00089   // = Use copy() or assign() instead of these.
00090   TAO_DynEnum_i (const TAO_DynEnum_i &src);
00091   TAO_DynEnum_i &operator= (const TAO_DynEnum_i &src);
00092 
00093 private:
00094   /// Current numeric value of the enum.
00095   CORBA::ULong value_;
00096 };
00097 
00098 TAO_END_VERSIONED_NAMESPACE_DECL
00099 
00100 #if defined(_MSC_VER)
00101 # pragma warning(pop)
00102 #endif /* _MSC_VER */
00103 
00104 #include /**/ "ace/post.h"
00105 #endif /* TAO_DYNENUM_I_H */

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