it_bus/date.h

00001 #ifndef _IT_BUS_DATE_H_
00002 #define _IT_BUS_DATE_H_
00003 
00004 // @Copyright 2004 IONA Technologies, Plc. All Rights Reserved.
00005 //
00006 
00007 #include <it_bus/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 {
00020     class Duration;
00021     class DateImpl;
00022 
00027     class IT_AFC_API Date : public AnySimpleType
00028     {
00029       public:
00030         typedef IT_Reflect::ValueRef<IT_Bus::Date> IT_ReflectionType;
00031 
00035         Date();
00036 
00046         Date(
00047             short wYear, 
00048             short wMonth, 
00049             short wDay
00050         ) IT_THROW_DECL((Exception));
00051 
00059         Date(
00060             const char* value
00061         ) IT_THROW_DECL((Exception));
00062 
00070         Date(
00071             const String& value
00072         ) IT_THROW_DECL((Exception));
00073 
00077         Date(
00078             const Date& copy
00079         );
00080 
00084         virtual ~Date();
00085 
00086         virtual AnyType&
00087         copy(
00088             const AnyType& rhs
00089         );
00090 
00091         virtual void
00092         write_value(
00093             AnySimpleTypeWriter& writer
00094         ) const IT_THROW_DECL((IT_Bus::SerializationException));
00095 
00096         virtual void
00097         read_value(
00098             AnySimpleTypeReader& reader
00099         ) IT_THROW_DECL((IT_Bus::DeserializationException));
00100 
00105         virtual AnyType::Kind
00106         get_kind() const;
00107 
00113         virtual const QName&
00114         get_type() const;
00115 
00116         virtual IT_Reflect::Reflection*
00117         get_reflection()
00118             IT_THROW_DECL((IT_Reflect::ReflectException));
00119         
00120         virtual const IT_Reflect::Reflection*
00121         get_reflection() const
00122             IT_THROW_DECL((IT_Reflect::ReflectException));
00123 
00129         String
00130         to_string() const;
00131 
00137         void
00138         from_string(
00139             const String& str
00140         ) IT_THROW_DECL((Exception));
00141 
00148         short 
00149         getYear() const;
00150 
00156         void 
00157         setYear(
00158             short wYear
00159         ) IT_THROW_DECL((Exception)); 
00160 
00167         short 
00168         getMonth() const;
00169 
00175         void 
00176         setMonth(
00177             short wMonth
00178         ) IT_THROW_DECL((Exception));
00179 
00186         short 
00187         getDay() const;
00188 
00194         void 
00195         setDay(
00196             short wDay
00197         ) IT_THROW_DECL((Exception));
00198 
00204         bool
00205         haveUTCTimeZoneOffset() const;
00206 
00210         void 
00211         setLocalTimeZone();
00212 
00219         void 
00220         setUTCTimeZoneOffset(
00221             short hour_offset, 
00222             short minute_offset
00223         ) IT_THROW_DECL((Exception));
00224 
00230         void 
00231         getUTCTimeZoneOffset(
00232             short& hour_offset, 
00233             short& minute_offset
00234         ) const;
00235 
00241         bool
00242         operator==(
00243             const Date& other
00244         ) const;
00245 
00251         bool
00252         operator!=(
00253             const Date& other
00254         ) const;
00255 
00259         Date&
00260         operator=(
00261             const Date& rhs
00262         );
00263 
00267         Date&
00268         operator+=(
00269             const Duration& rhs
00270         ) IT_THROW_DECL((IT_Bus::Exception));
00271 
00275         Date&
00276         operator-=(
00277             const Duration& rhs
00278         ) IT_THROW_DECL((IT_Bus::Exception));
00279 
00280         static const QName&
00281         get_static_type();
00282         
00283       private:
00284         DateImpl* m_impl;
00285     };
00286 
00290     extern IT_AFC_API Date
00291     operator+(
00292         const Date& lhs,
00293         const Duration& rhs
00294     ) IT_THROW_DECL((IT_Bus::Exception));
00295 
00299     extern IT_AFC_API Date
00300     operator-(
00301         const Date& lhs,
00302         const Duration& rhs
00303     ) IT_THROW_DECL((IT_Bus::Exception));
00304 
00305 }
00306 
00307 #endif /*_IT_BUS_DATE_H_*/

Generated on Thu Sep 7 11:38:52 2006 for Artix by  doxygen 1.4.7