it_bus/normalized_string.h

00001 #ifndef _IT_BUS_NORMALIZED_STRING_H_
00002 #define _IT_BUS_NORMALIZED_STRING_H_
00003 
00004 // @Copyright 2004 IONA Technologies, Plc. All Rights Reserved.
00005 //
00006 
00007 #include <it_cal/types.h>
00008 #include <it_bus/exception.h>
00009 #include <it_bus/api_defines.h>
00010 #include <it_bus/any_simple_type.h>
00011 
00012 namespace IT_Reflect 
00013 {
00014     class Reflection;
00015     template <class T> class ValueRef;
00016 }
00017 
00018 namespace IT_Bus
00019 {
00023     class IT_AFC_API NormalizedString : public AnySimpleType
00024     {
00025       public:
00026         typedef IT_Reflect::ValueRef<IT_Bus::NormalizedString>
00027         IT_ReflectionType;
00028 
00032         NormalizedString(
00033         ) throw(());
00034 
00040         NormalizedString(
00041             const String& value
00042         ) throw((IT_Bus::Exception));
00043 
00049         NormalizedString(
00050             const char* value
00051         ) throw((IT_Bus::Exception));
00052 
00056         NormalizedString(
00057             const NormalizedString& copy
00058         ) throw(());
00059 
00063         NormalizedString&
00064         operator=(
00065             const NormalizedString& rhs
00066         ) throw(());
00067 
00073         const String&
00074         get_value(
00075         ) const throw(());
00076 
00082         void
00083         set_value(
00084             const String& value
00085         ) throw((IT_Bus::Exception));
00086 
00092         static bool
00093         is_valid_normalized_string(
00094             const String& value
00095         ) throw(());
00096 
00097         // Implementation of methods from AnyType.
00098         //
00099         virtual AnyType&
00100         copy(
00101             const AnyType& copy
00102         );
00103 
00108         virtual AnyType::Kind
00109         get_kind() const;
00110 
00116         virtual const QName&
00117         get_type() const;
00118 
00125         virtual IT_Reflect::Reflection*
00126         get_reflection(
00127         ) throw((IT_Reflect::ReflectException));
00128         
00135         virtual const IT_Reflect::Reflection*
00136         get_reflection(
00137         ) const throw((IT_Reflect::ReflectException));
00138 
00139         // Implementation of methods from AnySimpleType.
00140         //
00141         virtual void
00142         write_value(
00143             AnySimpleTypeWriter& writer
00144         ) const throw((IT_Bus::SerializationException));
00145 
00146         virtual void
00147         read_value(
00148             AnySimpleTypeReader& reader
00149         ) throw((IT_Bus::DeserializationException));
00150 
00151         // Used by SchemaTypeTraits.
00152         //
00153         static const QName&
00154         get_static_type();
00155 
00156       protected:
00157         virtual void
00158         validate_string(
00159             const String& value
00160         ) throw((IT_Bus::Exception));
00161 
00162         virtual bool
00163         allow_empty_string() const
00164         {
00165             return true;
00166         }
00167 
00168         String m_value;
00169     };
00170 
00171     inline bool
00172     operator==(
00173         const NormalizedString& s1,
00174         const NormalizedString& s2
00175     ) throw(())
00176     {
00177         return s1.get_value() == s2.get_value();
00178     }
00179 
00180     inline bool
00181     operator!=(
00182         const NormalizedString& s1,
00183         const NormalizedString& s2
00184     ) throw(())
00185     {
00186         return s1.get_value() != s2.get_value();
00187     }
00188 }
00189 
00190 #endif /*_IT_BUS_NORMALIZED_STRING_H_*/

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