Classes | Public Member Functions | Static Public Member Functions

blpapi::Datetime Class Reference

#include <blpapi_datetime.h>

List of all members.

Classes

struct  Microseconds
struct  Milliseconds
struct  Nanoseconds
struct  Offset
struct  Picoseconds
struct  TimeTag

Public Member Functions

 Datetime ()
 Datetime (const Datetime &original)
 Datetime (const blpapi_Datetime_t &rawValue)
 Datetime (const blpapi_HighPrecisionDatetime_t &rawValue)
 Datetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds)
 Datetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, unsigned milliseconds)
 Datetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Milliseconds fractionOfSecond)
 Datetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Microseconds fractionOfSecond)
 Datetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Nanoseconds fractionOfSecond)
 Datetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Picoseconds fractionOfSecond)
 Datetime (unsigned year, unsigned month, unsigned day)
 Datetime (unsigned hours, unsigned minutes, unsigned seconds, unsigned milliseconds)
 Datetime (unsigned hours, unsigned minutes, unsigned seconds, Milliseconds fractionOfSecond)
 Datetime (unsigned hours, unsigned minutes, unsigned seconds, Microseconds fractionOfSecond)
 Datetime (unsigned hours, unsigned minutes, unsigned seconds, Nanoseconds fractionOfSecond)
 Datetime (unsigned hours, unsigned minutes, unsigned seconds, Picoseconds fractionOfSecond)
Datetimeoperator= (const Datetime &rhs)
void setDate (unsigned year, unsigned month, unsigned day)
void setTime (unsigned hours, unsigned minutes, unsigned seconds)
void setTime (unsigned hours, unsigned minutes, unsigned seconds, unsigned milliseconds)
void setTime (unsigned hours, unsigned minutes, unsigned seconds, Milliseconds fractionOfSecond)
void setTime (unsigned hours, unsigned minutes, unsigned seconds, Microseconds fractionOfSecond)
void setTime (unsigned hours, unsigned minutes, unsigned seconds, Nanoseconds fractionOfSecond)
void setTime (unsigned hours, unsigned minutes, unsigned seconds, Picoseconds fractionOfSecond)
void setOffset (short minutesAheadOfUTC)
void setYear (unsigned value)
void setMonth (unsigned value)
void setDay (unsigned value)
void setHours (unsigned value)
void setMinutes (unsigned value)
void setSeconds (unsigned value)
void setMilliseconds (unsigned milliseconds)
void setFractionOfSecond (Milliseconds value)
void setFractionOfSecond (Microseconds value)
void setFractionOfSecond (Nanoseconds value)
void setFractionOfSecond (Picoseconds value)
blpapi_Datetime_trawValue ()
blpapi_HighPrecisionDatetime_trawHighPrecisionValue ()
bool hasParts (unsigned parts) const
unsigned parts () const
unsigned year () const
unsigned month () const
unsigned day () const
unsigned hours () const
unsigned minutes () const
unsigned seconds () const
unsigned milliSeconds () const
unsigned milliseconds () const
unsigned microseconds () const
unsigned nanoseconds () const
unsigned long long picoseconds () const
short offset () const
const blpapi_Datetime_trawValue () const
const
blpapi_HighPrecisionDatetime_t
rawHighPrecisionValue () const
bool isValid () const
std::ostream & print (std::ostream &stream, int level=0, int spacesPerLevel=4) const

Static Public Member Functions

