00001 #ifndef _IT_BUS_GYEARMONTH_H_
00002 #define _IT_BUS_GYEARMONTH_H_
00003
00004
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 GYearMonthImpl;
00022
00027 class IT_AFC_API GYearMonth : public AnySimpleType
00028 {
00029 public:
00030 typedef IT_Reflect::ValueRef<IT_Bus::GYearMonth> IT_ReflectionType;
00031
00040 GYearMonth(
00041 short wYear = 1,
00042 short wMonth = 1
00043 ) throw((Exception));
00044
00052 GYearMonth(
00053 const char* value
00054 ) throw((Exception));
00055
00063 GYearMonth(
00064 const String& value
00065 ) throw((Exception));
00066
00070 GYearMonth(
00071 const GYearMonth& copy
00072 );
00073
00077 virtual ~GYearMonth();
00078
00079 virtual AnyType&
00080 copy(
00081 const AnyType& rhs
00082 );
00083
00084 virtual void
00085 write_value(
00086 AnySimpleTypeWriter& writer
00087 ) const throw((IT_Bus::SerializationException));
00088
00089 virtual void
00090 read_value(
00091 AnySimpleTypeReader& reader
00092 ) throw((IT_Bus::DeserializationException));
00093
00099 virtual AnyType::Kind
00100 get_kind() const;
00101
00107 virtual const QName&
00108 get_type() const;
00109
00110 virtual IT_Reflect::Reflection*
00111 get_reflection()
00112 throw((IT_Reflect::ReflectException));
00113
00114 virtual const IT_Reflect::Reflection*
00115 get_reflection() const
00116 throw((IT_Reflect::ReflectException));
00117
00123 String
00124 to_string() const;
00125
00131 void
00132 from_string(
00133 const String& str
00134 ) throw((Exception));
00135
00141 short
00142 getYear() const;
00143
00150 void
00151 setYear(
00152 short wYear
00153 ) throw((Exception));
00154
00160 short
00161 getMonth() const;
00162
00169 void
00170 setMonth(
00171 short wMonth
00172 ) throw((Exception));
00173
00179 bool
00180 haveUTCTimeZoneOffset() const;
00181
00185 void
00186 setLocalTimeZone();
00187
00193 void
00194 getUTCTimeZoneOffset(
00195 short& hour_offset,
00196 short& minute_offset
00197 ) const;
00198
00205 void
00206 setUTCTimeZoneOffset(
00207 short hour_offset,
00208 short minute_offset
00209 ) throw((Exception));
00210
00216 bool
00217 operator==(
00218 const GYearMonth& other
00219 ) const;
00220
00226 bool
00227 operator!=(
00228 const GYearMonth& other
00229 ) const;
00230
00234 GYearMonth&
00235 operator=(
00236 const GYearMonth& rhs
00237 );
00238
00242 GYearMonth&
00243 operator+=(
00244 const Duration& rhs
00245 ) throw((IT_Bus::Exception));
00246
00250 GYearMonth&
00251 operator-=(
00252 const Duration& rhs
00253 ) throw((IT_Bus::Exception));
00254
00255 static const QName&
00256 get_static_type();
00257
00258 private:
00259 GYearMonthImpl* m_impl;
00260 };
00261
00265 extern IT_AFC_API GYearMonth
00266 operator+(
00267 const GYearMonth& lhs,
00268 const Duration& rhs
00269 ) throw((IT_Bus::Exception));
00270
00274 extern IT_AFC_API GYearMonth
00275 operator-(
00276 const GYearMonth& lhs,
00277 const Duration& rhs
00278 ) throw((IT_Bus::Exception));
00279
00280 }
00281
00282 #endif