it_bus/any_type.h

00001 #ifndef _IT_BUS_ANY_TYPE_H_
00002 #define _IT_BUS_ANY_TYPE_H_
00003 
00004 // @Copyright 2004 IONA Technologies, Plc. All Rights Reserved.
00005 //
00006 
00007 #include <it_bus/serialization_exception.h>
00008 #include <it_bus/deserialization_exception.h>
00009 #include <it_bus/reflect/reflect_exception.h>
00010 #include <it_bus/implementation_details.h>
00011 
00012 namespace IT_Reflect
00013 {
00014     class Reflection;
00015     class NullReflection;
00016 }
00017 
00018 namespace IT_Bus
00019 {
00020     class ComplexTypeWriter;
00021     class ComplexTypeReader;
00022     class QName;
00023 
00028     class IT_AFC_API AnyType :
00029       public ImplementationDetails
00030     {
00031       public:
00057         enum Kind 
00058         {
00059             NONE,               // AnyType::get_kind() will never return this.
00060             BUILT_IN,           // Instance of a built-in type
00061             SIMPLE,             // Instance of simpleType restriction
00062             SEQUENCE,
00063             ALL,
00064             CHOICE,
00065             SIMPLE_CONTENT,
00066             ELEMENT_LIST,
00067             SOAP_ENC_ARRAY,
00068             COMPLEX_CONTENT,
00069             NILLABLE,
00070             ANY_HOLDER,
00071             ANY,                 // Instance of xsd:any.
00072             ANY_LIST,
00073             SIMPLE_TYPE_LIST,
00074             SIMPLE_TYPE_UNION,
00075             TYPE_LIST
00076         };
00077 
00078         // Default reflection type for types that do not support reflection.
00079         typedef IT_Reflect::NullReflection IT_ReflectionType;
00080 
00084         AnyType();
00085 
00089         virtual ~AnyType();
00090 
00097         virtual Kind
00098         get_kind() const;
00099         
00105         virtual const QName &
00106         get_type() const = 0;
00107 
00112         virtual void
00113         read(
00114             const QName& name,
00115             ComplexTypeReader& reader
00116         ) throw((IT_Bus::DeserializationException)) = 0;
00117 
00122         virtual void
00123         write(
00124             const QName& name,
00125             ComplexTypeWriter& writer
00126         ) const throw((IT_Bus::SerializationException)) = 0;
00127 
00134         virtual IT_Reflect::Reflection*
00135         get_reflection()
00136             throw((IT_Reflect::ReflectException));
00137         
00144         virtual const IT_Reflect::Reflection*
00145         get_reflection() const
00146             throw((IT_Reflect::ReflectException));
00147 
00157         virtual 
00158         AnyType&
00159         copy(
00160             const AnyType & rhs
00161         );
00162 
00164         virtual
00165         void
00166         set_holder_type(
00167             const QName& type
00168         );
00169     };
00170 }
00171 
00172 #endif  

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