static bool isValidDate (int year, int month, int day)
static bool isValidTime (int hours, int minutes, int seconds)
static bool isValidTime (int hours, int minutes, int seconds, int milliSeconds)
static bool isValidTime (int hours, int minutes, int seconds, Milliseconds fractionOfSecond)
static bool isValidTime (int hours, int minutes, int seconds, Microseconds fractionOfSecond)
static bool isValidTime (int hours, int minutes, int seconds, Nanoseconds fractionOfSecond)
static bool isValidTime (int hours, int minutes, int seconds, Picoseconds fractionOfSecond)
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds)
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Offset offset)
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Milliseconds fractionOfSecond)
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Microseconds fractionOfSecond)
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Nanoseconds fractionOfSecond)
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Picoseconds fractionOfSecond)
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Milliseconds fractionOfSecond, Offset offset)
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Microseconds fractionOfSecond, Offset offset)
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Nanoseconds fractionOfSecond, Offset offset)
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Picoseconds fractionOfSecond, Offset offset)
static Datetime createDate (unsigned year, unsigned month, unsigned day)
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds)
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Offset offset)
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, unsigned milliseconds)
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, unsigned milliseconds, Offset offset)
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Milliseconds fractionOfSecond)
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Microseconds fractionOfSecond)
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Nanoseconds fractionOfSecond)
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Picoseconds fractionOfSecond)
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Milliseconds fractionOfSecond, Offset offset)
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Microseconds fractionOfSecond, Offset offset)
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Nanoseconds fractionOfSecond, Offset offset)
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Picoseconds fractionOfSecond, Offset offset)

Detailed Description

Represents a date and/or time.

Datetime can represent a date and/or a time or any combination of the components of a date and time. The value is represented as eight parts which can be set or queried independently.

These parts are: year; month (from January as 1 to December as 12); day (of month, from 1 to 31); hour (from 0 to 23); minute (0 to 59); second (0 to 59); fraction-of-second (logically representing arbitrary precision, with the current interface providing picosecond resolution); and offset (time zone as minutes ahead of UTC).

Methods are provided to set and query the parts individually and in groups, e.g. setDate() and setTime(). It is also possible to determine which parts of the Datetime have been set (via the parts() method).


Constructor & Destructor Documentation

blpapi::Datetime::Datetime (  ) 

Construct a Datetime object with all parts unset.

blpapi::Datetime::Datetime ( const Datetime original  ) 

Copy constructor.

blpapi::Datetime::Datetime ( const blpapi_Datetime_t rawValue  ) 
blpapi::Datetime::Datetime ( const blpapi_HighPrecisionDatetime_t rawValue  )  [explicit]
blpapi::Datetime::Datetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds 
)

Create a Datetime object having the value representing the specified year, month, day, hours, minutes, and seconds parts. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function, and hours, minutes, and seconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by DATE and TIME set, and the OFFSET and FRACSECONDS parts unset. Use of this function is discouraged; use createDatetime instead.

blpapi::Datetime::Datetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
unsigned  milliseconds 
)

Create a Datetime object having the value representing the specified year, month, day, hours, minutes, seconds, and milliseconds. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function, and hours, minutes, seconds, and milliseconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by DATE and TIMEFRACSECONDS set, and the OFFSET part unset. Use of this function is discouraged; use createDatetime instead.

blpapi::Datetime::Datetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Milliseconds  fractionOfSecond 
)
blpapi::Datetime::Datetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Microseconds  fractionOfSecond 
)
blpapi::Datetime::Datetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Nanoseconds  fractionOfSecond 
)
blpapi::Datetime::Datetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Picoseconds  fractionOfSecond 
)

Create a Datetime object having the value representing the specified year, month, day, hours, minutes, seconds, and fractionOfSecond. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function, and hours, minutes, seconds, and fractionOfSecond represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by DATE and TIMEFRACSECONDS set, and the OFFSET part unset. Use of these functions is discouraged; use createDatetime instead.

blpapi::Datetime::Datetime ( unsigned  year,
unsigned  month,
unsigned  day 
)

Create a Datetime object having the value representing the specified year, month, and day. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function. The resulting Datetime object has the parts specified by DATE set, and all other parts unset. Note that constructing a Datetime from three integers produces a date; to create a time from hour, minute, and second (without the fraction-of-second part unset) use the constructor taking a TimeTag. Use of this function is discouraged; use createDate instead.

blpapi::Datetime::Datetime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
unsigned  milliseconds 
)

Create a Datetime object having the value representing the specified hours, minutes, seconds, and milliseconds. The behavior is undefined unless hours, minutes, seconds, and milliseconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by TIMEFRACSECONDS set, and all other parts unset. Note that removing the final argument from a call to this function results in a constructor creating a date, not a time.

