BDE 4.14.0 Production release
Loading...
Searching...
No Matches
baltzo::LocalTimePeriod Class Reference

#include <baltzo_localtimeperiod.h>

Public Types

typedef bsl::allocator< char > allocator_type
 

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (LocalTimePeriod, bslma::UsesBslmaAllocator)
 
 BSLMF_NESTED_TRAIT_DECLARATION (LocalTimePeriod, bslmf::IsBitwiseMoveable)
 
 LocalTimePeriod ()
 
 LocalTimePeriod (const allocator_type &allocator)
 
 LocalTimePeriod (const LocalTimeDescriptor &descriptor, const bdlt::Datetime &utcStartTime, const bdlt::Datetime &utcEndTime, const allocator_type &allocator=allocator_type())
 
 LocalTimePeriod (const LocalTimePeriod &original, const allocator_type &allocator=allocator_type())
 
 LocalTimePeriod (bslmf::MovableRef< LocalTimePeriod > original) BSLS_KEYWORD_NOEXCEPT
 
 LocalTimePeriod (bslmf::MovableRef< LocalTimePeriod > original, const allocator_type &allocator)
 
 ~LocalTimePeriod ()
 Destroy this object.
 
LocalTimePeriodoperator= (const LocalTimePeriod &rhs)
 
LocalTimePeriodoperator= (bslmf::MovableRef< LocalTimePeriod > rhs)
 
void setDescriptor (const LocalTimeDescriptor &value)
 Set the descriptor attribute to the specified value.
 
void setUtcStartAndEndTime (const bdlt::Datetime &utcStartTime, const bdlt::Datetime &utcEndTime)
 
void swap (LocalTimePeriod &other)
 
bslma::Allocatorallocator () const
 
const LocalTimeDescriptordescriptor () const
 
allocator_type get_allocator () const
 
const bdlt::DatetimeutcEndTime () const
 
const bdlt::DatetimeutcStartTime () const
 
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
 

Static Public Member Functions

static bool isValidUtcStartAndEndTime (const bdlt::Datetime &utcStartTime, const bdlt::Datetime &utcEndTime)
 

Detailed Description

This complex-constrained (value-semantic) attribute class describes a range of time in which a particular local time description (offset, DST status, and a descriptive string) is in effect. See the Attributes section for information on the class attributes. Note that the class invariants are identically the constraints on the attributes.

See baltzo_localtimeperiod

Member Typedef Documentation

◆ allocator_type

Constructor & Destructor Documentation

◆ LocalTimePeriod() [1/6]

baltzo::LocalTimePeriod::LocalTimePeriod ( )
inline

◆ LocalTimePeriod() [2/6]

baltzo::LocalTimePeriod::LocalTimePeriod ( const allocator_type allocator)
inlineexplicit

Create a LocalTimePeriod object having the (default) attribute values:

utcStartTime() == bdlt::Datetime()
utcEndTime() == bdlt::Datetime()
Definition baltzo_localtimedescriptor.h:189
const bdlt::Datetime & utcStartTime() const
Definition baltzo_localtimeperiod.h:562
const bdlt::Datetime & utcEndTime() const
Definition baltzo_localtimeperiod.h:556
const LocalTimeDescriptor & descriptor() const
Definition baltzo_localtimeperiod.h:544
Definition bbldc_basicisma30360.h:112

Optionally specify an allocator (e.g., the address of a bslma::Allocator object) to supply memory; otherwise, the default allocator is used.

◆ LocalTimePeriod() [3/6]

baltzo::LocalTimePeriod::LocalTimePeriod ( const LocalTimeDescriptor descriptor,
const bdlt::Datetime utcStartTime,
const bdlt::Datetime utcEndTime,
const allocator_type allocator = allocator_type() 
)
inline

Create a LocalTimePeriod object having the specified descriptor, utcStartTime, and utcEndTime attribute values. Optionally specify an allocator (e.g., the address of a bslma::Allocator object) to supply memory; otherwise, the default allocator is used. The behavior is undefined unless utcStartTime == utcEndTime, or if utcStartTime and utcEndTime are comparable (i.e., neither equals the a default constructed bdlt::DateTime object) unless utcStartTime < utcEndTime. (See the isValidUtcStartAndEndTime method.)

◆ LocalTimePeriod() [4/6]

baltzo::LocalTimePeriod::LocalTimePeriod ( const LocalTimePeriod original,
const allocator_type allocator = allocator_type() 
)
inline

Create a LocalTimePeriod object with the same value as the specified original object. Optionally specify an allocator (e.g., the address of a bslma::Allocator object) to supply memory; otherwise, the default allocator is used.

◆ LocalTimePeriod() [5/6]

