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

#include <baltzo_localtimedescriptor.h>

Public Types

typedef bsl::allocator allocator_type
 

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (LocalTimeDescriptor, bslmf::IsBitwiseMoveable)
 
 LocalTimeDescriptor ()
 
 LocalTimeDescriptor (const allocator_type &allocator)
 
 LocalTimeDescriptor (int utcOffsetInSeconds, bool dstInEffectFlag, const bsl::string_view &description, const allocator_type &allocator=allocator_type())
 
 LocalTimeDescriptor (const LocalTimeDescriptor &original, const allocator_type &allocator=allocator_type())
 
 LocalTimeDescriptor (bslmf::MovableRef< LocalTimeDescriptor > original) BSLS_KEYWORD_NOEXCEPT
 
 LocalTimeDescriptor (bslmf::MovableRef< LocalTimeDescriptor > original, const allocator_type &allocator)
 
 ~LocalTimeDescriptor ()
 Destroy this object.
 
LocalTimeDescriptoroperator= (const LocalTimeDescriptor &rhs)
 
LocalTimeDescriptoroperator= (bslmf::MovableRef< LocalTimeDescriptor > rhs)
 
void setDescription (const bsl::string_view &value)
 
void setDstInEffectFlag (bool value)
 
void setUtcOffsetInSeconds (int value)
 
void swap (LocalTimeDescriptor &other)
 
const bsl::stringdescription () const
 
bool dstInEffectFlag () const
 
int utcOffsetInSeconds () const
 
bslma::Allocatorallocator () const
 
allocator_type get_allocator () const
 
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
 

Static Public Member Functions

static bool isValidUtcOffsetInSeconds (int value)
 

Friends

void swap (LocalTimeDescriptor &, LocalTimeDescriptor &)
 

Detailed Description

This simply constrained (value-semantic) attribute class characterizes a subset of local time values. See the Attributes section for information on the class attributes. Note that the class invariants are identically the constraints on the individual attributes.

See baltzo_localtimedescriptor

Member Typedef Documentation

◆ allocator_type

Constructor & Destructor Documentation

◆ LocalTimeDescriptor() [1/6]

baltzo::LocalTimeDescriptor::LocalTimeDescriptor ( )
inline

◆ LocalTimeDescriptor() [2/6]

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

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

dstInEffectFlag() == false
description() == ""
const bsl::string & description() const
Definition baltzo_localtimedescriptor.h:542
bool dstInEffectFlag() const
Definition baltzo_localtimedescriptor.h:548
int utcOffsetInSeconds() const
Definition baltzo_localtimedescriptor.h:554

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

◆ LocalTimeDescriptor() [3/6]

baltzo::LocalTimeDescriptor::LocalTimeDescriptor ( int  utcOffsetInSeconds,
bool  dstInEffectFlag,
const bsl::string_view description,
const allocator_type allocator = allocator_type() 
)
inline

Create a LocalTimeDescriptor object having the specified utcOffsetInSeconds, dstInEffectFlag, and description 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 -86339 <= utcOffsetInSeconds <= 86399.

◆ LocalTimeDescriptor() [4/6]

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

Create a LocalTimeDescriptor object having 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.

◆ LocalTimeDescriptor() [5/6]

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

Create a LocalTimeDescriptor 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.

◆ LocalTimeDescriptor() [6/6]

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

Create a LocalTimeDescriptor 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.

◆ ~LocalTimeDescriptor()

baltzo::LocalTimeDescriptor::~LocalTimeDescriptor ( )
inline

Member Function Documentation

◆ allocator()

bslma::Allocator * baltzo::LocalTimeDescriptor::allocator ( ) const
inline
Deprecated:
Use get_allocator() instead.

Return get_allocator().mechanism().

◆ BSLMF_NESTED_TRAIT_DECLARATION()

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

◆ description()

const bsl::string & baltzo::LocalTimeDescriptor::description ( ) const
inline

Return a const reference to the description attribute of this object. Note that description is not canonical, and is intended for debugging only.

◆ dstInEffectFlag()

bool baltzo::LocalTimeDescriptor::dstInEffectFlag ( ) const
inline

Return the value of the dstInEffectFlag attribute of this object. Note that true implies Daylight-Saving Time (DST) is in effect.

◆ get_allocator()

LocalTimeDescriptor::allocator_type baltzo::LocalTimeDescriptor::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.

◆ isValidUtcOffsetInSeconds()

bool baltzo::LocalTimeDescriptor::isValidUtcOffsetInSeconds ( int  value)
inlinestatic

Return true if the specified value is in the range [-86399 .. 86399], and false otherwise.

◆ operator=() [1/2]

LocalTimeDescriptor & baltzo::LocalTimeDescriptor::operator= ( bslmf::MovableRef< LocalTimeDescriptor 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]

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

Assign to this object the value of the specified rhs object, and return a non-const reference to this object.

◆ print()

bsl::ostream & baltzo::LocalTimeDescriptor::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 non-const 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.

◆ setDescription()

void baltzo::LocalTimeDescriptor::setDescription ( const bsl::string_view value)
inline

Set the description attribute of this object to the specified value. Note that value is not canonical, and is intended for debugging only.

◆ setDstInEffectFlag()

void baltzo::LocalTimeDescriptor::setDstInEffectFlag ( bool  value)
inline

Set the dstInEffectFlag attribute of this object to the specified value. Note that true implies Daylight-Saving Time (DST) is in effect.

◆ setUtcOffsetInSeconds()

void baltzo::LocalTimeDescriptor::setUtcOffsetInSeconds ( int  value)
inline

Set the utcOffsetInSeconds attribute of this object to the specified value. The behavior is undefined unless -86399 <= value <= 86399.

◆ swap()

void baltzo::LocalTimeDescriptor::swap ( LocalTimeDescriptor 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.

◆ utcOffsetInSeconds()

int baltzo::LocalTimeDescriptor::utcOffsetInSeconds ( ) const
inline

Return the value of the utcOffsetInSeconds attribute of this object. Note that this value is in the range [-86399 .. 86399].

Friends And Related Symbol Documentation

◆ swap

void swap ( LocalTimeDescriptor ,
LocalTimeDescriptor  
)
friend

Exchange the values of the specified a and b objects. This function provides the no-throw exception-safety guarantee if the two objects were created with the same allocator and the basic guarantee otherwise.


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