blpapi::Datetime::Datetime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Milliseconds  fractionOfSecond 
)
blpapi::Datetime::Datetime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Microseconds  fractionOfSecond 
)
blpapi::Datetime::Datetime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Nanoseconds  fractionOfSecond 
)
blpapi::Datetime::Datetime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Picoseconds  fractionOfSecond 
)

Create a Datetime object having the value representing the specified hours, minutes, seconds, and fractionOfSecond. The behavior is undefined unless hours, minutes, seconds, and fractionOfSecond represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by TIMEFRACSECONDS set, and all other parts unset. Note that removing the final argument from a call to this function results in a constructor creating a date, not a time.


Member Function Documentation

static bool blpapi::Datetime::isValidDate ( int  year,
int  month,
int  day 
) [static]

Return true if the specified year, month, and day represent a valid calendar date, and false otherwise. Note that many functions within Datetime provide defined behavior only when valid dates are provided as arguments.

static bool blpapi::Datetime::isValidTime ( int  hours,
int  minutes,
int  seconds 
) [static]
static bool blpapi::Datetime::isValidTime ( int  hours,
int  minutes,
int  seconds,
int  milliSeconds 
) [static]
static bool blpapi::Datetime::isValidTime ( int  hours,
int  minutes,
int  seconds,
Milliseconds  fractionOfSecond 
) [static]
static bool blpapi::Datetime::isValidTime ( int  hours,
int  minutes,
int  seconds,
Microseconds  fractionOfSecond 
) [static]
static bool blpapi::Datetime::isValidTime ( int  hours,
int  minutes,
int  seconds,
Nanoseconds  fractionOfSecond 
) [static]
static bool blpapi::Datetime::isValidTime ( int  hours,
int  minutes,
int  seconds,
Picoseconds  fractionOfSecond 
) [static]

Return true if the specified hours, minutes, seconds, and (optionally specified) milliseconds or fractionOfSecond represent a valid time of day, and false otherwise. Note that many functions within Datetime provide defined behavior only when valid times are provided as arguments.

static Datetime blpapi::Datetime::createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds 
) [static]

Create a Datetime object having the value representing the specified year, month, day, hours, minutes, and seconds parts. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function, and hours, minutes, and seconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by DATE and TIME set, and the OFFSET and FRACSECONDS parts unset.

static Datetime blpapi::Datetime::createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Offset  offset 
) [static]

Create a Datetime object having the value representing the specified year, month, day, hours, minutes, seconds, and offset parts. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function, and hours, minutes, and seconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by DATE, TIME, and OFFSET set, and the FRACSECONDS part unset.

static Datetime blpapi::Datetime::createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Milliseconds  fractionOfSecond 
) [static]
static Datetime blpapi::Datetime::createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Microseconds  fractionOfSecond 
) [static]
static Datetime blpapi::Datetime::createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Nanoseconds  fractionOfSecond 
) [static]
static Datetime blpapi::Datetime::createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Picoseconds  fractionOfSecond 
) [static]

Create a Datetime object having the value representing the specified year, month, day, hours, minutes, seconds, and fractionOfSecond. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function, and hours, minutes, seconds, and fractionOfSecond represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by DATE and TIMEFRACSECONDS set, and the OFFSET part unset.

static Datetime blpapi::Datetime::createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Milliseconds  fractionOfSecond,
Offset  offset 
) [static]
static Datetime blpapi::Datetime::createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Microseconds  fractionOfSecond,
Offset  offset 
) [static]
static Datetime blpapi::Datetime::createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Nanoseconds  fractionOfSecond,
Offset  offset 
) [static]
static Datetime blpapi::Datetime::createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Picoseconds  fractionOfSecond,
Offset  offset 
) [static]

Create a Datetime object having the value representing the specified year, month, day, hours, minutes, seconds, fractionOfSecond, and offset. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function, and hours, minutes, seconds, and fractionOfSecond represent a valid time as specified by the isValidTime function. The resulting Datetime object has all parts set.

