#include <OW_CIMDateTime.hpp>
Collaboration diagram for OW_NAMESPACE::CIMDateTime:
Public Types | |
typedef COWIntrusiveReference< DateTimeData > CIMDateTime::* | safe_bool |
enum | EErrorCodes { E_INVALID_DATE_TIME_FORMAT } |
Public Member Functions | |
CIMDateTime () | |
Create a new interval type of CIMDateTime set to 0's. | |
~CIMDateTime () | |
CIMDateTime (CIMNULL_t) | |
Create a new interval type of CIMDateTime this object will have a null implementation. | |
CIMDateTime (const CIMDateTime &arg) | |
Create a new CIMDateTime object that is a copy of another. | |
CIMDateTime (const String &arg) | |
Create a new CIMDateTime object from a string representation of a CIM DateTime (See description of this string format in the class documentation of CIMDateTime. | |
CIMDateTime (const DateTime &arg) | |
Create an CIMDateTime object from a regular DateTime object. | |
CIMDateTime (UInt64 microSeconds) | |
Create an CIMDateTime object that represents an interval. | |
CIMDateTime & | operator= (const CIMDateTime &arg) |
Assignment operation. | |
UInt16 | getYear () const |
UInt8 | getMonth () const |
UInt32 | getDays () const |
UInt32 | getDay () const |
UInt8 | getHours () const |
UInt8 | getMinutes () const |
UInt8 | getSeconds () const |
UInt32 | getMicroSeconds () const |
Int16 | getUtc () const |
bool | equal (const CIMDateTime &arg) const |
Check if another CIMDateTime object is equal to this one. | |
CIMDateTime & | setYear (UInt16 arg) |
Set the year component of the CIMDateTime object. | |
CIMDateTime & | setMonth (UInt8 arg) |
Set the month component of the CIMDateTime object. | |
CIMDateTime & | setDays (UInt32 arg) |
Set the days component of the CIMDateTime object. | |
CIMDateTime & | setDay (UInt32 arg) |
Set the day component of the CIMDateTime object. | |
CIMDateTime & | setHours (UInt8 arg) |
Set the hours component of the CIMDateTime object. | |
CIMDateTime & | setMinutes (UInt8 arg) |
Set the minutes component of the CIMDateTime object. | |
CIMDateTime & | setSeconds (UInt8 arg) |
Set the seconds component of the CIMDateTime object. | |
CIMDateTime & | setMicroSeconds (UInt32 arg) |
Set the microseconds component of the CIMDateTime object. | |
CIMDateTime & | setUtc (Int16 arg) |
Set the utc offset component of the CIMDateTime object. | |
bool | isInterval () const |
void | setInterval (bool val) |
void | readObject (std::istream &istrm) |
Read this object from an input stream. | |
void | writeObject (std::ostream &ostrm) const |
Write this object to an output stream. | |
String | toString () const |
DateTime | toDateTime () const |
operator safe_bool () const | |
bool | operator! () const |
Private Attributes | |
COWIntrusiveReference< DateTimeData > | m_dptr |
Friends | |
OW_COMMON_API bool | operator== (const CIMDateTime &x, const CIMDateTime &y) |
OW_COMMON_API bool | operator< (const CIMDateTime &x, const CIMDateTime &y) |
Compare 2 CIMDateTime instances. | |
Classes | |
struct | DateTimeData |
Recall that a CIM datetime may contain a date or an interval.
A date has the following form:
yyyymmddhhmmss.mmmmmmsutc
Where
yyyy = year (0000-9999) mm = month (01-12) dd = day (01-31) hh = hour (00-23) mm = minute (00-59) ss = second (00-60) normally 59, but a leap second may be present mmmmmm = microseconds (0-999999). s = '+' or '-' to represent the UTC sign. utc = UTC offset (same as GMT offset). utc is the offset from UTC in minutes. It's worth noting that when daylight saving time is in effect, the utc will be different then when it's not.
An interval has the following form:
ddddddddhhmmss.mmmmmm:000
Where
dddddddd = days hh = hours mm = minutes ss = seconds mmmmmm = microseconds
Note that intervals always end in ":000" (this is how they are distinguished from dates).
Intervals are really durations since they do not specify a start and end time (as one expects when speaking about an interval). It is better to think of an interval as specifying time elapsed since some event.
Values must be zero-padded so that the entire string is always the same 25-character length. Fields which are not significant must be replaced with asterisk characters.
CIMDateTime objects are constructed from C character strings or from DateTime objects. These character strings must be exactly twenty-five characters and conform to one of the forms idententified above.
CIMDateTime objects which are not explicitly initialized will be implicitly initialized with the null time interval:
00000000000000.000000:000
Instances can be tested for nullness with the isNull() method.
Definition at line 113 of file OW_CIMDateTime.hpp.
|
Definition at line 308 of file OW_CIMDateTime.hpp. |
|
Definition at line 134 of file OW_CIMDateTime.hpp. |
|
Create a new interval type of CIMDateTime set to 0's.
Definition at line 85 of file OW_CIMDateTime.cpp. |
|
Definition at line 90 of file OW_CIMDateTime.cpp. |
|
Create a new interval type of CIMDateTime this object will have a null implementation.
Definition at line 94 of file OW_CIMDateTime.cpp. |
|
Create a new CIMDateTime object that is a copy of another.
Definition at line 99 of file OW_CIMDateTime.cpp. |
|
Create a new CIMDateTime object from a string representation of a CIM DateTime (See description of this string format in the class documentation of CIMDateTime.
Definition at line 104 of file OW_CIMDateTime.cpp. References OW_NAMESPACE::String::c_str(), OW_NAMESPACE::fillDateTimeData(), and m_dptr. |
|
Create an CIMDateTime object from a regular DateTime object. This constructor is *not* explicit so that a DateTime can be used where a CIMDateTime may be required.
Definition at line 110 of file OW_CIMDateTime.cpp. References OW_NAMESPACE::DateTime::getMicrosecond(), m_dptr, and OW_NAMESPACE::DateTime::toLocal(). |
|
Create an CIMDateTime object that represents an interval.
Definition at line 125 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Check if another CIMDateTime object is equal to this one.
Definition at line 247 of file OW_CIMDateTime.cpp. References m_dptr. Referenced by OW_NAMESPACE::operator==(). |
|
Definition at line 395 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Definition at line 392 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Definition at line 398 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Definition at line 407 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Definition at line 401 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Definition at line 389 of file OW_CIMDateTime.cpp. References m_dptr. Referenced by OW_NAMESPACE::getMagnitude(). |
|
Definition at line 404 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Definition at line 410 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Definition at line 386 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Definition at line 413 of file OW_CIMDateTime.cpp. References m_dptr. Referenced by OW_NAMESPACE::getMagnitude(), OW_NAMESPACE::operator<(), and toString(). |
|
Definition at line 151 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Definition at line 168 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Assignment operation.
Definition at line 145 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Read this object from an input stream.
|
|
Set the day component of the CIMDateTime object.
Definition at line 205 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Set the days component of the CIMDateTime object.
Definition at line 198 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Set the hours component of the CIMDateTime object.
Definition at line 212 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Definition at line 416 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Set the microseconds component of the CIMDateTime object.
Definition at line 233 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Set the minutes component of the CIMDateTime object.
Definition at line 219 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Set the month component of the CIMDateTime object.
Definition at line 191 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Set the seconds component of the CIMDateTime object.
Definition at line 226 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Set the utc offset component of the CIMDateTime object.
Definition at line 240 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Set the year component of the CIMDateTime object.
Definition at line 184 of file OW_CIMDateTime.cpp. References m_dptr. |
|
Definition at line 321 of file OW_CIMDateTime.cpp. References toString(). |
|
Definition at line 300 of file OW_CIMDateTime.cpp. References isInterval(), and m_dptr. Referenced by OW_NAMESPACE::StringBuffer::operator+=(), OW_NAMESPACE::operator<<(), OW_NAMESPACE::String::String(), toDateTime(), and OW_NAMESPACE::toString(). |
|
Write this object to an output stream.
|
|
Compare 2 CIMDateTime instances. An interval is always less than a date/time. Comparing a CIMNULL instance is undefined, and may throw a COWNULLReference exception or dereference a NULL pointer. The result of a comparison with an invalid date/time (any value out of range) is undefined. Definition at line 465 of file OW_CIMDateTime.cpp. |
|
Definition at line 419 of file OW_CIMDateTime.cpp. |
|
Definition at line 321 of file OW_CIMDateTime.hpp. Referenced by CIMDateTime(), equal(), getDay(), getDays(), getHours(), getMicroSeconds(), getMinutes(), getMonth(), getSeconds(), getUtc(), getYear(), isInterval(), operator safe_bool(), operator!(), operator=(), setDay(), setDays(), setHours(), setInterval(), setMicroSeconds(), setMinutes(), setMonth(), setSeconds(), setUtc(), setYear(), and toString(). |