baltzo::LocalTimePeriod::LocalTimePeriod ( bslmf::MovableRef< LocalTimePeriod original)
inline

Create a LocalTimePeriod object having the same value and the same allocator as the specified original object. The value of original becomes unspecified but valid, and its allocator remains unchanged.

◆ LocalTimePeriod() [6/6]

baltzo::LocalTimePeriod::LocalTimePeriod ( bslmf::MovableRef< LocalTimePeriod original,
const allocator_type allocator 
)
inline

Create a LocalTimePeriod object having the same value as the specified original object, using the specified allocator (e.g., the address of a bslma::Allocator object) to supply memory. The allocator of original remains unchanged. If original and the newly created object have the same allocator then the value of original becomes unspecified but valid, and no exceptions will be thrown; otherwise original is unchanged and an exception may be thrown.

◆ ~LocalTimePeriod()

baltzo::LocalTimePeriod::~LocalTimePeriod ( )
inline

Member Function Documentation

◆ allocator()

bslma::Allocator * baltzo::LocalTimePeriod::allocator ( ) const
inline

Return get_allocator().mechanism().

@DEPRECATED Use get_allocator() instead.

◆ BSLMF_NESTED_TRAIT_DECLARATION() [1/2]

baltzo::LocalTimePeriod::BSLMF_NESTED_TRAIT_DECLARATION ( LocalTimePeriod  ,
bslma::UsesBslmaAllocator   
)

◆ BSLMF_NESTED_TRAIT_DECLARATION() [2/2]

baltzo::LocalTimePeriod::BSLMF_NESTED_TRAIT_DECLARATION ( LocalTimePeriod  ,
bslmf::IsBitwiseMoveable   
)

◆ descriptor()

const LocalTimeDescriptor & baltzo::LocalTimePeriod::descriptor ( ) const
inline

Return a reference providing non-modifiable access to the descriptor attribute of this object.

◆ get_allocator()

LocalTimePeriod::allocator_type baltzo::LocalTimePeriod::get_allocator ( ) const
inline

Return the allocator used by this object to supply memory. Note that if no allocator was supplied at construction the default allocator in effect at construction is used.

◆ isValidUtcStartAndEndTime()

bool baltzo::LocalTimePeriod::isValidUtcStartAndEndTime ( const bdlt::Datetime utcStartTime,
const bdlt::Datetime utcEndTime 
)
inlinestatic

Return true if the specified utcStartTime and utcEndTime have the same value, or if utcStartTime and utcEndTime are comparable (i.e., neither has the value of a default-constructed bdlt::DateTime object) and utcStartTime < utcEndTime; return false otherwise.

◆ operator=() [1/2]

LocalTimePeriod & baltzo::LocalTimePeriod::operator= ( bslmf::MovableRef< LocalTimePeriod rhs)
inline

Assign to this object the value of the specified rhs object, and return a non-const reference to this object. The allocators of this object and rhs both remain unchanged. If rhs and this object have the same allocator then the value of rhs becomes unspecified but valid, and no exceptions will be thrown; otherwise rhs is unchanged (and an exception may be thrown).

◆ operator=() [2/2]

LocalTimePeriod & baltzo::LocalTimePeriod::operator= ( const LocalTimePeriod rhs)
inline

Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object.

◆ print()

bsl::ostream & baltzo::LocalTimePeriod::print ( bsl::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 the format is not fully specified, and can change without notice.

◆ setDescriptor()

void baltzo::LocalTimePeriod::setDescriptor ( const LocalTimeDescriptor value)
inline

◆ setUtcStartAndEndTime()

void baltzo::LocalTimePeriod::setUtcStartAndEndTime ( const bdlt::Datetime utcStartTime,
const bdlt::Datetime utcEndTime 
)
inline

Use the specified utcStartTime and utcEndTime to set the utcStartTime and utcEndTime attributes of this object respectively. The behavior is undefined unless utcStartTime == utcEndTime, or if utcStartTime and utcEndTime are comparable (i.e., neither equals a default constructed bdlt::DateTime object) unless utcStartTime < utcEndTime. (See the isValidUtcStartAndEndTime method.)

◆ swap()

void baltzo::LocalTimePeriod::swap ( LocalTimePeriod other)
inline

Efficiently exchange the value of this object with the value of the specified other object. This method provides the no-throw exception-safety guarantee. The behavior is undefined unless this object was created with the same allocator as other.

◆ utcEndTime()

const bdlt::Datetime & baltzo::LocalTimePeriod::utcEndTime ( ) const
inline

Return a reference providing non-modifiable access to the utcEndTime attribute of this object.

◆ utcStartTime()

const bdlt::Datetime & baltzo::LocalTimePeriod::utcStartTime ( ) const
inline

Return a reference providing non-modifiable access to the utcStartTime attribute of this object.


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