static Datetime blpapi::Datetime::createDate ( unsigned  year,
unsigned  month,
unsigned  day 
) [static]

Create a Datetime object having the value representing the specified year, month, and day. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function. The resulting Datetime object has the parts specified by DATE set, and all other parts unset.

static Datetime blpapi::Datetime::createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds 
) [static]

Create a Datetime object having the value representing the specified hours, minutes, and seconds. The behavior is undefined unless hours, minutes, and seconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by TIME set, and all other parts unset. Note that the FRACSECONDS part is unset.

static Datetime blpapi::Datetime::createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Offset  offset 
) [static]

Create a Datetime object having the value representing the specified hours, minutes, seconds, and offset. The behavior is undefined unless hours, minutes, and seconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by TIME and OFFSET set, and all other parts unset. Note that the FRACSECONDS part is unset.

static Datetime blpapi::Datetime::createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
unsigned  milliseconds 
) [static]

Create a Datetime object having the value representing the specified hours, minutes, seconds, and milliseconds. The behavior is undefined unless hours, minutes, seconds, and milliseconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by TIMEFRACSECONDS set, and all other parts unset.

static Datetime blpapi::Datetime::createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
unsigned  milliseconds,
Offset  offset 
) [static]

Create a Datetime object having the value representing the specified hours, minutes, seconds, milliseconds, and offset. The behavior is undefined unless hours, minutes, seconds, and milliseconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by TIMEFRACSECONDS and OFFSET set, and all other parts unset.

static Datetime blpapi::Datetime::createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Milliseconds  fractionOfSecond 
) [static]
static Datetime blpapi::Datetime::createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Microseconds  fractionOfSecond 
) [static]
static Datetime blpapi::Datetime::createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Nanoseconds  fractionOfSecond 
) [static]
static Datetime blpapi::Datetime::createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Picoseconds  fractionOfSecond 
) [static]

Create a Datetime object having the value representing the specified hours, minutes, seconds, and fractionOfSecond. The behavior is undefined unless hours, minutes, seconds, and fractionOfSecond represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by TIMEFRACSECONDS set, and all other parts unset.

static Datetime blpapi::Datetime::createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Milliseconds  fractionOfSecond,
Offset  offset 
) [static]
static Datetime blpapi::Datetime::createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Microseconds  fractionOfSecond,
Offset  offset 
) [static]
static Datetime blpapi::Datetime::createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Nanoseconds  fractionOfSecond,
Offset  offset 
) [static]
static Datetime blpapi::Datetime::createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Picoseconds  fractionOfSecond,
Offset  offset 
) [static]

Create a Datetime object having the value representing the specified hours, minutes, seconds, fractionOfSecond, and offset. The behavior is undefined unless hours, minutes, seconds, and fractionOfSecond represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by TIMEFRACSECONDS and OFFSET set, and all other parts unset.

Datetime& blpapi::Datetime::operator= ( const Datetime rhs  ) 

Assignment operator.

void blpapi::Datetime::setDate ( unsigned  year,
unsigned  month,
unsigned  day 
)

Set the DATE parts of this Datetime object to the specified year, month, and day. The behavior is undefined unless isValidDate(year, month, day) would return true.

void blpapi::Datetime::setTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds 
)

Set the TIME parts of this Datetime object to the specified hours, minutes, and seconds, and mark the FRACSECONDS part of this Datetime as unset. The behavior is undefined unless isValidTime(hours, minutes, seconds) would return true.

void blpapi::Datetime::setTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
unsigned  milliseconds 
)

Set the TIMEFRACSECONDS parts of this Datetime object to the specified hours, minutes, seconds, and milliseconds. The behavior is undefined unless isValidTime(hours, minutes, seconds, milliseconds) would return true.

void blpapi::Datetime::setTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Milliseconds  fractionOfSecond 
)
void blpapi::Datetime::setTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Microseconds  fractionOfSecond 
)
void blpapi::Datetime::setTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Nanoseconds  fractionOfSecond 
)
void blpapi::Datetime::setTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Picoseconds  fractionOfSecond 
)

