Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

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 
00047         NormalizedString(
00048             const NormalizedString& copy
00049         ) throw(());
00050 
00054         NormalizedString&
00055         operator=(
00056             const NormalizedString& rhs
00057         ) throw(());
00058 
00064         const String&
00065         get_value(
00066         ) const throw(());
00067 
00073         void
00074         set_value(
00075             const String& value
00076         ) throw((IT_Bus::Exception));
00077 
00083         static bool
00084         is_valid_normalized_string(
00085             const String& value
00086         ) throw(());
00087 
00088         // Implementation of methods from AnyType.
00089         //
00090         virtual AnyType&
00091         copy(
00092             const AnyType& copy
00093         );
00094 
00099         virtual AnyType::Kind
00100         get_kind() const;
00101 
00107         virtual const QName&
00108         get_type() const;
00109 
00116         virtual IT_Reflect::Reflection*
00117         get_reflection(
00118         ) throw((IT_Reflect::ReflectException));
00119         
00126         virtual const IT_Reflect::Reflection*
00127         get_reflection(
00128         ) const throw((IT_Reflect::ReflectException));
00129 
00130         // Implementation of methods from AnySimpleType.
00131         //
00132         virtual void
00133         write_value(
00134             AnySimpleTypeWriter& writer
00135         ) const throw((IT_Bus::SerializationException));
00136 
00137         virtual void
00138         read_value(
00139             AnySimpleTypeReader& reader
00140         ) throw((IT_Bus::DeserializationException));
00141 
00142         // Used by SchemaTypeTraits.
00143         //
00144         static const QName&
00145         get_static_type();
00146 
00147       protected:
00148         virtual void
00149         validate_string(
00150             const String& value
00151         ) throw((IT_Bus::Exception));
00152 
00153         virtual bool
00154         allow_empty_string() const
00155         {
00156             return true;
00157         }
00158 
00159         String m_value;
00160     };
00161 
00162     inline bool
00163     operator==(
00164         const NormalizedString& s1,
00165         const NormalizedString& s2
00166     ) throw(())
00167     {
00168         return s1.get_value() == s2.get_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 
00181 #endif /*_IT_BUS_NORMALIZED_STRING_H_*/

Generated on Wed Mar 22 12:23:03 2006 for Artix by  doxygen 1.3.9.1