00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00029
00030
00031
00032 #ifndef Pegasus_CIMDateTime_h
00033 #define Pegasus_CIMDateTime_h
00034
00035 #include <Pegasus/Common/Config.h>
00036 #include <Pegasus/Common/Array.h>
00037 #include <Pegasus/Common/Linkage.h>
00038
00039 PEGASUS_NAMESPACE_BEGIN
00040
00041 struct CIMDateTimeRep;
00042 class CMPISCMOUtilities;
00043
00119 class PEGASUS_COMMON_LINKAGE CIMDateTime
00120 {
00121 public:
00122
00123 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
00124
00127 static const Uint32 WILDCARD;
00128
00129 #endif
00130
00133 CIMDateTime();
00134
00138 CIMDateTime(const CIMDateTime& x);
00139
00149 CIMDateTime(const String& str);
00150
00163 CIMDateTime(Uint64 usec, Boolean isInterval);
00164
00165 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
00166
00182 CIMDateTime(
00183 Uint32 year,
00184 Uint32 month,
00185 Uint32 day,
00186 Uint32 hours,
00187 Uint32 minutes,
00188 Uint32 seconds,
00189 Uint32 microseconds,
00190 Uint32 numSignificantMicrosecondDigits,
00191 Sint32 utcOffset);
00192
00205 CIMDateTime(
00206 Uint32 days,
00207 Uint32 hours,
00208 Uint32 minutes,
00209 Uint32 seconds,
00210 Uint32 microseconds,
00211 Uint32 numSignificantMicrosecondDigits);
00212
00213 #endif
00214
00216 ~CIMDateTime();
00217
00230 CIMDateTime& operator=(const CIMDateTime& x);
00231
00236 String toString() const;
00237
00252 void set(const String & str);
00253
00254 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
00255
00271 void setTimeStamp(
00272 Uint32 year,
00273 Uint32 month,
00274 Uint32 day,
00275 Uint32 hours,
00276 Uint32 minutes,
00277 Uint32 seconds,
00278 Uint32 microseconds,
00279 Uint32 numSignificantMicrosecondDigits,
00280 Sint32 utcOffset);
00281
00294 void setInterval(
00295 Uint32 days,
00296 Uint32 hours,
00297 Uint32 minutes,
00298 Uint32 seconds,
00299 Uint32 microseconds,
00300 Uint32 numSignificantMicrosecondDigits);
00301
00302 #endif
00303
00307 void clear();
00308
00312 static CIMDateTime getCurrentDateTime();
00313
00323 static Sint64 getDifference(CIMDateTime startTime, CIMDateTime finishTime);
00324
00328 Boolean isInterval() const;
00329
00334 Boolean isInterval();
00335
00336 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
00337
00341 Boolean isTimeStamp() const;
00342
00343 #endif
00344
00351 Boolean equal(const CIMDateTime& x) const;
00352
00359 Uint64 toMicroSeconds() const;
00360
00371 CIMDateTime operator+(const CIMDateTime& x) const;
00372
00383 CIMDateTime & operator+=(const CIMDateTime& x);
00384
00396 CIMDateTime operator-(const CIMDateTime& x) const;
00397
00410 CIMDateTime & operator-=(const CIMDateTime& x);
00411
00422 CIMDateTime operator*(Uint64 x) const;
00423
00435 CIMDateTime & operator*=(Uint64 x);
00436
00448 CIMDateTime operator/(Uint64 num) const;
00449
00462 CIMDateTime & operator/=(Uint64 num);
00463
00476 Uint64 operator/(const CIMDateTime& cdt) const;
00477
00487 Boolean operator<(const CIMDateTime& x) const;
00488
00499 Boolean operator<=(const CIMDateTime& x) const;
00500
00510 Boolean operator>(const CIMDateTime & x) const;
00511
00522 Boolean operator>=(const CIMDateTime & x) const;
00523
00533 Boolean operator!=(const CIMDateTime & x) const;
00534
00535 private:
00536 CIMDateTimeRep* _rep;
00537 CIMDateTime(CIMDateTimeRep*);
00538 CIMDateTime(const CIMDateTimeRep*);
00539
00540 friend class CIMBuffer;
00541 friend class SCMOClass;
00542 friend class SCMODump;
00543 friend class SCMOInstance;
00544 friend class CMPISCMOUtilities;
00545 };
00546
00554 PEGASUS_COMMON_LINKAGE Boolean operator==(
00555 const CIMDateTime& x,
00556 const CIMDateTime& y);
00557
00558 #define PEGASUS_ARRAY_T CIMDateTime
00559 # include <Pegasus/Common/ArrayInter.h>
00560 #undef PEGASUS_ARRAY_T
00561
00562 PEGASUS_NAMESPACE_END
00563
00564 #endif