Set the TIMEFRACSECONDS parts of this Datetime object to the specified hours, minutes, seconds, and fractionOfSecond. The behavior is undefined unless isValidTime(hours, minutes, seconds, fractionOfSecond) would return true.

void blpapi::Datetime::setOffset ( short  minutesAheadOfUTC  ) 

Set the OFFSET (i.e. timezone) part of this Datetime object to the specified minutesAheadOfUTC. The behavior is undefined unless -840 <= minutesAheadOfUTC <= 840.

void blpapi::Datetime::setYear ( unsigned  value  ) 

Set the YEAR part of this Datetime object to the specified value. The behavior is undefined unless 1 <= value <= 9999, and either the MONTH part is not set, the DAY part is not set, or isValidDate(value. this->month(), this->day()) == true.

void blpapi::Datetime::setMonth ( unsigned  value  ) 

Set the MONTH part of this Datetime object to the specified value. The behavior is undefined unless 1 <= value <= 12, and either the DAY part is not set, the YEAR part is not set, or isValidDate(this->year(). value, this->day()) == true.

void blpapi::Datetime::setDay ( unsigned  value  ) 

Set the DAY part of this Datetime object to the specified value. The behavior is undefined unless 1 <= value <= 31, and either the MONTH part is not set, the YEAR part is not set, or isValidDate(this->year(). this->month(), value) == true.

void blpapi::Datetime::setHours ( unsigned  value  ) 

Set the HOURS part of this Datetime object to the specified value. The behavior is undefined unless 0 <= value <= 23.

void blpapi::Datetime::setMinutes ( unsigned  value  ) 

Set the MINUTES part of this Datetime object to the specified value. The behavior is undefined unless 0 <= value <= 59.

void blpapi::Datetime::setSeconds ( unsigned  value  ) 

Set the SECONDS part of this Datetime object to the specified value. The behavior is undefined unless 0 <= value <= 59.

void blpapi::Datetime::setMilliseconds ( unsigned  milliseconds  ) 

Set the FRACSECONDS part of this Datetime object to the specified milliseconds. The behavior is undefined unless 0 <= value <= 999.

void blpapi::Datetime::setFractionOfSecond ( Milliseconds  value  ) 

Set the FRACSECONDS part of this Datetime object to the Set the fraction of a second of the value of this object to the specified value. Note that the behavior is undefined unless 0 <= value <= 999 ms.

void blpapi::Datetime::setFractionOfSecond ( Microseconds  value  ) 

Set the FRACSECONDS part of this Datetime object to the specified value. Note that the behavior is undefined unless 0 <= value <= 999,999 us.

void blpapi::Datetime::setFractionOfSecond ( Nanoseconds  value  ) 

Set the FRACSECONDS part of this Datetime object to the specified value. Note that the behavior is undefined unless 0 <= value <= 999,999,999 ns.

void blpapi::Datetime::setFractionOfSecond ( Picoseconds  value  ) 

Set the FRACSECONDS part of this Datetime object to the specified value. Note that the behavior is undefined unless 0 <= value <= 999,999,999,999 ps.

blpapi_Datetime_t& blpapi::Datetime::rawValue (  ) 

Return a (modifiable) reference to the millisecond-resolution C struct underlying this object. Behavior of the object is undefined if the returned struct is modified concurrently with other non-const methods of this object, or if the fields of the blpapi_Datetime_t are modified such that the Datetime::isValid methods of this class would return false when passed those fields of the struct whose bits are set in the struct's parts field. Further, direct setting of the FRACSECONDS bit in the returned struct's parts field will cause this Datetime object to compute its fraction-of-second part not just from the struct's milliSeconds field, but also from the picoseconds field of the the struct returned from rawHighPrecisionValue(); if neither that field nor this Datetime objects' fraction-of-second part have been initialized, then the behavior of setting the FRACSECONDS bit directly is undefined.

blpapi_HighPrecisionDatetime_t& blpapi::Datetime::rawHighPrecisionValue (  ) 

