it_bus/any_holder.h

00001 #ifndef _IT_BUS_ANY_HOLDER_H_
00002 #define _IT_BUS_ANY_HOLDER_H_
00003 
00004 // @Copyright 2004 IONA Technologies, Plc. All Rights Reserved.
00005 //
00006 
00007 #include <it_bus/api_defines.h>
00008 #include <it_bus/any_type.h>
00009 
00010 namespace IT_Reflect
00011 {
00012     template <class T>
00013     class ComplexValueRef;
00014 }
00015 
00016 namespace IT_Bus
00017 {
00018     class AnyTypeFactory;
00019     
00036     class IT_AFC_API AnyHolder : public AnyType
00037     {
00038       public:
00039 
00040         typedef IT_Reflect::ComplexValueRef<AnyHolder> IT_ReflectionType;
00041 
00042         static const QName& get_static_type();
00043 
00047         AnyHolder();
00048 
00052         AnyHolder(
00053             AnyTypeFactory* type_manager
00054         );
00055 
00059         virtual ~AnyHolder() ;
00060 
00064         AnyHolder(
00065             const AnyHolder & rhs
00066         ) ;
00067 
00071         AnyHolder& 
00072         operator=(
00073             const AnyHolder & rhs
00074         ) ;
00075 
00084         virtual AnyType&
00085         copy(
00086             const AnyType& other
00087         );
00088 
00096         virtual const QName &
00097         get_type() const ;
00098 
00105         virtual Kind
00106         get_kind() const;
00107         
00111         virtual void
00112         read(
00113             const QName & name,
00114             ComplexTypeReader & reader
00115         ) throw((DeserializationException));
00116 
00120         virtual void
00121         write(
00122             const QName & name,
00123             ComplexTypeWriter & writer
00124         ) const throw((SerializationException));
00125 
00126         virtual void
00127         read_any(
00128             const QName & type,
00129             ComplexTypeReader & reader
00130         ) throw((DeserializationException)) ;
00131 
00132         virtual void
00133         write_any(
00134             const QName & element_name,
00135             ComplexTypeWriter & writer
00136         ) const throw((SerializationException)) ;
00137 
00143         bool
00144         is_empty() const;
00145 
00146         // Set Methods
00147         //
00153         void
00154         set_boolean(
00155             const Boolean & 
00156         );
00157 
00163         void
00164         set_byte(
00165             const Byte &
00166         );
00167 
00173         void
00174         set_short(
00175             const Short &
00176         );
00177 
00183         void
00184         set_int(
00185             const Int &
00186         );
00187 
00193         void
00194         set_long(
00195             const Long &
00196         );
00197 
00203         void
00204         set_string(
00205             const String &
00206         );
00207 
00213         void
00214         set_QName(
00215             const QName &
00216         );
00217 
00223         void
00224         set_float(
00225             const Float &
00226         );
00227 
00233         void
00234         set_double(
00235             const Double &
00236         );
00237 
00243         void
00244         set_ubyte(
00245             const UByte &
00246         ) ;
00247 
00253         void
00254         set_ushort(
00255             const UShort & 
00256         );
00257 
00263         void
00264         set_uint(
00265             const UInt &
00266         );
00267 
00273         void
00274         set_ulong(
00275             const ULong &
00276         );
00277 
00283         void
00284         set_decimal(
00285             const Decimal & 
00286         );
00287 
00293         void
00294         set_any_type(
00295             const AnyType& 
00296         );
00297 
00298         // GET METHODS
00299         //
00305         Boolean &
00306         get_boolean();
00307 
00313         Byte &
00314         get_byte();
00315 
00321         Short &
00322         get_short();
00323 
00329         Int &
00330         get_int();
00331 
00337         Long &
00338         get_long();
00339 
00345         String &
00346         get_string();
00347 
00353         QName &
00354         get_QName();
00355 
00361         Float &
00362         get_float();
00363 
00369         Double &
00370         get_double();
00371 
00377         UByte &
00378         get_ubyte() ;
00379 
00385         UShort &
00386         get_ushort();
00387 
00393         UInt &
00394         get_uint();
00395 
00401         ULong &
00402         get_ulong();
00403 
00409         Decimal & 
00410         get_decimal();
00411 
00417         AnyType&
00418         get_any_type();
00419 
00420         // CONST GET METHODS
00421         //
00427         const Boolean &
00428         get_boolean() const;
00429 
00435         const Byte &
00436         get_byte() const;
00437 
00443         const Short &
00444         get_short() const;
00445 
00451         const Int &
00452         get_int() const;
00453 
00459         const Long &
00460         get_long() const;
00461 
00467         const String &
00468         get_string() const;
00469 
00475         const Float &
00476         get_float() const;
00477 
00483         const Double &
00484         get_double() const;
00485 
00491         const UByte &
00492         get_ubyte() const;
00493 
00499         const UShort &
00500         get_ushort() const;
00501 
00507         const UInt &
00508         get_uint() const;
00509 
00515         const ULong &
00516         get_ulong() const;
00517 
00523         const Decimal & 
00524         get_decimal() const;
00525 
00531         const AnyType&
00532         get_any_type() const;
00533 
00539         AnyType*
00540         release();
00541 
00546         void 
00547         clear();
00548 
00555         virtual IT_Reflect::Reflection*
00556         get_reflection()
00557             throw((IT_Reflect::ReflectException));
00558         
00565         virtual const IT_Reflect::Reflection*
00566         get_reflection() const
00567             throw((IT_Reflect::ReflectException));
00568 
00569       private:
00570 
00577         AnyType* 
00578         create_type(
00579             const QName&                               type_name,
00580             ImplementationDetails::ImplementationType  impl_type
00581         ) const 
00582             throw((DeserializationException));
00583 
00587         AnyType*        m_value;
00588         AnyTypeFactory* m_factory;
00589     };
00590 }
00591 
00592 #endif  

Generated on Tue Mar 20 15:27:40 2007 for Artix by  doxygen 1.5.1-p1