Return a (modifiable) reference to the high-resolution C struct underlying this object. Behavior of the object is undefined if the returned struct is modified concurrently with other non-const methods of this object, or if the fields of the blpapi_HighPrecisionDatetime_t are modified such that the Datetime::isValid* methods of this class would return false when passed those fields of the struct whose bits are set in the struct's parts field.

bool blpapi::Datetime::hasParts ( unsigned  parts  )  const

Return true if this Datetime object has all of the specified parts set. The parts parameter must be constructed by or'ing together values from the DatetimeParts enum.

unsigned blpapi::Datetime::parts (  )  const

Return a bitmask of all parts that are set in this Datetime object. This can be compared to the values in the DatetimeParts enum using bitwise operations.

unsigned blpapi::Datetime::year (  )  const

Return the year value of this Datetime object. The result is undefined unless the YEAR part of this object is set.

unsigned blpapi::Datetime::month (  )  const

Return the month value of this Datetime object. The result is undefined unless the MONTH part of this object is set.

unsigned blpapi::Datetime::day (  )  const

Return the day value of this Datetime object. The result is undefined unless the DAY part of this object is set.

unsigned blpapi::Datetime::hours (  )  const

Return the hours value of this Datetime object. The result is undefined unless the HOURS part of this object is set.

unsigned blpapi::Datetime::minutes (  )  const

Return the minutes value of this Datetime object. The result is undefined unless the MINUTES part of this object is set.

unsigned blpapi::Datetime::seconds (  )  const

Return the seconds value of this Datetime object. The result is undefined unless the SECONDS part of this object is set.

unsigned blpapi::Datetime::milliSeconds (  )  const

Return the milliseconds value of this Datetime object. The result is undefined unless the FRACSECONDS part of this object is set. This function is deprecated; use milliseconds() instead.

unsigned blpapi::Datetime::milliseconds (  )  const

Return the number of (whole) milliseconds in the fraction-of-a-second part of the value of this object. The result is undefined unless the FRACSECONDS part of this object is set.

unsigned blpapi::Datetime::microseconds (  )  const

Return the number of (whole) microseconds in the fraction-of-a-second part of the value of this object. The result is undefined unless the FRACSECONDS part of this object is set.

unsigned blpapi::Datetime::nanoseconds (  )  const

Return the number of (whole) nanoseconds in the fraction-of-a-second part of the value of this object. The result is undefined unless the FRACSECONDS part of this object is set.

unsigned long long blpapi::Datetime::picoseconds (  )  const

Return the number of (whole) picoseconds in the fraction-of-a-second part of the value of this object. The result is undefined unless the FRACSECONDS part of this object is set.

short blpapi::Datetime::offset (  )  const

Return the number of minutes this Datetime object is ahead of UTC. The result is undefined unless the OFFSET part of this object is set.

const blpapi_Datetime_t& blpapi::Datetime::rawValue (  )  const

Return a (read-only) reference to the millisecond-resolution C struct underlying this object.

const blpapi_HighPrecisionDatetime_t& blpapi::Datetime::rawHighPrecisionValue (  )  const

Return a (read-only) reference to the high-precision C struct underlying this object.

bool blpapi::Datetime::isValid (  )  const

Check whether the value of this Datetime is valid. The behaviour is undefined unless this object represents a date (has YEAR, MONTH and DAY part set) or time (has HOURS, MINUTES, SECONDS and MILLISECONDS part set). Note that in almost all cases where this function returns false, prior member function calls have had undefined behavior. This function is deprecated; use isValidDate and/or isValidTime directly instead.

std::ostream& blpapi::Datetime::print ( std::ostream &  stream,
int  level = 0,
int  spacesPerLevel = 4 
) const

Write the value of this object to the specified output stream in a human-readable format, and return a reference to stream. Optionally specify an initial indentation level, whose absolute value is incremented recursively for nested objects. If level is specified, optionally specify spacesPerLevel, whose absolute value indicates the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level). If stream is not valid on entry, this operation has no effect. Note that this human-readable format is not fully specified, and can change without notice.


The documentation for this class was generated from the following file: